From 5d2654b1bacd3cf7375b8bb67e822fc0969b2044 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Tue, 23 Mar 2021 21:30:54 -0400 Subject: [PATCH 001/399] Implement Unit Test Suite for TorqueScript. --- Engine/source/console/test/ScriptTest.cpp | 395 +++++++++++++++++++++ Engine/source/console/test/consoleTest.cpp | 34 +- Tools/CMake/torque3d.cmake | 1 + 3 files changed, 397 insertions(+), 33 deletions(-) create mode 100644 Engine/source/console/test/ScriptTest.cpp diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp new file mode 100644 index 000000000..994606783 --- /dev/null +++ b/Engine/source/console/test/ScriptTest.cpp @@ -0,0 +1,395 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +#ifdef TORQUE_TESTS_ENABLED +#include "testing/unitTesting.h" +#include "platform/platform.h" +#include "console/simBase.h" +#include "console/consoleTypes.h" +#include "console/simBase.h" +#include "console/engineAPI.h" +#include "math/mMath.h" +#include "console/stringStack.h" + +template +inline T Convert(ConsoleValueRef); + +template<> +inline U32 Convert(ConsoleValueRef val) +{ + return val.getIntValue(); +} + +template<> +inline S32 Convert(ConsoleValueRef val) +{ + return val.getSignedIntValue(); +} + +template<> +inline bool Convert(ConsoleValueRef val) +{ + return val.getBoolValue(); +} + +template<> +inline F32 Convert(ConsoleValueRef val) +{ + return val.getFloatValue(); +} + +template<> +inline const char* Convert(ConsoleValueRef val) +{ + return val.getStringValue(); +} + +template<> +inline SimObject* Convert(ConsoleValueRef val) +{ + return Sim::findObject(val); +} + +template +inline T RunScript(const char* str) +{ + return Convert(Con::evaluate(str, false, NULL)); +} + +TEST(Script, Basic_Arithmetic) +{ + S32 add = RunScript(R"( + return 1.0 + 1; + )"); + + EXPECT_EQ(add, 2); + + S32 sub = RunScript(R"( + return 10 - 1.0; + )"); + + EXPECT_EQ(sub, 9); + + S32 mult = RunScript(R"( + return 10 * 2.5; + )"); + + EXPECT_EQ(mult, 25); + + S32 div = RunScript(R"( + return 10.0 / 2; + )"); + + EXPECT_EQ(div, 5); +} + +TEST(Script, Complex_Arithmetic) +{ + S32 result = RunScript(R"( + return 1 * 2 - (0.5 * 2); + )"); + + EXPECT_EQ(result, 1); + + S32 result2 = RunScript(R"( + return 1 * 2 * 3 % 2; + )"); + + EXPECT_EQ(result2, 0); +} + +TEST(Script, Basic_Concatination) +{ + const char* result1 = RunScript(R"( + return "a" @ "b"; + )"); + + EXPECT_STREQ(result1, "ab"); + + const char* result2 = RunScript(R"( + return "a" SPC "b"; + )"); + + EXPECT_STREQ(result2, "a b"); + + const char* result3 = RunScript(R"( + return "a" TAB "b"; + )"); + + EXPECT_STREQ(result3, "a\tb"); + + const char* result4 = RunScript(R"( + return "a" NL "b"; + )"); + + EXPECT_STREQ(result4, "a\nb"); + + const char* complex = RunScript(R"( + return "a" @ "b" @ "c" @ "d"; + )"); + + EXPECT_STREQ(complex, "abcd"); +} + +TEST(Script, Basic_Global_Variable_Tests) +{ + S32 value = RunScript(R"( + $a = 1; + return $a; + )"); + + EXPECT_EQ(value, 1); +} + +TEST(Script, Variable_Chaining_And_Usage) +{ + S32 value = RunScript(R"( + function t() + { + %a = %b = 2; + return %a; + } + return t(); + )"); + + EXPECT_EQ(value, 2); + + S32 valueGlobal = RunScript(R"( + function t() + { + $a = %b = 2; + } + t(); + return $a; + )"); + + EXPECT_EQ(valueGlobal, 2); + + S32 value2 = RunScript(R"( + function t(%a) + { + if ((%b = 2 * %a) != 5) + return %b; + return 5; + } + + return t(2); + )"); + + EXPECT_EQ(value2, 4); +} + +TEST(Script, Basic_Function_Call_And_Local_Variable_Testing) +{ + S32 value = RunScript(R"( + function t() { %a = 2; return %a; } + return t(); + )"); + + EXPECT_EQ(value, 2); + + S32 value2 = RunScript(R"( + function add(%a, %b) { return %a + %b; } + return add(2, 4); + )"); + + EXPECT_EQ(value2, 6); + + S32 value3 = RunScript(R"( + function fib(%a) { + if (%a == 0) + return 0; + if (%a == 1) + return 1; + return fib(%a - 1) + fib(%a - 2); + } + return fib(15); + )"); + + EXPECT_EQ(value3, 610); + + S32 staticCall = RunScript(R"( + function SimObject::bar(%a, %b) { + return %a + %b; + } + return SimObject::bar(1, 2); + )"); + + EXPECT_EQ(staticCall, 3); +} + +TEST(Script, Basic_Conditional_Statements) +{ + S32 value = RunScript(R"( + $a = "hello"; + if ($a $= "hello") + return 1; + return 2; + )"); + + EXPECT_EQ(value, 1); + + const char* ternaryValue = RunScript(R"( + return $a $= "hello" ? "World" : "No U"; + )"); + + EXPECT_STREQ(ternaryValue, "World"); +} + +TEST(Script, Basic_Loop_Statements) +{ + S32 whileValue = RunScript(R"( + $count = 0; + while ($count < 5) + $count++; + return $count; + )"); + + EXPECT_EQ(whileValue, 5); + + const char* forValue = RunScript(R"( + function t(%times) + { + %result = ""; + for (%i = 0; %i < %times; %i++) + %result = %result @ "a"; + return %result; + } + + return t(3); + )"); + + EXPECT_STREQ(forValue, "aaa"); + + const char* forIfValue = RunScript(R"( + function t() { + %str = ""; + for (%i = 0; %i < 5; %i++) { + + %loopValue = %i; + + if (%str $= "") + %str = %loopValue; + else + %str = %str @ "," SPC %loopValue; + } + return %str; + } + + return t(); + )"); + + EXPECT_STREQ(forIfValue, "0, 1, 2, 3, 4"); +} + +TEST(Script, TorqueScript_Array_Testing) +{ + S32 value = RunScript(R"( + function t(%idx) { %a[idx] = 2; return %a[idx]; } + return t(5); + )"); + + EXPECT_EQ(value, 2); + + S32 value2 = RunScript(R"( + function t(%idx) { %a[idx, 0] = 2; return %a[idx, 0]; } + return t(5); + )"); + + EXPECT_EQ(value2, 2); +} + +TEST(Script, Basic_SimObject) +{ + SimObject* object = RunScript(R"( + return new SimObject(FudgeCollector) { + fudge = "Chocolate"; + }; + )"); + + EXPECT_NE(object, (SimObject*)NULL); + + const char* propertyValue = RunScript(R"( + return FudgeCollector.fudge; + )"); + + EXPECT_STREQ(propertyValue, "Chocolate"); + + const char* funcReturn = RunScript(R"( + function SimObject::fooFunc(%this) + { + return "Bar"; + } + + return FudgeCollector.fooFunc(); + )"); + + EXPECT_STREQ(funcReturn, "Bar"); + + const char* parentFn = RunScript(R"( + new SimObject(Hello); + + function SimObject::fooFunc2(%this) + { + return "Bar"; + } + + function Hello::fooFunc2(%this) + { + %bar = Parent::fooFunc2(%this); + return "Foo" @ %bar; + } + + return Hello.fooFunc2(); + )"); + + EXPECT_STREQ(parentFn, "FooBar"); +} + +TEST(Script, Basic_Package) +{ + S32 value = RunScript(R"( + function a() { return 3; } + package overrides { + function a() { return 5; } + }; + return a(); + )"); + + EXPECT_EQ(value, 3); + + S32 overrideValue = RunScript(R"( + activatePackage(overrides); + return a(); + )"); + + EXPECT_EQ(overrideValue, 5); + + S32 deactivatedValue = RunScript(R"( + deactivatePackage(overrides); + return a(); + )"); + + EXPECT_EQ(deactivatedValue, 3); +} + +#endif diff --git a/Engine/source/console/test/consoleTest.cpp b/Engine/source/console/test/consoleTest.cpp index aa0b3970e..adea797a2 100644 --- a/Engine/source/console/test/consoleTest.cpp +++ b/Engine/source/console/test/consoleTest.cpp @@ -252,36 +252,4 @@ TEST(Con, execute) STR.popFrame(); } -static U32 gConsoleStackFrame = 0; - -ConsoleFunction(testConsoleStackFrame, S32, 1, 1, "") -{ - gConsoleStackFrame = CSTK.mFrame; - return (U32)Con::executef("testScriptEvalFunction"); // execute a sub function which manipulates the stack -} - -TEST(Con, evaluate) -{ - U32 startStackPos = CSTK.mStackPos; - U32 startStringStackPos = STR.mStart; - S32 returnValue = Con::evaluate("function testScriptEvalFunction() {return \"1\"@\"2\"@\"3\";}\nreturn testConsoleStackFrame();", false, "testEvaluate"); - U32 frame = CSTK.mFrame; - - EXPECT_TRUE(returnValue == 123) << - "Evaluate should return 123"; - - EXPECT_TRUE(gConsoleStackFrame == (frame+2)) << - "Console stack frame inside function should be +2"; - - EXPECT_TRUE(CSTK.mFrame == frame) << - "Console stack frame outside function should be the same as before"; - - EXPECT_TRUE(STR.mStart == startStringStackPos) << - "Console string stack should not be changed"; - - EXPECT_TRUE(CSTK.mStackPos == startStackPos) << - "Console stack should not be changed"; - -} - -#endif \ No newline at end of file +#endif diff --git a/Tools/CMake/torque3d.cmake b/Tools/CMake/torque3d.cmake index 0c1791a5d..c64a18986 100644 --- a/Tools/CMake/torque3d.cmake +++ b/Tools/CMake/torque3d.cmake @@ -247,6 +247,7 @@ addPath("${srcDir}/sfx/media") addPath("${srcDir}/sfx/null") addPath("${srcDir}/sfx") addPath("${srcDir}/console") +addPath("${srcDir}/console/test") addPath("${srcDir}/core") addPath("${srcDir}/core/stream") addPath("${srcDir}/core/strings") From 35500a87c60d84efe8077c9bda064ca02da4b69e Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Tue, 30 Mar 2021 19:33:19 -0400 Subject: [PATCH 002/399] initial port of the new interpreter --- Engine/source/T3D/gameBase/gameConnection.cpp | 13 +- Engine/source/app/net/net.cpp | 4 +- Engine/source/app/net/tcpObject.cpp | 4 +- Engine/source/app/net/tcpObject.h | 2 +- Engine/source/console/SimXMLDocument.cpp | 2 +- Engine/source/console/SimXMLDocument.h | 2 +- Engine/source/console/ast.h | 278 +- Engine/source/console/astAlloc.cpp | 180 +- Engine/source/console/astNodes.cpp | 1297 +++---- Engine/source/console/codeBlock.cpp | 1517 ++++----- Engine/source/console/codeInterpreter.cpp | 3018 ----------------- Engine/source/console/codeInterpreter.h | 262 -- Engine/source/console/compiledEval.cpp | 1909 ++++++++++- Engine/source/console/compiler.h | 24 +- Engine/source/console/console.cpp | 229 +- Engine/source/console/consoleInternal.cpp | 165 +- Engine/source/console/consoleInternal.h | 83 +- Engine/source/console/consoleLogger.cpp | 8 +- Engine/source/console/consoleLogger.h | 2 +- Engine/source/console/consoleValueStack.h | 121 + Engine/source/console/sim.h | 9 +- Engine/source/console/simManager.cpp | 23 +- Engine/source/console/simSet.cpp | 12 +- Engine/source/console/simSet.h | 4 +- Engine/source/console/stringStack.cpp | 225 -- Engine/source/console/stringStack.h | 44 - Engine/source/console/test/ScriptTest.cpp | 2 + Engine/source/console/test/consoleTest.cpp | 3 + Engine/source/console/test/engineAPITest.cpp | 4 +- Engine/source/core/strings/stringFunctions.h | 5 + Engine/source/environment/waterObject.cpp | 2 +- Engine/source/environment/waterObject.h | 2 +- Engine/source/gui/core/guiControl.cpp | 2 +- Engine/source/gui/core/guiControl.h | 2 +- Engine/source/gui/worldEditor/worldEditor.cpp | 6 +- Engine/source/gui/worldEditor/worldEditor.h | 2 +- Engine/source/platformWin32/winMath.cpp | 19 +- Engine/source/sfx/sfxSource.cpp | 2 +- Engine/source/sfx/sfxSource.h | 2 +- Engine/source/sfx/sfxTrack.cpp | 2 +- Engine/source/sfx/sfxTrack.h | 2 +- .../shaderGen/GLSL/customFeatureGLSL.cpp | 6 +- .../source/shaderGen/GLSL/customFeatureGLSL.h | 2 +- .../shaderGen/HLSL/customFeatureHLSL.cpp | 6 +- .../source/shaderGen/HLSL/customFeatureHLSL.h | 2 +- .../source/shaderGen/customShaderFeature.cpp | 2 +- Engine/source/shaderGen/customShaderFeature.h | 2 +- 47 files changed, 3675 insertions(+), 5839 deletions(-) delete mode 100644 Engine/source/console/codeInterpreter.cpp delete mode 100644 Engine/source/console/codeInterpreter.h create mode 100644 Engine/source/console/consoleValueStack.h diff --git a/Engine/source/T3D/gameBase/gameConnection.cpp b/Engine/source/T3D/gameBase/gameConnection.cpp index 01ae0ee17..e4a4c9f5e 100644 --- a/Engine/source/T3D/gameBase/gameConnection.cpp +++ b/Engine/source/T3D/gameBase/gameConnection.cpp @@ -331,7 +331,7 @@ DefineEngineStringlyVariadicMethod(GameConnection, setConnectArgs, void, 3, 17, "@see GameConnection::onConnect()\n\n") { - StringStackWrapper args(argc - 2, argv + 2); + ConsoleValueToStringArrayWrapper args(argc - 2, argv + 2); object->setConnectArgs(args.count(), args); } @@ -494,11 +494,17 @@ bool GameConnection::readConnectRequest(BitStream *stream, const char **errorStr *errorString = "CR_INVALID_ARGS"; return false; } - ConsoleValueRef connectArgv[MaxConnectArgs + 3]; + ConsoleValue connectArgv[MaxConnectArgs + 3]; ConsoleValue connectArgvValue[MaxConnectArgs + 3]; + // TODO(JTH): Fix pls. + AssertISV(false, "TODO: FIX CONSOLE VALUE"); + return false; + + /* for(U32 i = 0; i < mConnectArgc+3; i++) { + connectArgv[i].value = &connectArgvValue[i]; connectArgvValue[i].init(); } @@ -524,6 +530,7 @@ bool GameConnection::readConnectRequest(BitStream *stream, const char **errorStr return false; } return true; + */ } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- @@ -1088,7 +1095,7 @@ bool GameConnection::readDemoStartBlock(BitStream *stream) void GameConnection::demoPlaybackComplete() { static const char* demoPlaybackArgv[1] = { "demoPlaybackComplete" }; - static StringStackConsoleWrapper demoPlaybackCmd(1, demoPlaybackArgv); + static StringArrayToConsoleValueWrapper demoPlaybackCmd(1, demoPlaybackArgv); Sim::postCurrentEvent(Sim::getRootGroup(), new SimConsoleEvent(demoPlaybackCmd.argc, demoPlaybackCmd.argv, false)); Parent::demoPlaybackComplete(); diff --git a/Engine/source/app/net/net.cpp b/Engine/source/app/net/net.cpp index 3de813e89..1e2255323 100644 --- a/Engine/source/app/net/net.cpp +++ b/Engine/source/app/net/net.cpp @@ -251,7 +251,7 @@ DefineEngineStringlyVariadicFunction( commandToServer, void, 2, RemoteCommandEve NetConnection *conn = NetConnection::getConnectionToServer(); if(!conn) return; - StringStackWrapper args(argc - 1, argv + 1); + ConsoleValueToStringArrayWrapper args(argc - 1, argv + 1); RemoteCommandEvent::sendRemoteCommand(conn, args.count(), args); } @@ -289,7 +289,7 @@ DefineEngineStringlyVariadicFunction( commandToClient, void, 3, RemoteCommandEve NetConnection *conn; if(!Sim::findObject(argv[1], conn)) return; - StringStackWrapper args(argc - 2, argv + 2); + ConsoleValueToStringArrayWrapper args(argc - 2, argv + 2); RemoteCommandEvent::sendRemoteCommand(conn, args.count(), args); } diff --git a/Engine/source/app/net/tcpObject.cpp b/Engine/source/app/net/tcpObject.cpp index 07c8908eb..1b77e3bad 100644 --- a/Engine/source/app/net/tcpObject.cpp +++ b/Engine/source/app/net/tcpObject.cpp @@ -236,13 +236,13 @@ TCPObject::~TCPObject() } } -bool TCPObject::processArguments(S32 argc, ConsoleValueRef *argv) +bool TCPObject::processArguments(S32 argc, ConsoleValue *argv) { if(argc == 0) return true; else if(argc == 1) { - addToTable(NetSocket::fromHandle(dAtoi(argv[0]))); + addToTable(NetSocket::fromHandle(argv[0].getInt())); return true; } return false; diff --git a/Engine/source/app/net/tcpObject.h b/Engine/source/app/net/tcpObject.h index 9a8b5e40d..a869f48be 100644 --- a/Engine/source/app/net/tcpObject.h +++ b/Engine/source/app/net/tcpObject.h @@ -83,7 +83,7 @@ public: void disconnect(); State getState() { return mState; } - bool processArguments(S32 argc, ConsoleValueRef *argv); + bool processArguments(S32 argc, ConsoleValue *argv); void send(const U8 *buffer, U32 bufferLen); ///Send an entire file over tcp diff --git a/Engine/source/console/SimXMLDocument.cpp b/Engine/source/console/SimXMLDocument.cpp index df45888d1..66a116dfe 100644 --- a/Engine/source/console/SimXMLDocument.cpp +++ b/Engine/source/console/SimXMLDocument.cpp @@ -158,7 +158,7 @@ SimXMLDocument::~SimXMLDocument() // ----------------------------------------------------------------------------- // Included for completeness. // ----------------------------------------------------------------------------- -bool SimXMLDocument::processArguments(S32 argc, ConsoleValueRef *argv) +bool SimXMLDocument::processArguments(S32 argc, ConsoleValue *argv) { return argc == 0; } diff --git a/Engine/source/console/SimXMLDocument.h b/Engine/source/console/SimXMLDocument.h index 342917cff..d31104a68 100644 --- a/Engine/source/console/SimXMLDocument.h +++ b/Engine/source/console/SimXMLDocument.h @@ -57,7 +57,7 @@ class SimXMLDocument: public SimObject // tie in to the script language. The .cc file has more in depth // comments on these. //----------------------------------------------------------------------- - bool processArguments(S32 argc, ConsoleValueRef *argv); + bool processArguments(S32 argc, ConsoleValue *argv); bool onAdd(); void onRemove(); static void initPersistFields(); diff --git a/Engine/source/console/ast.h b/Engine/source/console/ast.h index f81971413..558446534 100644 --- a/Engine/source/console/ast.h +++ b/Engine/source/console/ast.h @@ -39,8 +39,15 @@ enum TypeReq TypeReqNone, TypeReqUInt, TypeReqFloat, - TypeReqString, - TypeReqVar + TypeReqString +}; + +enum ExprNodeName +{ + NameExprNode, + NameFloatNode, + NameIntNode, + NameVarNode }; /// Representation of a node for the scripting language parser. @@ -52,7 +59,7 @@ enum TypeReq /// each representing a different language construct. struct StmtNode { - StmtNode *mNext; ///< Next entry in parse tree. + StmtNode* next; ///< Next entry in parse tree. StmtNode(); virtual ~StmtNode() {} @@ -61,8 +68,8 @@ struct StmtNode /// @{ /// - void append(StmtNode *next); - StmtNode *getNext() const { return mNext; } + void append(StmtNode* next); + StmtNode* getNext() const { return next; } /// @} @@ -79,93 +86,95 @@ struct StmtNode /// @name Breaking /// @{ - void addBreakLine(CodeStream &codeStream); + void addBreakLine(CodeStream& codeStream); /// @} /// @name Compilation /// @{ - virtual U32 compileStmt(CodeStream &codeStream, U32 ip) = 0; + virtual U32 compileStmt(CodeStream& codeStream, U32 ip) = 0; virtual void setPackage(StringTableEntry packageName); /// @} }; /// Helper macro #ifndef DEBUG_AST_NODES -# define DBG_STMT_TYPE(s) virtual String dbgStmtType() const { return String(#s); } +# define DBG_STMT_TYPE(s) virtual const char* dbgStmtType() const { return "#s"; } #else # define DBG_STMT_TYPE(s) #endif struct BreakStmtNode : StmtNode { - static BreakStmtNode *alloc(S32 lineNumber); + static BreakStmtNode* alloc(S32 lineNumber); - U32 compileStmt(CodeStream &codeStream, U32 ip); + U32 compileStmt(CodeStream& codeStream, U32 ip); DBG_STMT_TYPE(BreakStmtNode); }; struct ContinueStmtNode : StmtNode { - static ContinueStmtNode *alloc(S32 lineNumber); + static ContinueStmtNode* alloc(S32 lineNumber); - U32 compileStmt(CodeStream &codeStream, U32 ip); + U32 compileStmt(CodeStream& codeStream, U32 ip); DBG_STMT_TYPE(ContinueStmtNode); }; /// A mathematical expression. struct ExprNode : StmtNode { + ExprNode* optimizedNode; - U32 compileStmt(CodeStream &codeStream, U32 ip); + U32 compileStmt(CodeStream& codeStream, U32 ip); - virtual U32 compile(CodeStream &codeStream, U32 ip, TypeReq type) = 0; + virtual U32 compile(CodeStream& codeStream, U32 ip, TypeReq type) = 0; virtual TypeReq getPreferredType() = 0; + virtual ExprNodeName getExprNodeNameEnum() const { return NameExprNode; } }; struct ReturnStmtNode : StmtNode { - ExprNode *expr; + ExprNode* expr; - static ReturnStmtNode *alloc(S32 lineNumber, ExprNode *expr); + static ReturnStmtNode* alloc(S32 lineNumber, ExprNode* expr); - U32 compileStmt(CodeStream &codeStream, U32 ip); + U32 compileStmt(CodeStream& codeStream, U32 ip); DBG_STMT_TYPE(ReturnStmtNode); }; struct IfStmtNode : StmtNode { - ExprNode *testExpr; - StmtNode *ifBlock, *elseBlock; + ExprNode* testExpr; + StmtNode* ifBlock, * elseBlock; U32 endifOffset; U32 elseOffset; bool integer; bool propagate; - static IfStmtNode *alloc(S32 lineNumber, ExprNode *testExpr, StmtNode *ifBlock, StmtNode *elseBlock, bool propagateThrough); - void propagateSwitchExpr(ExprNode *left, bool string); - ExprNode *getSwitchOR(ExprNode *left, ExprNode *list, bool string); + static IfStmtNode* alloc(S32 lineNumber, ExprNode* testExpr, StmtNode* ifBlock, StmtNode* elseBlock, bool propagateThrough); + void propagateSwitchExpr(ExprNode* left, bool string); + ExprNode* getSwitchOR(ExprNode* left, ExprNode* list, bool string); - U32 compileStmt(CodeStream &codeStream, U32 ip); + U32 compileStmt(CodeStream& codeStream, U32 ip); DBG_STMT_TYPE(IfStmtNode); }; struct LoopStmtNode : StmtNode { - ExprNode *testExpr; - ExprNode *initExpr; - ExprNode *endLoopExpr; - StmtNode *loopBlock; + ExprNode* testExpr; + ExprNode* initExpr; + ExprNode* endLoopExpr; + StmtNode* loopBlock; bool isDoLoop; U32 breakOffset; U32 continueOffset; U32 loopBlockStartOffset; bool integer; - static LoopStmtNode *alloc(S32 lineNumber, ExprNode *testExpr, ExprNode *initExpr, ExprNode *endLoopExpr, StmtNode *loopBlock, bool isDoLoop); + static LoopStmtNode* alloc(S32 lineNumber, ExprNode* testExpr, ExprNode* initExpr, ExprNode* endLoopExpr, StmtNode* loopBlock, bool isDoLoop); - U32 compileStmt(CodeStream &codeStream, U32 ip); + U32 compileStmt(CodeStream& codeStream, U32 ip); DBG_STMT_TYPE(LoopStmtNode); }; @@ -189,35 +198,38 @@ struct IterStmtNode : StmtNode static IterStmtNode* alloc(S32 lineNumber, StringTableEntry varName, ExprNode* containerExpr, StmtNode* body, bool isStringIter); - U32 compileStmt(CodeStream &codeStream, U32 ip); + U32 compileStmt(CodeStream& codeStream, U32 ip); }; /// A binary mathematical expression (ie, left op right). struct BinaryExprNode : ExprNode { S32 op; - ExprNode *left; - ExprNode *right; + ExprNode* left; + ExprNode* right; }; struct FloatBinaryExprNode : BinaryExprNode { - static FloatBinaryExprNode *alloc(S32 lineNumber, S32 op, ExprNode *left, ExprNode *right); + static FloatBinaryExprNode* alloc(S32 lineNumber, S32 op, ExprNode* left, ExprNode* right); + + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); + + bool optimize(); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(FloatBinaryExprNode); }; struct ConditionalExprNode : ExprNode { - ExprNode *testExpr; - ExprNode *trueExpr; - ExprNode *falseExpr; + ExprNode* testExpr; + ExprNode* trueExpr; + ExprNode* falseExpr; bool integer; - static ConditionalExprNode *alloc(S32 lineNumber, ExprNode *testExpr, ExprNode *trueExpr, ExprNode *falseExpr); + static ConditionalExprNode* alloc(S32 lineNumber, ExprNode* testExpr, ExprNode* trueExpr, ExprNode* falseExpr); - virtual U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + virtual U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); virtual TypeReq getPreferredType(); DBG_STMT_TYPE(ConditionalExprNode); }; @@ -227,11 +239,13 @@ struct IntBinaryExprNode : BinaryExprNode TypeReq subType; U32 operand; - static IntBinaryExprNode *alloc(S32 lineNumber, S32 op, ExprNode *left, ExprNode *right); + static IntBinaryExprNode* alloc(S32 lineNumber, S32 op, ExprNode* left, ExprNode* right); void getSubTypeOperand(); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + bool optimize(); + + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(IntBinaryExprNode); }; @@ -239,9 +253,9 @@ struct IntBinaryExprNode : BinaryExprNode struct StreqExprNode : BinaryExprNode { bool eq; - static StreqExprNode *alloc(S32 lineNumber, ExprNode *left, ExprNode *right, bool eq); + static StreqExprNode* alloc(S32 lineNumber, ExprNode* left, ExprNode* right, bool eq); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(StreqExprNode); }; @@ -249,19 +263,19 @@ struct StreqExprNode : BinaryExprNode struct StrcatExprNode : BinaryExprNode { S32 appendChar; - static StrcatExprNode *alloc(S32 lineNumber, ExprNode *left, ExprNode *right, S32 appendChar); + static StrcatExprNode* alloc(S32 lineNumber, ExprNode* left, ExprNode* right, S32 appendChar); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(StrcatExprNode); }; struct CommaCatExprNode : BinaryExprNode { - static CommaCatExprNode *alloc(S32 lineNumber, ExprNode *left, ExprNode *right); + static CommaCatExprNode* alloc(S32 lineNumber, ExprNode* left, ExprNode* right); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(CommaCatExprNode); }; @@ -269,12 +283,12 @@ struct CommaCatExprNode : BinaryExprNode struct IntUnaryExprNode : ExprNode { S32 op; - ExprNode *expr; + ExprNode* expr; bool integer; - static IntUnaryExprNode *alloc(S32 lineNumber, S32 op, ExprNode *expr); + static IntUnaryExprNode* alloc(S32 lineNumber, S32 op, ExprNode* expr); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(IntUnaryExprNode); }; @@ -282,11 +296,11 @@ struct IntUnaryExprNode : ExprNode struct FloatUnaryExprNode : ExprNode { S32 op; - ExprNode *expr; + ExprNode* expr; - static FloatUnaryExprNode *alloc(S32 lineNumber, S32 op, ExprNode *expr); + static FloatUnaryExprNode* alloc(S32 lineNumber, S32 op, ExprNode* expr); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(FloatUnaryExprNode); }; @@ -294,12 +308,13 @@ struct FloatUnaryExprNode : ExprNode struct VarNode : ExprNode { StringTableEntry varName; - ExprNode *arrayIndex; + ExprNode* arrayIndex; - static VarNode *alloc(S32 lineNumber, StringTableEntry varName, ExprNode *arrayIndex); + static VarNode* alloc(S32 lineNumber, StringTableEntry varName, ExprNode* arrayIndex); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); + virtual ExprNodeName getExprNodeNameEnum() const { return NameVarNode; } DBG_STMT_TYPE(VarNode); }; @@ -308,10 +323,11 @@ struct IntNode : ExprNode S32 value; U32 index; // if it's converted to float/string - static IntNode *alloc(S32 lineNumber, S32 value); + static IntNode* alloc(S32 lineNumber, S32 value); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); + virtual ExprNodeName getExprNodeNameEnum() const { return NameIntNode; } DBG_STMT_TYPE(IntNode); }; @@ -320,24 +336,25 @@ struct FloatNode : ExprNode F64 value; U32 index; - static FloatNode *alloc(S32 lineNumber, F64 value); + static FloatNode* alloc(S32 lineNumber, F64 value); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); + virtual ExprNodeName getExprNodeNameEnum() const { return NameFloatNode; } DBG_STMT_TYPE(FloatNode); }; struct StrConstNode : ExprNode { - char *str; + char* str; F64 fVal; U32 index; bool tag; bool doc; // Specifies that this string is a documentation block. - static StrConstNode *alloc(S32 lineNumber, char *str, bool tag, bool doc = false); + static StrConstNode* alloc(S32 lineNumber, char* str, bool tag, bool doc = false); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(StrConstNode); }; @@ -348,9 +365,9 @@ struct ConstantNode : ExprNode F64 fVal; U32 index; - static ConstantNode *alloc(S32 lineNumber, StringTableEntry value); + static ConstantNode* alloc(S32 lineNumber, StringTableEntry value); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(ConstantNode); }; @@ -358,13 +375,13 @@ struct ConstantNode : ExprNode struct AssignExprNode : ExprNode { StringTableEntry varName; - ExprNode *expr; - ExprNode *arrayIndex; + ExprNode* expr; + ExprNode* arrayIndex; TypeReq subType; - static AssignExprNode *alloc(S32 lineNumber, StringTableEntry varName, ExprNode *arrayIndex, ExprNode *expr); + static AssignExprNode* alloc(S32 lineNumber, StringTableEntry varName, ExprNode* arrayIndex, ExprNode* expr); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(AssignExprNode); }; @@ -373,22 +390,22 @@ struct AssignDecl { S32 lineNumber; S32 token; - ExprNode *expr; + ExprNode* expr; bool integer; }; struct AssignOpExprNode : ExprNode { StringTableEntry varName; - ExprNode *expr; - ExprNode *arrayIndex; + ExprNode* expr; + ExprNode* arrayIndex; S32 op; U32 operand; TypeReq subType; - static AssignOpExprNode *alloc(S32 lineNumber, StringTableEntry varName, ExprNode *arrayIndex, ExprNode *expr, S32 op); + static AssignOpExprNode* alloc(S32 lineNumber, StringTableEntry varName, ExprNode* arrayIndex, ExprNode* expr, S32 op); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(AssignOpExprNode); }; @@ -396,22 +413,22 @@ struct AssignOpExprNode : ExprNode struct TTagSetStmtNode : StmtNode { StringTableEntry tag; - ExprNode *valueExpr; - ExprNode *stringExpr; + ExprNode* valueExpr; + ExprNode* stringExpr; - static TTagSetStmtNode *alloc(S32 lineNumber, StringTableEntry tag, ExprNode *valueExpr, ExprNode *stringExpr); + static TTagSetStmtNode* alloc(S32 lineNumber, StringTableEntry tag, ExprNode* valueExpr, ExprNode* stringExpr); - U32 compileStmt(CodeStream &codeStream, U32 ip); + U32 compileStmt(CodeStream& codeStream, U32 ip); DBG_STMT_TYPE(TTagSetStmtNode); }; struct TTagDerefNode : ExprNode { - ExprNode *expr; + ExprNode* expr; - static TTagDerefNode *alloc(S32 lineNumber, ExprNode *expr); + static TTagDerefNode* alloc(S32 lineNumber, ExprNode* expr); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(TTagDerefNode); }; @@ -420,9 +437,9 @@ struct TTagExprNode : ExprNode { StringTableEntry tag; - static TTagExprNode *alloc(S32 lineNumber, StringTableEntry tag); + static TTagExprNode* alloc(S32 lineNumber, StringTableEntry tag); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(TTagExprNode); }; @@ -431,42 +448,31 @@ struct FuncCallExprNode : ExprNode { StringTableEntry funcName; StringTableEntry nameSpace; - ExprNode *args; + ExprNode* args; U32 callType; enum { FunctionCall, + StaticCall, MethodCall, ParentCall }; - static FuncCallExprNode *alloc(S32 lineNumber, StringTableEntry funcName, StringTableEntry nameSpace, ExprNode *args, bool dot); + static FuncCallExprNode* alloc(S32 lineNumber, StringTableEntry funcName, StringTableEntry nameSpace, ExprNode* args, bool dot); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(FuncCallExprNode); }; -struct FuncPointerCallExprNode : ExprNode -{ - ExprNode *funcPointer; - ExprNode *args; - - static FuncPointerCallExprNode *alloc(S32 lineNumber, ExprNode *stmt, ExprNode *args); - - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); - TypeReq getPreferredType(); - DBG_STMT_TYPE(FuncPointerCallExprNode); -}; - struct AssertCallExprNode : ExprNode { - ExprNode *testExpr; - const char *message; + ExprNode* testExpr; + const char* message; U32 messageIndex; - static AssertCallExprNode *alloc(S32 lineNumber, ExprNode *testExpr, const char *message); + static AssertCallExprNode* alloc(S32 lineNumber, ExprNode* testExpr, const char* message); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(AssertCallExprNode); }; @@ -474,19 +480,19 @@ struct AssertCallExprNode : ExprNode struct SlotDecl { S32 lineNumber; - ExprNode *object; + ExprNode* object; StringTableEntry slotName; - ExprNode *array; + ExprNode* array; }; struct SlotAccessNode : ExprNode { - ExprNode *objectExpr, *arrayExpr; + ExprNode* objectExpr, * arrayExpr; StringTableEntry slotName; - static SlotAccessNode *alloc(S32 lineNumber, ExprNode *objectExpr, ExprNode *arrayExpr, StringTableEntry slotName); + static SlotAccessNode* alloc(S32 lineNumber, ExprNode* objectExpr, ExprNode* arrayExpr, StringTableEntry slotName); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(SlotAccessNode); }; @@ -494,101 +500,99 @@ struct SlotAccessNode : ExprNode struct InternalSlotDecl { S32 lineNumber; - ExprNode *object; - ExprNode *slotExpr; + ExprNode* object; + ExprNode* slotExpr; bool recurse; }; struct InternalSlotAccessNode : ExprNode { - ExprNode *objectExpr, *slotExpr; + ExprNode* objectExpr, * slotExpr; bool recurse; - static InternalSlotAccessNode *alloc(S32 lineNumber, ExprNode *objectExpr, ExprNode *slotExpr, bool recurse); + static InternalSlotAccessNode* alloc(S32 lineNumber, ExprNode* objectExpr, ExprNode* slotExpr, bool recurse); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(InternalSlotAccessNode); }; struct SlotAssignNode : ExprNode { - ExprNode *objectExpr, *arrayExpr; + ExprNode* objectExpr, * arrayExpr; StringTableEntry slotName; - ExprNode *valueExpr; + ExprNode* valueExpr; U32 typeID; - static SlotAssignNode *alloc(S32 lineNumber, ExprNode *objectExpr, ExprNode *arrayExpr, StringTableEntry slotName, ExprNode *valueExpr, U32 typeID = -1); + static SlotAssignNode* alloc(S32 lineNumber, ExprNode* objectExpr, ExprNode* arrayExpr, StringTableEntry slotName, ExprNode* valueExpr, U32 typeID = -1); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(SlotAssignNode); }; struct SlotAssignOpNode : ExprNode { - ExprNode *objectExpr, *arrayExpr; + ExprNode* objectExpr, * arrayExpr; StringTableEntry slotName; S32 op; - ExprNode *valueExpr; + ExprNode* valueExpr; U32 operand; TypeReq subType; - static SlotAssignOpNode *alloc(S32 lineNumber, ExprNode *objectExpr, StringTableEntry slotName, ExprNode *arrayExpr, S32 op, ExprNode *valueExpr); + static SlotAssignOpNode* alloc(S32 lineNumber, ExprNode* objectExpr, StringTableEntry slotName, ExprNode* arrayExpr, S32 op, ExprNode* valueExpr); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); DBG_STMT_TYPE(SlotAssignOpNode); }; struct ObjectDeclNode : ExprNode { - ExprNode *classNameExpr; + ExprNode* classNameExpr; StringTableEntry parentObject; - ExprNode *objectNameExpr; - ExprNode *argList; - SlotAssignNode *slotDecls; - ObjectDeclNode *subObjects; + ExprNode* objectNameExpr; + ExprNode* argList; + SlotAssignNode* slotDecls; + ObjectDeclNode* subObjects; bool isDatablock; U32 failOffset; bool isClassNameInternal; bool isSingleton; - static ObjectDeclNode *alloc(S32 lineNumber, ExprNode *classNameExpr, ExprNode *objectNameExpr, ExprNode *argList, StringTableEntry parentObject, SlotAssignNode *slotDecls, ObjectDeclNode *subObjects, bool isDatablock, bool classNameInternal, bool isSingleton); + static ObjectDeclNode* alloc(S32 lineNumber, ExprNode* classNameExpr, ExprNode* objectNameExpr, ExprNode* argList, StringTableEntry parentObject, SlotAssignNode* slotDecls, ObjectDeclNode* subObjects, bool isDatablock, bool classNameInternal, bool isSingleton); U32 precompileSubObject(bool); - U32 compile(CodeStream &codeStream, U32 ip, TypeReq type); - U32 compileSubObject(CodeStream &codeStream, U32 ip, bool); + U32 compile(CodeStream& codeStream, U32 ip, TypeReq type); + U32 compileSubObject(CodeStream& codeStream, U32 ip, bool); TypeReq getPreferredType(); DBG_STMT_TYPE(ObjectDeclNode); }; struct ObjectBlockDecl { - SlotAssignNode *slots; - ObjectDeclNode *decls; + SlotAssignNode* slots; + ObjectDeclNode* decls; }; struct FunctionDeclStmtNode : StmtNode { StringTableEntry fnName; - VarNode *args; - StmtNode *stmts; + VarNode* args; + StmtNode* stmts; StringTableEntry nameSpace; StringTableEntry package; U32 endOffset; U32 argc; - static FunctionDeclStmtNode *alloc(S32 lineNumber, StringTableEntry fnName, StringTableEntry nameSpace, VarNode *args, StmtNode *stmts); + static FunctionDeclStmtNode* alloc(S32 lineNumber, StringTableEntry fnName, StringTableEntry nameSpace, VarNode* args, StmtNode* stmts); - U32 compileStmt(CodeStream &codeStream, U32 ip); + U32 compileStmt(CodeStream& codeStream, U32 ip); void setPackage(StringTableEntry packageName); DBG_STMT_TYPE(FunctionDeclStmtNode); }; -extern StmtNode *gStatementList; -extern StmtNode *gAnonFunctionList; -extern U32 gAnonFunctionID; +extern StmtNode* gStatementList; extern ExprEvalState gEvalState; #endif diff --git a/Engine/source/console/astAlloc.cpp b/Engine/source/console/astAlloc.cpp index 521b6dbcc..58d5a0d7f 100644 --- a/Engine/source/console/astAlloc.cpp +++ b/Engine/source/console/astAlloc.cpp @@ -1,5 +1,5 @@ //----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC +// Copyright (c) 2013 GarageGames, LLC // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to @@ -20,7 +20,6 @@ // IN THE SOFTWARE. //----------------------------------------------------------------------------- -#include "platform/platform.h" #include "console/console.h" #include "console/compiler.h" #include "console/consoleInternal.h" @@ -38,25 +37,25 @@ using namespace Compiler; //------------------------------------------------------------ -BreakStmtNode *BreakStmtNode::alloc(S32 lineNumber) +BreakStmtNode* BreakStmtNode::alloc(S32 lineNumber) { - BreakStmtNode *ret = (BreakStmtNode *)consoleAlloc(sizeof(BreakStmtNode)); + BreakStmtNode* ret = (BreakStmtNode*)consoleAlloc(sizeof(BreakStmtNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; return ret; } -ContinueStmtNode *ContinueStmtNode::alloc(S32 lineNumber) +ContinueStmtNode* ContinueStmtNode::alloc(S32 lineNumber) { - ContinueStmtNode *ret = (ContinueStmtNode *)consoleAlloc(sizeof(ContinueStmtNode)); + ContinueStmtNode* ret = (ContinueStmtNode*)consoleAlloc(sizeof(ContinueStmtNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; return ret; } -ReturnStmtNode *ReturnStmtNode::alloc(S32 lineNumber, ExprNode *expr) +ReturnStmtNode* ReturnStmtNode::alloc(S32 lineNumber, ExprNode* expr) { - ReturnStmtNode *ret = (ReturnStmtNode *)consoleAlloc(sizeof(ReturnStmtNode)); + ReturnStmtNode* ret = (ReturnStmtNode*)consoleAlloc(sizeof(ReturnStmtNode)); constructInPlace(ret); ret->expr = expr; ret->dbgLineNumber = lineNumber; @@ -64,9 +63,9 @@ ReturnStmtNode *ReturnStmtNode::alloc(S32 lineNumber, ExprNode *expr) return ret; } -IfStmtNode *IfStmtNode::alloc(S32 lineNumber, ExprNode *testExpr, StmtNode *ifBlock, StmtNode *elseBlock, bool propagate) +IfStmtNode* IfStmtNode::alloc(S32 lineNumber, ExprNode* testExpr, StmtNode* ifBlock, StmtNode* elseBlock, bool propagate) { - IfStmtNode *ret = (IfStmtNode *)consoleAlloc(sizeof(IfStmtNode)); + IfStmtNode* ret = (IfStmtNode*)consoleAlloc(sizeof(IfStmtNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; @@ -78,9 +77,9 @@ IfStmtNode *IfStmtNode::alloc(S32 lineNumber, ExprNode *testExpr, StmtNode *ifBl return ret; } -LoopStmtNode *LoopStmtNode::alloc(S32 lineNumber, ExprNode *initExpr, ExprNode *testExpr, ExprNode *endLoopExpr, StmtNode *loopBlock, bool isDoLoop) +LoopStmtNode* LoopStmtNode::alloc(S32 lineNumber, ExprNode* initExpr, ExprNode* testExpr, ExprNode* endLoopExpr, StmtNode* loopBlock, bool isDoLoop) { - LoopStmtNode *ret = (LoopStmtNode *)consoleAlloc(sizeof(LoopStmtNode)); + LoopStmtNode* ret = (LoopStmtNode*)consoleAlloc(sizeof(LoopStmtNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; ret->testExpr = testExpr; @@ -111,11 +110,12 @@ IterStmtNode* IterStmtNode::alloc(S32 lineNumber, StringTableEntry varName, Expr return ret; } -FloatBinaryExprNode *FloatBinaryExprNode::alloc(S32 lineNumber, S32 op, ExprNode *left, ExprNode *right) +FloatBinaryExprNode* FloatBinaryExprNode::alloc(S32 lineNumber, S32 op, ExprNode* left, ExprNode* right) { - FloatBinaryExprNode *ret = (FloatBinaryExprNode *)consoleAlloc(sizeof(FloatBinaryExprNode)); + FloatBinaryExprNode* ret = (FloatBinaryExprNode*)consoleAlloc(sizeof(FloatBinaryExprNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->op = op; ret->left = left; @@ -124,11 +124,12 @@ FloatBinaryExprNode *FloatBinaryExprNode::alloc(S32 lineNumber, S32 op, ExprNode return ret; } -IntBinaryExprNode *IntBinaryExprNode::alloc(S32 lineNumber, S32 op, ExprNode *left, ExprNode *right) +IntBinaryExprNode* IntBinaryExprNode::alloc(S32 lineNumber, S32 op, ExprNode* left, ExprNode* right) { - IntBinaryExprNode *ret = (IntBinaryExprNode *)consoleAlloc(sizeof(IntBinaryExprNode)); + IntBinaryExprNode* ret = (IntBinaryExprNode*)consoleAlloc(sizeof(IntBinaryExprNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->op = op; ret->left = left; @@ -137,11 +138,12 @@ IntBinaryExprNode *IntBinaryExprNode::alloc(S32 lineNumber, S32 op, ExprNode *le return ret; } -StreqExprNode *StreqExprNode::alloc(S32 lineNumber, ExprNode *left, ExprNode *right, bool eq) +StreqExprNode* StreqExprNode::alloc(S32 lineNumber, ExprNode* left, ExprNode* right, bool eq) { - StreqExprNode *ret = (StreqExprNode *)consoleAlloc(sizeof(StreqExprNode)); + StreqExprNode* ret = (StreqExprNode*)consoleAlloc(sizeof(StreqExprNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->left = left; ret->right = right; ret->eq = eq; @@ -149,11 +151,12 @@ StreqExprNode *StreqExprNode::alloc(S32 lineNumber, ExprNode *left, ExprNode *ri return ret; } -StrcatExprNode *StrcatExprNode::alloc(S32 lineNumber, ExprNode *left, ExprNode *right, S32 appendChar) +StrcatExprNode* StrcatExprNode::alloc(S32 lineNumber, ExprNode* left, ExprNode* right, int appendChar) { - StrcatExprNode *ret = (StrcatExprNode *)consoleAlloc(sizeof(StrcatExprNode)); + StrcatExprNode* ret = (StrcatExprNode*)consoleAlloc(sizeof(StrcatExprNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->left = left; ret->right = right; ret->appendChar = appendChar; @@ -161,61 +164,67 @@ StrcatExprNode *StrcatExprNode::alloc(S32 lineNumber, ExprNode *left, ExprNode * return ret; } -CommaCatExprNode *CommaCatExprNode::alloc(S32 lineNumber, ExprNode *left, ExprNode *right) +CommaCatExprNode* CommaCatExprNode::alloc(S32 lineNumber, ExprNode* left, ExprNode* right) { - CommaCatExprNode *ret = (CommaCatExprNode *)consoleAlloc(sizeof(CommaCatExprNode)); + CommaCatExprNode* ret = (CommaCatExprNode*)consoleAlloc(sizeof(CommaCatExprNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->left = left; ret->right = right; return ret; } -IntUnaryExprNode *IntUnaryExprNode::alloc(S32 lineNumber, S32 op, ExprNode *expr) +IntUnaryExprNode* IntUnaryExprNode::alloc(S32 lineNumber, S32 op, ExprNode* expr) { - IntUnaryExprNode *ret = (IntUnaryExprNode *)consoleAlloc(sizeof(IntUnaryExprNode)); + IntUnaryExprNode* ret = (IntUnaryExprNode*)consoleAlloc(sizeof(IntUnaryExprNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->op = op; ret->expr = expr; return ret; } -FloatUnaryExprNode *FloatUnaryExprNode::alloc(S32 lineNumber, S32 op, ExprNode *expr) +FloatUnaryExprNode* FloatUnaryExprNode::alloc(S32 lineNumber, S32 op, ExprNode* expr) { - FloatUnaryExprNode *ret = (FloatUnaryExprNode *)consoleAlloc(sizeof(FloatUnaryExprNode)); + FloatUnaryExprNode* ret = (FloatUnaryExprNode*)consoleAlloc(sizeof(FloatUnaryExprNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->op = op; ret->expr = expr; return ret; } -VarNode *VarNode::alloc(S32 lineNumber, StringTableEntry varName, ExprNode *arrayIndex) +VarNode* VarNode::alloc(S32 lineNumber, StringTableEntry varName, ExprNode* arrayIndex) { - VarNode *ret = (VarNode *)consoleAlloc(sizeof(VarNode)); + VarNode* ret = (VarNode*)consoleAlloc(sizeof(VarNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->varName = varName; ret->arrayIndex = arrayIndex; return ret; } -IntNode *IntNode::alloc(S32 lineNumber, S32 value) +IntNode* IntNode::alloc(S32 lineNumber, S32 value) { - IntNode *ret = (IntNode *)consoleAlloc(sizeof(IntNode)); + IntNode* ret = (IntNode*)consoleAlloc(sizeof(IntNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->value = value; return ret; } -ConditionalExprNode *ConditionalExprNode::alloc(S32 lineNumber, ExprNode *testExpr, ExprNode *trueExpr, ExprNode *falseExpr) +ConditionalExprNode* ConditionalExprNode::alloc(S32 lineNumber, ExprNode* testExpr, ExprNode* trueExpr, ExprNode* falseExpr) { - ConditionalExprNode *ret = (ConditionalExprNode *)consoleAlloc(sizeof(ConditionalExprNode)); + ConditionalExprNode* ret = (ConditionalExprNode*)consoleAlloc(sizeof(ConditionalExprNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->testExpr = testExpr; ret->trueExpr = trueExpr; ret->falseExpr = falseExpr; @@ -223,44 +232,50 @@ ConditionalExprNode *ConditionalExprNode::alloc(S32 lineNumber, ExprNode *testEx return ret; } -FloatNode *FloatNode::alloc(S32 lineNumber, F64 value) +FloatNode* FloatNode::alloc(S32 lineNumber, F64 value) { - FloatNode *ret = (FloatNode *)consoleAlloc(sizeof(FloatNode)); + FloatNode* ret = (FloatNode*)consoleAlloc(sizeof(FloatNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->value = value; return ret; } -StrConstNode *StrConstNode::alloc(S32 lineNumber, char *str, bool tag, bool doc) +StrConstNode* StrConstNode::alloc(S32 lineNumber, char* str, bool tag, bool doc) { - StrConstNode *ret = (StrConstNode *)consoleAlloc(sizeof(StrConstNode)); + StrConstNode* ret = (StrConstNode*)consoleAlloc(sizeof(StrConstNode)); constructInPlace(ret); + S32 len = dStrlen(str); + ret->dbgLineNumber = lineNumber; - dsize_t retStrLen = dStrlen(str) + 1; - ret->str = (char *)consoleAlloc(retStrLen); + ret->optimizedNode = NULL; + ret->str = (char*)consoleAlloc(len + 1); ret->tag = tag; ret->doc = doc; - dStrcpy(ret->str, str, retStrLen); + dStrcpy(ret->str, str, len); + ret->str[len] = '\0'; return ret; } -ConstantNode *ConstantNode::alloc(S32 lineNumber, StringTableEntry value) +ConstantNode* ConstantNode::alloc(S32 lineNumber, StringTableEntry value) { - ConstantNode *ret = (ConstantNode *)consoleAlloc(sizeof(ConstantNode)); + ConstantNode* ret = (ConstantNode*)consoleAlloc(sizeof(ConstantNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->value = value; return ret; } -AssignExprNode *AssignExprNode::alloc(S32 lineNumber, StringTableEntry varName, ExprNode *arrayIndex, ExprNode *expr) +AssignExprNode* AssignExprNode::alloc(S32 lineNumber, StringTableEntry varName, ExprNode* arrayIndex, ExprNode* expr) { - AssignExprNode *ret = (AssignExprNode *)consoleAlloc(sizeof(AssignExprNode)); + AssignExprNode* ret = (AssignExprNode*)consoleAlloc(sizeof(AssignExprNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->varName = varName; ret->expr = expr; ret->arrayIndex = arrayIndex; @@ -268,11 +283,12 @@ AssignExprNode *AssignExprNode::alloc(S32 lineNumber, StringTableEntry varName, return ret; } -AssignOpExprNode *AssignOpExprNode::alloc(S32 lineNumber, StringTableEntry varName, ExprNode *arrayIndex, ExprNode *expr, S32 op) +AssignOpExprNode* AssignOpExprNode::alloc(S32 lineNumber, StringTableEntry varName, ExprNode* arrayIndex, ExprNode* expr, S32 op) { - AssignOpExprNode *ret = (AssignOpExprNode *)consoleAlloc(sizeof(AssignOpExprNode)); + AssignOpExprNode* ret = (AssignOpExprNode*)consoleAlloc(sizeof(AssignOpExprNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->varName = varName; ret->expr = expr; ret->arrayIndex = arrayIndex; @@ -280,9 +296,9 @@ AssignOpExprNode *AssignOpExprNode::alloc(S32 lineNumber, StringTableEntry varNa return ret; } -TTagSetStmtNode *TTagSetStmtNode::alloc(S32 lineNumber, StringTableEntry tag, ExprNode *valueExpr, ExprNode *stringExpr) +TTagSetStmtNode* TTagSetStmtNode::alloc(S32 lineNumber, StringTableEntry tag, ExprNode* valueExpr, ExprNode* stringExpr) { - TTagSetStmtNode *ret = (TTagSetStmtNode *)consoleAlloc(sizeof(TTagSetStmtNode)); + TTagSetStmtNode* ret = (TTagSetStmtNode*)consoleAlloc(sizeof(TTagSetStmtNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; ret->tag = tag; @@ -291,59 +307,54 @@ TTagSetStmtNode *TTagSetStmtNode::alloc(S32 lineNumber, StringTableEntry tag, Ex return ret; } -TTagDerefNode *TTagDerefNode::alloc(S32 lineNumber, ExprNode *expr) +TTagDerefNode* TTagDerefNode::alloc(S32 lineNumber, ExprNode* expr) { - TTagDerefNode *ret = (TTagDerefNode *)consoleAlloc(sizeof(TTagDerefNode)); + TTagDerefNode* ret = (TTagDerefNode*)consoleAlloc(sizeof(TTagDerefNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->expr = expr; return ret; } -TTagExprNode *TTagExprNode::alloc(S32 lineNumber, StringTableEntry tag) +TTagExprNode* TTagExprNode::alloc(S32 lineNumber, StringTableEntry tag) { - TTagExprNode *ret = (TTagExprNode *)consoleAlloc(sizeof(TTagExprNode)); + TTagExprNode* ret = (TTagExprNode*)consoleAlloc(sizeof(TTagExprNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->tag = tag; return ret; } -FuncCallExprNode *FuncCallExprNode::alloc(S32 lineNumber, StringTableEntry funcName, StringTableEntry nameSpace, ExprNode *args, bool dot) +FuncCallExprNode* FuncCallExprNode::alloc(S32 lineNumber, StringTableEntry funcName, StringTableEntry nameSpace, ExprNode* args, bool dot) { - FuncCallExprNode *ret = (FuncCallExprNode *)consoleAlloc(sizeof(FuncCallExprNode)); + FuncCallExprNode* ret = (FuncCallExprNode*)consoleAlloc(sizeof(FuncCallExprNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->funcName = funcName; ret->nameSpace = nameSpace; ret->args = args; if (dot) ret->callType = MethodCall; - else + else if (nameSpace != NULL) { - if (nameSpace && !dStricmp(nameSpace, "Parent")) + if (dStricmp(nameSpace, "Parent") == 0) ret->callType = ParentCall; else - ret->callType = FunctionCall; + ret->callType = StaticCall; } + else + ret->callType = FunctionCall; return ret; } -FuncPointerCallExprNode *FuncPointerCallExprNode::alloc(S32 lineNumber, ExprNode *funcPointer, ExprNode *args) +AssertCallExprNode* AssertCallExprNode::alloc(S32 lineNumber, ExprNode* testExpr, const char* message) { - FuncPointerCallExprNode *ret = (FuncPointerCallExprNode *)consoleAlloc(sizeof(FuncPointerCallExprNode)); - constructInPlace(ret); - ret->dbgLineNumber = lineNumber; - ret->funcPointer = funcPointer; - ret->args = args; - return ret; -} +#ifdef TORQUE_ENABLE_SCRIPTASSERTS -AssertCallExprNode *AssertCallExprNode::alloc(S32 lineNumber, ExprNode *testExpr, const char *message) -{ -#ifdef TORQUE_ENABLE_SCRIPTASSERTS - - AssertCallExprNode *ret = (AssertCallExprNode *)consoleAlloc(sizeof(FuncCallExprNode)); + AssertCallExprNode* ret = (AssertCallExprNode*)consoleAlloc(sizeof(FuncCallExprNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; ret->testExpr = testExpr; @@ -357,10 +368,11 @@ AssertCallExprNode *AssertCallExprNode::alloc(S32 lineNumber, ExprNode *testExpr #endif } -SlotAccessNode *SlotAccessNode::alloc(S32 lineNumber, ExprNode *objectExpr, ExprNode *arrayExpr, StringTableEntry slotName) +SlotAccessNode* SlotAccessNode::alloc(S32 lineNumber, ExprNode* objectExpr, ExprNode* arrayExpr, StringTableEntry slotName) { - SlotAccessNode *ret = (SlotAccessNode *)consoleAlloc(sizeof(SlotAccessNode)); + SlotAccessNode* ret = (SlotAccessNode*)consoleAlloc(sizeof(SlotAccessNode)); constructInPlace(ret); + ret->optimizedNode = NULL; ret->dbgLineNumber = lineNumber; ret->objectExpr = objectExpr; ret->arrayExpr = arrayExpr; @@ -368,22 +380,24 @@ SlotAccessNode *SlotAccessNode::alloc(S32 lineNumber, ExprNode *objectExpr, Expr return ret; } -InternalSlotAccessNode *InternalSlotAccessNode::alloc(S32 lineNumber, ExprNode *objectExpr, ExprNode *slotExpr, bool recurse) +InternalSlotAccessNode* InternalSlotAccessNode::alloc(S32 lineNumber, ExprNode* objectExpr, ExprNode* slotExpr, bool recurse) { - InternalSlotAccessNode *ret = (InternalSlotAccessNode *)consoleAlloc(sizeof(InternalSlotAccessNode)); + InternalSlotAccessNode* ret = (InternalSlotAccessNode*)consoleAlloc(sizeof(InternalSlotAccessNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->objectExpr = objectExpr; ret->slotExpr = slotExpr; ret->recurse = recurse; return ret; } -SlotAssignNode *SlotAssignNode::alloc(S32 lineNumber, ExprNode *objectExpr, ExprNode *arrayExpr, StringTableEntry slotName, ExprNode *valueExpr, U32 typeID /* = -1 */) +SlotAssignNode* SlotAssignNode::alloc(S32 lineNumber, ExprNode* objectExpr, ExprNode* arrayExpr, StringTableEntry slotName, ExprNode* valueExpr, U32 typeID /* = -1 */) { - SlotAssignNode *ret = (SlotAssignNode *)consoleAlloc(sizeof(SlotAssignNode)); + SlotAssignNode* ret = (SlotAssignNode*)consoleAlloc(sizeof(SlotAssignNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->objectExpr = objectExpr; ret->arrayExpr = arrayExpr; ret->slotName = slotName; @@ -392,11 +406,12 @@ SlotAssignNode *SlotAssignNode::alloc(S32 lineNumber, ExprNode *objectExpr, Expr return ret; } -SlotAssignOpNode *SlotAssignOpNode::alloc(S32 lineNumber, ExprNode *objectExpr, StringTableEntry slotName, ExprNode *arrayExpr, S32 op, ExprNode *valueExpr) +SlotAssignOpNode* SlotAssignOpNode::alloc(S32 lineNumber, ExprNode* objectExpr, StringTableEntry slotName, ExprNode* arrayExpr, S32 op, ExprNode* valueExpr) { - SlotAssignOpNode *ret = (SlotAssignOpNode *)consoleAlloc(sizeof(SlotAssignOpNode)); + SlotAssignOpNode* ret = (SlotAssignOpNode*)consoleAlloc(sizeof(SlotAssignOpNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->objectExpr = objectExpr; ret->arrayExpr = arrayExpr; ret->slotName = slotName; @@ -405,11 +420,12 @@ SlotAssignOpNode *SlotAssignOpNode::alloc(S32 lineNumber, ExprNode *objectExpr, return ret; } -ObjectDeclNode *ObjectDeclNode::alloc(S32 lineNumber, ExprNode *classNameExpr, ExprNode *objectNameExpr, ExprNode *argList, StringTableEntry parentObject, SlotAssignNode *slotDecls, ObjectDeclNode *subObjects, bool isDatablock, bool classNameInternal, bool isSingleton) +ObjectDeclNode* ObjectDeclNode::alloc(S32 lineNumber, ExprNode* classNameExpr, ExprNode* objectNameExpr, ExprNode* argList, StringTableEntry parentObject, SlotAssignNode* slotDecls, ObjectDeclNode* subObjects, bool isDatablock, bool classNameInternal, bool isSingleton) { - ObjectDeclNode *ret = (ObjectDeclNode *)consoleAlloc(sizeof(ObjectDeclNode)); + ObjectDeclNode* ret = (ObjectDeclNode*)consoleAlloc(sizeof(ObjectDeclNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; + ret->optimizedNode = NULL; ret->classNameExpr = classNameExpr; ret->objectNameExpr = objectNameExpr; ret->argList = argList; @@ -422,13 +438,13 @@ ObjectDeclNode *ObjectDeclNode::alloc(S32 lineNumber, ExprNode *classNameExpr, E if (parentObject) ret->parentObject = parentObject; else - ret->parentObject = StringTable->EmptyString(); + ret->parentObject = StringTable->insert(""); return ret; } -FunctionDeclStmtNode *FunctionDeclStmtNode::alloc(S32 lineNumber, StringTableEntry fnName, StringTableEntry nameSpace, VarNode *args, StmtNode *stmts) +FunctionDeclStmtNode* FunctionDeclStmtNode::alloc(S32 lineNumber, StringTableEntry fnName, StringTableEntry nameSpace, VarNode* args, StmtNode* stmts) { - FunctionDeclStmtNode *ret = (FunctionDeclStmtNode *)consoleAlloc(sizeof(FunctionDeclStmtNode)); + FunctionDeclStmtNode* ret = (FunctionDeclStmtNode*)consoleAlloc(sizeof(FunctionDeclStmtNode)); constructInPlace(ret); ret->dbgLineNumber = lineNumber; ret->fnName = fnName; diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index 51bde9d61..28e6b4960 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -44,94 +44,66 @@ struct Token namespace Compiler { - U32 compileBlock(StmtNode *block, CodeStream &codeStream, U32 ip) + U32 compileBlock(StmtNode* block, CodeStream& codeStream, U32 ip) { - for (StmtNode *walk = block; walk; walk = walk->getNext()) + for (StmtNode* walk = block; walk; walk = walk->getNext()) ip = walk->compileStmt(codeStream, ip); return codeStream.tell(); } - - inline bool isSimpleVarLookup(ExprNode *arrayExpr, StringTableEntry &varName) - { - if (arrayExpr == nullptr) - { - varName = StringTable->insert(""); - return false; - } - - // No double arrays allowed for optimization. - VarNode *var = dynamic_cast(arrayExpr); - if (var && !var->arrayIndex) - { - StringTableEntry arrayVar = StringTable->insert(var->varName); - precompileIdent(arrayVar); - varName = arrayVar; - return true; - } - return false; - } - - // Do not allow 'recursive' %this optimizations. It can lead to weird bytecode - // generation since we can only optimize one expression at a time. - static bool OnlyOneThisOptimization = false; - - inline bool isThisVar(ExprNode *objectExpr) - { - // If we are currently optimizing a this var, don't allow extra optimization. - if (objectExpr == nullptr || OnlyOneThisOptimization) - return false; - - VarNode *thisVar = dynamic_cast(objectExpr); - if (thisVar && thisVar->varName == StringTable->insert("%this")) - return true; - return false; - } - - inline void optimizeThisPointer(CodeStream &codeStream, ExprNode *arrayExpr, U32 &ip, StringTableEntry slotName) - { - OnlyOneThisOptimization = true; - - // Is the array a simple variable? If so, we can optimize that. - StringTableEntry varName = nullptr; - bool simple = false; - - if (arrayExpr) - { - simple = isSimpleVarLookup(arrayExpr, varName); - if (!simple) - { - // Less optimized array setting. - codeStream.emit(OP_ADVANCE_STR); - ip = arrayExpr->compile(codeStream, ip, TypeReqString); - } - } - - codeStream.emit(OP_SETCURFIELD_THIS); - codeStream.emitSTE(slotName); - - if (arrayExpr) - { - if (simple) - { - codeStream.emit(OP_SETCURFIELD_ARRAY_VAR); - codeStream.emitSTE(varName); - } - else - { - codeStream.emit(OP_SETCURFIELD_ARRAY); - codeStream.emit(OP_TERMINATE_REWIND_STR); - } - } - - OnlyOneThisOptimization = false; - } } using namespace Compiler; +class FuncVars +{ + struct Var + { + S32 reg; + TypeReq currentType; + bool isConstant; + }; + +public: + S32 assign(StringTableEntry var, TypeReq currentType, bool isConstant = false) + { + std::unordered_map::iterator found = vars.find(var); + if (found != vars.end()) + { + AssertISV(!found->second.isConstant, avar("Reassigning variable %s when it is a constant", var)); + return found->second.reg; + } + + S32 id = counter++; + vars[var] = { id, currentType, isConstant }; + return id; + } + + S32 lookup(StringTableEntry var) + { + std::unordered_map::iterator found = vars.find(var); + AssertISV(found != vars.end(), avar("Variable %s referenced before used when compiling script.", var)); + return found->second.reg; + } + + TypeReq lookupType(StringTableEntry var) + { + std::unordered_map::iterator found = vars.find(var); + AssertISV(found != vars.end(), avar("Variable %s referenced before used when compiling script.", var)); + return found->second.currentType; + } + + inline S32 count() { return counter; } + +private: + std::unordered_map vars; + S32 counter = 0; +}; + +FuncVars* gFuncVars = NULL; + //----------------------------------------------------------------------------- -void StmtNode::addBreakLine(CodeStream &code) +void StmtNode::addBreakLine(CodeStream& code) { code.addBreakLine(dbgLineNumber, code.tell()); } @@ -140,21 +112,20 @@ void StmtNode::addBreakLine(CodeStream &code) StmtNode::StmtNode() { - mNext = NULL; + next = NULL; dbgFileName = CodeBlock::smCurrentParser->getCurrentFile(); - dbgLineNumber = 0; } void StmtNode::setPackage(StringTableEntry) { } -void StmtNode::append(StmtNode *next) +void StmtNode::append(StmtNode* next) { - StmtNode *walk = this; - while (walk->mNext) - walk = walk->mNext; - walk->mNext = next; + StmtNode* walk = this; + while (walk->next) + walk = walk->next; + walk->next = next; } @@ -175,64 +146,42 @@ static U32 conversionOp(TypeReq src, TypeReq dst) { switch (dst) { - case TypeReqUInt: - return OP_STR_TO_UINT; - case TypeReqFloat: - return OP_STR_TO_FLT; - case TypeReqNone: - return OP_STR_TO_NONE; - case TypeReqVar: - return OP_SAVEVAR_STR; - default: - break; + case TypeReqUInt: + return OP_STR_TO_UINT; + case TypeReqFloat: + return OP_STR_TO_FLT; + case TypeReqNone: + return OP_STR_TO_NONE; + default: + break; } } else if (src == TypeReqFloat) { switch (dst) { - case TypeReqUInt: - return OP_FLT_TO_UINT; - case TypeReqString: - return OP_FLT_TO_STR; - case TypeReqNone: - return OP_FLT_TO_NONE; - case TypeReqVar: - return OP_SAVEVAR_FLT; - default: - break; + case TypeReqUInt: + return OP_FLT_TO_UINT; + case TypeReqString: + return OP_FLT_TO_STR; + case TypeReqNone: + return OP_FLT_TO_NONE; + default: + break; } } else if (src == TypeReqUInt) { switch (dst) { - case TypeReqFloat: - return OP_UINT_TO_FLT; - case TypeReqString: - return OP_UINT_TO_STR; - case TypeReqNone: - return OP_UINT_TO_NONE; - case TypeReqVar: - return OP_SAVEVAR_UINT; - default: - break; - } - } - else if (src == TypeReqVar) - { - switch (dst) - { - case TypeReqUInt: - return OP_LOADVAR_UINT; - case TypeReqFloat: - return OP_LOADVAR_FLT; - case TypeReqString: - return OP_LOADVAR_STR; - case TypeReqNone: - return OP_COPYVAR_TO_NONE; - default: - break; + case TypeReqFloat: + return OP_UINT_TO_FLT; + case TypeReqString: + return OP_UINT_TO_STR; + case TypeReqNone: + return OP_UINT_TO_NONE; + default: + break; } } return OP_INVALID; @@ -240,7 +189,7 @@ static U32 conversionOp(TypeReq src, TypeReq dst) //------------------------------------------------------------ -U32 BreakStmtNode::compileStmt(CodeStream &codeStream, U32 ip) +U32 BreakStmtNode::compileStmt(CodeStream& codeStream, U32 ip) { if (codeStream.inLoop()) { @@ -257,7 +206,7 @@ U32 BreakStmtNode::compileStmt(CodeStream &codeStream, U32 ip) //------------------------------------------------------------ -U32 ContinueStmtNode::compileStmt(CodeStream &codeStream, U32 ip) +U32 ContinueStmtNode::compileStmt(CodeStream& codeStream, U32 ip) { if (codeStream.inLoop()) { @@ -274,7 +223,7 @@ U32 ContinueStmtNode::compileStmt(CodeStream &codeStream, U32 ip) //------------------------------------------------------------ -U32 ExprNode::compileStmt(CodeStream &codeStream, U32 ip) +U32 ExprNode::compileStmt(CodeStream& codeStream, U32 ip) { addBreakLine(codeStream); return compile(codeStream, ip, TypeReqNone); @@ -282,7 +231,7 @@ U32 ExprNode::compileStmt(CodeStream &codeStream, U32 ip) //------------------------------------------------------------ -U32 ReturnStmtNode::compileStmt(CodeStream &codeStream, U32 ip) +U32 ReturnStmtNode::compileStmt(CodeStream& codeStream, U32 ip) { addBreakLine(codeStream); if (!expr) @@ -295,15 +244,15 @@ U32 ReturnStmtNode::compileStmt(CodeStream &codeStream, U32 ip) // Return the correct type switch (walkType) { - case TypeReqUInt: - codeStream.emit(OP_RETURN_UINT); - break; - case TypeReqFloat: - codeStream.emit(OP_RETURN_FLT); - break; - default: - codeStream.emit(OP_RETURN); - break; + case TypeReqUInt: + codeStream.emit(OP_RETURN_UINT); + break; + case TypeReqFloat: + codeStream.emit(OP_RETURN_FLT); + break; + default: + codeStream.emit(OP_RETURN); + break; } } return codeStream.tell(); @@ -311,10 +260,10 @@ U32 ReturnStmtNode::compileStmt(CodeStream &codeStream, U32 ip) //------------------------------------------------------------ -ExprNode *IfStmtNode::getSwitchOR(ExprNode *left, ExprNode *list, bool string) +ExprNode* IfStmtNode::getSwitchOR(ExprNode* left, ExprNode* list, bool string) { - ExprNode *nextExpr = (ExprNode *)list->getNext(); - ExprNode *test; + ExprNode* nextExpr = (ExprNode*)list->getNext(); + ExprNode* test; if (string) test = StreqExprNode::alloc(left->dbgLineNumber, left, list, true); else @@ -324,14 +273,14 @@ ExprNode *IfStmtNode::getSwitchOR(ExprNode *left, ExprNode *list, bool string) return IntBinaryExprNode::alloc(test->dbgLineNumber, opOR, test, getSwitchOR(left, nextExpr, string)); } -void IfStmtNode::propagateSwitchExpr(ExprNode *left, bool string) +void IfStmtNode::propagateSwitchExpr(ExprNode* left, bool string) { testExpr = getSwitchOR(left, testExpr, string); if (propagate && elseBlock) - ((IfStmtNode *)elseBlock)->propagateSwitchExpr(left, string); + ((IfStmtNode*)elseBlock)->propagateSwitchExpr(left, string); } -U32 IfStmtNode::compileStmt(CodeStream &codeStream, U32 ip) +U32 IfStmtNode::compileStmt(CodeStream& codeStream, U32 ip) { U32 endifIp, elseIp; addBreakLine(codeStream); @@ -373,7 +322,7 @@ U32 IfStmtNode::compileStmt(CodeStream &codeStream, U32 ip) //------------------------------------------------------------ -U32 LoopStmtNode::compileStmt(CodeStream &codeStream, U32 ip) +U32 LoopStmtNode::compileStmt(CodeStream& codeStream, U32 ip) { if (testExpr->getPreferredType() == TypeReqUInt) { @@ -446,7 +395,7 @@ U32 LoopStmtNode::compileStmt(CodeStream &codeStream, U32 ip) //------------------------------------------------------------ -U32 IterStmtNode::compileStmt(CodeStream &codeStream, U32 ip) +U32 IterStmtNode::compileStmt(CodeStream& codeStream, U32 ip) { // Instruction sequence: // @@ -491,7 +440,7 @@ U32 IterStmtNode::compileStmt(CodeStream &codeStream, U32 ip) //------------------------------------------------------------ -U32 ConditionalExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 ConditionalExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { // code is testExpr // JMPIFNOT falseStart @@ -528,25 +477,31 @@ TypeReq ConditionalExprNode::getPreferredType() //------------------------------------------------------------ -U32 FloatBinaryExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 FloatBinaryExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { + if (optimize()) + { + ip = optimizedNode->compile(codeStream, ip, type); + return codeStream.tell(); + } + ip = right->compile(codeStream, ip, TypeReqFloat); ip = left->compile(codeStream, ip, TypeReqFloat); U32 operand = OP_INVALID; switch (op) { - case '+': - operand = OP_ADD; - break; - case '-': - operand = OP_SUB; - break; - case '/': - operand = OP_DIV; - break; - case '*': - operand = OP_MUL; - break; + case '+': + operand = OP_ADD; + break; + case '-': + operand = OP_SUB; + break; + case '/': + operand = OP_DIV; + break; + case '*': + operand = OP_MUL; + break; } codeStream.emit(operand); if (type != TypeReqFloat) @@ -566,59 +521,64 @@ void IntBinaryExprNode::getSubTypeOperand() subType = TypeReqUInt; switch (op) { - case '^': - operand = OP_XOR; - break; - case '%': - operand = OP_MOD; - break; - case '&': - operand = OP_BITAND; - break; - case '|': - operand = OP_BITOR; - break; - case '<': - operand = OP_CMPLT; - subType = TypeReqFloat; - break; - case '>': - operand = OP_CMPGR; - subType = TypeReqFloat; - break; - case opGE: - operand = OP_CMPGE; - subType = TypeReqFloat; - break; - case opLE: - operand = OP_CMPLE; - subType = TypeReqFloat; - break; - case opEQ: - operand = OP_CMPEQ; - subType = TypeReqFloat; - break; - case opNE: - operand = OP_CMPNE; - subType = TypeReqFloat; - break; - case opOR: - operand = OP_OR; - break; - case opAND: - operand = OP_AND; - break; - case opSHR: - operand = OP_SHR; - break; - case opSHL: - operand = OP_SHL; - break; + case '^': + operand = OP_XOR; + break; + case '%': + operand = OP_MOD; + break; + case '&': + operand = OP_BITAND; + break; + case '|': + operand = OP_BITOR; + break; + case '<': + operand = OP_CMPLT; + subType = TypeReqFloat; + break; + case '>': + operand = OP_CMPGR; + subType = TypeReqFloat; + break; + case opGE: + operand = OP_CMPGE; + subType = TypeReqFloat; + break; + case opLE: + operand = OP_CMPLE; + subType = TypeReqFloat; + break; + case opEQ: + operand = OP_CMPEQ; + subType = TypeReqFloat; + break; + case opNE: + operand = OP_CMPNE; + subType = TypeReqFloat; + break; + case opOR: + operand = OP_OR; + break; + case opAND: + operand = OP_AND; + break; + case opSHR: + operand = OP_SHR; + break; + case opSHL: + operand = OP_SHL; + break; } } -U32 IntBinaryExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 IntBinaryExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { + // TODO: What if we do other optimizations and this doesn't work for it..this + // so far only works for simple MOD optimizations... + if (optimize()) + right = optimizedNode; + getSubTypeOperand(); if (operand == OP_OR || operand == OP_AND) @@ -647,7 +607,7 @@ TypeReq IntBinaryExprNode::getPreferredType() //------------------------------------------------------------ -U32 StreqExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 StreqExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { // eval str left // OP_ADVANCE_STR_NUL @@ -673,7 +633,7 @@ TypeReq StreqExprNode::getPreferredType() //------------------------------------------------------------ -U32 StrcatExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 StrcatExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { ip = left->compile(codeStream, ip, TypeReqString); if (!appendChar) @@ -699,7 +659,7 @@ TypeReq StrcatExprNode::getPreferredType() //------------------------------------------------------------ -U32 CommaCatExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 CommaCatExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { ip = left->compile(codeStream, ip, TypeReqString); codeStream.emit(OP_ADVANCE_STR_COMMA); @@ -725,7 +685,7 @@ TypeReq CommaCatExprNode::getPreferredType() //------------------------------------------------------------ -U32 IntUnaryExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 IntUnaryExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { integer = true; TypeReq prefType = expr->getPreferredType(); @@ -749,7 +709,7 @@ TypeReq IntUnaryExprNode::getPreferredType() //------------------------------------------------------------ -U32 FloatUnaryExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 FloatUnaryExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { ip = expr->compile(codeStream, ip, TypeReqFloat); codeStream.emit(OP_NEG); @@ -765,22 +725,16 @@ TypeReq FloatUnaryExprNode::getPreferredType() //------------------------------------------------------------ -U32 VarNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 VarNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { - // if this has an arrayIndex and we are not short circuiting from a constant. - // if we are a var node - // OP_SETCURVAR_ARRAY_VARLOOKUP - // varName - // varNodeVarName - - // else - // OP_LOADIMMED_IDENT - // varName - // OP_ADVANCE_STR - // evaluate arrayIndex TypeReqString - // OP_REWIND_STR - // OP_SETCURVAR_ARRAY - // OP_LOADVAR (type) + // if this has an arrayIndex... + // OP_LOADIMMED_IDENT + // varName + // OP_ADVANCE_STR + // evaluate arrayIndex TypeReqString + // OP_REWIND_STR + // OP_SETCURVAR_ARRAY + // OP_LOADVAR (type) // else // OP_SETCURVAR @@ -790,56 +744,24 @@ U32 VarNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) if (type == TypeReqNone) return codeStream.tell(); - bool shortCircuit = false; - if (arrayIndex) - { - // If we have a constant, shortcircuit the array logic. - - IntNode *intNode = dynamic_cast(arrayIndex); - StrConstNode *strNode = dynamic_cast(arrayIndex); - if (intNode) - { - varName = StringTable->insert(avar("%s%d", varName, intNode->value)); - shortCircuit = true; - } - else if (strNode) - { - varName = StringTable->insert(avar("%s%s", varName, strNode->str)); - shortCircuit = true; - } - } - precompileIdent(varName); - if (arrayIndex && !shortCircuit) + bool oldVariables = arrayIndex || varName[0] == '$'; + + if (oldVariables) { - // Ok, lets try to optimize %var[%someothervar] as this is - // a common case for array usage. - StringTableEntry varNodeVarName; - if (isSimpleVarLookup(arrayIndex, varNodeVarName)) + codeStream.emit(arrayIndex ? OP_LOADIMMED_IDENT : OP_SETCURVAR); + codeStream.emitSTE(varName); + + if (arrayIndex) { - codeStream.emit(OP_SETCURVAR_ARRAY_VARLOOKUP); - codeStream.emitSTE(varName); - codeStream.emitSTE(varNodeVarName); - } - else - { - codeStream.emit(OP_LOADIMMED_IDENT); - codeStream.emitSTE(varName); codeStream.emit(OP_ADVANCE_STR); ip = arrayIndex->compile(codeStream, ip, TypeReqString); codeStream.emit(OP_REWIND_STR); codeStream.emit(OP_SETCURVAR_ARRAY); } - } - else - { - codeStream.emit(OP_SETCURVAR); - codeStream.emitSTE(varName); - } - - switch (type) - { + switch (type) + { case TypeReqUInt: codeStream.emit(OP_LOADVAR_UINT); break; @@ -849,25 +771,36 @@ U32 VarNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) case TypeReqString: codeStream.emit(OP_LOADVAR_STR); break; - case TypeReqVar: - codeStream.emit(OP_LOADVAR_VAR); - break; case TypeReqNone: break; default: break; + } } + else + { + switch (type) + { + case TypeReqUInt: codeStream.emit(OP_LOAD_LOCAL_VAR_UINT); break; + case TypeReqFloat: codeStream.emit(OP_LOAD_LOCAL_VAR_FLT); break; + default: codeStream.emit(OP_LOAD_LOCAL_VAR_STR); + } + + codeStream.emit(gFuncVars->lookup(varName)); + } + return codeStream.tell(); } TypeReq VarNode::getPreferredType() { - return TypeReqNone; // no preferred type + bool oldVariables = arrayIndex || varName[0] == '$'; + return oldVariables ? TypeReqNone : gFuncVars->lookupType(varName); } //------------------------------------------------------------ -U32 IntNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 IntNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { if (type == TypeReqString) index = getCurrentStringTable()->addIntString(value); @@ -876,20 +809,20 @@ U32 IntNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) switch (type) { - case TypeReqUInt: - codeStream.emit(OP_LOADIMMED_UINT); - codeStream.emit(value); - break; - case TypeReqString: - codeStream.emit(OP_LOADIMMED_STR); - codeStream.emit(index); - break; - case TypeReqFloat: - codeStream.emit(OP_LOADIMMED_FLT); - codeStream.emit(index); - break; - case TypeReqNone: - break; + case TypeReqUInt: + codeStream.emit(OP_LOADIMMED_UINT); + codeStream.emit(value); + break; + case TypeReqString: + codeStream.emit(OP_LOADIMMED_STR); + codeStream.emit(index); + break; + case TypeReqFloat: + codeStream.emit(OP_LOADIMMED_FLT); + codeStream.emit(index); + break; + case TypeReqNone: + break; } return codeStream.tell(); } @@ -901,7 +834,7 @@ TypeReq IntNode::getPreferredType() //------------------------------------------------------------ -U32 FloatNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 FloatNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { if (type == TypeReqString) index = getCurrentStringTable()->addFloatString(value); @@ -910,20 +843,20 @@ U32 FloatNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) switch (type) { - case TypeReqUInt: - codeStream.emit(OP_LOADIMMED_UINT); - codeStream.emit(U32(value)); - break; - case TypeReqString: - codeStream.emit(OP_LOADIMMED_STR); - codeStream.emit(index); - break; - case TypeReqFloat: - codeStream.emit(OP_LOADIMMED_FLT); - codeStream.emit(index); - break; - case TypeReqNone: - break; + case TypeReqUInt: + codeStream.emit(OP_LOADIMMED_UINT); + codeStream.emit(U32(value)); + break; + case TypeReqString: + codeStream.emit(OP_LOADIMMED_STR); + codeStream.emit(index); + break; + case TypeReqFloat: + codeStream.emit(OP_LOADIMMED_FLT); + codeStream.emit(index); + break; + case TypeReqNone: + break; } return codeStream.tell(); } @@ -935,7 +868,7 @@ TypeReq FloatNode::getPreferredType() //------------------------------------------------------------ -U32 StrConstNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 StrConstNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { // Early out for documentation block. if (doc) @@ -966,20 +899,20 @@ U32 StrConstNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) // Otherwise, deal with it normally as a string literal case. switch (type) { - case TypeReqString: - codeStream.emit(tag ? OP_TAG_TO_STR : OP_LOADIMMED_STR); - codeStream.emit(index); - break; - case TypeReqUInt: - codeStream.emit(OP_LOADIMMED_UINT); - codeStream.emit(U32(fVal)); - break; - case TypeReqFloat: - codeStream.emit(OP_LOADIMMED_FLT); - codeStream.emit(index); - break; - case TypeReqNone: - break; + case TypeReqString: + codeStream.emit(tag ? OP_TAG_TO_STR : OP_LOADIMMED_STR); + codeStream.emit(index); + break; + case TypeReqUInt: + codeStream.emit(OP_LOADIMMED_UINT); + codeStream.emit(U32(fVal)); + break; + case TypeReqFloat: + codeStream.emit(OP_LOADIMMED_FLT); + codeStream.emit(index); + break; + case TypeReqNone: + break; } return codeStream.tell(); } @@ -991,7 +924,7 @@ TypeReq StrConstNode::getPreferredType() //------------------------------------------------------------ -U32 ConstantNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 ConstantNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { if (type == TypeReqString) { @@ -1006,20 +939,20 @@ U32 ConstantNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) switch (type) { - case TypeReqString: - codeStream.emit(OP_LOADIMMED_IDENT); - codeStream.emitSTE(value); - break; - case TypeReqUInt: - codeStream.emit(OP_LOADIMMED_UINT); - codeStream.emit(U32(fVal)); - break; - case TypeReqFloat: - codeStream.emit(OP_LOADIMMED_FLT); - codeStream.emit(index); - break; - case TypeReqNone: - break; + case TypeReqString: + codeStream.emit(OP_LOADIMMED_IDENT); + codeStream.emitSTE(value); + break; + case TypeReqUInt: + codeStream.emit(OP_LOADIMMED_UINT); + codeStream.emit(U32(fVal)); + break; + case TypeReqFloat: + codeStream.emit(OP_LOADIMMED_FLT); + codeStream.emit(index); + break; + case TypeReqNone: + break; } return ip; } @@ -1031,49 +964,23 @@ TypeReq ConstantNode::getPreferredType() //------------------------------------------------------------ -U32 AssignExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 AssignExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { subType = expr->getPreferredType(); if (subType == TypeReqNone) subType = type; if (subType == TypeReqNone) - { - // What we need to do in this case is turn it into a VarNode reference. - // Unfortunately other nodes such as field access (SlotAccessNode) - // cannot be optimized in the same manner as all fields are exposed - // and set as strings. - if (dynamic_cast(expr) != NULL) - { - subType = TypeReqVar; - } - else - { - subType = TypeReqString; - } - } + subType = TypeReqString; - //if we are an array index and we are gonna short circuit - // eval expr - // compute new varName - // OP_SETCURVAR_CREATE - // varName - // OP_SAVEVAR - - //else if it's an array expr and we don't short circuit, the formula is: + // if it's an array expr, the formula is: // eval expr // (push and pop if it's TypeReqString) OP_ADVANCE_STR - // if array lookup is varnode - // OP_SETCURVAR_ARRAY_CREATE_VARLOOKUP - // varName - // varNodeVarName - // else - // OP_LOADIMMED_IDENT - // varName - // OP_ADVANCE_STR - // eval array - // OP_REWIND_STR - // OP_SETCURVAR_ARRAY_CREATE - // endif + // OP_LOADIMMED_IDENT + // varName + // OP_ADVANCE_STR + // eval array + // OP_REWIND_STR + // OP_SETCURVAR_ARRAY_CREATE // OP_TERMINATE_REWIND_STR // OP_SAVEVAR @@ -1083,45 +990,19 @@ U32 AssignExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) // varname // OP_SAVEVAR - ip = expr->compile(codeStream, ip, subType); - - bool shortCircuit = false; - if (arrayIndex) - { - // If we have a constant, shortcircuit the array logic. - - IntNode *intNode = dynamic_cast(arrayIndex); - StrConstNode *strNode = dynamic_cast(arrayIndex); - if (intNode) - { - varName = StringTable->insert(avar("%s%d", varName, intNode->value)); - shortCircuit = true; - } - else if (strNode) - { - varName = StringTable->insert(avar("%s%s", varName, strNode->str)); - shortCircuit = true; - } - } - precompileIdent(varName); - if (arrayIndex && !shortCircuit) - { - if (subType == TypeReqString) - codeStream.emit(OP_ADVANCE_STR); + ip = expr->compile(codeStream, ip, subType); - // Ok, lets try to optimize %var[%someothervar] as this is - // a common case for array usage. - StringTableEntry varNodeVarName; - if (isSimpleVarLookup(arrayIndex, varNodeVarName)) - { - codeStream.emit(OP_SETCURVAR_ARRAY_CREATE_VARLOOKUP); - codeStream.emitSTE(varName); - codeStream.emitSTE(varNodeVarName); - } - else + bool oldVariables = arrayIndex || varName[0] == '$'; + + if (oldVariables) + { + if (arrayIndex) { + if (subType == TypeReqString) + codeStream.emit(OP_ADVANCE_STR); + codeStream.emit(OP_LOADIMMED_IDENT); codeStream.emitSTE(varName); @@ -1129,35 +1010,37 @@ U32 AssignExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) ip = arrayIndex->compile(codeStream, ip, TypeReqString); codeStream.emit(OP_REWIND_STR); codeStream.emit(OP_SETCURVAR_ARRAY_CREATE); + if (subType == TypeReqString) + codeStream.emit(OP_TERMINATE_REWIND_STR); + } + else + { + codeStream.emit(OP_SETCURVAR_CREATE); + codeStream.emitSTE(varName); + } + switch (subType) + { + case TypeReqString: codeStream.emit(OP_SAVEVAR_STR); break; + case TypeReqUInt: codeStream.emit(OP_SAVEVAR_UINT); break; + case TypeReqFloat: codeStream.emit(OP_SAVEVAR_FLT); break; } - - if (subType == TypeReqString) - codeStream.emit(OP_TERMINATE_REWIND_STR); } else { - codeStream.emit(OP_SETCURVAR_CREATE); - codeStream.emitSTE(varName); - } - switch (subType) - { - case TypeReqString: - codeStream.emit(OP_SAVEVAR_STR); - break; - case TypeReqUInt: - codeStream.emit(OP_SAVEVAR_UINT); - break; - case TypeReqFloat: - codeStream.emit(OP_SAVEVAR_FLT); - break; - case TypeReqVar: - codeStream.emit(OP_SAVEVAR_VAR); - break; - case TypeReqNone: - break; + switch (subType) + { + case TypeReqUInt: codeStream.emit(OP_SAVE_LOCAL_VAR_UINT); break; + case TypeReqFloat: codeStream.emit(OP_SAVE_LOCAL_VAR_FLT); break; + default: codeStream.emit(OP_SAVE_LOCAL_VAR_STR); + } + codeStream.emit(gFuncVars->assign(varName, subType == TypeReqNone ? TypeReqString : subType)); } + if (type != subType) - codeStream.emit(conversionOp(subType, type)); + { + U32 conOp = conversionOp(subType, type); + codeStream.emit(conOp); + } return ip; } @@ -1168,163 +1051,99 @@ TypeReq AssignExprNode::getPreferredType() //------------------------------------------------------------ -static void getAssignOpTypeOp(S32 op, TypeReq &type, U32 &operand) +static void getAssignOpTypeOp(S32 op, TypeReq& type, U32& operand) { switch (op) { - case '+': - case opPLUSPLUS: - type = TypeReqFloat; - operand = OP_ADD; - break; - case '-': - case opMINUSMINUS: - type = TypeReqFloat; - operand = OP_SUB; - break; - case '*': - type = TypeReqFloat; - operand = OP_MUL; - break; - case '/': - type = TypeReqFloat; - operand = OP_DIV; - break; - case '%': - type = TypeReqUInt; - operand = OP_MOD; - break; - case '&': - type = TypeReqUInt; - operand = OP_BITAND; - break; - case '^': - type = TypeReqUInt; - operand = OP_XOR; - break; - case '|': - type = TypeReqUInt; - operand = OP_BITOR; - break; - case opSHL: - type = TypeReqUInt; - operand = OP_SHL; - break; - case opSHR: - type = TypeReqUInt; - operand = OP_SHR; - break; + case '+': + case opPLUSPLUS: + type = TypeReqFloat; + operand = OP_ADD; + break; + case '-': + type = TypeReqFloat; + operand = OP_SUB; + break; + case '*': + type = TypeReqFloat; + operand = OP_MUL; + break; + case '/': + type = TypeReqFloat; + operand = OP_DIV; + break; + case '%': + type = TypeReqUInt; + operand = OP_MOD; + break; + case '&': + type = TypeReqUInt; + operand = OP_BITAND; + break; + case '^': + type = TypeReqUInt; + operand = OP_XOR; + break; + case '|': + type = TypeReqUInt; + operand = OP_BITOR; + break; + case opSHL: + type = TypeReqUInt; + operand = OP_SHL; + break; + case opSHR: + type = TypeReqUInt; + operand = OP_SHR; + break; } } -U32 AssignOpExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 AssignOpExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { // goes like this... - // - // IF no array index && (op == OPPLUSPLUS or op == OPMINUSMINUS) - // if op == OPPLUSPLUS - // OP_INC - // varName - // else if op == OPMINUSMINUS - // OP_DEC - // varName - // else - // OP_INVALID - // endif - // ELSE - // eval expr as float or int - // if there's an arrayIndex and we don't short circuit - // if arrayIndex is a var node - // OP_SETCURVAR_ARRAY_CREATE_VARLOOKUP - // varName - // varNodeVarName - // else - // OP_LOADIMMED_IDENT - // varName - // OP_ADVANCE_STR - // eval arrayIndex stringwise - // OP_REWIND_STR - // OP_SETCURVAR_ARRAY_CREATE - // endif - // else - // OP_SETCURVAR_CREATE - // varName - // endif - // OP_LOADVAR_FLT or UINT - // operand - // OP_SAVEVAR_FLT or UINT - // ENDIF - // - // if subtype != type - // convert type - // endif + // eval expr as float or int + // if there's an arrayIndex + + // OP_LOADIMMED_IDENT + // varName + // OP_ADVANCE_STR + // eval arrayIndex stringwise + // OP_REWIND_STR + // OP_SETCURVAR_ARRAY_CREATE + + // else + // OP_SETCURVAR_CREATE + // varName + + // OP_LOADVAR_FLT or UINT + // operand + // OP_SAVEVAR_FLT or UINT // conversion OP if necessary. getAssignOpTypeOp(op, subType, operand); + precompileIdent(varName); - // ++ or -- optimization support for non indexed variables. - if ((!arrayIndex) && (op == opPLUSPLUS || op == opMINUSMINUS)) + bool oldVariables = arrayIndex || varName[0] == '$'; + + if (op == opPLUSPLUS && !oldVariables) { - precompileIdent(varName); + const S32 varIdx = gFuncVars->assign(varName, TypeReqFloat); - if (op == opPLUSPLUS) - { - codeStream.emit(OP_INC); - codeStream.emitSTE(varName); - } - else if (op == opMINUSMINUS) - { - codeStream.emit(OP_DEC); - codeStream.emitSTE(varName); - } - else - { - // This should NEVER happen. This is just for sanity. - AssertISV(false, "Tried to use ++ or -- but something weird happened."); - codeStream.emit(OP_INVALID); - } + codeStream.emit(OP_INC); + codeStream.emit(varIdx); } else { ip = expr->compile(codeStream, ip, subType); - bool shortCircuit = false; - if (arrayIndex) + if (oldVariables) { - // If we have a constant, shortcircuit the array logic. - - IntNode *intNode = dynamic_cast(arrayIndex); - StrConstNode *strNode = dynamic_cast(arrayIndex); - if (intNode) + if (!arrayIndex) { - varName = StringTable->insert(avar("%s%d", varName, intNode->value)); - shortCircuit = true; - } - else if (strNode) - { - varName = StringTable->insert(avar("%s%s", varName, strNode->str)); - shortCircuit = true; - } - } - - precompileIdent(varName); - - if (!arrayIndex || shortCircuit) - { - codeStream.emit(OP_SETCURVAR_CREATE); - codeStream.emitSTE(varName); - } - else - { - // Ok, lets try to optimize %var[%someothervar] as this is - // a common case for array usage. - StringTableEntry varNodeVarName; - if (isSimpleVarLookup(arrayIndex, varNodeVarName)) - { - codeStream.emit(OP_SETCURVAR_ARRAY_CREATE_VARLOOKUP); + codeStream.emit(OP_SETCURVAR_CREATE); codeStream.emitSTE(varName); - codeStream.emitSTE(varNodeVarName); } else { @@ -1336,13 +1155,27 @@ U32 AssignOpExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) codeStream.emit(OP_REWIND_STR); codeStream.emit(OP_SETCURVAR_ARRAY_CREATE); } + codeStream.emit((subType == TypeReqFloat) ? OP_LOADVAR_FLT : OP_LOADVAR_UINT); + codeStream.emit(operand); + codeStream.emit((subType == TypeReqFloat) ? OP_SAVEVAR_FLT : OP_SAVEVAR_UINT); + } + else + { + const bool isFloat = subType == TypeReqFloat; + const S32 varIdx = gFuncVars->assign(varName, subType == TypeReqNone ? TypeReqString : subType); + + codeStream.emit(isFloat ? OP_LOAD_LOCAL_VAR_FLT : OP_LOAD_LOCAL_VAR_UINT); + codeStream.emit(varIdx); + codeStream.emit(operand); + codeStream.emit(isFloat ? OP_SAVE_LOCAL_VAR_FLT : OP_SAVE_LOCAL_VAR_UINT); + codeStream.emit(varIdx); + } + + if (subType != type) + { + codeStream.emit(conversionOp(subType, type)); } - codeStream.emit((subType == TypeReqFloat) ? OP_LOADVAR_FLT : OP_LOADVAR_UINT); - codeStream.emit(operand); - codeStream.emit((subType == TypeReqFloat) ? OP_SAVEVAR_FLT : OP_SAVEVAR_UINT); } - if (subType != type) - codeStream.emit(conversionOp(subType, type)); return codeStream.tell(); } @@ -1385,7 +1218,7 @@ TypeReq TTagExprNode::getPreferredType() //------------------------------------------------------------ -U32 FuncCallExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 FuncCallExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { // OP_PUSH_FRAME // arg OP_PUSH arg OP_PUSH arg OP_PUSH @@ -1399,69 +1232,38 @@ U32 FuncCallExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) precompileIdent(funcName); precompileIdent(nameSpace); + S32 count = 0; + for (ExprNode* walk = args; walk; walk = static_cast(walk->getNext())) + count++; + codeStream.emit(OP_PUSH_FRAME); + codeStream.emit(count); - bool isThisCall = false; - - ExprNode *walk = args; - - // Try to optimize the this pointer call if it is a variable - // that we are loading. - if (callType == MethodCall) - { - // We cannot optimize array indices because it can have quite - // a bit of code to figure out the array index. - VarNode *var = dynamic_cast(args); - if (var && !var->arrayIndex) - { - precompileIdent(var->varName); - - // Are we a %this call? - isThisCall = (var->varName == StringTable->insert("%this")); - - codeStream.emit(OP_PUSH_THIS); - codeStream.emitSTE(var->varName); - - // inc args since we took care of first arg. - walk = (ExprNode*)walk ->getNext(); - } - } - - for (; walk; walk = (ExprNode *)walk->getNext()) + for (ExprNode* walk = args; walk; walk = static_cast(walk->getNext())) { TypeReq walkType = walk->getPreferredType(); - if (walkType == TypeReqNone) walkType = TypeReqString; + if (walkType == TypeReqNone) + walkType = TypeReqString; + ip = walk->compile(codeStream, ip, walkType); switch (walk->getPreferredType()) { - case TypeReqFloat: - codeStream.emit(OP_PUSH_FLT); - break; - case TypeReqUInt: - codeStream.emit(OP_PUSH_UINT); - break; - default: - codeStream.emit(OP_PUSH); - break; + case TypeReqFloat: + codeStream.emit(OP_PUSH_FLT); + break; + case TypeReqUInt: + codeStream.emit(OP_PUSH_UINT); + break; + default: + codeStream.emit(OP_PUSH); + break; } } - if (isThisCall) - { - codeStream.emit(OP_CALLFUNC_THIS); - codeStream.emitSTE(funcName); - } - else - { - if (callType == MethodCall || callType == ParentCall) - codeStream.emit(OP_CALLFUNC); - else - codeStream.emit(OP_CALLFUNC_RESOLVE); - - codeStream.emitSTE(funcName); - codeStream.emitSTE(nameSpace); - codeStream.emit(callType); - } + codeStream.emit(OP_CALLFUNC); + codeStream.emitSTE(funcName); + codeStream.emitSTE(nameSpace); + codeStream.emit(callType); if (type != TypeReqString) codeStream.emit(conversionOp(TypeReqString, type)); @@ -1473,53 +1275,10 @@ TypeReq FuncCallExprNode::getPreferredType() return TypeReqString; } -//------------------------------------------------------------ - -U32 FuncPointerCallExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) -{ - // OP_PUSH_FRAME - // arg OP_PUSH arg OP_PUSH arg OP_PUSH - // eval all the args, then call the function. - - // eval fn pointer - // OP_CALLFUNC_POINTER - - codeStream.emit(OP_PUSH_FRAME); - for (ExprNode *walk = args; walk; walk = (ExprNode *)walk->getNext()) - { - TypeReq walkType = walk->getPreferredType(); - if (walkType == TypeReqNone) walkType = TypeReqString; - ip = walk->compile(codeStream, ip, walkType); - switch (walk->getPreferredType()) - { - case TypeReqFloat: - codeStream.emit(OP_PUSH_FLT); - break; - case TypeReqUInt: - codeStream.emit(OP_PUSH_UINT); - break; - default: - codeStream.emit(OP_PUSH); - break; - } - } - - ip = funcPointer->compile(codeStream, ip, TypeReqString); - codeStream.emit(OP_CALLFUNC_POINTER); - - if (type != TypeReqString) - codeStream.emit(conversionOp(TypeReqString, type)); - return codeStream.tell(); -} - -TypeReq FuncPointerCallExprNode::getPreferredType() -{ - return TypeReqString; -} //------------------------------------------------------------ -U32 AssertCallExprNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 AssertCallExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { #ifdef TORQUE_ENABLE_SCRIPTASSERTS @@ -1541,59 +1300,51 @@ TypeReq AssertCallExprNode::getPreferredType() //------------------------------------------------------------ -U32 SlotAccessNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 SlotAccessNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { if (type == TypeReqNone) return ip; precompileIdent(slotName); - // check if object is %this. If we are, we can do additional optimizations. - if (isThisVar(objectExpr)) + if (arrayExpr) { - optimizeThisPointer(codeStream, arrayExpr, ip, slotName); + // eval array + // OP_ADVANCE_STR + // evaluate object expression sub (OP_SETCURFIELD) + // OP_TERMINATE_REWIND_STR + // OP_SETCURFIELDARRAY + // total add of 4 + array precomp + + ip = arrayExpr->compile(codeStream, ip, TypeReqString); + codeStream.emit(OP_ADVANCE_STR); } - else + ip = objectExpr->compile(codeStream, ip, TypeReqString); + codeStream.emit(OP_SETCUROBJECT); + + codeStream.emit(OP_SETCURFIELD); + + codeStream.emitSTE(slotName); + + if (arrayExpr) { - if (arrayExpr) - { - // eval array - // OP_ADVANCE_STR - // evaluate object expression sub (OP_SETCURFIELD) - // OP_TERMINATE_REWIND_STR - // OP_SETCURFIELDARRAY - // total add of 4 + array precomp - - ip = arrayExpr->compile(codeStream, ip, TypeReqString); - codeStream.emit(OP_ADVANCE_STR); - } - ip = objectExpr->compile(codeStream, ip, TypeReqString); - codeStream.emit(OP_SETCUROBJECT); - - codeStream.emit(OP_SETCURFIELD); - - codeStream.emitSTE(slotName); - - if (arrayExpr) - { - codeStream.emit(OP_TERMINATE_REWIND_STR); - codeStream.emit(OP_SETCURFIELD_ARRAY); - } + codeStream.emit(OP_TERMINATE_REWIND_STR); + codeStream.emit(OP_SETCURFIELD_ARRAY); } switch (type) { - case TypeReqUInt: - codeStream.emit(OP_LOADFIELD_UINT); - break; - case TypeReqFloat: - codeStream.emit(OP_LOADFIELD_FLT); - break; - case TypeReqString: - codeStream.emit(OP_LOADFIELD_STR); - break; - case TypeReqNone: - break; + case TypeReqUInt: + codeStream.emit(OP_LOADFIELD_UINT); + break; + case TypeReqFloat: + codeStream.emit(OP_LOADFIELD_FLT); + break; + case TypeReqString: + codeStream.emit(OP_LOADFIELD_STR); + break; + case TypeReqNone: + break; } return codeStream.tell(); } @@ -1605,7 +1356,7 @@ TypeReq SlotAccessNode::getPreferredType() //----------------------------------------------------------------------------- -U32 InternalSlotAccessNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 InternalSlotAccessNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { if (type == TypeReqNone) return ip; @@ -1629,7 +1380,7 @@ TypeReq InternalSlotAccessNode::getPreferredType() //----------------------------------------------------------------------------- -U32 SlotAssignNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 SlotAssignNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { // first eval the expression TypeReqString @@ -1662,38 +1413,29 @@ U32 SlotAssignNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) precompileIdent(slotName); ip = valueExpr->compile(codeStream, ip, TypeReqString); - - if (isThisVar(objectExpr)) + codeStream.emit(OP_ADVANCE_STR); + if (arrayExpr) { - optimizeThisPointer(codeStream, arrayExpr, ip, slotName); + ip = arrayExpr->compile(codeStream, ip, TypeReqString); + codeStream.emit(OP_ADVANCE_STR); + } + if (objectExpr) + { + ip = objectExpr->compile(codeStream, ip, TypeReqString); + codeStream.emit(OP_SETCUROBJECT); } else + codeStream.emit(OP_SETCUROBJECT_NEW); + codeStream.emit(OP_SETCURFIELD); + codeStream.emitSTE(slotName); + + if (arrayExpr) { - codeStream.emit(OP_ADVANCE_STR); - if (arrayExpr) - { - ip = arrayExpr->compile(codeStream, ip, TypeReqString); - codeStream.emit(OP_ADVANCE_STR); - } - if (objectExpr) - { - ip = objectExpr->compile(codeStream, ip, TypeReqString); - codeStream.emit(OP_SETCUROBJECT); - } - else - codeStream.emit(OP_SETCUROBJECT_NEW); - codeStream.emit(OP_SETCURFIELD); - codeStream.emitSTE(slotName); - - if (arrayExpr) - { - codeStream.emit(OP_TERMINATE_REWIND_STR); - codeStream.emit(OP_SETCURFIELD_ARRAY); - } - codeStream.emit(OP_TERMINATE_REWIND_STR); + codeStream.emit(OP_SETCURFIELD_ARRAY); } + codeStream.emit(OP_TERMINATE_REWIND_STR); codeStream.emit(OP_SAVEFIELD_STR); if (typeID != -1) @@ -1714,7 +1456,7 @@ TypeReq SlotAssignNode::getPreferredType() //------------------------------------------------------------ -U32 SlotAssignOpNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 SlotAssignOpNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { // first eval the expression as its type @@ -1743,28 +1485,20 @@ U32 SlotAssignOpNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) precompileIdent(slotName); ip = valueExpr->compile(codeStream, ip, subType); - - if (isThisVar(objectExpr)) + if (arrayExpr) { - optimizeThisPointer(codeStream, arrayExpr, ip, slotName); + ip = arrayExpr->compile(codeStream, ip, TypeReqString); + codeStream.emit(OP_ADVANCE_STR); } - else - { - if (arrayExpr) - { - ip = arrayExpr->compile(codeStream, ip, TypeReqString); - codeStream.emit(OP_ADVANCE_STR); - } - ip = objectExpr->compile(codeStream, ip, TypeReqString); - codeStream.emit(OP_SETCUROBJECT); - codeStream.emit(OP_SETCURFIELD); - codeStream.emitSTE(slotName); + ip = objectExpr->compile(codeStream, ip, TypeReqString); + codeStream.emit(OP_SETCUROBJECT); + codeStream.emit(OP_SETCURFIELD); + codeStream.emitSTE(slotName); - if (arrayExpr) - { - codeStream.emit(OP_TERMINATE_REWIND_STR); - codeStream.emit(OP_SETCURFIELD_ARRAY); - } + if (arrayExpr) + { + codeStream.emit(OP_TERMINATE_REWIND_STR); + codeStream.emit(OP_SETCURFIELD_ARRAY); } codeStream.emit((subType == TypeReqFloat) ? OP_LOADFIELD_FLT : OP_LOADFIELD_UINT); codeStream.emit(operand); @@ -1782,7 +1516,7 @@ TypeReq SlotAssignOpNode::getPreferredType() //------------------------------------------------------------ -U32 ObjectDeclNode::compileSubObject(CodeStream &codeStream, U32 ip, bool root) +U32 ObjectDeclNode::compileSubObject(CodeStream& codeStream, U32 ip, bool root) { // goes @@ -1808,29 +1542,34 @@ U32 ObjectDeclNode::compileSubObject(CodeStream &codeStream, U32 ip, bool root) // To fix the stack issue [7/9/2007 Black] // OP_FINISH_OBJECT <-- fail point jumps to this opcode + S32 count = 2; // 2 OP_PUSH's + for (ExprNode* exprWalk = argList; exprWalk; exprWalk = (ExprNode*)exprWalk->getNext()) + count++; + codeStream.emit(OP_PUSH_FRAME); + codeStream.emit(count); ip = classNameExpr->compile(codeStream, ip, TypeReqString); codeStream.emit(OP_PUSH); ip = objectNameExpr->compile(codeStream, ip, TypeReqString); codeStream.emit(OP_PUSH); - for (ExprNode *exprWalk = argList; exprWalk; exprWalk = (ExprNode *)exprWalk->getNext()) + for (ExprNode* exprWalk = argList; exprWalk; exprWalk = (ExprNode*)exprWalk->getNext()) { TypeReq walkType = exprWalk->getPreferredType(); if (walkType == TypeReqNone) walkType = TypeReqString; ip = exprWalk->compile(codeStream, ip, walkType); switch (exprWalk->getPreferredType()) { - case TypeReqFloat: - codeStream.emit(OP_PUSH_FLT); - break; - case TypeReqUInt: - codeStream.emit(OP_PUSH_UINT); - break; - default: - codeStream.emit(OP_PUSH); - break; + case TypeReqFloat: + codeStream.emit(OP_PUSH_FLT); + break; + case TypeReqUInt: + codeStream.emit(OP_PUSH_UINT); + break; + default: + codeStream.emit(OP_PUSH); + break; } } codeStream.emit(OP_CREATE_OBJECT); @@ -1841,11 +1580,11 @@ U32 ObjectDeclNode::compileSubObject(CodeStream &codeStream, U32 ip, bool root) codeStream.emit(isSingleton); codeStream.emit(dbgLineNumber); const U32 failIp = codeStream.emit(0); - for (SlotAssignNode *slotWalk = slotDecls; slotWalk; slotWalk = (SlotAssignNode *)slotWalk->getNext()) + for (SlotAssignNode* slotWalk = slotDecls; slotWalk; slotWalk = (SlotAssignNode*)slotWalk->getNext()) ip = slotWalk->compile(codeStream, ip, TypeReqNone); codeStream.emit(OP_ADD_OBJECT); codeStream.emit(root); - for (ObjectDeclNode *objectWalk = subObjects; objectWalk; objectWalk = (ObjectDeclNode *)objectWalk->getNext()) + for (ObjectDeclNode* objectWalk = subObjects; objectWalk; objectWalk = (ObjectDeclNode*)objectWalk->getNext()) ip = objectWalk->compileSubObject(codeStream, ip, false); codeStream.emit(OP_END_OBJECT); codeStream.emit(root || isDatablock); @@ -1857,7 +1596,7 @@ U32 ObjectDeclNode::compileSubObject(CodeStream &codeStream, U32 ip, bool root) return codeStream.tell(); } -U32 ObjectDeclNode::compile(CodeStream &codeStream, U32 ip, TypeReq type) +U32 ObjectDeclNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { // root object decl does: @@ -1881,7 +1620,7 @@ TypeReq ObjectDeclNode::getPreferredType() //------------------------------------------------------------ -U32 FunctionDeclStmtNode::compileStmt(CodeStream &codeStream, U32 ip) +U32 FunctionDeclStmtNode::compileStmt(CodeStream& codeStream, U32 ip) { // OP_FUNC_DECL // func name @@ -1896,10 +1635,14 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream &codeStream, U32 ip) setCurrentStringTable(&getFunctionStringTable()); setCurrentFloatTable(&getFunctionFloatTable()); + FuncVars vars; + gFuncVars = &vars; + argc = 0; - for (VarNode *walk = args; walk; walk = (VarNode *)((StmtNode*)walk)->getNext()) + for (VarNode* walk = args; walk; walk = (VarNode*)((StmtNode*)walk)->getNext()) { precompileIdent(walk->varName); + gFuncVars->assign(walk->varName, TypeReqNone); argc++; } @@ -1919,9 +1662,11 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream &codeStream, U32 ip) codeStream.emit(U32(bool(stmts != NULL) ? 1 : 0) + U32(dbgLineNumber << 1)); const U32 endIp = codeStream.emit(0); codeStream.emit(argc); - for (VarNode *walk = args; walk; walk = (VarNode *)((StmtNode*)walk)->getNext()) + const U32 localNumVarsIP = codeStream.emit(0); + for (VarNode* walk = args; walk; walk = (VarNode*)((StmtNode*)walk)->getNext()) { - codeStream.emitSTE(walk->varName); + StringTableEntry name = walk->varName; + codeStream.emit(gFuncVars->lookup(name)); } CodeBlock::smInFunction = true; ip = compileBlock(stmts, codeStream, ip); @@ -1933,10 +1678,12 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream &codeStream, U32 ip) CodeBlock::smInFunction = false; codeStream.emit(OP_RETURN_VOID); + codeStream.patch(localNumVarsIP, gFuncVars->count()); codeStream.patch(endIp, codeStream.tell()); setCurrentStringTable(&getGlobalStringTable()); setCurrentFloatTable(&getGlobalFloatTable()); + gFuncVars = NULL; return ip; } diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index b4dd6b2c6..997519231 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -477,7 +477,6 @@ bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, con STEtoCode = compileSTEtoCode; gStatementList = NULL; - gAnonFunctionList = NULL; // Set up the parser. smCurrentParser = getParserForFile(fileName); @@ -487,17 +486,6 @@ bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, con smCurrentParser->setScanBuffer(script, fileName); smCurrentParser->restart(NULL); smCurrentParser->parse(); - if (gStatementList) - { - if (gAnonFunctionList) - { - // Prepend anonymous functions to statement list, so they're defined already when - // the statements run. - gAnonFunctionList->append(gStatementList); - gStatementList = gAnonFunctionList; - } - } - if (gSyntaxError) { @@ -575,11 +563,9 @@ bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, con st.close(); return true; - - } -ConsoleValueRef CodeBlock::compileExec(StringTableEntry fileName, const char *inString, bool noCalls, S32 setFrame) +void CodeBlock::compileExec(StringTableEntry fileName, const char *inString, ConsoleValue &returnValue, bool noCalls, S32 setFrame) { AssertFatal(Con::isMainThread(), "Compiling code on a secondary thread"); @@ -620,7 +606,6 @@ ConsoleValueRef CodeBlock::compileExec(StringTableEntry fileName, const char *in addToCodeList(); gStatementList = NULL; - gAnonFunctionList = NULL; // Set up the parser. smCurrentParser = getParserForFile(fileName); @@ -630,21 +615,11 @@ ConsoleValueRef CodeBlock::compileExec(StringTableEntry fileName, const char *in smCurrentParser->setScanBuffer(string, fileName); smCurrentParser->restart(NULL); smCurrentParser->parse(); - if (gStatementList) - { - if (gAnonFunctionList) - { - // Prepend anonymous functions to statement list, so they're defined already when - // the statements run. - gAnonFunctionList->append(gStatementList); - gStatementList = gAnonFunctionList; - } - } if (!gStatementList) { delete this; - return ConsoleValueRef(); + return; } resetTables(); @@ -678,7 +653,7 @@ ConsoleValueRef CodeBlock::compileExec(StringTableEntry fileName, const char *in if (lastIp + 1 != codeSize) Con::warnf(ConsoleLogEntry::General, "precompile size mismatch, precompile: %d compile: %d", codeSize, lastIp); - return exec(0, fileName, NULL, 0, 0, noCalls, NULL, setFrame); + exec(0, fileName, NULL, 0, 0, noCalls, NULL, returnValue, setFrame); } //------------------------------------------------------------------------- @@ -739,775 +714,723 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) switch (code[ip++]) { - case OP_FUNC_DECL: - { - StringTableEntry fnName = CodeToSTE(code, ip); - StringTableEntry fnNamespace = CodeToSTE(code, ip + 2); - StringTableEntry fnPackage = CodeToSTE(code, ip + 4); - bool hasBody = bool(code[ip + 6]); - U32 newIp = code[ip + 7]; - U32 argc = code[ip + 8]; - endFuncIp = newIp; - - Con::printf("%i: OP_FUNC_DECL name=%s nspace=%s package=%s hasbody=%i newip=%i argc=%i", - ip - 1, fnName, fnNamespace, fnPackage, hasBody, newIp, argc); - - // Skip args. - - ip += 9 + (argc * 2); - smInFunction = true; - break; - } - - case OP_CREATE_OBJECT: - { - StringTableEntry objParent = CodeToSTE(code, ip); - bool isDataBlock = code[ip + 2]; - bool isInternal = code[ip + 3]; - bool isSingleton = code[ip + 4]; - U32 lineNumber = code[ip + 5]; - U32 failJump = code[ip + 6]; - - Con::printf("%i: OP_CREATE_OBJECT objParent=%s isDataBlock=%i isInternal=%i isSingleton=%i lineNumber=%i failJump=%i", - ip - 1, objParent, isDataBlock, isInternal, isSingleton, lineNumber, failJump); - - ip += 7; - break; - } - - case OP_ADD_OBJECT: - { - bool placeAtRoot = code[ip++]; - Con::printf("%i: OP_ADD_OBJECT placeAtRoot=%i", ip - 1, placeAtRoot); - break; - } - - case OP_END_OBJECT: - { - bool placeAtRoot = code[ip++]; - Con::printf("%i: OP_END_OBJECT placeAtRoot=%i", ip - 1, placeAtRoot); - break; - } - - case OP_FINISH_OBJECT: - { - Con::printf("%i: OP_FINISH_OBJECT", ip - 1); - break; - } - - case OP_JMPIFFNOT: - { - Con::printf("%i: OP_JMPIFFNOT ip=%i", ip - 1, code[ip]); - ++ip; - break; - } - - case OP_JMPIFNOT: - { - Con::printf("%i: OP_JMPIFNOT ip=%i", ip - 1, code[ip]); - ++ip; - break; - } - - case OP_JMPIFF: - { - Con::printf("%i: OP_JMPIFF ip=%i", ip - 1, code[ip]); - ++ip; - break; - } - - case OP_JMPIF: - { - Con::printf("%i: OP_JMPIF ip=%i", ip - 1, code[ip]); - ++ip; - break; - } - - case OP_JMPIFNOT_NP: - { - Con::printf("%i: OP_JMPIFNOT_NP ip=%i", ip - 1, code[ip]); - ++ip; - break; - } - - case OP_JMPIF_NP: - { - Con::printf("%i: OP_JMPIF_NP ip=%i", ip - 1, code[ip]); - ++ip; - break; - } - - case OP_JMP: - { - Con::printf("%i: OP_JMP ip=%i", ip - 1, code[ip]); - ++ip; - break; - } - - case OP_RETURN: - { - Con::printf("%i: OP_RETURN", ip - 1); - - if (upToReturn) - return; - - break; - } - - case OP_RETURN_VOID: - { - Con::printf("%i: OP_RETURNVOID", ip - 1); - - if (upToReturn) - return; - - break; - } - - case OP_RETURN_UINT: - { - Con::printf("%i: OP_RETURNUINT", ip - 1); - - if (upToReturn) - return; - - break; - } - - case OP_RETURN_FLT: - { - Con::printf("%i: OP_RETURNFLT", ip - 1); - - if (upToReturn) - return; - - break; - } - - case OP_CMPEQ: - { - Con::printf("%i: OP_CMPEQ", ip - 1); - break; - } - - case OP_CMPGR: - { - Con::printf("%i: OP_CMPGR", ip - 1); - break; - } - - case OP_CMPGE: - { - Con::printf("%i: OP_CMPGE", ip - 1); - break; - } - - case OP_CMPLT: - { - Con::printf("%i: OP_CMPLT", ip - 1); - break; - } - - case OP_CMPLE: - { - Con::printf("%i: OP_CMPLE", ip - 1); - break; - } - - case OP_CMPNE: - { - Con::printf("%i: OP_CMPNE", ip - 1); - break; - } - - case OP_XOR: - { - Con::printf("%i: OP_XOR", ip - 1); - break; - } - - case OP_MOD: - { - Con::printf("%i: OP_MOD", ip - 1); - break; - } - - case OP_BITAND: - { - Con::printf("%i: OP_BITAND", ip - 1); - break; - } - - case OP_BITOR: - { - Con::printf("%i: OP_BITOR", ip - 1); - break; - } - - case OP_NOT: - { - Con::printf("%i: OP_NOT", ip - 1); - break; - } - - case OP_NOTF: - { - Con::printf("%i: OP_NOTF", ip - 1); - break; - } - - case OP_ONESCOMPLEMENT: - { - Con::printf("%i: OP_ONESCOMPLEMENT", ip - 1); - break; - } - - case OP_SHR: - { - Con::printf("%i: OP_SHR", ip - 1); - break; - } - - case OP_SHL: - { - Con::printf("%i: OP_SHL", ip - 1); - break; - } - - case OP_AND: - { - Con::printf("%i: OP_AND", ip - 1); - break; - } - - case OP_OR: - { - Con::printf("%i: OP_OR", ip - 1); - break; - } - - case OP_ADD: - { - Con::printf("%i: OP_ADD", ip - 1); - break; - } - - case OP_SUB: - { - Con::printf("%i: OP_SUB", ip - 1); - break; - } - - case OP_MUL: - { - Con::printf("%i: OP_MUL", ip - 1); - break; - } - - case OP_DIV: - { - Con::printf("%i: OP_DIV", ip - 1); - break; - } - - case OP_NEG: - { - Con::printf("%i: OP_NEG", ip - 1); - break; - } - - case OP_INC: - { - Con::printf("%i: OP_INC varName=%s", ip - 1, CodeToSTE(code, ip)); - ip += 2; - break; - } - - case OP_DEC: - { - Con::printf("%i: OP_DEC varName=%s", ip - 1, CodeToSTE(code, ip)); - ip += 2; - break; - } - - case OP_SETCURVAR: - { - StringTableEntry var = CodeToSTE(code, ip); - - Con::printf("%i: OP_SETCURVAR var=%s", ip - 1, var); - ip += 2; - break; - } - - case OP_SETCURVAR_CREATE: - { - StringTableEntry var = CodeToSTE(code, ip); - - Con::printf("%i: OP_SETCURVAR_CREATE var=%s", ip - 1, var); - ip += 2; - break; - } - - case OP_SETCURVAR_ARRAY: - { - Con::printf("%i: OP_SETCURVAR_ARRAY", ip - 1); - break; - } - - case OP_SETCURVAR_ARRAY_VARLOOKUP: - { - StringTableEntry arrayName = CodeToSTE(code, ip); - StringTableEntry arrayLookup = CodeToSTE(code, ip + 2); - - Con::printf("%i: OP_SETCURVAR_ARRAY_VARLOOKUP arrayName=%s arrayLookup=%s", ip - 1, arrayName, arrayLookup); - ip += 4; - break; - } - - case OP_SETCURVAR_ARRAY_CREATE: - { - Con::printf("%i: OP_SETCURVAR_ARRAY_CREATE", ip - 1); - break; - } - - case OP_SETCURVAR_ARRAY_CREATE_VARLOOKUP: - { - StringTableEntry arrayName = CodeToSTE(code, ip); - StringTableEntry arrayLookup = CodeToSTE(code, ip + 2); - - Con::printf("%i: OP_SETCURVAR_ARRAY_CREATE_VARLOOKUP arrayName=%s arrayLookup=%s", ip - 1, arrayName, arrayLookup); - ip += 4; - break; - } - - case OP_LOADVAR_UINT: - { - Con::printf("%i: OP_LOADVAR_UINT", ip - 1); - break; - } - - case OP_LOADVAR_FLT: - { - Con::printf("%i: OP_LOADVAR_FLT", ip - 1); - break; - } - - case OP_LOADVAR_STR: - { - Con::printf("%i: OP_LOADVAR_STR", ip - 1); - break; - } - - case OP_LOADVAR_VAR: - { - Con::printf("%i: OP_LOADVAR_VAR", ip - 1); - break; - } - - case OP_SAVEVAR_UINT: - { - Con::printf("%i: OP_SAVEVAR_UINT", ip - 1); - break; - } - - case OP_SAVEVAR_FLT: - { - Con::printf("%i: OP_SAVEVAR_FLT", ip - 1); - break; - } - - case OP_SAVEVAR_STR: - { - Con::printf("%i: OP_SAVEVAR_STR", ip - 1); - break; - } - - case OP_SAVEVAR_VAR: - { - Con::printf("%i: OP_SAVEVAR_VAR", ip - 1); - break; - } - - case OP_SETCUROBJECT: - { - Con::printf("%i: OP_SETCUROBJECT", ip - 1); - break; - } - - case OP_SETCUROBJECT_NEW: - { - Con::printf("%i: OP_SETCUROBJECT_NEW", ip - 1); - break; - } - - case OP_SETCUROBJECT_INTERNAL: - { - Con::printf("%i: OP_SETCUROBJECT_INTERNAL", ip - 1); - ++ip; - break; - } - - case OP_SETCURFIELD: - { - StringTableEntry curField = CodeToSTE(code, ip); - Con::printf("%i: OP_SETCURFIELD field=%s", ip - 1, curField); - ip += 2; - break; - } - - case OP_SETCURFIELD_ARRAY: - { - Con::printf("%i: OP_SETCURFIELD_ARRAY", ip - 1); - break; - } - - case OP_SETCURFIELD_ARRAY_VAR: - { - StringTableEntry var = CodeToSTE(code, ip); - Con::printf("%i: OP_SETCURFIELD_ARRAY_VAR var=%s", ip - 1, var); - ip += 2; - break; - } - - case OP_SETCURFIELD_THIS: - { - StringTableEntry curField = CodeToSTE(code, ip); - Con::printf("%i: OP_SETCURFIELD_THIS field=%s", ip - 1, curField); - ip += 2; - break; - } - - case OP_SETCURFIELD_TYPE: - { - U32 type = code[ip]; - Con::printf("%i: OP_SETCURFIELD_TYPE type=%i", ip - 1, type); - ++ip; - break; - } - - case OP_LOADFIELD_UINT: - { - Con::printf("%i: OP_LOADFIELD_UINT", ip - 1); - break; - } - - case OP_LOADFIELD_FLT: - { - Con::printf("%i: OP_LOADFIELD_FLT", ip - 1); - break; - } - - case OP_LOADFIELD_STR: - { - Con::printf("%i: OP_LOADFIELD_STR", ip - 1); - break; - } - - case OP_SAVEFIELD_UINT: - { - Con::printf("%i: OP_SAVEFIELD_UINT", ip - 1); - break; - } - - case OP_SAVEFIELD_FLT: - { - Con::printf("%i: OP_SAVEFIELD_FLT", ip - 1); - break; - } - - case OP_SAVEFIELD_STR: - { - Con::printf("%i: OP_SAVEFIELD_STR", ip - 1); - break; - } - - case OP_STR_TO_UINT: - { - Con::printf("%i: OP_STR_TO_UINT", ip - 1); - break; - } - - case OP_STR_TO_FLT: - { - Con::printf("%i: OP_STR_TO_FLT", ip - 1); - break; - } - - case OP_STR_TO_NONE: - { - Con::printf("%i: OP_STR_TO_NONE", ip - 1); - break; - } - - case OP_FLT_TO_UINT: - { - Con::printf("%i: OP_FLT_TO_UINT", ip - 1); - break; - } - - case OP_FLT_TO_STR: - { - Con::printf("%i: OP_FLT_TO_STR", ip - 1); - break; - } - - case OP_FLT_TO_NONE: - { - Con::printf("%i: OP_FLT_TO_NONE", ip - 1); - break; - } - - case OP_UINT_TO_FLT: - { - Con::printf("%i: OP_SAVEFIELD_STR", ip - 1); - break; - } - - case OP_UINT_TO_STR: - { - Con::printf("%i: OP_UINT_TO_STR", ip - 1); - break; - } - - case OP_UINT_TO_NONE: - { - Con::printf("%i: OP_UINT_TO_NONE", ip - 1); - break; - } - - case OP_COPYVAR_TO_NONE: - { - Con::printf("%i: OP_COPYVAR_TO_NONE", ip - 1); - break; - } - - case OP_LOADIMMED_UINT: - { - U32 val = code[ip]; - Con::printf("%i: OP_LOADIMMED_UINT val=%i", ip - 1, val); - ++ip; - break; - } - - case OP_LOADIMMED_FLT: - { - F64 val = (smInFunction ? functionFloats : globalFloats)[code[ip]]; - Con::printf("%i: OP_LOADIMMED_FLT val=%f", ip - 1, val); - ++ip; - break; - } - - case OP_TAG_TO_STR: - { - const char* str = (smInFunction ? functionStrings : globalStrings) + code[ip]; - Con::printf("%i: OP_TAG_TO_STR str=%s", ip - 1, str); - ++ip; - break; - } - - case OP_LOADIMMED_STR: - { - const char* str = (smInFunction ? functionStrings : globalStrings) + code[ip]; - Con::printf("%i: OP_LOADIMMED_STR str=%s", ip - 1, str); - ++ip; - break; - } - - case OP_DOCBLOCK_STR: - { - const char* str = (smInFunction ? functionStrings : globalStrings) + code[ip]; - Con::printf("%i: OP_DOCBLOCK_STR str=%s", ip - 1, str); - ++ip; - break; - } - - case OP_LOADIMMED_IDENT: - { - StringTableEntry str = CodeToSTE(code, ip); - Con::printf("%i: OP_LOADIMMED_IDENT str=%s", ip - 1, str); - ip += 2; - break; - } - - case OP_CALLFUNC_RESOLVE: - { - StringTableEntry fnNamespace = CodeToSTE(code, ip + 2); - StringTableEntry fnName = CodeToSTE(code, ip); - U32 callType = code[ip + 2]; - - Con::printf("%i: OP_CALLFUNC_RESOLVE name=%s nspace=%s callType=%s", ip - 1, fnName, fnNamespace, - callType == FuncCallExprNode::FunctionCall ? "FunctionCall" - : callType == FuncCallExprNode::MethodCall ? "MethodCall" : "ParentCall"); - - ip += 5; - break; - } - - case OP_CALLFUNC: - { - StringTableEntry fnNamespace = CodeToSTE(code, ip + 2); - StringTableEntry fnName = CodeToSTE(code, ip); - U32 callType = code[ip + 4]; - - Con::printf("%i: OP_CALLFUNC name=%s nspace=%s callType=%s", ip - 1, fnName, fnNamespace, - callType == FuncCallExprNode::FunctionCall ? "FunctionCall" - : callType == FuncCallExprNode::MethodCall ? "MethodCall" : "ParentCall"); - - ip += 5; - break; - } - - case OP_CALLFUNC_POINTER: - { - Con::printf("%i: OP_CALLFUNC_POINTER", ip - 1); - break; - } - - case OP_CALLFUNC_THIS: - { - StringTableEntry fnName = CodeToSTE(code, ip); - Con::printf("%i: OP_CALLFUNC_THIS name=%s ", ip - 1, fnName); - - ip += 2; - break; - } - - case OP_ADVANCE_STR: - { - Con::printf("%i: OP_ADVANCE_STR", ip - 1); - break; - } - - case OP_ADVANCE_STR_APPENDCHAR: - { - char ch = code[ip]; - Con::printf("%i: OP_ADVANCE_STR_APPENDCHAR char=%c", ip - 1, ch); - ++ip; - break; - } - - case OP_ADVANCE_STR_COMMA: - { - Con::printf("%i: OP_ADVANCE_STR_COMMA", ip - 1); - break; - } - - case OP_ADVANCE_STR_NUL: - { - Con::printf("%i: OP_ADVANCE_STR_NUL", ip - 1); - break; - } - - case OP_REWIND_STR: - { - Con::printf("%i: OP_REWIND_STR", ip - 1); - break; - } - - case OP_TERMINATE_REWIND_STR: - { - Con::printf("%i: OP_TERMINATE_REWIND_STR", ip - 1); - break; - } - - case OP_COMPARE_STR: - { - Con::printf("%i: OP_COMPARE_STR", ip - 1); - break; - } - - case OP_PUSH: - { - Con::printf("%i: OP_PUSH", ip - 1); - break; - } - - case OP_PUSH_UINT: - { - Con::printf("%i: OP_PUSH_UINT", ip - 1); - break; - } - - case OP_PUSH_FLT: - { - Con::printf("%i: OP_PUSH_FLT", ip - 1); - break; - } - - case OP_PUSH_VAR: - { - Con::printf("%i: OP_PUSH_VAR", ip - 1); - break; - } - - case OP_PUSH_THIS: - { - Con::printf("%i: OP_PUSH_THIS varName=%s", ip - 1, CodeToSTE(code, ip)); - ip += 2; - break; - } - - case OP_PUSH_FRAME: - { - Con::printf("%i: OP_PUSH_FRAME", ip - 1); - break; - } - - case OP_ASSERT: - { - const char* message = (smInFunction ? functionStrings : globalStrings) + code[ip]; - Con::printf("%i: OP_ASSERT message=%s", ip - 1, message); - ++ip; - break; - } - - case OP_BREAK: - { - Con::printf("%i: OP_BREAK", ip - 1); - break; - } - - case OP_ITER_BEGIN: - { - StringTableEntry varName = CodeToSTE(code, ip); - U32 failIp = code[ip + 2]; - - Con::printf("%i: OP_ITER_BEGIN varName=%s failIp=%i", ip - 1, varName, failIp); - - ip += 3; - break; - } - - case OP_ITER_BEGIN_STR: - { - StringTableEntry varName = CodeToSTE(code, ip); - U32 failIp = code[ip + 2]; - - Con::printf("%i: OP_ITER_BEGIN varName=%s failIp=%i", ip - 1, varName, failIp); - - ip += 3; - break; - } - - case OP_ITER: - { - U32 breakIp = code[ip]; - - Con::printf("%i: OP_ITER breakIp=%i", ip - 1, breakIp); - - ++ip; - break; - } - - case OP_ITER_END: - { - Con::printf("%i: OP_ITER_END", ip - 1); - break; - } - - default: - Con::printf("%i: !!INVALID!!", ip - 1); - break; + case OP_FUNC_DECL: + { + StringTableEntry fnName = CodeToSTE(code, ip); + StringTableEntry fnNamespace = CodeToSTE(code, ip + 2); + StringTableEntry fnPackage = CodeToSTE(code, ip + 4); + bool hasBody = bool(code[ip + 6]); + U32 newIp = code[ip + 7]; + U32 argc = code[ip + 8]; + U32 regCount = code[ip + 9]; + endFuncIp = newIp; + + Con::printf("%i: OP_FUNC_DECL name=%s nspace=%s package=%s hasbody=%i newip=%i argc=%i regCount=%i", + ip - 1, fnName, fnNamespace, fnPackage, hasBody, newIp, argc, regCount); + + // Skip args. + + ip += 10 + argc; + smInFunction = true; + break; + } + + case OP_CREATE_OBJECT: + { + StringTableEntry objParent = CodeToSTE(code, ip); + bool isDataBlock = code[ip + 2]; + bool isInternal = code[ip + 3]; + bool isSingleton = code[ip + 4]; + U32 lineNumber = code[ip + 5]; + U32 failJump = code[ip + 6]; + + Con::printf("%i: OP_CREATE_OBJECT objParent=%s isDataBlock=%i isInternal=%i isSingleton=%i lineNumber=%i failJump=%i", + ip - 1, objParent, isDataBlock, isInternal, isSingleton, lineNumber, failJump); + + ip += 7; + break; + } + + case OP_ADD_OBJECT: + { + bool placeAtRoot = code[ip++]; + Con::printf("%i: OP_ADD_OBJECT placeAtRoot=%i", ip - 1, placeAtRoot); + break; + } + + case OP_END_OBJECT: + { + bool placeAtRoot = code[ip++]; + Con::printf("%i: OP_END_OBJECT placeAtRoot=%i", ip - 1, placeAtRoot); + break; + } + + case OP_FINISH_OBJECT: + { + Con::printf("%i: OP_FINISH_OBJECT", ip - 1); + break; + } + + case OP_JMPIFFNOT: + { + Con::printf("%i: OP_JMPIFFNOT ip=%i", ip - 1, code[ip]); + ++ip; + break; + } + + case OP_JMPIFNOT: + { + Con::printf("%i: OP_JMPIFNOT ip=%i", ip - 1, code[ip]); + ++ip; + break; + } + + case OP_JMPIFF: + { + Con::printf("%i: OP_JMPIFF ip=%i", ip - 1, code[ip]); + ++ip; + break; + } + + case OP_JMPIF: + { + Con::printf("%i: OP_JMPIF ip=%i", ip - 1, code[ip]); + ++ip; + break; + } + + case OP_JMPIFNOT_NP: + { + Con::printf("%i: OP_JMPIFNOT_NP ip=%i", ip - 1, code[ip]); + ++ip; + break; + } + + case OP_JMPIF_NP: + { + Con::printf("%i: OP_JMPIF_NP ip=%i", ip - 1, code[ip]); + ++ip; + break; + } + + case OP_JMP: + { + Con::printf("%i: OP_JMP ip=%i", ip - 1, code[ip]); + ++ip; + break; + } + + case OP_RETURN: + { + Con::printf("%i: OP_RETURN", ip - 1); + + if (upToReturn) + return; + + break; + } + + case OP_RETURN_VOID: + { + Con::printf("%i: OP_RETURNVOID", ip - 1); + + if (upToReturn) + return; + + break; + } + + case OP_RETURN_UINT: + { + Con::printf("%i: OP_RETURNUINT", ip - 1); + + if (upToReturn) + return; + + break; + } + + case OP_RETURN_FLT: + { + Con::printf("%i: OP_RETURNFLT", ip - 1); + + if (upToReturn) + return; + + break; + } + + case OP_CMPEQ: + { + Con::printf("%i: OP_CMPEQ", ip - 1); + break; + } + + case OP_CMPGR: + { + Con::printf("%i: OP_CMPGR", ip - 1); + break; + } + + case OP_CMPGE: + { + Con::printf("%i: OP_CMPGE", ip - 1); + break; + } + + case OP_CMPLT: + { + Con::printf("%i: OP_CMPLT", ip - 1); + break; + } + + case OP_CMPLE: + { + Con::printf("%i: OP_CMPLE", ip - 1); + break; + } + + case OP_CMPNE: + { + Con::printf("%i: OP_CMPNE", ip - 1); + break; + } + + case OP_XOR: + { + Con::printf("%i: OP_XOR", ip - 1); + break; + } + + case OP_MOD: + { + Con::printf("%i: OP_MOD", ip - 1); + break; + } + + case OP_BITAND: + { + Con::printf("%i: OP_BITAND", ip - 1); + break; + } + + case OP_BITOR: + { + Con::printf("%i: OP_BITOR", ip - 1); + break; + } + + case OP_NOT: + { + Con::printf("%i: OP_NOT", ip - 1); + break; + } + + case OP_NOTF: + { + Con::printf("%i: OP_NOTF", ip - 1); + break; + } + + case OP_ONESCOMPLEMENT: + { + Con::printf("%i: OP_ONESCOMPLEMENT", ip - 1); + break; + } + + case OP_SHR: + { + Con::printf("%i: OP_SHR", ip - 1); + break; + } + + case OP_SHL: + { + Con::printf("%i: OP_SHL", ip - 1); + break; + } + + case OP_AND: + { + Con::printf("%i: OP_AND", ip - 1); + break; + } + + case OP_OR: + { + Con::printf("%i: OP_OR", ip - 1); + break; + } + + case OP_ADD: + { + Con::printf("%i: OP_ADD", ip - 1); + break; + } + + case OP_SUB: + { + Con::printf("%i: OP_SUB", ip - 1); + break; + } + + case OP_MUL: + { + Con::printf("%i: OP_MUL", ip - 1); + break; + } + + case OP_DIV: + { + Con::printf("%i: OP_DIV", ip - 1); + break; + } + + case OP_NEG: + { + Con::printf("%i: OP_NEG", ip - 1); + break; + } + + case OP_INC: + { + Con::printf("%i: OP_INC reg=%i", ip - 1, code[ip]); + ++ip; + break; + } + + case OP_SETCURVAR: + { + StringTableEntry var = CodeToSTE(code, ip); + + Con::printf("%i: OP_SETCURVAR var=%s", ip - 1, var); + ip += 2; + break; + } + + case OP_SETCURVAR_CREATE: + { + StringTableEntry var = CodeToSTE(code, ip); + + Con::printf("%i: OP_SETCURVAR_CREATE var=%s", ip - 1, var); + ip += 2; + break; + } + + case OP_SETCURVAR_ARRAY: + { + Con::printf("%i: OP_SETCURVAR_ARRAY", ip - 1); + break; + } + + case OP_SETCURVAR_ARRAY_CREATE: + { + Con::printf("%i: OP_SETCURVAR_ARRAY_CREATE", ip - 1); + break; + } + + case OP_LOADVAR_UINT: + { + Con::printf("%i: OP_LOADVAR_UINT", ip - 1); + break; + } + + case OP_LOADVAR_FLT: + { + Con::printf("%i: OP_LOADVAR_FLT", ip - 1); + break; + } + + case OP_LOADVAR_STR: + { + Con::printf("%i: OP_LOADVAR_STR", ip - 1); + break; + } + + case OP_SAVEVAR_UINT: + { + Con::printf("%i: OP_SAVEVAR_UINT", ip - 1); + break; + } + + case OP_SAVEVAR_FLT: + { + Con::printf("%i: OP_SAVEVAR_FLT", ip - 1); + break; + } + + case OP_SAVEVAR_STR: + { + Con::printf("%i: OP_SAVEVAR_STR", ip - 1); + break; + } + + case OP_LOAD_LOCAL_VAR_UINT: + { + Con::printf("%i: OP_LOAD_LOCAL_VAR_UINT reg=%i", ip - 1, code[ip]); + ++ip; + break; + } + + case OP_LOAD_LOCAL_VAR_FLT: + { + Con::printf("%i: OP_LOAD_LOCAL_VAR_FLT reg=%i", ip - 1, code[ip]); + ++ip; + break; + } + + case OP_LOAD_LOCAL_VAR_STR: + { + Con::printf("%i: OP_LOAD_LOCAL_VAR_STR reg=%i", ip - 1, code[ip]); + ++ip; + break; + } + + case OP_SAVE_LOCAL_VAR_UINT: + { + Con::printf("%i: OP_SAVE_LOCAL_VAR_UINT reg=%i", ip - 1, code[ip]); + ++ip; + break; + } + + case OP_SAVE_LOCAL_VAR_FLT: + { + Con::printf("%i: OP_SAVE_LOCAL_VAR_FLT reg=%i", ip - 1, code[ip]); + ++ip; + break; + } + + case OP_SAVE_LOCAL_VAR_STR: + { + Con::printf("%i: OP_SAVE_LOCAL_VAR_STR reg=%i", ip - 1, code[ip]); + ++ip; + break; + } + + case OP_SETCUROBJECT: + { + Con::printf("%i: OP_SETCUROBJECT", ip - 1); + break; + } + + case OP_SETCUROBJECT_NEW: + { + Con::printf("%i: OP_SETCUROBJECT_NEW", ip - 1); + break; + } + + case OP_SETCUROBJECT_INTERNAL: + { + Con::printf("%i: OP_SETCUROBJECT_INTERNAL", ip - 1); + ++ip; + break; + } + + case OP_SETCURFIELD: + { + StringTableEntry curField = CodeToSTE(code, ip); + Con::printf("%i: OP_SETCURFIELD field=%s", ip - 1, curField); + ip += 2; + break; + } + + case OP_SETCURFIELD_ARRAY: + { + Con::printf("%i: OP_SETCURFIELD_ARRAY", ip - 1); + break; + } + + case OP_SETCURFIELD_TYPE: + { + U32 type = code[ip]; + Con::printf("%i: OP_SETCURFIELD_TYPE type=%i", ip - 1, type); + ++ip; + break; + } + + case OP_LOADFIELD_UINT: + { + Con::printf("%i: OP_LOADFIELD_UINT", ip - 1); + break; + } + + case OP_LOADFIELD_FLT: + { + Con::printf("%i: OP_LOADFIELD_FLT", ip - 1); + break; + } + + case OP_LOADFIELD_STR: + { + Con::printf("%i: OP_LOADFIELD_STR", ip - 1); + break; + } + + case OP_SAVEFIELD_UINT: + { + Con::printf("%i: OP_SAVEFIELD_UINT", ip - 1); + break; + } + + case OP_SAVEFIELD_FLT: + { + Con::printf("%i: OP_SAVEFIELD_FLT", ip - 1); + break; + } + + case OP_SAVEFIELD_STR: + { + Con::printf("%i: OP_SAVEFIELD_STR", ip - 1); + break; + } + + case OP_STR_TO_UINT: + { + Con::printf("%i: OP_STR_TO_UINT", ip - 1); + break; + } + + case OP_STR_TO_FLT: + { + Con::printf("%i: OP_STR_TO_FLT", ip - 1); + break; + } + + case OP_STR_TO_NONE: + { + Con::printf("%i: OP_STR_TO_NONE", ip - 1); + break; + } + + case OP_FLT_TO_UINT: + { + Con::printf("%i: OP_FLT_TO_UINT", ip - 1); + break; + } + + case OP_FLT_TO_STR: + { + Con::printf("%i: OP_FLT_TO_STR", ip - 1); + break; + } + + case OP_FLT_TO_NONE: + { + Con::printf("%i: OP_FLT_TO_NONE", ip - 1); + break; + } + + case OP_UINT_TO_FLT: + { + Con::printf("%i: OP_UINT_TO_FLT", ip - 1); + break; + } + + case OP_UINT_TO_STR: + { + Con::printf("%i: OP_UINT_TO_STR", ip - 1); + break; + } + + case OP_UINT_TO_NONE: + { + Con::printf("%i: OP_UINT_TO_NONE", ip - 1); + break; + } + + case OP_LOADIMMED_UINT: + { + U32 val = code[ip]; + Con::printf("%i: OP_LOADIMMED_UINT val=%i", ip - 1, val); + ++ip; + break; + } + + case OP_LOADIMMED_FLT: + { + F64 val = (smInFunction ? functionFloats : globalFloats)[code[ip]]; + Con::printf("%i: OP_LOADIMMED_FLT val=%f", ip - 1, val); + ++ip; + break; + } + + case OP_TAG_TO_STR: + { + const char* str = (smInFunction ? functionStrings : globalStrings) + code[ip]; + Con::printf("%i: OP_TAG_TO_STR str=%s", ip - 1, str); + ++ip; + break; + } + + case OP_LOADIMMED_STR: + { + const char* str = (smInFunction ? functionStrings : globalStrings) + code[ip]; + Con::printf("%i: OP_LOADIMMED_STR str=%s", ip - 1, str); + ++ip; + break; + } + + case OP_DOCBLOCK_STR: + { + const char* str = (smInFunction ? functionStrings : globalStrings) + code[ip]; + Con::printf("%i: OP_DOCBLOCK_STR str=%s", ip - 1, str); + ++ip; + break; + } + + case OP_LOADIMMED_IDENT: + { + StringTableEntry str = CodeToSTE(code, ip); + Con::printf("%i: OP_LOADIMMED_IDENT str=%s", ip - 1, str); + ip += 2; + break; + } + + case OP_CALLFUNC: + { + StringTableEntry fnNamespace = CodeToSTE(code, ip + 2); + StringTableEntry fnName = CodeToSTE(code, ip); + U32 callType = code[ip + 4]; + + StringTableEntry callTypeName; + switch (callType) + { + case FuncCallExprNode::FunctionCall: callTypeName = "FunctionCall"; break; + case FuncCallExprNode::MethodCall: callTypeName = "MethodCall"; break; + case FuncCallExprNode::ParentCall: callTypeName = "ParentCall"; break; + case FuncCallExprNode::StaticCall: callTypeName = "StaticCall"; break; + } + + Con::printf("%i: OP_CALLFUNC name=%s nspace=%s callType=%s", ip - 1, fnName, fnNamespace, callTypeName); + + ip += 5; + break; + } + + case OP_ADVANCE_STR: + { + Con::printf("%i: OP_ADVANCE_STR", ip - 1); + break; + } + + case OP_ADVANCE_STR_APPENDCHAR: + { + char ch = code[ip]; + Con::printf("%i: OP_ADVANCE_STR_APPENDCHAR char=%c", ip - 1, ch); + ++ip; + break; + } + + case OP_ADVANCE_STR_COMMA: + { + Con::printf("%i: OP_ADVANCE_STR_COMMA", ip - 1); + break; + } + + case OP_ADVANCE_STR_NUL: + { + Con::printf("%i: OP_ADVANCE_STR_NUL", ip - 1); + break; + } + + case OP_REWIND_STR: + { + Con::printf("%i: OP_REWIND_STR", ip - 1); + break; + } + + case OP_TERMINATE_REWIND_STR: + { + Con::printf("%i: OP_TERMINATE_REWIND_STR", ip - 1); + break; + } + + case OP_COMPARE_STR: + { + Con::printf("%i: OP_COMPARE_STR", ip - 1); + break; + } + + case OP_PUSH: + { + Con::printf("%i: OP_PUSH", ip - 1); + break; + } + + case OP_PUSH_UINT: + { + Con::printf("%i: OP_PUSH_UINT", ip - 1); + break; + } + + case OP_PUSH_FLT: + { + Con::printf("%i: OP_PUSH_FLT", ip - 1); + break; + } + + case OP_PUSH_FRAME: + { + Con::printf("%i: OP_PUSH_FRAME count=%i", ip - 1, code[ip]); + ++ip; + break; + } + + case OP_ASSERT: + { + const char* message = (smInFunction ? functionStrings : globalStrings) + code[ip]; + Con::printf("%i: OP_ASSERT message=%s", ip - 1, message); + ++ip; + break; + } + + case OP_BREAK: + { + Con::printf("%i: OP_BREAK", ip - 1); + break; + } + + case OP_ITER_BEGIN: + { + StringTableEntry varName = CodeToSTE(code, ip); + U32 failIp = code[ip + 2]; + + Con::printf("%i: OP_ITER_BEGIN varName=%s failIp=%i", ip - 1, varName, failIp); + + ip += 3; + break; + } + + case OP_ITER_BEGIN_STR: + { + StringTableEntry varName = CodeToSTE(code, ip); + U32 failIp = code[ip + 2]; + + Con::printf("%i: OP_ITER_BEGIN varName=%s failIp=%i", ip - 1, varName, failIp); + + ip += 3; + break; + } + + case OP_ITER: + { + U32 breakIp = code[ip]; + + Con::printf("%i: OP_ITER breakIp=%i", ip - 1, breakIp); + + ++ip; + break; + } + + case OP_ITER_END: + { + Con::printf("%i: OP_ITER_END", ip - 1); + break; + } + + default: + Con::printf("%i: !!INVALID!!", ip - 1); + break; } } diff --git a/Engine/source/console/codeInterpreter.cpp b/Engine/source/console/codeInterpreter.cpp deleted file mode 100644 index 614eb8fec..000000000 --- a/Engine/source/console/codeInterpreter.cpp +++ /dev/null @@ -1,3018 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// -// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames -// Copyright (C) 2015 Faust Logic, Inc. -//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// - -#include "console/codeInterpreter.h" -#include "console/compiler.h" -#include "console/simBase.h" -#include "console/telnetDebugger.h" -#include "sim/netStringTable.h" -#include "console/ICallMethod.h" -#include "console/stringStack.h" -#include "util/messaging/message.h" -#include "core/strings/findMatch.h" -#include "core/strings/stringUnit.h" -#include "console/console.h" -#include "console/consoleInternal.h" -#include "cinterface/cinterface.h" - -//#define TORQUE_VALIDATE_STACK - -using namespace Compiler; - -enum EvalConstants -{ - MaxStackSize = 1024, - FieldBufferSizeString = 2048, - FieldBufferSizeNumeric = 128, - MethodOnComponent = -2 -}; - -namespace Con -{ - // Current script file name and root, these are registered as - // console variables. - extern StringTableEntry gCurrentFile; - extern StringTableEntry gCurrentRoot; - extern S32 gObjectCopyFailures; -} - -// Gets a component of an object's field value or a variable and returns it -// in val. -static void getFieldComponent(SimObject* object, StringTableEntry field, const char* array, StringTableEntry subField, char val[]) -{ - const char* prevVal = NULL; - - // Grab value from object. - if (object && field) - prevVal = object->getDataField(field, array); - - // Otherwise, grab from the string stack. The value coming in will always - // be a string because that is how multicomponent variables are handled. - else - prevVal = STR.getStringValue(); - - // Make sure we got a value. - if (prevVal && *prevVal) - { - static const StringTableEntry xyzw[] = - { - StringTable->insert("x"), - StringTable->insert("y"), - StringTable->insert("z"), - StringTable->insert("w") - }; - - static const StringTableEntry rgba[] = - { - StringTable->insert("r"), - StringTable->insert("g"), - StringTable->insert("b"), - StringTable->insert("a") - }; - - // Translate xyzw and rgba into the indexed component - // of the variable or field. - if (subField == xyzw[0] || subField == rgba[0]) - dStrcpy(val, StringUnit::getUnit(prevVal, 0, " \t\n"), 128); - - else if (subField == xyzw[1] || subField == rgba[1]) - dStrcpy(val, StringUnit::getUnit(prevVal, 1, " \t\n"), 128); - - else if (subField == xyzw[2] || subField == rgba[2]) - dStrcpy(val, StringUnit::getUnit(prevVal, 2, " \t\n"), 128); - - else if (subField == xyzw[3] || subField == rgba[3]) - dStrcpy(val, StringUnit::getUnit(prevVal, 3, " \t\n"), 128); - - else - val[0] = 0; - } - else - val[0] = 0; -} - -// Sets a component of an object's field value based on the sub field. 'x' will -// set the first field, 'y' the second, and 'z' the third. -static void setFieldComponent(SimObject* object, StringTableEntry field, const char* array, StringTableEntry subField) -{ - // Copy the current string value - char strValue[1024]; - dStrncpy(strValue, STR.getStringValue(), 1024); - - char val[1024] = ""; - const char* prevVal = NULL; - - // Set the value on an object field. - if (object && field) - prevVal = object->getDataField(field, array); - - // Set the value on a variable. - else if (gEvalState.currentVariable) - prevVal = gEvalState.getStringVariable(); - - // Ensure that the variable has a value - if (!prevVal) - return; - - static const StringTableEntry xyzw[] = - { - StringTable->insert("x"), - StringTable->insert("y"), - StringTable->insert("z"), - StringTable->insert("w") - }; - - static const StringTableEntry rgba[] = - { - StringTable->insert("r"), - StringTable->insert("g"), - StringTable->insert("b"), - StringTable->insert("a") - }; - - // Insert the value into the specified - // component of the string. - if (subField == xyzw[0] || subField == rgba[0]) - dStrcpy(val, StringUnit::setUnit(prevVal, 0, strValue, " \t\n"), 128); - - else if (subField == xyzw[1] || subField == rgba[1]) - dStrcpy(val, StringUnit::setUnit(prevVal, 1, strValue, " \t\n"), 128); - - else if (subField == xyzw[2] || subField == rgba[2]) - dStrcpy(val, StringUnit::setUnit(prevVal, 2, strValue, " \t\n"), 128); - - else if (subField == xyzw[3] || subField == rgba[3]) - dStrcpy(val, StringUnit::setUnit(prevVal, 3, strValue, " \t\n"), 128); - - if (val[0] != 0) - { - // Update the field or variable. - if (object && field) - object->setDataField(field, 0, val); - else if (gEvalState.currentVariable) - gEvalState.setStringVariable(val); - } -} -extern ExprEvalState gEvalState; - -char sTraceBuffer[1024]; - -StringStack STR; -ConsoleValueStack CSTK; - -U32 _FLT = 0; ///< Stack pointer for floatStack. -U32 _UINT = 0; ///< Stack pointer for intStack. -U32 _ITER = 0; ///< Stack pointer for iterStack. - -IterStackRecord iterStack[MaxStackSize]; - -F64 floatStack[MaxStackSize]; -S64 intStack[MaxStackSize]; - -char curFieldArray[256]; -char prevFieldArray[256]; - -typedef OPCodeReturn(CodeInterpreter::*OpFn)(U32&); - -static OpFn gOpCodeArray[MAX_OP_CODELEN]; - -CodeInterpreter::CodeInterpreter(CodeBlock *cb) : - mCodeBlock(cb), - mIterDepth(0), - mCurFloatTable(nullptr), - mCurStringTable(nullptr), - mThisFunctionName(nullptr), - mPopFrame(false), - mObjectCreationStackIndex(0), - mCurrentNewObject(nullptr), - mFailJump(0), - mPrevField(nullptr), - mCurField(nullptr), - mPrevObject(nullptr), - mCurObject(nullptr), - mSaveObject(nullptr), - mThisObject(nullptr), - mNSEntry(nullptr), - mCurFNDocBlock(nullptr), - mCurNSDocBlock(nullptr), - mCallArgc(0), - mCallArgv(nullptr), - mSaveCodeBlock(nullptr), - mCurrentInstruction(0) -{ - dMemset(&mExec, 0, sizeof(mExec)); - dMemset(&mObjectCreationStack, 0, sizeof(mObjectCreationStack)); - dMemset(&mNSDocBlockClass, 0, sizeof(mNSDocBlockClass)); -} - -CodeInterpreter::~CodeInterpreter() -{ -} - -void CodeInterpreter::init() -{ - gOpCodeArray[OP_FUNC_DECL] = &CodeInterpreter::op_func_decl; - gOpCodeArray[OP_CREATE_OBJECT] = &CodeInterpreter::op_create_object; - gOpCodeArray[OP_ADD_OBJECT] = &CodeInterpreter::op_add_object; - gOpCodeArray[OP_END_OBJECT] = &CodeInterpreter::op_end_object; - gOpCodeArray[OP_FINISH_OBJECT] = &CodeInterpreter::op_finish_object; - gOpCodeArray[OP_JMPIFFNOT] = &CodeInterpreter::op_jmpiffnot; - gOpCodeArray[OP_JMPIFNOT] = &CodeInterpreter::op_jmpifnot; - gOpCodeArray[OP_JMPIFF] = &CodeInterpreter::op_jmpiff; - gOpCodeArray[OP_JMPIF] = &CodeInterpreter::op_jmpif; - gOpCodeArray[OP_JMPIFNOT_NP] = &CodeInterpreter::op_jmpifnot_np; - gOpCodeArray[OP_JMPIF_NP] = &CodeInterpreter::op_jmpif_np; - gOpCodeArray[OP_JMP] = &CodeInterpreter::op_jmp; - gOpCodeArray[OP_RETURN] = &CodeInterpreter::op_return; - gOpCodeArray[OP_RETURN_VOID] = &CodeInterpreter::op_return_void; - gOpCodeArray[OP_RETURN_FLT] = &CodeInterpreter::op_return_flt; - gOpCodeArray[OP_RETURN_UINT] = &CodeInterpreter::op_return_uint; - gOpCodeArray[OP_CMPEQ] = &CodeInterpreter::op_cmpeq; - gOpCodeArray[OP_CMPGR] = &CodeInterpreter::op_cmpgr; - gOpCodeArray[OP_CMPGE] = &CodeInterpreter::op_cmpge; - gOpCodeArray[OP_CMPLT] = &CodeInterpreter::op_cmplt; - gOpCodeArray[OP_CMPLE] = &CodeInterpreter::op_cmple; - gOpCodeArray[OP_CMPNE] = &CodeInterpreter::op_cmpne; - gOpCodeArray[OP_XOR] = &CodeInterpreter::op_xor; - gOpCodeArray[OP_MOD] = &CodeInterpreter::op_mod; - gOpCodeArray[OP_BITAND] = &CodeInterpreter::op_bitand; - gOpCodeArray[OP_BITOR] = &CodeInterpreter::op_bitor; - gOpCodeArray[OP_NOT] = &CodeInterpreter::op_not; - gOpCodeArray[OP_NOTF] = &CodeInterpreter::op_notf; - gOpCodeArray[OP_ONESCOMPLEMENT] = &CodeInterpreter::op_onescomplement; - gOpCodeArray[OP_SHR] = &CodeInterpreter::op_shr; - gOpCodeArray[OP_SHL] = &CodeInterpreter::op_shl; - gOpCodeArray[OP_AND] = &CodeInterpreter::op_and; - gOpCodeArray[OP_OR] = &CodeInterpreter::op_or; - gOpCodeArray[OP_ADD] = &CodeInterpreter::op_add; - gOpCodeArray[OP_SUB] = &CodeInterpreter::op_sub; - gOpCodeArray[OP_MUL] = &CodeInterpreter::op_mul; - gOpCodeArray[OP_DIV] = &CodeInterpreter::op_div; - gOpCodeArray[OP_NEG] = &CodeInterpreter::op_neg; - gOpCodeArray[OP_INC] = &CodeInterpreter::op_inc; - gOpCodeArray[OP_DEC] = &CodeInterpreter::op_dec; - gOpCodeArray[OP_SETCURVAR] = &CodeInterpreter::op_setcurvar; - gOpCodeArray[OP_SETCURVAR_CREATE] = &CodeInterpreter::op_setcurvar_create; - gOpCodeArray[OP_SETCURVAR_ARRAY] = &CodeInterpreter::op_setcurvar_array; - gOpCodeArray[OP_SETCURVAR_ARRAY_VARLOOKUP] = &CodeInterpreter::op_setcurvar_array_varlookup; - gOpCodeArray[OP_SETCURVAR_ARRAY_CREATE] = &CodeInterpreter::op_setcurvar_array_create; - gOpCodeArray[OP_SETCURVAR_ARRAY_CREATE_VARLOOKUP] = &CodeInterpreter::op_setcurvar_array_create_varlookup; - gOpCodeArray[OP_LOADVAR_UINT] = &CodeInterpreter::op_loadvar_uint; - gOpCodeArray[OP_LOADVAR_FLT] = &CodeInterpreter::op_loadvar_flt; - gOpCodeArray[OP_LOADVAR_STR] = &CodeInterpreter::op_loadvar_str; - gOpCodeArray[OP_LOADVAR_VAR] = &CodeInterpreter::op_loadvar_var; - gOpCodeArray[OP_SAVEVAR_UINT] = &CodeInterpreter::op_savevar_uint; - gOpCodeArray[OP_SAVEVAR_FLT] = &CodeInterpreter::op_savevar_flt; - gOpCodeArray[OP_SAVEVAR_STR] = &CodeInterpreter::op_savevar_str; - gOpCodeArray[OP_SAVEVAR_VAR] = &CodeInterpreter::op_savevar_var; - gOpCodeArray[OP_SETCUROBJECT] = &CodeInterpreter::op_setcurobject; - gOpCodeArray[OP_SETCUROBJECT_INTERNAL] = &CodeInterpreter::op_setcurobject_internal; - gOpCodeArray[OP_SETCUROBJECT_NEW] = &CodeInterpreter::op_setcurobject_new; - gOpCodeArray[OP_SETCURFIELD] = &CodeInterpreter::op_setcurfield; - gOpCodeArray[OP_SETCURFIELD_ARRAY] = &CodeInterpreter::op_setcurfield_array; - gOpCodeArray[OP_SETCURFIELD_TYPE] = &CodeInterpreter::op_setcurfield_type; - gOpCodeArray[OP_SETCURFIELD_ARRAY_VAR] = &CodeInterpreter::op_setcurfield_array_var; - gOpCodeArray[OP_SETCURFIELD_THIS] = &CodeInterpreter::op_setcurfield_this; - gOpCodeArray[OP_LOADFIELD_UINT] = &CodeInterpreter::op_loadfield_uint; - gOpCodeArray[OP_LOADFIELD_FLT] = &CodeInterpreter::op_loadfield_flt; - gOpCodeArray[OP_LOADFIELD_STR] = &CodeInterpreter::op_loadfield_str; - gOpCodeArray[OP_SAVEFIELD_UINT] = &CodeInterpreter::op_savefield_uint; - gOpCodeArray[OP_SAVEFIELD_FLT] = &CodeInterpreter::op_savefield_flt; - gOpCodeArray[OP_SAVEFIELD_STR] = &CodeInterpreter::op_savefield_str; - gOpCodeArray[OP_STR_TO_UINT] = &CodeInterpreter::op_str_to_uint; - gOpCodeArray[OP_STR_TO_FLT] = &CodeInterpreter::op_str_to_flt; - gOpCodeArray[OP_STR_TO_NONE] = &CodeInterpreter::op_str_to_none; - gOpCodeArray[OP_FLT_TO_UINT] = &CodeInterpreter::op_flt_to_uint; - gOpCodeArray[OP_FLT_TO_STR] = &CodeInterpreter::op_flt_to_str; - gOpCodeArray[OP_FLT_TO_NONE] = &CodeInterpreter::op_flt_to_none; - gOpCodeArray[OP_UINT_TO_FLT] = &CodeInterpreter::op_uint_to_flt; - gOpCodeArray[OP_UINT_TO_STR] = &CodeInterpreter::op_uint_to_str; - gOpCodeArray[OP_UINT_TO_NONE] = &CodeInterpreter::op_uint_to_none; - gOpCodeArray[OP_COPYVAR_TO_NONE] = &CodeInterpreter::op_copyvar_to_none; - gOpCodeArray[OP_LOADIMMED_UINT] = &CodeInterpreter::op_loadimmed_uint; - gOpCodeArray[OP_LOADIMMED_FLT] = &CodeInterpreter::op_loadimmed_flt; - gOpCodeArray[OP_TAG_TO_STR] = &CodeInterpreter::op_tag_to_str; - gOpCodeArray[OP_LOADIMMED_STR] = &CodeInterpreter::op_loadimmed_str; - gOpCodeArray[OP_DOCBLOCK_STR] = &CodeInterpreter::op_docblock_str; - gOpCodeArray[OP_LOADIMMED_IDENT] = &CodeInterpreter::op_loadimmed_ident; - gOpCodeArray[OP_CALLFUNC_RESOLVE] = &CodeInterpreter::op_callfunc_resolve; - gOpCodeArray[OP_CALLFUNC] = &CodeInterpreter::op_callfunc; - gOpCodeArray[OP_CALLFUNC_POINTER] = &CodeInterpreter::op_callfunc_pointer; - gOpCodeArray[OP_CALLFUNC_THIS] = &CodeInterpreter::op_callfunc_this; - gOpCodeArray[OP_ADVANCE_STR] = &CodeInterpreter::op_advance_str; - gOpCodeArray[OP_ADVANCE_STR_APPENDCHAR] = &CodeInterpreter::op_advance_str_appendchar; - gOpCodeArray[OP_ADVANCE_STR_COMMA] = &CodeInterpreter::op_advance_str_comma; - gOpCodeArray[OP_ADVANCE_STR_NUL] = &CodeInterpreter::op_advance_str_nul; - gOpCodeArray[OP_REWIND_STR] = &CodeInterpreter::op_rewind_str; - gOpCodeArray[OP_TERMINATE_REWIND_STR] = &CodeInterpreter::op_terminate_rewind_str; - gOpCodeArray[OP_COMPARE_STR] = &CodeInterpreter::op_compare_str; - gOpCodeArray[OP_PUSH] = &CodeInterpreter::op_push; - gOpCodeArray[OP_PUSH_UINT] = &CodeInterpreter::op_push_uint; - gOpCodeArray[OP_PUSH_FLT] = &CodeInterpreter::op_push_flt; - gOpCodeArray[OP_PUSH_VAR] = &CodeInterpreter::op_push_var; - gOpCodeArray[OP_PUSH_THIS] = &CodeInterpreter::op_push_this; - gOpCodeArray[OP_PUSH_FRAME] = &CodeInterpreter::op_push_frame; - gOpCodeArray[OP_ASSERT] = &CodeInterpreter::op_assert; - gOpCodeArray[OP_BREAK] = &CodeInterpreter::op_break; - gOpCodeArray[OP_ITER_BEGIN_STR] = &CodeInterpreter::op_iter_begin_str; - gOpCodeArray[OP_ITER_BEGIN] = &CodeInterpreter::op_iter_begin; - gOpCodeArray[OP_ITER] = &CodeInterpreter::op_iter; - gOpCodeArray[OP_ITER_END] = &CodeInterpreter::op_iter_end; - gOpCodeArray[OP_INVALID] = &CodeInterpreter::op_invalid; -} - -ConsoleValueRef CodeInterpreter::exec(U32 ip, - StringTableEntry functionName, - Namespace *thisNamespace, - U32 argc, - ConsoleValueRef *argv, - bool noCalls, - StringTableEntry packageName, - S32 setFrame) -{ - mExec.functionName = functionName; - mExec.thisNamespace = thisNamespace; - mExec.argc = argc; - mExec.argv = argv; - mExec.noCalls = noCalls; - mExec.packageName = packageName; - mExec.setFrame = setFrame; - - mCodeBlock->incRefCount(); - - mPopFrame = false; - -#ifdef TORQUE_VALIDATE_STACK - U32 stackStart = STR.mStartStackSize; -#endif - - STR.clearFunctionOffset(); // ensures arg buffer offset is back to 0 - - // Lets load up our function arguments. - parseArgs(ip); - - // Grab the state of the telenet debugger here once - // so that the push and pop frames are always balanced. - const bool telDebuggerOn = TelDebugger && TelDebugger->isConnected(); - if (telDebuggerOn && setFrame < 0) - TelDebugger->pushStackFrame(); - - mSaveCodeBlock = CodeBlock::smCurrentCodeBlock; - CodeBlock::smCurrentCodeBlock = mCodeBlock; - if (mCodeBlock->name) - { - Con::gCurrentFile = mCodeBlock->name; - Con::gCurrentRoot = mCodeBlock->modPath; - } - - U32 *code = mCodeBlock->code; - - while (true) - { - mCurrentInstruction = code[ip++]; - mNSEntry = nullptr; - -#ifdef TORQUE_VALIDATE_STACK - // OP Code check. - AssertFatal(mCurrentInstruction < MAX_OP_CODELEN, "Invalid OP code in script interpreter"); -#endif - - breakContinueLabel: - OPCodeReturn ret = (this->*gOpCodeArray[mCurrentInstruction])(ip); - if (ret == OPCodeReturn::exitCode) - break; - else if (ret == OPCodeReturn::breakContinue) - goto breakContinueLabel; - } - - if (telDebuggerOn && setFrame < 0) - TelDebugger->popStackFrame(); - - if (mPopFrame) - gEvalState.popFrame(); - - if (argv) - { - if (gEvalState.traceOn) - { - sTraceBuffer[0] = 0; - dStrcat(sTraceBuffer, "Leaving ", 1024); - - if (packageName) - { - dStrcat(sTraceBuffer, "[", 1024); - dStrcat(sTraceBuffer, packageName, 1024); - dStrcat(sTraceBuffer, "]", 1024); - } - if (thisNamespace && thisNamespace->mName) - { - dSprintf(sTraceBuffer + dStrlen(sTraceBuffer), (U32)(sizeof(sTraceBuffer) - dStrlen(sTraceBuffer)), - "%s::%s() - return %s", thisNamespace->mName, mThisFunctionName, STR.getStringValue()); - } - else - { - dSprintf(sTraceBuffer + dStrlen(sTraceBuffer), (U32)(sizeof(sTraceBuffer) - dStrlen(sTraceBuffer)), - "%s() - return %s", mThisFunctionName, STR.getStringValue()); - } - Con::printf("%s", sTraceBuffer); - } - } - - CodeBlock::smCurrentCodeBlock = mSaveCodeBlock; - if (mSaveCodeBlock && mSaveCodeBlock->name) - { - Con::gCurrentFile = mSaveCodeBlock->name; - Con::gCurrentRoot = mSaveCodeBlock->modPath; - } - - mCodeBlock->decRefCount(); - -#ifdef TORQUE_VALIDATE_STACK - AssertFatal(!(STR.mStartStackSize > stackStart), "String stack not popped enough in script exec"); - AssertFatal(!(STR.mStartStackSize < stackStart), "String stack popped too much in script exec"); -#endif - - return mReturnValue; -} - -void CodeInterpreter::parseArgs(U32 &ip) -{ - U32 *code = mCodeBlock->code; - - if (mExec.argv) - { - U32 fnArgc = code[ip + 2 + 6]; - mThisFunctionName = Compiler::CodeToSTE(code, ip); - S32 wantedArgc = getMin(mExec.argc - 1, fnArgc); // argv[0] is func name - if (gEvalState.traceOn) - { - sTraceBuffer[0] = 0; - dStrcat(sTraceBuffer, "Entering ", 1024); - - if (mExec.packageName) - { - dStrcat(sTraceBuffer, "[", 1024); - dStrcat(sTraceBuffer, mExec.packageName, 1024); - dStrcat(sTraceBuffer, "]", 1024); - } - if (mExec.thisNamespace && mExec.thisNamespace->mName) - { - dSprintf(sTraceBuffer + dStrlen(sTraceBuffer), (U32)(sizeof(sTraceBuffer) - dStrlen(sTraceBuffer)), - "%s::%s(", mExec.thisNamespace->mName, mThisFunctionName); - } - else - { - dSprintf(sTraceBuffer + dStrlen(sTraceBuffer), (U32)(sizeof(sTraceBuffer) - dStrlen(sTraceBuffer)), - "%s(", mThisFunctionName); - } - for (S32 i = 0; i < wantedArgc; i++) - { - dStrcat(sTraceBuffer, mExec.argv[i + 1], 1024); - if (i != wantedArgc - 1) - dStrcat(sTraceBuffer, ", ", 1024); - } - dStrcat(sTraceBuffer, ")", 1024); - Con::printf("%s", sTraceBuffer); - } - - gEvalState.pushFrame(mThisFunctionName, mExec.thisNamespace); - mPopFrame = true; - - StringTableEntry thisPointer = StringTable->insert("%this"); - - for (S32 i = 0; i < wantedArgc; i++) - { - StringTableEntry var = Compiler::CodeToSTE(code, ip + (2 + 6 + 1) + (i * 2)); - gEvalState.setCurVarNameCreate(var); - - ConsoleValueRef ref = mExec.argv[i + 1]; - - switch (ref.getType()) - { - case ConsoleValue::TypeInternalInt: - gEvalState.setIntVariable(ref); - break; - case ConsoleValue::TypeInternalFloat: - gEvalState.setFloatVariable(ref); - break; - case ConsoleValue::TypeInternalStringStackPtr: - gEvalState.setStringStackPtrVariable(ref.getStringStackPtrValue()); - break; - case ConsoleValue::TypeInternalStackString: - case ConsoleValue::TypeInternalString: - default: - gEvalState.setStringVariable(ref); - break; - } - - if (var == thisPointer) - { - // %this gets optimized as it is flagged as a constant. - // Since it is guarenteed to be constant, we can then perform optimizations. - gEvalState.currentVariable->mIsConstant = true; - - // Store a reference to the this pointer object. - mThisObject = Sim::findObject(gEvalState.getStringVariable()); - } - } - - ip = ip + (fnArgc * 2) + (2 + 6 + 1); - mCurFloatTable = mCodeBlock->functionFloats; - mCurStringTable = mCodeBlock->functionStrings; - } - else - { - mCurFloatTable = mCodeBlock->globalFloats; - mCurStringTable = mCodeBlock->globalStrings; - - // If requested stack frame isn't available, request a new one - // (this prevents assert failures when creating local - // variables without a stack frame) - if (gEvalState.getStackDepth() <= mExec.setFrame) - mExec.setFrame = -1; - - // Do we want this code to execute using a new stack frame? - if (mExec.setFrame < 0) - { - gEvalState.pushFrame(NULL, NULL); - mPopFrame = true; - } - else - { - // We want to copy a reference to an existing stack frame - // on to the top of the stack. Any change that occurs to - // the locals during this new frame will also occur in the - // original frame. - S32 stackIndex = gEvalState.getStackDepth() - mExec.setFrame - 1; - gEvalState.pushFrameRef(stackIndex); - mPopFrame = true; - } - } -} - -OPCodeReturn CodeInterpreter::op_func_decl(U32 &ip) -{ - U32 *code = mCodeBlock->code; - - if (!mExec.noCalls) - { - StringTableEntry fnName = CodeToSTE(code, ip); - StringTableEntry fnNamespace = CodeToSTE(code, ip + 2); - StringTableEntry fnPackage = CodeToSTE(code, ip + 4); - bool hasBody = (code[ip + 6] & 0x01) != 0; - U32 lineNumber = code[ip + 6] >> 1; - - Namespace::unlinkPackages(); - Namespace *ns = Namespace::find(fnNamespace, fnPackage); - ns->addFunction(fnName, mCodeBlock, hasBody ? ip : 0, mCurFNDocBlock ? dStrdup(mCurFNDocBlock) : NULL, lineNumber);// if no body, set the IP to 0 - if (mCurNSDocBlock) - { - // If we have a docblock before we declare the function in the script file, - // this will attempt to set the doc block to the function. - // See OP_DOCBLOCK_STR - if (fnNamespace == StringTable->lookup(mNSDocBlockClass)) - { - char *usageStr = dStrdup(mCurNSDocBlock); - usageStr[dStrlen(usageStr)] = '\0'; - ns->mUsage = usageStr; - ns->mCleanUpUsage = true; - mCurNSDocBlock = NULL; - } - } - Namespace::relinkPackages(); - - // If we had a docblock, it's definitely not valid anymore, so clear it out. - mCurFNDocBlock = NULL; - - //Con::printf("Adding function %s::%s (%d)", fnNamespace, fnName, ip); - } - ip = code[ip + 7]; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_create_object(U32 &ip) -{ - U32 *code = mCodeBlock->code; - - // Read some useful info. - StringTableEntry objParent = CodeToSTE(code, ip); - bool isDataBlock = code[ip + 2]; - bool isInternal = code[ip + 3]; - bool isSingleton = code[ip + 4]; - U32 lineNumber = code[ip + 5]; - mFailJump = code[ip + 6]; - - // If we don't allow calls, we certainly don't allow creating objects! - // Moved this to after failJump is set. Engine was crashing when - // noCalls = true and an object was being created at the beginning of - // a file. ADL. - if (mExec.noCalls) - { - ip = mFailJump; - return OPCodeReturn::success; - } - - // Push the old info to the stack - //Assert( objectCreationStackIndex < objectCreationStackSize ); - mObjectCreationStack[mObjectCreationStackIndex].newObject = mCurrentNewObject; - mObjectCreationStack[mObjectCreationStackIndex++].failJump = mFailJump; - - // Get the constructor information off the stack. - CSTK.getArgcArgv(NULL, &mCallArgc, &mCallArgv); - const char *objectName = mCallArgv[2]; - - // Con::printf("Creating object..."); - - // objectName = argv[1]... - mCurrentNewObject = NULL; - - // Are we creating a datablock? If so, deal with case where we override - // an old one. - if (isDataBlock) - { - // Con::printf(" - is a datablock"); - - // Find the old one if any. - SimObject *db = Sim::getDataBlockGroup()->findObject(objectName); - - // Make sure we're not changing types on ourselves... - if (db && dStricmp(db->getClassName(), mCallArgv[1])) - { - Con::errorf(ConsoleLogEntry::General, "%s: Cannot re-declare data block %s with a different class.", mCodeBlock->getFileLine(ip), objectName); - ip = mFailJump; - STR.popFrame(); - CSTK.popFrame(); - return OPCodeReturn::success; - } - - // If there was one, set the currentNewObject and move on. - if (db) - mCurrentNewObject = db; - } - else if (!isInternal) - { - // IF we aren't looking at a local/internal object, then check if - // this object already exists in the global space - - AbstractClassRep* rep = AbstractClassRep::findClassRep(objectName); - if (rep != NULL) { - Con::errorf(ConsoleLogEntry::General, "%s: Cannot name object [%s] the same name as a script class.", - mCodeBlock->getFileLine(ip), objectName); - ip = mFailJump; - STR.popFrame(); - CSTK.popFrame(); - return OPCodeReturn::success; - } - - SimObject *obj = Sim::findObject((const char*)objectName); - if (obj /*&& !obj->isLocalName()*/) - { - if (isSingleton) - { - // Make sure we're not trying to change types - if (dStricmp(obj->getClassName(), (const char*)mCallArgv[1]) != 0) - { - Con::errorf(ConsoleLogEntry::General, "%s: Cannot re-declare object [%s] with a different class [%s] - was [%s].", - mCodeBlock->getFileLine(ip), objectName, (const char*)mCallArgv[1], obj->getClassName()); - ip = mFailJump; - STR.popFrame(); - CSTK.popFrame(); - return OPCodeReturn::success; - } - - // We're creating a singleton, so use the found object - // instead of creating a new object. - mCurrentNewObject = obj; - } - else - { - const char* redefineBehavior = Con::getVariable("$Con::redefineBehavior"); - - if (dStricmp(redefineBehavior, "replaceExisting") == 0) - { - // Save our constructor args as the argv vector is stored on the - // string stack and may get stomped if deleteObject triggers - // script execution. - - ConsoleValueRef savedArgv[StringStack::MaxArgs]; - for (int i = 0; i< mCallArgc; i++) { - savedArgv[i] = mCallArgv[i]; - } - //dMemcpy( savedArgv, callArgv, sizeof( savedArgv[ 0 ] ) * callArgc ); - - // Prevent stack value corruption - CSTK.pushFrame(); - STR.pushFrame(); - // -- - - obj->deleteObject(); - obj = NULL; - - // Prevent stack value corruption - CSTK.popFrame(); - STR.popFrame(); - // -- - - //dMemcpy( callArgv, savedArgv, sizeof( callArgv[ 0 ] ) * callArgc ); - for (int i = 0; iinsert(newName); - break; - } - } - } - else if (dStricmp(redefineBehavior, "unnameNew") == 0) - { - objectName = StringTable->insert(""); - } - else if (dStricmp(redefineBehavior, "postfixNew") == 0) - { - const char* postfix = Con::getVariable("$Con::redefineBehaviorPostfix"); - String newName = String::ToString("%s%s", objectName, postfix); - - if (Sim::findObject(newName)) - { - Con::errorf(ConsoleLogEntry::General, "%s: Cannot re-declare object with postfix [%s].", - mCodeBlock->getFileLine(ip), newName.c_str()); - ip = mFailJump; - STR.popFrame(); - CSTK.popFrame(); - return OPCodeReturn::success; - } - else - objectName = StringTable->insert(newName); - } - else - { - Con::errorf(ConsoleLogEntry::General, "%s: Cannot re-declare object [%s].", - mCodeBlock->getFileLine(ip), objectName); - ip = mFailJump; - STR.popFrame(); - CSTK.popFrame(); - return OPCodeReturn::success; - } - } - } - } - - STR.popFrame(); - CSTK.popFrame(); - - if (!mCurrentNewObject) - { - // Well, looks like we have to create a new object. - ConsoleObject *object = ConsoleObject::create((const char*)mCallArgv[1]); - - // Deal with failure! - if (!object) - { - Con::errorf(ConsoleLogEntry::General, "%s: Unable to instantiate non-conobject class %s.", mCodeBlock->getFileLine(ip), (const char*)mCallArgv[1]); - ip = mFailJump; - return OPCodeReturn::success; - } - - // Do special datablock init if appropros - if (isDataBlock) - { - SimDataBlock *dataBlock = dynamic_cast(object); - if (dataBlock) - { - dataBlock->assignId(); - } - else - { - // They tried to make a non-datablock with a datablock keyword! - Con::errorf(ConsoleLogEntry::General, "%s: Unable to instantiate non-datablock class %s.", mCodeBlock->getFileLine(ip), (const char*)mCallArgv[1]); - // Clean up... - delete object; - mCurrentNewObject = NULL; - ip = mFailJump; - return OPCodeReturn::success; - } - } - - // Finally, set currentNewObject to point to the new one. - mCurrentNewObject = dynamic_cast(object); - - // Deal with the case of a non-SimObject. - if (!mCurrentNewObject) - { - Con::errorf(ConsoleLogEntry::General, "%s: Unable to instantiate non-SimObject class %s.", mCodeBlock->getFileLine(ip), (const char*)mCallArgv[1]); - delete object; - mCurrentNewObject = NULL; - ip = mFailJump; - return OPCodeReturn::success; - } - - // Set the declaration line - mCurrentNewObject->setDeclarationLine(lineNumber); - - // Set the file that this object was created in - mCurrentNewObject->setFilename(mCodeBlock->name); - - // Does it have a parent object? (ie, the copy constructor : syntax, not inheriance) - if (*objParent) - { - // Find it! - SimObject *parent; - if (Sim::findObject(objParent, parent)) - { - // Con::printf(" - Parent object found: %s", parent->getClassName()); - - mCurrentNewObject->setCopySource(parent); - mCurrentNewObject->assignFieldsFrom(parent); - - // copy any substitution statements - SimDataBlock* parent_db = dynamic_cast(parent); - if (parent_db) - { - SimDataBlock* currentNewObject_db = dynamic_cast(mCurrentNewObject); - if (currentNewObject_db) - currentNewObject_db->copySubstitutionsFrom(parent_db); - } - } - else - { - if (Con::gObjectCopyFailures == -1) - Con::errorf(ConsoleLogEntry::General, "%s: Unable to find parent object %s for %s.", mCodeBlock->getFileLine(ip), objParent, (const char*)mCallArgv[1]); - else - ++Con::gObjectCopyFailures; - - // Fail to create the object. - delete object; - mCurrentNewObject = NULL; - ip = mFailJump; - return OPCodeReturn::success; - } - } - - // If a name was passed, assign it. - if (objectName[0]) - { - if (!isInternal) - mCurrentNewObject->assignName(objectName); - else - mCurrentNewObject->setInternalName(objectName); - - // Set the original name - mCurrentNewObject->setOriginalName(objectName); - } - - // Prevent stack value corruption - CSTK.pushFrame(); - STR.pushFrame(); - // -- - - // Do the constructor parameters. - if (!mCurrentNewObject->processArguments(mCallArgc - 3, mCallArgv + 3)) - { - delete mCurrentNewObject; - mCurrentNewObject = NULL; - ip = mFailJump; - - // Prevent stack value corruption - CSTK.popFrame(); - STR.popFrame(); - // -- - return OPCodeReturn::success; - } - - // Prevent stack value corruption - CSTK.popFrame(); - STR.popFrame(); - // -- - - // If it's not a datablock, allow people to modify bits of it. - if (!isDataBlock) - { - mCurrentNewObject->setModStaticFields(true); - mCurrentNewObject->setModDynamicFields(true); - } - } - else - { - mCurrentNewObject->reloadReset(); // AFX (reload-reset) - // Does it have a parent object? (ie, the copy constructor : syntax, not inheriance) - if (*objParent) - { - // Find it! - SimObject *parent; - if (Sim::findObject(objParent, parent)) - { - // Con::printf(" - Parent object found: %s", parent->getClassName()); - - // temporarily block name change - SimObject::preventNameChanging = true; - mCurrentNewObject->setCopySource(parent); - mCurrentNewObject->assignFieldsFrom(parent); - // restore name changing - SimObject::preventNameChanging = false; - - // copy any substitution statements - SimDataBlock* parent_db = dynamic_cast(parent); - if (parent_db) - { - SimDataBlock* currentNewObject_db = dynamic_cast(mCurrentNewObject); - if (currentNewObject_db) - currentNewObject_db->copySubstitutionsFrom(parent_db); - } - } - else - Con::errorf(ConsoleLogEntry::General, "%d: Unable to find parent object %s for %s.", lineNumber, objParent, (const char*)mCallArgv[1]); - } - } - - // Advance the IP past the create info... - ip += 7; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_add_object(U32 &ip) -{ - // See OP_SETCURVAR for why we do this. - mCurFNDocBlock = NULL; - mCurNSDocBlock = NULL; - - // Do we place this object at the root? - bool placeAtRoot = mCodeBlock->code[ip++]; - - // Con::printf("Adding object %s", currentNewObject->getName()); - - // Prevent stack value corruption - CSTK.pushFrame(); - STR.pushFrame(); - // -- - - // Make sure it wasn't already added, then add it. - if (mCurrentNewObject->isProperlyAdded() == false) - { - bool ret = false; - - Message *msg = dynamic_cast(mCurrentNewObject); - if (msg) - { - SimObjectId id = Message::getNextMessageID(); - if (id != 0xffffffff) - ret = mCurrentNewObject->registerObject(id); - else - Con::errorf("%s: No more object IDs available for messages", mCodeBlock->getFileLine(ip)); - } - else - ret = mCurrentNewObject->registerObject(); - - if (!ret) - { - // This error is usually caused by failing to call Parent::initPersistFields in the class' initPersistFields(). - Con::warnf(ConsoleLogEntry::General, "%s: Register object failed for object %s of class %s.", mCodeBlock->getFileLine(ip), mCurrentNewObject->getName(), mCurrentNewObject->getClassName()); - delete mCurrentNewObject; - mCurrentNewObject = NULL; - ip = mFailJump; - // Prevent stack value corruption - CSTK.popFrame(); - STR.popFrame(); - // -- - return OPCodeReturn::success; - } - } - - // Are we dealing with a datablock? - SimDataBlock *dataBlock = dynamic_cast(mCurrentNewObject); - static String errorStr; - - // If so, preload it. - if (dataBlock && !dataBlock->preload(true, errorStr)) - { - Con::errorf(ConsoleLogEntry::General, "%s: preload failed for %s: %s.", mCodeBlock->getFileLine(ip), - mCurrentNewObject->getName(), errorStr.c_str()); - dataBlock->deleteObject(); - mCurrentNewObject = NULL; - ip = mFailJump; - - // Prevent stack value corruption - CSTK.popFrame(); - STR.popFrame(); - // -- - return OPCodeReturn::success; - } - - // What group will we be added to, if any? - U32 groupAddId = intStack[_UINT]; - SimGroup *grp = NULL; - SimSet *set = NULL; - bool isMessage = dynamic_cast(mCurrentNewObject) != NULL; - - if (!placeAtRoot || !mCurrentNewObject->getGroup()) - { - if (!isMessage) - { - if (!placeAtRoot) - { - // Otherwise just add to the requested group or set. - if (!Sim::findObject(groupAddId, grp)) - Sim::findObject(groupAddId, set); - } - - if (placeAtRoot) - { - // Deal with the instantGroup if we're being put at the root or we're adding to a component. - if (Con::gInstantGroup.isEmpty() - || !Sim::findObject(Con::gInstantGroup, grp)) - grp = Sim::getRootGroup(); - } - } - - // If we didn't get a group, then make sure we have a pointer to - // the rootgroup. - if (!grp) - grp = Sim::getRootGroup(); - - // add to the parent group - grp->addObject(mCurrentNewObject); - - // If for some reason the add failed, add the object to the - // root group so it won't leak. - if (!mCurrentNewObject->getGroup()) - Sim::getRootGroup()->addObject(mCurrentNewObject); - - // add to any set we might be in - if (set) - set->addObject(mCurrentNewObject); - } - - // store the new object's ID on the stack (overwriting the group/set - // id, if one was given, otherwise getting pushed) - if (placeAtRoot) - intStack[_UINT] = mCurrentNewObject->getId(); - else - intStack[++_UINT] = mCurrentNewObject->getId(); - - // Prevent stack value corruption - CSTK.popFrame(); - STR.popFrame(); - // -- - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_end_object(U32 &ip) -{ - // If we're not to be placed at the root, make sure we clean up - // our group reference. - bool placeAtRoot = mCodeBlock->code[ip++]; - if (!placeAtRoot) - _UINT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_finish_object(U32 &ip) -{ - if (mCurrentNewObject) - mCurrentNewObject->onPostAdd(); - - //Assert( objectCreationStackIndex >= 0 ); - // Restore the object info from the stack [7/9/2007 Black] - mCurrentNewObject = mObjectCreationStack[--mObjectCreationStackIndex].newObject; - mFailJump = mObjectCreationStack[mObjectCreationStackIndex].failJump; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_jmpiffnot(U32 &ip) -{ - if (floatStack[_FLT--]) - { - ip++; - return OPCodeReturn::success; - } - ip = mCodeBlock->code[ip]; - return OPCodeReturn::success; -} - - -OPCodeReturn CodeInterpreter::op_jmpifnot(U32 &ip) -{ - if (intStack[_UINT--]) - { - ip++; - return OPCodeReturn::success; - } - ip = mCodeBlock->code[ip]; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_jmpiff(U32 &ip) -{ - if (!floatStack[_FLT--]) - { - ip++; - return OPCodeReturn::success; - } - ip = mCodeBlock->code[ip]; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_jmpif(U32 &ip) -{ - if (!intStack[_UINT--]) - { - ip++; - return OPCodeReturn::success; - } - ip = mCodeBlock->code[ip]; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_jmpifnot_np(U32 &ip) -{ - if (intStack[_UINT]) - { - _UINT--; - ip++; - return OPCodeReturn::success; - } - ip = mCodeBlock->code[ip]; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_jmpif_np(U32 &ip) -{ - if (!intStack[_UINT]) - { - _UINT--; - ip++; - return OPCodeReturn::success; - } - ip = mCodeBlock->code[ip]; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_jmp(U32 &ip) -{ - ip = mCodeBlock->code[ip]; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_return_void(U32 &ip) -{ - STR.setStringValue(""); - // We're falling thru here on purpose. - - OPCodeReturn ret = op_return(ip); - - return ret; -} - -OPCodeReturn CodeInterpreter::op_return(U32 &ip) -{ - StringStackPtr retValue = STR.getStringValuePtr(); - - if (mIterDepth > 0) - { - // Clear iterator state. - while (mIterDepth > 0) - { - iterStack[--_ITER].mIsStringIter = false; - --mIterDepth; - } - - STR.rewind(); - STR.setStringValue(StringStackPtrRef(retValue).getPtr(&STR)); // Not nice but works. - retValue = STR.getStringValuePtr(); - } - - // Previously the return value was on the stack and would be returned using STR.getStringValue(). - // Now though we need to wrap it in a ConsoleValueRef - mReturnValue.value = CSTK.pushStringStackPtr(retValue); - - return OPCodeReturn::exitCode; -} - -OPCodeReturn CodeInterpreter::op_return_flt(U32 &ip) -{ - if (mIterDepth > 0) - { - // Clear iterator state. - while (mIterDepth > 0) - { - iterStack[--_ITER].mIsStringIter = false; - --mIterDepth; - } - - } - - mReturnValue.value = CSTK.pushFLT(floatStack[_FLT]); - _FLT--; - - return OPCodeReturn::exitCode; -} - -OPCodeReturn CodeInterpreter::op_return_uint(U32 &ip) -{ - if (mIterDepth > 0) - { - // Clear iterator state. - while (mIterDepth > 0) - { - iterStack[--_ITER].mIsStringIter = false; - --mIterDepth; - } - } - - mReturnValue.value = CSTK.pushUINT(intStack[_UINT]); - _UINT--; - - return OPCodeReturn::exitCode; -} - -OPCodeReturn CodeInterpreter::op_cmpeq(U32 &ip) -{ - intStack[_UINT + 1] = bool(floatStack[_FLT] == floatStack[_FLT - 1]); - _UINT++; - _FLT -= 2; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_cmpgr(U32 &ip) -{ - intStack[_UINT + 1] = bool(floatStack[_FLT] > floatStack[_FLT - 1]); - _UINT++; - _FLT -= 2; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_cmpge(U32 &ip) -{ - intStack[_UINT + 1] = bool(floatStack[_FLT] >= floatStack[_FLT - 1]); - _UINT++; - _FLT -= 2; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_cmplt(U32 &ip) -{ - intStack[_UINT + 1] = bool(floatStack[_FLT] < floatStack[_FLT - 1]); - _UINT++; - _FLT -= 2; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_cmple(U32 &ip) -{ - intStack[_UINT + 1] = bool(floatStack[_FLT] <= floatStack[_FLT - 1]); - _UINT++; - _FLT -= 2; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_cmpne(U32 &ip) -{ - intStack[_UINT + 1] = bool(floatStack[_FLT] != floatStack[_FLT - 1]); - _UINT++; - _FLT -= 2; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_xor(U32 &ip) -{ - intStack[_UINT - 1] = intStack[_UINT] ^ intStack[_UINT - 1]; - _UINT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_mod(U32 &ip) -{ - if (intStack[_UINT - 1] != 0) - intStack[_UINT - 1] = intStack[_UINT] % intStack[_UINT - 1]; - else - intStack[_UINT - 1] = 0; - _UINT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_bitand(U32 &ip) -{ - intStack[_UINT - 1] = intStack[_UINT] & intStack[_UINT - 1]; - _UINT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_bitor(U32 &ip) -{ - intStack[_UINT - 1] = intStack[_UINT] | intStack[_UINT - 1]; - _UINT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_not(U32 &ip) -{ - intStack[_UINT] = !intStack[_UINT]; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_notf(U32 &ip) -{ - intStack[_UINT + 1] = !floatStack[_FLT]; - _FLT--; - _UINT++; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_onescomplement(U32 &ip) -{ - intStack[_UINT] = ~intStack[_UINT]; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_shr(U32 &ip) -{ - intStack[_UINT - 1] = intStack[_UINT] >> intStack[_UINT - 1]; - _UINT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_shl(U32 &ip) -{ - intStack[_UINT - 1] = intStack[_UINT] << intStack[_UINT - 1]; - _UINT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_and(U32 &ip) -{ - intStack[_UINT - 1] = intStack[_UINT] && intStack[_UINT - 1]; - _UINT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_or(U32 &ip) -{ - intStack[_UINT - 1] = intStack[_UINT] || intStack[_UINT - 1]; - _UINT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_add(U32 &ip) -{ - floatStack[_FLT - 1] = floatStack[_FLT] + floatStack[_FLT - 1]; - _FLT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_sub(U32 &ip) -{ - floatStack[_FLT - 1] = floatStack[_FLT] - floatStack[_FLT - 1]; - _FLT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_mul(U32 &ip) -{ - floatStack[_FLT - 1] = floatStack[_FLT] * floatStack[_FLT - 1]; - _FLT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_div(U32 &ip) -{ - floatStack[_FLT - 1] = floatStack[_FLT] / floatStack[_FLT - 1]; - _FLT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_neg(U32 &ip) -{ - floatStack[_FLT] = -floatStack[_FLT]; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_inc(U32 &ip) -{ - StringTableEntry var = CodeToSTE(mCodeBlock->code, ip); - ip += 2; - - // If a variable is set, then these must be NULL. It is necessary - // to set this here so that the vector parser can appropriately - // identify whether it's dealing with a vector. - mPrevField = NULL; - mPrevObject = NULL; - mCurObject = NULL; - - gEvalState.setCurVarNameCreate(var); - - // In order to let docblocks work properly with variables, we have - // clear the current docblock when we do an assign. This way it - // won't inappropriately carry forward to following function decls. - mCurFNDocBlock = NULL; - mCurNSDocBlock = NULL; - - F64 val = gEvalState.getFloatVariable() + 1.0; - gEvalState.setFloatVariable(val); - - // We gotta push val onto the stack. What if we have - // more expressions that have to use this. - // If we don't, we send out an op code to pop it. - floatStack[_FLT + 1] = val; - _FLT++; - - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_dec(U32 &ip) -{ - StringTableEntry var = CodeToSTE(mCodeBlock->code, ip); - ip += 2; - - // If a variable is set, then these must be NULL. It is necessary - // to set this here so that the vector parser can appropriately - // identify whether it's dealing with a vector. - mPrevField = NULL; - mPrevObject = NULL; - mCurObject = NULL; - - gEvalState.setCurVarNameCreate(var); - - // In order to let docblocks work properly with variables, we have - // clear the current docblock when we do an assign. This way it - // won't inappropriately carry forward to following function decls. - mCurFNDocBlock = NULL; - mCurNSDocBlock = NULL; - - F64 val = gEvalState.getFloatVariable() - 1.0; - gEvalState.setFloatVariable(val); - - // We gotta push val onto the stack. What if we have - // more expressions that have to use this. - // If we don't, we send out an op code to pop it. - floatStack[_FLT + 1] = val; - _FLT++; - - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_setcurvar(U32 &ip) -{ - StringTableEntry var = CodeToSTE(mCodeBlock->code, ip); - ip += 2; - - // If a variable is set, then these must be NULL. It is necessary - // to set this here so that the vector parser can appropriately - // identify whether it's dealing with a vector. - mPrevField = NULL; - mPrevObject = NULL; - mCurObject = NULL; - - gEvalState.setCurVarName(var); - - // In order to let docblocks work properly with variables, we have - // clear the current docblock when we do an assign. This way it - // won't inappropriately carry forward to following function decls. - mCurFNDocBlock = NULL; - mCurNSDocBlock = NULL; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_setcurvar_create(U32 &ip) -{ - StringTableEntry var = CodeToSTE(mCodeBlock->code, ip); - ip += 2; - - // See OP_SETCURVAR - mPrevField = NULL; - mPrevObject = NULL; - mCurObject = NULL; - - gEvalState.setCurVarNameCreate(var); - - // See OP_SETCURVAR for why we do this. - mCurFNDocBlock = NULL; - mCurNSDocBlock = NULL; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_setcurvar_array(U32 &ip) -{ - StringTableEntry var = STR.getSTValue(); - - // See OP_SETCURVAR - mPrevField = NULL; - mPrevObject = NULL; - mCurObject = NULL; - - gEvalState.setCurVarName(var); - - // See OP_SETCURVAR for why we do this. - mCurFNDocBlock = NULL; - mCurNSDocBlock = NULL; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_setcurvar_array_varlookup(U32 &ip) -{ - StringTableEntry arrayName = CodeToSTE(mCodeBlock->code, ip); - StringTableEntry arrayLookup = CodeToSTE(mCodeBlock->code, ip + 2); - ip += 4; - - STR.setStringValue(arrayName); - STR.advance(); - - // See OP_SETCURVAR - mPrevField = NULL; - mPrevObject = NULL; - mCurObject = NULL; - - // resolve arrayLookup to get the 'value' - // Note: we have to setCurVarNameCreate in case the var doesn't exist. - // this won't cause much of a performance hit since vars are hashed. - gEvalState.setCurVarNameCreate(arrayLookup); - StringTableEntry hash = gEvalState.getStringVariable(); - - STR.setStringValue(hash); - STR.rewind(); - - // Generate new array name. - StringTableEntry var = STR.getSTValue(); - gEvalState.setCurVarName(var); - - // See OP_SETCURVAR for why we do this. - mCurFNDocBlock = NULL; - mCurNSDocBlock = NULL; - - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_setcurvar_array_create(U32 &ip) -{ - StringTableEntry var = STR.getSTValue(); - - // See OP_SETCURVAR - mPrevField = NULL; - mPrevObject = NULL; - mCurObject = NULL; - - gEvalState.setCurVarNameCreate(var); - - // See OP_SETCURVAR for why we do this. - mCurFNDocBlock = NULL; - mCurNSDocBlock = NULL; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_setcurvar_array_create_varlookup(U32 &ip) -{ - StringTableEntry arrayName = CodeToSTE(mCodeBlock->code, ip); - StringTableEntry arrayLookup = CodeToSTE(mCodeBlock->code, ip + 2); - ip += 4; - - // See OP_SETCURVAR - mPrevField = NULL; - mPrevObject = NULL; - mCurObject = NULL; - - STR.setStringValue(arrayName); - STR.advance(); - - // resolve arrayLookup to get the 'value' - // Note: we have to setCurVarNameCreate in case the var doesn't exist. - // this won't cause much of a performance hit since vars are hashed. - gEvalState.setCurVarNameCreate(arrayLookup); - StringTableEntry hash = gEvalState.getStringVariable(); - - STR.setStringValue(hash); - STR.rewind(); - - // Generate new array name. - StringTableEntry var = STR.getSTValue(); - gEvalState.setCurVarNameCreate(var); - - // See OP_SETCURVAR for why we do this. - mCurFNDocBlock = NULL; - mCurNSDocBlock = NULL; - - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_loadvar_uint(U32 &ip) -{ - intStack[_UINT + 1] = gEvalState.getIntVariable(); - _UINT++; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_loadvar_flt(U32 &ip) -{ - floatStack[_FLT + 1] = gEvalState.getFloatVariable(); - _FLT++; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_loadvar_str(U32 &ip) -{ - StringTableEntry val = gEvalState.getStringVariable(); - STR.setStringValue(val); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_loadvar_var(U32 &ip) -{ - // Sets current source of OP_SAVEVAR_VAR - gEvalState.copyVariable = gEvalState.currentVariable; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_savevar_uint(U32 &ip) -{ - gEvalState.setIntVariable(intStack[_UINT]); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_savevar_flt(U32 &ip) -{ - gEvalState.setFloatVariable(floatStack[_FLT]); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_savevar_str(U32 &ip) -{ - gEvalState.setStringVariable(STR.getStringValue()); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_savevar_var(U32 &ip) -{ - // this basically handles %var1 = %var2 - gEvalState.setCopyVariable(); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_setcurobject(U32 &ip) -{ - // Save the previous object for parsing vector fields. - mPrevObject = mCurObject; - StringTableEntry val = STR.getStringValue(); - - // Sim::findObject will sometimes find valid objects from - // multi-component strings. This makes sure that doesn't - // happen. - for (const char* check = val; *check; check++) - { - if (*check == ' ') - { - val = ""; - break; - } - } - mCurObject = Sim::findObject(val); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_setcurobject_internal(U32 &ip) -{ - ++ip; // To skip the recurse flag if the object wasn't found - if (mCurObject) - { - SimSet *set = dynamic_cast(mCurObject); - if (set) - { - StringTableEntry intName = StringTable->insert(STR.getStringValue()); - bool recurse = mCodeBlock->code[ip - 1]; - SimObject *obj = set->findObjectByInternalName(intName, recurse); - intStack[_UINT + 1] = obj ? obj->getId() : 0; - _UINT++; - } - else - { - Con::errorf(ConsoleLogEntry::Script, "%s: Attempt to use -> on non-set %s of class %s.", mCodeBlock->getFileLine(ip - 2), mCurObject->getName(), mCurObject->getClassName()); - intStack[_UINT] = 0; - } - } - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_setcurobject_new(U32 &ip) -{ - mCurObject = mCurrentNewObject; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_setcurfield(U32 &ip) -{ - // Save the previous field for parsing vector fields. - mPrevField = mCurField; - dStrcpy(prevFieldArray, curFieldArray, 256); - mCurField = CodeToSTE(mCodeBlock->code, ip); - curFieldArray[0] = 0; - ip += 2; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_setcurfield_array(U32 &ip) -{ - dStrcpy(curFieldArray, STR.getStringValue(), 256); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_setcurfield_type(U32 &ip) -{ - if (mCurObject) - mCurObject->setDataFieldType(mCodeBlock->code[ip], mCurField, curFieldArray); - ip++; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_setcurfield_array_var(U32 &ip) -{ - StringTableEntry var = CodeToSTE(mCodeBlock->code, ip); - ip += 2; - - // We set the current var name (create it as well in case if it doesn't exist, - // otherwise we will crash). - gEvalState.setCurVarNameCreate(var); - - // Then load the var and copy the contents to the current field array - dStrncpy(curFieldArray, gEvalState.currentVariable->getStringValue(), sizeof(curFieldArray)); - - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_setcurfield_this(U32 &ip) -{ - // set the 'this pointer' as the current object. - mCurObject = mThisObject; - - mPrevField = mCurField; - dStrcpy(prevFieldArray, curFieldArray, 256); - mCurField = CodeToSTE(mCodeBlock->code, ip); - curFieldArray[0] = 0; - ip += 2; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_loadfield_uint(U32 &ip) -{ - if (mCurObject) - intStack[_UINT + 1] = U32(dAtoi(mCurObject->getDataField(mCurField, curFieldArray))); - else - { - // The field is not being retrieved from an object. Maybe it's - // a special accessor? - char buff[FieldBufferSizeNumeric]; - memset(buff, 0, sizeof(buff)); - getFieldComponent(mPrevObject, mPrevField, prevFieldArray, mCurField, buff); - intStack[_UINT + 1] = dAtoi(buff); - } - _UINT++; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_loadfield_flt(U32 &ip) -{ - if (mCurObject) - floatStack[_FLT + 1] = dAtof(mCurObject->getDataField(mCurField, curFieldArray)); - else - { - // The field is not being retrieved from an object. Maybe it's - // a special accessor? - char buff[FieldBufferSizeNumeric]; - memset(buff, 0, sizeof(buff)); - getFieldComponent(mPrevObject, mPrevField, prevFieldArray, mCurField, buff); - floatStack[_FLT + 1] = dAtof(buff); - } - _FLT++; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_loadfield_str(U32 &ip) -{ - if (mCurObject) - { - StringTableEntry val = mCurObject->getDataField(mCurField, curFieldArray); - STR.setStringValue(val); - } - else - { - // The field is not being retrieved from an object. Maybe it's - // a special accessor? - char buff[FieldBufferSizeString]; - memset(buff, 0, sizeof(buff)); - getFieldComponent(mPrevObject, mPrevField, prevFieldArray, mCurField, buff); - STR.setStringValue(buff); - } - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_savefield_uint(U32 &ip) -{ - STR.setIntValue(intStack[_UINT]); - if (mCurObject) - mCurObject->setDataField(mCurField, curFieldArray, STR.getStringValue()); - else - { - // The field is not being set on an object. Maybe it's - // a special accessor? - setFieldComponent(mPrevObject, mPrevField, prevFieldArray, mCurField); - mPrevObject = NULL; - } - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_savefield_flt(U32 &ip) -{ - STR.setFloatValue(floatStack[_FLT]); - if (mCurObject) - mCurObject->setDataField(mCurField, curFieldArray, STR.getStringValue()); - else - { - // The field is not being set on an object. Maybe it's - // a special accessor? - setFieldComponent(mPrevObject, mPrevField, prevFieldArray, mCurField); - mPrevObject = NULL; - } - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_savefield_str(U32 &ip) -{ - if (mCurObject) - mCurObject->setDataField(mCurField, curFieldArray, STR.getStringValue()); - else - { - // The field is not being set on an object. Maybe it's - // a special accessor? - setFieldComponent(mPrevObject, mPrevField, prevFieldArray, mCurField); - mPrevObject = NULL; - } - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_str_to_uint(U32 &ip) -{ - intStack[_UINT + 1] = STR.getIntValue(); - _UINT++; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_str_to_flt(U32 &ip) -{ - floatStack[_FLT + 1] = STR.getFloatValue(); - _FLT++; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_str_to_none(U32 &ip) -{ - // This exists simply to deal with certain typecast situations. - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_flt_to_uint(U32 &ip) -{ - intStack[_UINT + 1] = (S64)floatStack[_FLT]; - _FLT--; - _UINT++; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_flt_to_str(U32 &ip) -{ - STR.setFloatValue(floatStack[_FLT]); - _FLT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_flt_to_none(U32 &ip) -{ - _FLT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_uint_to_flt(U32 &ip) -{ - floatStack[_FLT + 1] = (F32)intStack[_UINT]; - _UINT--; - _FLT++; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_uint_to_str(U32 &ip) -{ - STR.setIntValue(intStack[_UINT]); - _UINT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_uint_to_none(U32 &ip) -{ - _UINT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_copyvar_to_none(U32 &ip) -{ - gEvalState.copyVariable = NULL; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_loadimmed_uint(U32 &ip) -{ - intStack[_UINT + 1] = mCodeBlock->code[ip++]; - _UINT++; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_loadimmed_flt(U32 &ip) -{ - floatStack[_FLT + 1] = mCurFloatTable[mCodeBlock->code[ip]]; - ip++; - _FLT++; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_tag_to_str(U32 &ip) -{ - mCodeBlock->code[ip - 1] = OP_LOADIMMED_STR; - // it's possible the string has already been converted - if (U8(mCurStringTable[mCodeBlock->code[ip]]) != StringTagPrefixByte) - { - U32 id = GameAddTaggedString(mCurStringTable + mCodeBlock->code[ip]); - dSprintf(mCurStringTable + mCodeBlock->code[ip] + 1, 7, "%d", id); - *(mCurStringTable + mCodeBlock->code[ip]) = StringTagPrefixByte; - } - - // Fallthrough - OPCodeReturn ret = op_loadimmed_str(ip); - - return ret; -} - -OPCodeReturn CodeInterpreter::op_loadimmed_str(U32 &ip) -{ - STR.setStringValue(mCurStringTable + mCodeBlock->code[ip++]); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_docblock_str(U32 &ip) -{ - // If the first word of the doc is '\class' or '@class', then this - // is a namespace doc block, otherwise it is a function doc block. - const char* docblock = mCurStringTable + mCodeBlock->code[ip++]; - - const char* sansClass = dStrstr(docblock, "@class"); - if (!sansClass) - sansClass = dStrstr(docblock, "\\class"); - - if (sansClass) - { - // Don't save the class declaration. Scan past the 'class' - // keyword and up to the first whitespace. - sansClass += 7; - S32 index = 0; - while ((*sansClass != ' ') && (*sansClass != '\n') && *sansClass && (index < (nsDocLength - 1))) - { - mNSDocBlockClass[index++] = *sansClass; - sansClass++; - } - mNSDocBlockClass[index] = '\0'; - - mCurNSDocBlock = sansClass + 1; - } - else - mCurFNDocBlock = docblock; - - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_loadimmed_ident(U32 &ip) -{ - STR.setStringValue(CodeToSTE(mCodeBlock->code, ip)); - ip += 2; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_callfunc_resolve(U32 &ip) -{ - // This deals with a function that is potentially living in a namespace. - StringTableEntry fnNamespace = CodeToSTE(mCodeBlock->code, ip + 2); - StringTableEntry fnName = CodeToSTE(mCodeBlock->code, ip); - - // Try to look it up. - mNSEntry = Namespace::find(fnNamespace)->lookup(fnName); - if (!CInterface::GetCInterface().isMethod(fnNamespace, fnName) && !mNSEntry) - { - ip += 5; - Con::warnf(ConsoleLogEntry::General, - "%s: Unable to find function %s%s%s", - mCodeBlock->getFileLine(ip - 7), fnNamespace ? fnNamespace : "", - fnNamespace ? "::" : "", fnName); - STR.popFrame(); - CSTK.popFrame(); - return OPCodeReturn::success; - } - - // Fallthrough to op_callfunc_resolve - OPCodeReturn ret = op_callfunc(ip); - - return ret; -} - -OPCodeReturn CodeInterpreter::op_callfunc(U32 &ip) -{ - // This routingId is set when we query the object as to whether - // it handles this method. It is set to an enum from the table - // above indicating whether it handles it on a component it owns - // or just on the object. - S32 routingId = 0; - - U32 *code = mCodeBlock->code; - - StringTableEntry fnNamespace = CodeToSTE(mCodeBlock->code, ip + 2); - StringTableEntry fnName = CodeToSTE(code, ip); - - //if this is called from inside a function, append the ip and codeptr - if (gEvalState.getStackDepth() > 0) - { - gEvalState.getCurrentFrame().code = mCodeBlock; - gEvalState.getCurrentFrame().ip = ip - 1; - } - - U32 callType = code[ip + 4]; - - ip += 5; - CSTK.getArgcArgv(fnName, &mCallArgc, &mCallArgv); - - const char *componentReturnValue = ""; - Namespace *ns = NULL; - - bool cFunctionRes = false; - const char* cRetRes = NULL; - - if (callType == FuncCallExprNode::FunctionCall) - { - if (!mNSEntry) - mNSEntry = Namespace::global()->lookup(fnName); - - StringStackWrapper args(mCallArgc, mCallArgv); - cRetRes = CInterface::CallFunction(fnNamespace, fnName, args.argv + 1, args.argc - 1, &cFunctionRes); - } - else if (callType == FuncCallExprNode::MethodCall) - { - mSaveObject = gEvalState.thisObject; - gEvalState.thisObject = Sim::findObject((const char*)mCallArgv[1]); - if (!gEvalState.thisObject) - { - // Go back to the previous saved object. - gEvalState.thisObject = mSaveObject; - - Con::warnf(ConsoleLogEntry::General, "%s: Unable to find object: '%s' attempting to call function '%s'", mCodeBlock->getFileLine(ip - 4), (const char*)mCallArgv[1], fnName); - STR.popFrame(); - CSTK.popFrame(); - STR.setStringValue(""); - return OPCodeReturn::success; - } - - bool handlesMethod = gEvalState.thisObject->handlesConsoleMethod(fnName, &routingId); - if (handlesMethod && routingId == MethodOnComponent) - { - ICallMethod *pComponent = dynamic_cast(gEvalState.thisObject); - if (pComponent) - componentReturnValue = pComponent->callMethodArgList(mCallArgc, mCallArgv, false); - } - - ns = gEvalState.thisObject->getNamespace(); - if (ns) - mNSEntry = ns->lookup(fnName); - else - mNSEntry = NULL; - - StringStackWrapper args(mCallArgc, mCallArgv); - cRetRes = CInterface::CallMethod(gEvalState.thisObject, fnName, args.argv + 2, args.argc - 2, &cFunctionRes); - } - else // it's a ParentCall - { - if (mExec.thisNamespace) - { - ns = mExec.thisNamespace->mParent; - if (ns) - mNSEntry = ns->lookup(fnName); - else - mNSEntry = NULL; - } - else - { - ns = NULL; - mNSEntry = NULL; - } - } - - Namespace::Entry::CallbackUnion * nsCb = NULL; - const char * nsUsage = NULL; - if (mNSEntry) - { - nsCb = &mNSEntry->cb; - nsUsage = mNSEntry->mUsage; - routingId = 0; - } - if (!cFunctionRes && (!mNSEntry || mExec.noCalls)) - { - if (!mExec.noCalls && !(routingId == MethodOnComponent)) - { - if (callType == FuncCallExprNode::MethodCall) - { - if (gEvalState.thisObject != NULL) - { - // Try to use the name instead of the id - StringTableEntry name = gEvalState.thisObject->getName() ? gEvalState.thisObject->getName() : gEvalState.thisObject->getIdString(); - Con::warnf(ConsoleLogEntry::General, "%s: Unknown method %s.%s Namespace List: %s", mCodeBlock->getFileLine(ip - 6), name, fnName, Con::getNamespaceList(ns)); - } - else - { - // NULL. - Con::warnf(ConsoleLogEntry::General, "%s: Unknown method NULL.%s", mCodeBlock->getFileLine(ip - 6), fnName); - } - } - else if (callType == FuncCallExprNode::ParentCall) - { - Con::warnf(ConsoleLogEntry::General, "%s: Unknown parent call %s.", mCodeBlock->getFileLine(ip - 6), fnName); - } - else - { - Con::warnf(ConsoleLogEntry::General, "%s: Unknown function %s.", mCodeBlock->getFileLine(ip - 6), fnName); - } - } - STR.popFrame(); - CSTK.popFrame(); - - if (routingId == MethodOnComponent) - STR.setStringValue(componentReturnValue); - else - STR.setStringValue(""); - return OPCodeReturn::success; - } - - // ConsoleFunctionType is for any function defined by script. - // Any 'callback' type is an engine function that is exposed to script. - if (cFunctionRes || mNSEntry->mType == Namespace::Entry::ConsoleFunctionType) - { - ConsoleValue retVal; - ConsoleValueRef ret; - if (cFunctionRes) - { - retVal.init(); - ret.value = &retVal; - retVal.setStackStringValue(cRetRes); - } - else if (mNSEntry->mFunctionOffset) - { - ret = mNSEntry->mCode->exec(mNSEntry->mFunctionOffset, fnName, mNSEntry->mNamespace, mCallArgc, mCallArgv, false, mNSEntry->mPackage); - } - - STR.popFrame(); - // Functions are assumed to return strings, so look ahead to see if we can skip the conversion - if (code[ip] == OP_STR_TO_UINT) - { - ip++; - intStack[++_UINT] = (U32)((S32)ret); - } - else if (code[ip] == OP_STR_TO_FLT) - { - ip++; - floatStack[++_FLT] = (F32)ret; - } - else if (code[ip] == OP_STR_TO_NONE) - { - STR.setStringValue(ret.getStringValue()); - ip++; - } - else - STR.setStringValue((const char*)ret); - - // This will clear everything including returnValue - CSTK.popFrame(); - //STR.clearFunctionOffset(); - } - else - { - const char* nsName = ns ? ns->mName : ""; -#ifndef TORQUE_DEBUG - // [tom, 12/13/2006] This stops tools functions from working in the console, - // which is useful behavior when debugging so I'm ifdefing this out for debug builds. - if (mNSEntry->mToolOnly && !Con::isCurrentScriptToolScript()) - { - Con::errorf(ConsoleLogEntry::Script, "%s: %s::%s - attempting to call tools only function from outside of tools.", mCodeBlock->getFileLine(ip - 6), nsName, fnName); - } - else -#endif - if ((mNSEntry->mMinArgs && S32(mCallArgc) < mNSEntry->mMinArgs) || (mNSEntry->mMaxArgs && S32(mCallArgc) > mNSEntry->mMaxArgs)) - { - Con::warnf(ConsoleLogEntry::Script, "%s: %s::%s - wrong number of arguments (got %i, expected min %i and max %i).", - mCodeBlock->getFileLine(ip - 6), nsName, fnName, - mCallArgc, mNSEntry->mMinArgs, mNSEntry->mMaxArgs); - Con::warnf(ConsoleLogEntry::Script, "%s: usage: %s", mCodeBlock->getFileLine(ip - 6), mNSEntry->mUsage); - STR.popFrame(); - CSTK.popFrame(); - } - else - { - switch (mNSEntry->mType) - { - case Namespace::Entry::StringCallbackType: - { - const char *ret = mNSEntry->cb.mStringCallbackFunc(gEvalState.thisObject, mCallArgc, mCallArgv); - STR.popFrame(); - CSTK.popFrame(); - if (ret != STR.getStringValue()) - STR.setStringValue(ret); - //else - // sSTR.setLen(dStrlen(ret)); - break; - } - case Namespace::Entry::IntCallbackType: - { - S32 result = mNSEntry->cb.mIntCallbackFunc(gEvalState.thisObject, mCallArgc, mCallArgv); - STR.popFrame(); - CSTK.popFrame(); - if (code[ip] == OP_STR_TO_UINT) - { - ip++; - intStack[++_UINT] = result; - break; - } - else if (code[ip] == OP_STR_TO_FLT) - { - ip++; - floatStack[++_FLT] = result; - break; - } - else if (code[ip] == OP_STR_TO_NONE) - ip++; - else - STR.setIntValue(result); - break; - } - case Namespace::Entry::FloatCallbackType: - { - F64 result = mNSEntry->cb.mFloatCallbackFunc(gEvalState.thisObject, mCallArgc, mCallArgv); - STR.popFrame(); - CSTK.popFrame(); - if (code[ip] == OP_STR_TO_UINT) - { - ip++; - intStack[++_UINT] = (S64)result; - break; - } - else if (code[ip] == OP_STR_TO_FLT) - { - ip++; - floatStack[++_FLT] = result; - break; - } - else if (code[ip] == OP_STR_TO_NONE) - ip++; - else - STR.setFloatValue(result); - break; - } - case Namespace::Entry::VoidCallbackType: - mNSEntry->cb.mVoidCallbackFunc(gEvalState.thisObject, mCallArgc, mCallArgv); - if (code[ip] != OP_STR_TO_NONE && Con::getBoolVariable("$Con::warnVoidAssignment", true)) - Con::warnf(ConsoleLogEntry::General, "%s: Call to %s in %s uses result of void function call.", mCodeBlock->getFileLine(ip - 6), fnName, mExec.functionName); - - STR.popFrame(); - CSTK.popFrame(); - STR.setStringValue(""); - break; - case Namespace::Entry::BoolCallbackType: - { - bool result = mNSEntry->cb.mBoolCallbackFunc(gEvalState.thisObject, mCallArgc, mCallArgv); - STR.popFrame(); - CSTK.popFrame(); - if (code[ip] == OP_STR_TO_UINT) - { - ip++; - intStack[++_UINT] = result; - break; - } - else if (code[ip] == OP_STR_TO_FLT) - { - ip++; - floatStack[++_FLT] = result; - break; - } - else if (code[ip] == OP_STR_TO_NONE) - ip++; - else - STR.setIntValue(result); - break; - } - } - } - } - - if (callType == FuncCallExprNode::MethodCall) - gEvalState.thisObject = mSaveObject; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_callfunc_pointer(U32 &ip) -{ - // get function name. This is the 'function pointer'. - StringTableEntry fnName = StringTable->insert(STR.getStringValue()); - - U32 *code = mCodeBlock->code; - - mNSEntry = Namespace::global()->lookup(fnName); - - //if this is called from inside a function, append the ip and codeptr - if (gEvalState.getStackDepth() > 0) - { - gEvalState.getCurrentFrame().code = mCodeBlock; - gEvalState.getCurrentFrame().ip = ip - 1; - } - - CSTK.getArgcArgv(fnName, &mCallArgc, &mCallArgv); - - - if (!mNSEntry || mExec.noCalls) - { - if (!mExec.noCalls) - { - Con::warnf(ConsoleLogEntry::General, "%s: Unknown function %s.", mCodeBlock->getFileLine(ip - 6), fnName); - } - STR.popFrame(); - CSTK.popFrame(); - - STR.setStringValue(""); - return OPCodeReturn::success; - } - - // ConsoleFunctionType is for any function defined by script. - // Any 'callback' type is an engine function that is exposed to script. - if (mNSEntry->mType == Namespace::Entry::ConsoleFunctionType) - { - ConsoleValueRef ret; - if (mNSEntry->mFunctionOffset) - ret = mNSEntry->mCode->exec(mNSEntry->mFunctionOffset, fnName, mNSEntry->mNamespace, mCallArgc, mCallArgv, false, mNSEntry->mPackage); - - STR.popFrame(); - // Functions are assumed to return strings, so look ahead to see if we can skip the conversion - if (code[ip] == OP_STR_TO_UINT) - { - ip++; - intStack[++_UINT] = (U32)((S32)ret); - } - else if (code[ip] == OP_STR_TO_FLT) - { - ip++; - floatStack[++_FLT] = (F32)ret; - } - else if (code[ip] == OP_STR_TO_NONE) - { - STR.setStringValue(ret.getStringValue()); - ip++; - } - else - STR.setStringValue((const char*)ret); - - // This will clear everything including returnValue - CSTK.popFrame(); - //STR.clearFunctionOffset(); - } - else - { - const char* nsName = ""; - -#ifndef TORQUE_DEBUG - // [tom, 12/13/2006] This stops tools functions from working in the console, - // which is useful behavior when debugging so I'm ifdefing this out for debug builds. - if (mNSEntry->mToolOnly && !Con::isCurrentScriptToolScript()) - { - Con::errorf(ConsoleLogEntry::Script, "%s: %s::%s - attempting to call tools only function from outside of tools.", mCodeBlock->getFileLine(ip - 6), nsName, fnName); - } - else -#endif - if ((mNSEntry->mMinArgs && S32(mCallArgc) < mNSEntry->mMinArgs) || (mNSEntry->mMaxArgs && S32(mCallArgc) > mNSEntry->mMaxArgs)) - { - Con::warnf(ConsoleLogEntry::Script, "%s: %s::%s - wrong number of arguments (got %i, expected min %i and max %i).", - mCodeBlock->getFileLine(ip - 6), nsName, fnName, - mCallArgc, mNSEntry->mMinArgs, mNSEntry->mMaxArgs); - Con::warnf(ConsoleLogEntry::Script, "%s: usage: %s", mCodeBlock->getFileLine(ip - 6), mNSEntry->mUsage); - STR.popFrame(); - CSTK.popFrame(); - } - else - { - switch (mNSEntry->mType) - { - case Namespace::Entry::StringCallbackType: - { - const char *ret = mNSEntry->cb.mStringCallbackFunc(gEvalState.thisObject, mCallArgc, mCallArgv); - STR.popFrame(); - CSTK.popFrame(); - if (ret != STR.getStringValue()) - STR.setStringValue(ret); - //else - // sSTR.setLen(dStrlen(ret)); - break; - } - case Namespace::Entry::IntCallbackType: - { - S32 result = mNSEntry->cb.mIntCallbackFunc(gEvalState.thisObject, mCallArgc, mCallArgv); - STR.popFrame(); - CSTK.popFrame(); - if (code[ip] == OP_STR_TO_UINT) - { - ip++; - intStack[++_UINT] = result; - break; - } - else if (code[ip] == OP_STR_TO_FLT) - { - ip++; - floatStack[++_FLT] = result; - break; - } - else if (code[ip] == OP_STR_TO_NONE) - ip++; - else - STR.setIntValue(result); - break; - } - case Namespace::Entry::FloatCallbackType: - { - F64 result = mNSEntry->cb.mFloatCallbackFunc(gEvalState.thisObject, mCallArgc, mCallArgv); - STR.popFrame(); - CSTK.popFrame(); - if (code[ip] == OP_STR_TO_UINT) - { - ip++; - intStack[++_UINT] = (S64)result; - break; - } - else if (code[ip] == OP_STR_TO_FLT) - { - ip++; - floatStack[++_FLT] = result; - break; - } - else if (code[ip] == OP_STR_TO_NONE) - ip++; - else - STR.setFloatValue(result); - break; - } - case Namespace::Entry::VoidCallbackType: - mNSEntry->cb.mVoidCallbackFunc(gEvalState.thisObject, mCallArgc, mCallArgv); - if (code[ip] != OP_STR_TO_NONE && Con::getBoolVariable("$Con::warnVoidAssignment", true)) - Con::warnf(ConsoleLogEntry::General, "%s: Call to %s in %s uses result of void function call.", mCodeBlock->getFileLine(ip - 6), fnName, mExec.functionName); - - STR.popFrame(); - CSTK.popFrame(); - STR.setStringValue(""); - break; - case Namespace::Entry::BoolCallbackType: - { - bool result = mNSEntry->cb.mBoolCallbackFunc(gEvalState.thisObject, mCallArgc, mCallArgv); - STR.popFrame(); - CSTK.popFrame(); - if (code[ip] == OP_STR_TO_UINT) - { - ip++; - intStack[++_UINT] = result; - break; - } - else if (code[ip] == OP_STR_TO_FLT) - { - ip++; - floatStack[++_FLT] = result; - break; - } - else if (code[ip] == OP_STR_TO_NONE) - ip++; - else - STR.setIntValue(result); - break; - } - } - } - } - - - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_callfunc_this(U32 &ip) -{ - U32 *code = mCodeBlock->code; - - StringTableEntry fnName = CodeToSTE(code, ip); - - //if this is called from inside a function, append the ip and codeptr - if (gEvalState.getStackDepth() > 0) - { - gEvalState.getCurrentFrame().code = mCodeBlock; - gEvalState.getCurrentFrame().ip = ip - 1; - } - - ip += 2; - CSTK.getArgcArgv(fnName, &mCallArgc, &mCallArgv); - - Namespace *ns = mThisObject ? mThisObject->getNamespace() : NULL; - if (ns) - mNSEntry = ns->lookup(fnName); - else - mNSEntry = NULL; - - if (!mNSEntry || mExec.noCalls) - { - if (!mExec.noCalls) - { - if (mThisObject) - { - // Try to use the name instead of the id - StringTableEntry name = mThisObject->getName() ? mThisObject->getName() : mThisObject->getIdString(); - Con::warnf(ConsoleLogEntry::General, "%s: Unknown method %s.%s Namespace List: %s", mCodeBlock->getFileLine(ip - 6), name, fnName, Con::getNamespaceList(ns)); - } - else - { - // At least let the scripter know that they access the object. - Con::warnf(ConsoleLogEntry::General, "%s: Unknown method NULL.%s", mCodeBlock->getFileLine(ip - 6), fnName); - } - } - STR.popFrame(); - CSTK.popFrame(); - - STR.setStringValue(""); - return OPCodeReturn::success; - } - - // ConsoleFunctionType is for any function defined by script. - // Any 'callback' type is an engine function that is exposed to script. - if (mNSEntry->mType == Namespace::Entry::ConsoleFunctionType) - { - ConsoleValueRef ret; - if (mNSEntry->mFunctionOffset) - ret = mNSEntry->mCode->exec(mNSEntry->mFunctionOffset, fnName, mNSEntry->mNamespace, mCallArgc, mCallArgv, false, mNSEntry->mPackage); - - STR.popFrame(); - // Functions are assumed to return strings, so look ahead to see if we can skip the conversion - if (code[ip] == OP_STR_TO_UINT) - { - ip++; - intStack[++_UINT] = (U32)((S32)ret); - } - else if (code[ip] == OP_STR_TO_FLT) - { - ip++; - floatStack[++_FLT] = (F32)ret; - } - else if (code[ip] == OP_STR_TO_NONE) - { - STR.setStringValue(ret.getStringValue()); - ip++; - } - else - STR.setStringValue((const char*)ret); - - // This will clear everything including returnValue - CSTK.popFrame(); - //STR.clearFunctionOffset(); - } - else - { - const char* nsName = ns ? ns->mName : ""; -#ifndef TORQUE_DEBUG - // [tom, 12/13/2006] This stops tools functions from working in the console, - // which is useful behavior when debugging so I'm ifdefing this out for debug builds. - if (mNSEntry->mToolOnly && !Con::isCurrentScriptToolScript()) - { - Con::errorf(ConsoleLogEntry::Script, "%s: %s::%s - attempting to call tools only function from outside of tools.", mCodeBlock->getFileLine(ip - 6), nsName, fnName); - } - else -#endif - if ((mNSEntry->mMinArgs && S32(mCallArgc) < mNSEntry->mMinArgs) || (mNSEntry->mMaxArgs && S32(mCallArgc) > mNSEntry->mMaxArgs)) - { - Con::warnf(ConsoleLogEntry::Script, "%s: %s::%s - wrong number of arguments (got %i, expected min %i and max %i).", - mCodeBlock->getFileLine(ip - 6), nsName, fnName, - mCallArgc, mNSEntry->mMinArgs, mNSEntry->mMaxArgs); - Con::warnf(ConsoleLogEntry::Script, "%s: usage: %s", mCodeBlock->getFileLine(ip - 6), mNSEntry->mUsage); - STR.popFrame(); - CSTK.popFrame(); - } - else - { - switch (mNSEntry->mType) - { - case Namespace::Entry::StringCallbackType: - { - const char *ret = mNSEntry->cb.mStringCallbackFunc(mThisObject, mCallArgc, mCallArgv); - STR.popFrame(); - CSTK.popFrame(); - if (ret != STR.getStringValue()) - STR.setStringValue(ret); - //else - // sSTR.setLen(dStrlen(ret)); - break; - } - case Namespace::Entry::IntCallbackType: - { - S32 result = mNSEntry->cb.mIntCallbackFunc(mThisObject, mCallArgc, mCallArgv); - STR.popFrame(); - CSTK.popFrame(); - if (code[ip] == OP_STR_TO_UINT) - { - ip++; - intStack[++_UINT] = result; - break; - } - else if (code[ip] == OP_STR_TO_FLT) - { - ip++; - floatStack[++_FLT] = result; - break; - } - else if (code[ip] == OP_STR_TO_NONE) - ip++; - else - STR.setIntValue(result); - break; - } - case Namespace::Entry::FloatCallbackType: - { - F64 result = mNSEntry->cb.mFloatCallbackFunc(mThisObject, mCallArgc, mCallArgv); - STR.popFrame(); - CSTK.popFrame(); - if (code[ip] == OP_STR_TO_UINT) - { - ip++; - intStack[++_UINT] = (S64)result; - break; - } - else if (code[ip] == OP_STR_TO_FLT) - { - ip++; - floatStack[++_FLT] = result; - break; - } - else if (code[ip] == OP_STR_TO_NONE) - ip++; - else - STR.setFloatValue(result); - break; - } - case Namespace::Entry::VoidCallbackType: - mNSEntry->cb.mVoidCallbackFunc(mThisObject, mCallArgc, mCallArgv); - if (code[ip] != OP_STR_TO_NONE && Con::getBoolVariable("$Con::warnVoidAssignment", true)) - Con::warnf(ConsoleLogEntry::General, "%s: Call to %s in %s uses result of void function call.", mCodeBlock->getFileLine(ip - 6), fnName, mExec.functionName); - - STR.popFrame(); - CSTK.popFrame(); - STR.setStringValue(""); - break; - case Namespace::Entry::BoolCallbackType: - { - bool result = mNSEntry->cb.mBoolCallbackFunc(mThisObject, mCallArgc, mCallArgv); - STR.popFrame(); - CSTK.popFrame(); - if (code[ip] == OP_STR_TO_UINT) - { - ip++; - intStack[++_UINT] = result; - break; - } - else if (code[ip] == OP_STR_TO_FLT) - { - ip++; - floatStack[++_FLT] = result; - break; - } - else if (code[ip] == OP_STR_TO_NONE) - ip++; - else - STR.setIntValue(result); - break; - } - } - } - } - - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_advance_str(U32 &ip) -{ - STR.advance(); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_advance_str_appendchar(U32 &ip) -{ - STR.advanceChar(mCodeBlock->code[ip++]); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_advance_str_comma(U32 &ip) -{ - STR.advanceChar('_'); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_advance_str_nul(U32 &ip) -{ - STR.advanceChar(0); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_rewind_str(U32 &ip) -{ - STR.rewind(); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_terminate_rewind_str(U32 &ip) -{ - STR.rewindTerminate(); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_compare_str(U32 &ip) -{ - intStack[++_UINT] = STR.compare(); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_push(U32 &ip) -{ - STR.push(); - CSTK.pushStringStackPtr(STR.getPreviousStringValuePtr()); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_push_uint(U32 &ip) -{ - CSTK.pushUINT(intStack[_UINT]); - _UINT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_push_flt(U32 &ip) -{ - CSTK.pushFLT(floatStack[_FLT]); - _FLT--; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_push_var(U32 &ip) -{ - if (gEvalState.currentVariable) - CSTK.pushValue(gEvalState.currentVariable->value); - else - CSTK.pushString(""); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_push_this(U32 &ip) -{ - StringTableEntry varName = CodeToSTE(mCodeBlock->code, ip); - ip += 2; - - // shorthand OP_SETCURVAR - - // If a variable is set, then these must be NULL. It is necessary - // to set this here so that the vector parser can appropriately - // identify whether it's dealing with a vector. - mPrevField = NULL; - mPrevObject = NULL; - mCurObject = NULL; - - gEvalState.setCurVarName(varName); - - // In order to let docblocks work properly with variables, we have - // clear the current docblock when we do an assign. This way it - // won't inappropriately carry forward to following function decls. - mCurFNDocBlock = NULL; - mCurNSDocBlock = NULL; - - // shorthand OP_LOADVAR_STR (since objs can be by name we can't assume uint) - STR.setStringValue(gEvalState.getStringVariable()); - - // shorthand OP_PUSH - STR.push(); - CSTK.pushStringStackPtr(STR.getPreviousStringValuePtr()); - - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_push_frame(U32 &ip) -{ - STR.pushFrame(); - CSTK.pushFrame(); - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_assert(U32 &ip) -{ - if (!intStack[_UINT--]) - { - const char *message = mCurStringTable + mCodeBlock->code[ip]; - - U32 breakLine, inst; - mCodeBlock->findBreakLine(ip - 1, breakLine, inst); - - if (PlatformAssert::processAssert(PlatformAssert::Fatal, - mCodeBlock->name ? mCodeBlock->name : "eval", - breakLine, - message)) - { - if (TelDebugger && TelDebugger->isConnected() && breakLine > 0) - { - TelDebugger->breakProcess(); - } - else - Platform::debugBreak(); - } - } - - ip++; - - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_break(U32 &ip) -{ - //append the ip and codeptr before managing the breakpoint! - AssertFatal(gEvalState.getStackDepth() > 0, "Empty eval stack on break!"); - gEvalState.getCurrentFrame().code = mCodeBlock; - gEvalState.getCurrentFrame().ip = ip - 1; - - U32 breakLine; - mCodeBlock->findBreakLine(ip - 1, breakLine, mCurrentInstruction); - if (!breakLine) - return OPCodeReturn::breakContinue; - TelDebugger->executionStopped(mCodeBlock, breakLine); - return OPCodeReturn::breakContinue; -} - -OPCodeReturn CodeInterpreter::op_iter_begin_str(U32 &ip) -{ - iterStack[_ITER].mIsStringIter = true; - - // Emulate fallthrough: - OPCodeReturn fallthrough = op_iter_begin(ip); - - return fallthrough; -} - -OPCodeReturn CodeInterpreter::op_iter_begin(U32 &ip) -{ - StringTableEntry varName = CodeToSTE(mCodeBlock->code, ip); - U32 failIp = mCodeBlock->code[ip + 2]; - - IterStackRecord& iter = iterStack[_ITER]; - - if (varName[0] == '$') - iter.mVariable = gEvalState.globalVars.add(varName); - else - iter.mVariable = gEvalState.getCurrentFrame().add(varName); - - if (iter.mIsStringIter) - { - iter.mData.mStr.mString = STR.getStringValuePtr(); - iter.mData.mStr.mIndex = 0; - } - else - { - // Look up the object. - - SimSet* set; - if (!Sim::findObject(STR.getStringValue(), set)) - { - Con::errorf(ConsoleLogEntry::General, "No SimSet object '%s'", STR.getStringValue()); - Con::errorf(ConsoleLogEntry::General, "Did you mean to use 'foreach$' instead of 'foreach'?"); - ip = failIp; - return OPCodeReturn::success; - } - - // Set up. - - iter.mData.mObj.mSet = set; - iter.mData.mObj.mIndex = 0; - } - - _ITER++; - mIterDepth++; - - STR.push(); - - ip += 3; - - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_iter(U32 &ip) -{ - U32 breakIp = mCodeBlock->code[ip]; - IterStackRecord& iter = iterStack[_ITER - 1]; - - if (iter.mIsStringIter) - { - const char* str = StringStackPtrRef(iter.mData.mStr.mString).getPtr(&STR); - - U32 startIndex = iter.mData.mStr.mIndex; - U32 endIndex = startIndex; - - // Break if at end. - - if (!str[startIndex]) - { - ip = breakIp; - return OPCodeReturn::success; // continue in old interpreter - } - - // Find right end of current component. - - if (!dIsspace(str[endIndex])) - do ++endIndex; - while (str[endIndex] && !dIsspace(str[endIndex])); - - // Extract component. - - if (endIndex != startIndex) - { - char savedChar = str[endIndex]; - const_cast< char* >(str)[endIndex] = '\0'; // We are on the string stack so this is okay. - iter.mVariable->setStringValue(&str[startIndex]); - const_cast< char* >(str)[endIndex] = savedChar; - } - else - iter.mVariable->setStringValue(""); - - // Skip separator. - if (str[endIndex] != '\0') - ++endIndex; - - iter.mData.mStr.mIndex = endIndex; - } - else - { - U32 index = iter.mData.mObj.mIndex; - SimSet* set = iter.mData.mObj.mSet; - - if (index >= set->size()) - { - ip = breakIp; - return OPCodeReturn::success; // continue in old interpreter - } - - iter.mVariable->setIntValue(set->at(index)->getId()); - iter.mData.mObj.mIndex = index + 1; - } - - ++ip; - - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_iter_end(U32 &ip) -{ - --_ITER; - --mIterDepth; - STR.rewind(); - iterStack[_ITER].mIsStringIter = false; - return OPCodeReturn::success; -} - -OPCodeReturn CodeInterpreter::op_invalid(U32 &ip) -{ - // Invalid does nothing. - return OPCodeReturn::exitCode; -} diff --git a/Engine/source/console/codeInterpreter.h b/Engine/source/console/codeInterpreter.h deleted file mode 100644 index 133222726..000000000 --- a/Engine/source/console/codeInterpreter.h +++ /dev/null @@ -1,262 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#ifndef _CODEINTERPRETER_H_ -#define _CODEINTERPRETER_H_ - -#include "console/codeBlock.h" -#include "console/console.h" -#include "console/consoleInternal.h" - -/// Frame data for a foreach/foreach$ loop. -struct IterStackRecord -{ - /// If true, this is a foreach$ loop; if not, it's a foreach loop. - bool mIsStringIter; - - /// The iterator variable. - Dictionary::Entry* mVariable; - - /// Information for an object iterator loop. - struct ObjectPos - { - /// The set being iterated over. - SimSet* mSet; - - /// Current index in the set. - U32 mIndex; - }; - - /// Information for a string iterator loop. - struct StringPos - { - /// The raw string data on the string stack. - StringStackPtr mString; - - /// Current parsing position. - U32 mIndex; - }; - - union - { - ObjectPos mObj; - StringPos mStr; - } mData; -}; - -enum OPCodeReturn -{ - exitCode = -1, - success = 0, - breakContinue = 1 -}; - -class CodeInterpreter -{ -public: - CodeInterpreter(CodeBlock *cb); - ~CodeInterpreter(); - - ConsoleValueRef exec(U32 ip, - StringTableEntry functionName, - Namespace *thisNamespace, - U32 argc, - ConsoleValueRef *argv, - bool noCalls, - StringTableEntry packageName, - S32 setFrame); - - static void init(); - - // Methods -private: - void parseArgs(U32 &ip); - - /// Group op codes - /// @{ - - OPCodeReturn op_func_decl(U32 &ip); - OPCodeReturn op_create_object(U32 &ip); - OPCodeReturn op_add_object(U32 &ip); - OPCodeReturn op_end_object(U32 &ip); - OPCodeReturn op_finish_object(U32 &ip); - OPCodeReturn op_jmpiffnot(U32 &ip); - OPCodeReturn op_jmpifnot(U32 &ip); - OPCodeReturn op_jmpiff(U32 &ip); - OPCodeReturn op_jmpif(U32 &ip); - OPCodeReturn op_jmpifnot_np(U32 &ip); - OPCodeReturn op_jmpif_np(U32 &ip); - OPCodeReturn op_jmp(U32 &ip); - OPCodeReturn op_return_void(U32 &ip); - OPCodeReturn op_return(U32 &ip); - OPCodeReturn op_return_flt(U32 &ip); - OPCodeReturn op_return_uint(U32 &ip); - OPCodeReturn op_cmpeq(U32 &ip); - OPCodeReturn op_cmpgr(U32 &ip); - OPCodeReturn op_cmpge(U32 &ip); - OPCodeReturn op_cmplt(U32 &ip); - OPCodeReturn op_cmple(U32 &ip); - OPCodeReturn op_cmpne(U32 &ip); - OPCodeReturn op_xor(U32 &ip); - OPCodeReturn op_mod(U32 &ip); - OPCodeReturn op_bitand(U32 &ip); - OPCodeReturn op_bitor(U32 &ip); - OPCodeReturn op_not(U32 &ip); - OPCodeReturn op_notf(U32 &ip); - OPCodeReturn op_onescomplement(U32 &ip); - OPCodeReturn op_shr(U32 &ip); - OPCodeReturn op_shl(U32 &ip); - OPCodeReturn op_and(U32 &ip); - OPCodeReturn op_or(U32 &ip); - OPCodeReturn op_add(U32 &ip); - OPCodeReturn op_sub(U32 &ip); - OPCodeReturn op_mul(U32 &ip); - OPCodeReturn op_div(U32 &ip); - OPCodeReturn op_neg(U32 &ip); - OPCodeReturn op_inc(U32 &ip); - OPCodeReturn op_dec(U32 &ip); - OPCodeReturn op_setcurvar(U32 &ip); - OPCodeReturn op_setcurvar_create(U32 &ip); - OPCodeReturn op_setcurvar_array(U32 &ip); - OPCodeReturn op_setcurvar_array_varlookup(U32 &ip); - OPCodeReturn op_setcurvar_array_create(U32 &ip); - OPCodeReturn op_setcurvar_array_create_varlookup(U32 &ip); - OPCodeReturn op_loadvar_uint(U32 &ip); - OPCodeReturn op_loadvar_flt(U32 &ip); - OPCodeReturn op_loadvar_str(U32 &ip); - OPCodeReturn op_loadvar_var(U32 &ip); - OPCodeReturn op_savevar_uint(U32 &ip); - OPCodeReturn op_savevar_flt(U32 &ip); - OPCodeReturn op_savevar_str(U32 &ip); - OPCodeReturn op_savevar_var(U32 &ip); - OPCodeReturn op_setcurobject(U32 &ip); - OPCodeReturn op_setcurobject_internal(U32 &ip); - OPCodeReturn op_setcurobject_new(U32 &ip); - OPCodeReturn op_setcurfield(U32 &ip); - OPCodeReturn op_setcurfield_array(U32 &ip); - OPCodeReturn op_setcurfield_type(U32 &ip); - OPCodeReturn op_setcurfield_this(U32 &ip); - OPCodeReturn op_setcurfield_array_var(U32 &ip); - OPCodeReturn op_loadfield_uint(U32 &ip); - OPCodeReturn op_loadfield_flt(U32 &ip); - OPCodeReturn op_loadfield_str(U32 &ip); - OPCodeReturn op_savefield_uint(U32 &ip); - OPCodeReturn op_savefield_flt(U32 &ip); - OPCodeReturn op_savefield_str(U32 &ip); - OPCodeReturn op_str_to_uint(U32 &ip); - OPCodeReturn op_str_to_flt(U32 &ip); - OPCodeReturn op_str_to_none(U32 &ip); - OPCodeReturn op_flt_to_uint(U32 &ip); - OPCodeReturn op_flt_to_str(U32 &ip); - OPCodeReturn op_flt_to_none(U32 &ip); - OPCodeReturn op_uint_to_flt(U32 &ip); - OPCodeReturn op_uint_to_str(U32 &ip); - OPCodeReturn op_uint_to_none(U32 &ip); - OPCodeReturn op_copyvar_to_none(U32 &ip); - OPCodeReturn op_loadimmed_uint(U32 &ip); - OPCodeReturn op_loadimmed_flt(U32 &ip); - OPCodeReturn op_tag_to_str(U32 &ip); - OPCodeReturn op_loadimmed_str(U32 &ip); - OPCodeReturn op_docblock_str(U32 &ip); - OPCodeReturn op_loadimmed_ident(U32 &ip); - OPCodeReturn op_callfunc_resolve(U32 &ip); - OPCodeReturn op_callfunc(U32 &ip); - OPCodeReturn op_callfunc_pointer(U32 &ip); - OPCodeReturn op_callfunc_this(U32 &ip); - OPCodeReturn op_advance_str(U32 &ip); - OPCodeReturn op_advance_str_appendchar(U32 &ip); - OPCodeReturn op_advance_str_comma(U32 &ip); - OPCodeReturn op_advance_str_nul(U32 &ip); - OPCodeReturn op_rewind_str(U32 &ip); - OPCodeReturn op_terminate_rewind_str(U32 &ip); - OPCodeReturn op_compare_str(U32 &ip); - OPCodeReturn op_push(U32 &ip); - OPCodeReturn op_push_uint(U32 &ip); - OPCodeReturn op_push_flt(U32 &ip); - OPCodeReturn op_push_var(U32 &ip); - OPCodeReturn op_push_this(U32 &ip); - OPCodeReturn op_push_frame(U32 &ip); - OPCodeReturn op_assert(U32 &ip); - OPCodeReturn op_break(U32 &ip); - OPCodeReturn op_iter_begin_str(U32 &ip); - OPCodeReturn op_iter_begin(U32 &ip); - OPCodeReturn op_iter(U32 &ip); - OPCodeReturn op_iter_end(U32 &ip); - OPCodeReturn op_invalid(U32 &ip); - - /// @} - -private: - CodeBlock *mCodeBlock; - - /// Group exec arguments. - struct - { - StringTableEntry functionName; - Namespace *thisNamespace; - U32 argc; - ConsoleValueRef *argv; - bool noCalls; - StringTableEntry packageName; - S32 setFrame; - } mExec; - - U32 mIterDepth; - F64 *mCurFloatTable; - char *mCurStringTable; - StringTableEntry mThisFunctionName; - bool mPopFrame; - - // Add local object creation stack [7/9/2007 Black] - static const U32 objectCreationStackSize = 32; - U32 mObjectCreationStackIndex; - struct - { - SimObject *newObject; - U32 failJump; - } mObjectCreationStack[objectCreationStackSize]; - - SimObject *mCurrentNewObject; - U32 mFailJump; - StringTableEntry mPrevField; - StringTableEntry mCurField; - SimObject *mPrevObject; - SimObject *mCurObject; - SimObject *mSaveObject; - SimObject *mThisObject; - Namespace::Entry *mNSEntry; - StringTableEntry mCurFNDocBlock; - StringTableEntry mCurNSDocBlock; - U32 mCallArgc; - ConsoleValueRef *mCallArgv; - CodeBlock *mSaveCodeBlock; - - // note: anything returned is pushed to CSTK and will be invalidated on the next exec() - ConsoleValueRef mReturnValue; - - U32 mCurrentInstruction; - - static const S32 nsDocLength = 128; - char mNSDocBlockClass[nsDocLength]; -}; - -#endif \ No newline at end of file diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 47f5717ad..1d9ae968c 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -1,5 +1,7 @@ //----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC +// Copyright (c) 2013 GarageGames, LLC +// Copyright (c) 2015 Faust Logic, Inc. +// Copyright (c) 2021 TGEMIT Authors & Contributors // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to @@ -40,8 +42,8 @@ #include "util/messaging/message.h" #include "core/frameAllocator.h" -#include "console/codeInterpreter.h" #include "console/returnBuffer.h" +#include "console/consoleValueStack.h" #ifndef TORQUE_TGB_ONLY #include "materials/materialDefinition.h" @@ -50,13 +52,71 @@ using namespace Compiler; +enum EvalConstants +{ + MaxStackSize = 1024, + FieldBufferSizeString = 2048, + FieldBufferSizeNumeric = 128, + MethodOnComponent = -2 +}; + +/// Frame data for a foreach/foreach$ loop. +struct IterStackRecord +{ + /// If true, this is a foreach$ loop; if not, it's a foreach loop. + bool mIsStringIter; + + /// The iterator variable. + Dictionary::Entry* mVariable; + + /// Information for an object iterator loop. + struct ObjectPos + { + /// The set being iterated over. + SimSet* mSet; + + /// Current index in the set. + U32 mIndex; + }; + + /// Information for a string iterator loop. + struct StringPos + { + /// The raw string data on the string stack. + const char* mString; + + /// Current parsing position. + U32 mIndex; + }; + union + { + ObjectPos mObj; + StringPos mStr; + } mData; +}; + +ConsoleValueStack<4096> gCallStack; + +StringStack STR; + +U32 _FLT = 0; ///< Stack pointer for floatStack. +U32 _UINT = 0; ///< Stack pointer for intStack. +U32 _ITER = 0; ///< Stack pointer for iterStack. + +IterStackRecord iterStack[MaxStackSize]; + +F64 floatStack[MaxStackSize]; +S64 intStack[MaxStackSize]; + +char curFieldArray[256]; +char prevFieldArray[256]; + namespace Con { // Current script file name and root, these are registered as // console variables. extern StringTableEntry gCurrentFile; extern StringTableEntry gCurrentRoot; - extern S32 gObjectCopyFailures; } namespace Con @@ -79,6 +139,124 @@ namespace Con } } +// Gets a component of an object's field value or a variable and returns it +// in val. +static void getFieldComponent(SimObject* object, StringTableEntry field, const char* array, StringTableEntry subField, char val[]) +{ + const char* prevVal = NULL; + + // Grab value from object. + if (object && field) + prevVal = object->getDataField(field, array); + + // Otherwise, grab from the string stack. The value coming in will always + // be a string because that is how multicomponent variables are handled. + else + prevVal = STR.getStringValue(); + + // Make sure we got a value. + if (prevVal && *prevVal) + { + static const StringTableEntry xyzw[] = + { + StringTable->insert("x"), + StringTable->insert("y"), + StringTable->insert("z"), + StringTable->insert("w") + }; + + static const StringTableEntry rgba[] = + { + StringTable->insert("r"), + StringTable->insert("g"), + StringTable->insert("b"), + StringTable->insert("a") + }; + + // Translate xyzw and rgba into the indexed component + // of the variable or field. + if (subField == xyzw[0] || subField == rgba[0]) + dStrcpy(val, StringUnit::getUnit(prevVal, 0, " \t\n"), 128); + + else if (subField == xyzw[1] || subField == rgba[1]) + dStrcpy(val, StringUnit::getUnit(prevVal, 1, " \t\n"), 128); + + else if (subField == xyzw[2] || subField == rgba[2]) + dStrcpy(val, StringUnit::getUnit(prevVal, 2, " \t\n"), 128); + + else if (subField == xyzw[3] || subField == rgba[3]) + dStrcpy(val, StringUnit::getUnit(prevVal, 3, " \t\n"), 128); + + else + val[0] = 0; + } + else + val[0] = 0; +} + +// Sets a component of an object's field value based on the sub field. 'x' will +// set the first field, 'y' the second, and 'z' the third. +static void setFieldComponent(SimObject* object, StringTableEntry field, const char* array, StringTableEntry subField) +{ + // Copy the current string value + char strValue[1024]; + dStrncpy(strValue, STR.getStringValue(), 1024); + + char val[1024] = ""; + const char* prevVal = NULL; + + // Set the value on an object field. + if (object && field) + prevVal = object->getDataField(field, array); + + // Set the value on a variable. + else if (gEvalState.currentVariable) + prevVal = gEvalState.getStringVariable(); + + // Ensure that the variable has a value + if (!prevVal) + return; + + static const StringTableEntry xyzw[] = + { + StringTable->insert("x"), + StringTable->insert("y"), + StringTable->insert("z"), + StringTable->insert("w") + }; + + static const StringTableEntry rgba[] = + { + StringTable->insert("r"), + StringTable->insert("g"), + StringTable->insert("b"), + StringTable->insert("a") + }; + + // Insert the value into the specified + // component of the string. + if (subField == xyzw[0] || subField == rgba[0]) + dStrcpy(val, StringUnit::setUnit(prevVal, 0, strValue, " \t\n"), 128); + + else if (subField == xyzw[1] || subField == rgba[1]) + dStrcpy(val, StringUnit::setUnit(prevVal, 1, strValue, " \t\n"), 128); + + else if (subField == xyzw[2] || subField == rgba[2]) + dStrcpy(val, StringUnit::setUnit(prevVal, 2, strValue, " \t\n"), 128); + + else if (subField == xyzw[3] || subField == rgba[3]) + dStrcpy(val, StringUnit::setUnit(prevVal, 3, strValue, " \t\n"), 128); + + if (val[0] != 0) + { + // Update the field or variable. + if (object && field) + object->setDataField(field, 0, val); + else if (gEvalState.currentVariable) + gEvalState.setStringVariable(val); + } +} + //------------------------------------------------------------ F64 consoleStringToNumber(const char *str, StringTableEntry file, U32 line) @@ -239,38 +417,1717 @@ void ExprEvalState::setStringVariable(const char *val) currentVariable->setStringValue(val); } -void ExprEvalState::setStringStackPtrVariable(StringStackPtr str) -{ - AssertFatal(currentVariable != NULL, "Invalid evaluator state - trying to set null variable!"); - currentVariable->setStringStackPtrValue(str); -} +//----------------------------------------------------------------------------- -void ExprEvalState::setCopyVariable() +U32 gExecCount = 0; +void CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNamespace, U32 argc, ConsoleValue* argv, bool noCalls, StringTableEntry packageName, ConsoleValue& returnValue, S32 setFrame) { - if (copyVariable) +#ifdef TORQUE_DEBUG + U32 stackStart = STR.mStartStackSize; + gExecCount++; +#endif + + const dsize_t TRACE_BUFFER_SIZE = 1024; + static char traceBuffer[TRACE_BUFFER_SIZE]; + U32 i; + + U32 iterDepth = 0; + + incRefCount(); + F64* curFloatTable; + char* curStringTable; + S32 curStringTableLen = 0; //clint to ensure we dont overwrite it + STR.clearFunctionOffset(); + StringTableEntry thisFunctionName = NULL; + bool popFrame = false; + if (argv) { - switch (copyVariable->value.type) + // assume this points into a function decl: + U32 fnArgc = code[ip + 2 + 6]; + U32 regCount = code[ip + 2 + 7]; + thisFunctionName = CodeToSTE(code, ip); + S32 wantedArgc = getMin(argc - 1, fnArgc); // argv[0] is func name + if (gEvalState.traceOn) { - case ConsoleValue::TypeInternalInt: - currentVariable->setIntValue(copyVariable->getIntValue()); + traceBuffer[0] = 0; + dStrcat(traceBuffer, "Entering ", TRACE_BUFFER_SIZE); + if (packageName) + { + dStrcat(traceBuffer, "[", TRACE_BUFFER_SIZE); + dStrcat(traceBuffer, packageName, TRACE_BUFFER_SIZE); + dStrcat(traceBuffer, "]", TRACE_BUFFER_SIZE); + } + if (thisNamespace && thisNamespace->mName) + { + dSprintf(traceBuffer + dStrlen(traceBuffer), sizeof(traceBuffer) - dStrlen(traceBuffer), + "%s::%s(", thisNamespace->mName, thisFunctionName); + } + else + { + dSprintf(traceBuffer + dStrlen(traceBuffer), sizeof(traceBuffer) - dStrlen(traceBuffer), + "%s(", thisFunctionName); + } + for (i = 0; i < wantedArgc; i++) + { + dStrcat(traceBuffer, argv[i + 1].getString(), TRACE_BUFFER_SIZE); + if (i != wantedArgc - 1) + dStrcat(traceBuffer, ", ", TRACE_BUFFER_SIZE); + } + dStrcat(traceBuffer, ")", TRACE_BUFFER_SIZE); + Con::printf("%s", traceBuffer); + } + gEvalState.pushFrame(thisFunctionName, thisNamespace, regCount); + popFrame = true; + for (i = 0; i < wantedArgc; i++) + { + S32 reg = code[ip + (2 + 6 + 1 + 1) + i]; + ConsoleValue& value = argv[i + 1]; + switch (value.getType()) + { + case ConsoleValueType::cvString: + gEvalState.setLocalStringVariable(reg, value.getString(), dStrlen(value.getString())); break; - case ConsoleValue::TypeInternalFloat: - currentVariable->setFloatValue(copyVariable->getFloatValue()); + case ConsoleValueType::cvInteger: + gEvalState.setLocalIntVariable(reg, value.getInt()); + break; + case ConsoleValueType::cvFloat: + gEvalState.setLocalFloatVariable(reg, value.getFloat()); + break; + case ConsoleValueType::cvSTEntry: + gEvalState.setLocalStringTableEntryVariable(reg, value.getString()); break; default: - currentVariable->setStringValue(copyVariable->getStringValue()); - break; + AssertFatal(false, avar("Invalid local variable type. Type was: %i", value.getType())); + } + } + ip = ip + fnArgc + (2 + 6 + 1 + 1); + curFloatTable = functionFloats; + curStringTable = functionStrings; + curStringTableLen = functionStringsMaxLen; + } + else + { + curFloatTable = globalFloats; + curStringTable = globalStrings; + curStringTableLen = globalStringsMaxLen; + + // Do we want this code to execute using a new stack frame? + if (setFrame < 0) + { + gEvalState.pushFrame(NULL, NULL, 0); + gCallStack.pushFrame(0); + popFrame = true; + } + else if (!gEvalState.stack.empty()) + { + // We want to copy a reference to an existing stack frame + // on to the top of the stack. Any change that occurs to + // the locals during this new frame will also occur in the + // original frame. + S32 stackIndex = gEvalState.stack.size() - setFrame - 1; + gEvalState.pushFrameRef(stackIndex); + popFrame = true; } } -} - -//------------------------------------------------------------ - - -ConsoleValueRef CodeBlock::exec(U32 ip, const char *functionName, Namespace *thisNamespace, U32 argc, ConsoleValueRef *argv, bool noCalls, StringTableEntry packageName, S32 setFrame) -{ - CodeInterpreter interpreter(this); - return interpreter.exec(ip, functionName, thisNamespace, argc, argv, noCalls, packageName, setFrame); + + // Grab the state of the telenet debugger here once + // so that the push and pop frames are always balanced. + const bool telDebuggerOn = TelDebugger && TelDebugger->isConnected(); + if (telDebuggerOn && setFrame < 0) + TelDebugger->pushStackFrame(); + + StringTableEntry var, objParent; + U32 failJump; + StringTableEntry fnName; + StringTableEntry fnNamespace, fnPackage; + + static const U32 objectCreationStackSize = 32; + U32 objectCreationStackIndex = 0; + struct { + SimObject* newObject; + U32 failJump; + } objectCreationStack[objectCreationStackSize]; + + SimObject* currentNewObject = 0; + StringTableEntry prevField = NULL; + StringTableEntry curField = NULL; + SimObject* prevObject = NULL; + SimObject* curObject = NULL; + SimObject* saveObject = NULL; + Namespace::Entry* nsEntry; + Namespace* ns; + const char* curFNDocBlock = NULL; + const char* curNSDocBlock = NULL; + const S32 nsDocLength = 128; + char nsDocBlockClass[nsDocLength]; + + S32 callArgc; + ConsoleValue* callArgv; + + static char curFieldArray[256]; + static char prevFieldArray[256]; + + CodeBlock* saveCodeBlock = smCurrentCodeBlock; + smCurrentCodeBlock = this; + if (this->name) + { + Con::gCurrentFile = this->name; + Con::gCurrentRoot = this->modPath; + } + const char* val; + S32 reg; + + // The frame temp is used by the variable accessor ops (OP_SAVEFIELD_* and + // OP_LOADFIELD_*) to store temporary values for the fields. + static S32 VAL_BUFFER_SIZE = 1024; + FrameTemp valBuffer(VAL_BUFFER_SIZE); + + for (;;) + { + U32 instruction = code[ip++]; + breakContinue: + switch (instruction) + { + case OP_FUNC_DECL: + if (!noCalls) + { + fnName = CodeToSTE(code, ip); + fnNamespace = CodeToSTE(code, ip + 2); + fnPackage = CodeToSTE(code, ip + 4); + bool hasBody = (code[ip + 6] & 0x01) != 0; + U32 lineNumber = code[ip + 6] >> 1; + + Namespace::unlinkPackages(); + if (fnNamespace == NULL && fnPackage == NULL) + ns = Namespace::global(); + else + ns = Namespace::find(fnNamespace, fnPackage); + ns->addFunction(fnName, this, hasBody ? ip : 0);// if no body, set the IP to 0 + if (curNSDocBlock) + { + if (fnNamespace == StringTable->lookup(nsDocBlockClass)) + { + char* usageStr = dStrdup(curNSDocBlock); + usageStr[dStrlen(usageStr)] = '\0'; + ns->mUsage = usageStr; + ns->mCleanUpUsage = true; + curNSDocBlock = NULL; + } + } + Namespace::relinkPackages(); + + // If we had a docblock, it's definitely not valid anymore, so clear it out. + curFNDocBlock = NULL; + + //Con::printf("Adding function %s::%s (%d)", fnNamespace, fnName, ip); + } + ip = code[ip + 7]; + break; + + case OP_CREATE_OBJECT: + { + // Read some useful info. + objParent = CodeToSTE(code, ip); + bool isDataBlock = code[ip + 2]; + bool isInternal = code[ip + 3]; + bool isSingleton = code[ip + 4]; + U32 lineNumber = code[ip + 5]; + failJump = code[ip + 6]; + + // If we don't allow calls, we certainly don't allow creating objects! + // Moved this to after failJump is set. Engine was crashing when + // noCalls = true and an object was being created at the beginning of + // a file. ADL. + if (noCalls) + { + ip = failJump; + break; + } + + // Push the old info to the stack + //Assert( objectCreationStackIndex < objectCreationStackSize ); + objectCreationStack[objectCreationStackIndex].newObject = currentNewObject; + objectCreationStack[objectCreationStackIndex++].failJump = failJump; + + // Get the constructor information off the stack. + gCallStack.argvc(NULL, callArgc, &callArgv); + AssertFatal(callArgc - 3 >= 0, avar("Call Arg needs at least 3, only has %d", callArgc)); + const char* objectName = callArgv[2].getString(); + + // Con::printf("Creating object..."); + + // objectName = argv[1]... + currentNewObject = NULL; + + // Are we creating a datablock? If so, deal with case where we override + // an old one. + if (isDataBlock) + { + // Con::printf(" - is a datablock"); + + // Find the old one if any. + SimObject* db = Sim::getDataBlockGroup()->findObject(objectName); + + // Make sure we're not changing types on ourselves... + if (db && dStricmp(db->getClassName(), callArgv[1].getString())) + { + Con::errorf(ConsoleLogEntry::General, "Cannot re-declare data block %s with a different class.", objectName); + ip = failJump; + gCallStack.popFrame(); + break; + } + + // If there was one, set the currentNewObject and move on. + if (db) + currentNewObject = db; + } + else if (!isInternal) + { + AbstractClassRep* rep = AbstractClassRep::findClassRep(objectName); + if (rep != NULL) + { + Con::errorf(ConsoleLogEntry::General, "%s: Cannot name object [%s] the same name as a script class.", + getFileLine(ip), objectName); + ip = failJump; + gCallStack.popFrame(); + break; + } + + SimObject* obj = Sim::findObject((const char*)objectName); + if (obj) + { + if (isSingleton) + { + // Make sure we're not trying to change types + if (dStricmp(obj->getClassName(), callArgv[1].getString()) != 0) + { + Con::errorf(ConsoleLogEntry::General, "%s: Cannot re-declare object [%s] with a different class [%s] - was [%s].", + getFileLine(ip), objectName, callArgv[1].getString(), obj->getClassName()); + ip = failJump; + gCallStack.popFrame(); + break; + } + + // We're creating a singleton, so use the found object instead of creating a new object. + currentNewObject = obj; + Con::warnf("%s: Singleton Object was already created with name %s. Using existing object.", + getFileLine(ip), objectName); + } + } + } + + gCallStack.popFrame(); + + if (!currentNewObject) + { + // Well, looks like we have to create a new object. + ConsoleObject* object = ConsoleObject::create(callArgv[1].getString()); + + // Deal with failure! + if (!object) + { + Con::errorf(ConsoleLogEntry::General, "%s: Unable to instantiate non-conobject class %s.", getFileLine(ip - 1), callArgv[1].getString()); + ip = failJump; + break; + } + + // Do special datablock init if appropros + if (isDataBlock) + { + SimDataBlock* dataBlock = dynamic_cast(object); + if (dataBlock) + { + dataBlock->assignId(); + } + else + { + // They tried to make a non-datablock with a datablock keyword! + Con::errorf(ConsoleLogEntry::General, "%s: Unable to instantiate non-datablock class %s.", getFileLine(ip - 1), callArgv[1].getString()); + + // Clean up... + delete object; + ip = failJump; + break; + } + } + + // Finally, set currentNewObject to point to the new one. + currentNewObject = dynamic_cast(object); + + // Deal with the case of a non-SimObject. + if (!currentNewObject) + { + Con::errorf(ConsoleLogEntry::General, "%s: Unable to instantiate non-SimObject class %s.", getFileLine(ip - 1), callArgv[1].getString()); + delete object; + ip = failJump; + break; + } + + // Set the declaration line + currentNewObject->setDeclarationLine(lineNumber); + + // Set the file that this object was created in + currentNewObject->setFilename(this->name); + + // Does it have a parent object? (ie, the copy constructor : syntax, not inheriance) + if (*objParent) + { + // Find it! + SimObject* parent; + if (Sim::findObject(objParent, parent)) + { + // Con::printf(" - Parent object found: %s", parent->getClassName()); + + currentNewObject->setCopySource(parent); + currentNewObject->assignFieldsFrom(parent); + + // copy any substitution statements + SimDataBlock* parent_db = dynamic_cast(parent); + if (parent_db) + { + SimDataBlock* currentNewObject_db = dynamic_cast(currentNewObject); + if (currentNewObject_db) + currentNewObject_db->copySubstitutionsFrom(parent_db); + } + } + else + { + Con::errorf(ConsoleLogEntry::General, "%s: Unable to find parent object %s for %s.", getFileLine(ip - 1), objParent, callArgv[1].getString()); + delete object; + currentNewObject = NULL; + ip = failJump; + break; + } + } + + // If a name was passed, assign it. + if (objectName[0]) + { + if (!isInternal) + currentNewObject->assignName(objectName); + else + currentNewObject->setInternalName(objectName); + + // Set the original name + currentNewObject->setOriginalName( objectName ); + } + + // Do the constructor parameters. + if (!currentNewObject->processArguments(callArgc - 3, callArgv + 3)) + { + delete currentNewObject; + currentNewObject = NULL; + ip = failJump; + break; + } + + // If it's not a datablock, allow people to modify bits of it. + if (!isDataBlock) + { + currentNewObject->setModStaticFields(true); + currentNewObject->setModDynamicFields(true); + } + } + else + { + currentNewObject->reloadReset(); // AFX (reload-reset) + + // Does it have a parent object? (ie, the copy constructor : syntax, not inheriance) + if (*objParent) + { + // Find it! + SimObject* parent; + if (Sim::findObject(objParent, parent)) + { + // Con::printf(" - Parent object found: %s", parent->getClassName()); + + // temporarily block name change + SimObject::preventNameChanging = true; + currentNewObject->setCopySource(parent); + currentNewObject->assignFieldsFrom(parent); + // restore name changing + SimObject::preventNameChanging = false; + + // copy any substitution statements + SimDataBlock* parent_db = dynamic_cast(parent); + if (parent_db) + { + SimDataBlock* currentNewObject_db = dynamic_cast(currentNewObject); + if (currentNewObject_db) + currentNewObject_db->copySubstitutionsFrom(parent_db); + } + } + else + { + Con::errorf(ConsoleLogEntry::General, "%d: Unable to find parent object %s for %s.", lineNumber, objParent, callArgv[1].getString()); + } + } + } + + // Advance the IP past the create info... + ip += 7; + break; + } + + case OP_ADD_OBJECT: + { + // See OP_SETCURVAR for why we do this. + curFNDocBlock = NULL; + curNSDocBlock = NULL; + + // Do we place this object at the root? + bool placeAtRoot = code[ip++]; + + // Con::printf("Adding object %s", currentNewObject->getName()); + + // Make sure it wasn't already added, then add it. + if (currentNewObject == NULL) + { + break; + } + + bool isMessage = dynamic_cast(currentNewObject) != NULL; + + if (currentNewObject->isProperlyAdded() == false) + { + bool ret = false; + if (isMessage) + { + SimObjectId id = Message::getNextMessageID(); + if (id != 0xffffffff) + ret = currentNewObject->registerObject(id); + else + Con::errorf("%s: No more object IDs available for messages", getFileLine(ip)); + } + else + ret = currentNewObject->registerObject(); + + if (!ret) + { + // This error is usually caused by failing to call Parent::initPersistFields in the class' initPersistFields(). + Con::warnf(ConsoleLogEntry::General, "%s: Register object failed for object %s of class %s.", getFileLine(ip - 2), currentNewObject->getName(), currentNewObject->getClassName()); + delete currentNewObject; + ip = failJump; + break; + } + } + + // Are we dealing with a datablock? + SimDataBlock* dataBlock = dynamic_cast(currentNewObject); + String errorStr; + + // If so, preload it. + if (dataBlock && !dataBlock->preload(true, errorStr)) + { + Con::errorf(ConsoleLogEntry::General, "%s: preload failed for %s: %s.", getFileLine(ip - 2), + currentNewObject->getName(), errorStr.c_str()); + dataBlock->deleteObject(); + ip = failJump; + break; + } + + // What group will we be added to, if any? + U32 groupAddId = (U32)intStack[_UINT]; + SimGroup* grp = NULL; + SimSet* set = NULL; + + if (!placeAtRoot || !currentNewObject->getGroup()) + { + if (!isMessage) + { + if (!placeAtRoot) + { + // Otherwise just add to the requested group or set. + if (!Sim::findObject(groupAddId, grp)) + Sim::findObject(groupAddId, set); + } + + if (placeAtRoot) + { + // Deal with the instantGroup if we're being put at the root or we're adding to a component. + if (Con::gInstantGroup.isEmpty() || !Sim::findObject(Con::gInstantGroup, grp)) + grp = Sim::getRootGroup(); + } + } + + // If we didn't get a group, then make sure we have a pointer to + // the rootgroup. + if (!grp) + grp = Sim::getRootGroup(); + + // add to the parent group + grp->addObject(currentNewObject); + + // If for some reason the add failed, add the object to the + // root group so it won't leak. + if (currentNewObject->getGroup() == NULL) + Sim::getRootGroup()->addObject(currentNewObject); + + // add to any set we might be in + if (set) + set->addObject(currentNewObject); + } + + // store the new object's ID on the stack (overwriting the group/set + // id, if one was given, otherwise getting pushed) + S32 id = currentNewObject->getId(); + if (placeAtRoot) + intStack[_UINT] = id; + else + intStack[++_UINT] = id; + + break; + } + + case OP_END_OBJECT: + { + // If we're not to be placed at the root, make sure we clean up + // our group reference. + bool placeAtRoot = code[ip++]; + if (!placeAtRoot) + _UINT--; + break; + } + + case OP_FINISH_OBJECT: + { + if (currentNewObject) + currentNewObject->onPostAdd(); + + //Assert( objectCreationStackIndex >= 0 ); + // Restore the object info from the stack [7/9/2007 Black] + currentNewObject = objectCreationStack[--objectCreationStackIndex].newObject; + failJump = objectCreationStack[objectCreationStackIndex].failJump; + break; + } + + case OP_JMPIFFNOT: + if (floatStack[_FLT--]) + { + ip++; + break; + } + ip = code[ip]; + break; + case OP_JMPIFNOT: + if (intStack[_UINT--]) + { + ip++; + break; + } + ip = code[ip]; + break; + case OP_JMPIFF: + if (!floatStack[_FLT--]) + { + ip++; + break; + } + ip = code[ip]; + break; + case OP_JMPIF: + if (!intStack[_UINT--]) + { + ip++; + break; + } + ip = code[ip]; + break; + case OP_JMPIFNOT_NP: + if (intStack[_UINT]) + { + _UINT--; + ip++; + break; + } + ip = code[ip]; + break; + case OP_JMPIF_NP: + if (!intStack[_UINT]) + { + _UINT--; + ip++; + break; + } + ip = code[ip]; + break; + case OP_JMP: + ip = code[ip]; + break; + + // This fixes a bug when not explicitly returning a value. + case OP_RETURN_VOID: + STR.setStringValue(""); + // We're falling thru here on purpose. + + case OP_RETURN: + + if (iterDepth > 0) + { + // Clear iterator state. + while (iterDepth > 0) + { + iterStack[--_ITER].mIsStringIter = false; + --iterDepth; + } + + const char* retVal = STR.getStringValue(); + STR.rewind(); + + returnValue.setString(retVal, STR.mLen); + //STR.setStringValue(returnValue); // Not nice but works. + } + + goto execFinished; + + case OP_RETURN_FLT: + + if (iterDepth > 0) + { + // Clear iterator state. + while (iterDepth > 0) + { + iterStack[--_ITER].mIsStringIter = false; + --iterDepth; + } + + } + + returnValue.setFloat(floatStack[_FLT]); + _FLT--; + + goto execFinished; + + case OP_RETURN_UINT: + + if (iterDepth > 0) + { + // Clear iterator state. + while (iterDepth > 0) + { + iterStack[--_ITER].mIsStringIter = false; + --iterDepth; + } + } + + returnValue.setInt(intStack[_UINT]); + _UINT--; + + goto execFinished; + + case OP_CMPEQ: + intStack[_UINT + 1] = bool(floatStack[_FLT] == floatStack[_FLT - 1]); + _UINT++; + _FLT -= 2; + break; + + case OP_CMPGR: + intStack[_UINT + 1] = bool(floatStack[_FLT] > floatStack[_FLT - 1]); + _UINT++; + _FLT -= 2; + break; + + case OP_CMPGE: + intStack[_UINT + 1] = bool(floatStack[_FLT] >= floatStack[_FLT - 1]); + _UINT++; + _FLT -= 2; + break; + + case OP_CMPLT: + intStack[_UINT + 1] = bool(floatStack[_FLT] < floatStack[_FLT - 1]); + _UINT++; + _FLT -= 2; + break; + + case OP_CMPLE: + intStack[_UINT + 1] = bool(floatStack[_FLT] <= floatStack[_FLT - 1]); + _UINT++; + _FLT -= 2; + break; + + case OP_CMPNE: + intStack[_UINT + 1] = bool(floatStack[_FLT] != floatStack[_FLT - 1]); + _UINT++; + _FLT -= 2; + break; + + case OP_XOR: + intStack[_UINT - 1] = intStack[_UINT] ^ intStack[_UINT - 1]; + _UINT--; + break; + + case OP_MOD: + if (intStack[_UINT - 1] != 0) + intStack[_UINT - 1] = intStack[_UINT] % intStack[_UINT - 1]; + else + intStack[_UINT - 1] = 0; + _UINT--; + break; + + case OP_BITAND: + intStack[_UINT - 1] = intStack[_UINT] & intStack[_UINT - 1]; + _UINT--; + break; + + case OP_BITOR: + intStack[_UINT - 1] = intStack[_UINT] | intStack[_UINT - 1]; + _UINT--; + break; + + case OP_NOT: + intStack[_UINT] = !intStack[_UINT]; + break; + + case OP_NOTF: + intStack[_UINT + 1] = !floatStack[_FLT]; + _FLT--; + _UINT++; + break; + + case OP_ONESCOMPLEMENT: + intStack[_UINT] = ~intStack[_UINT]; + break; + + case OP_SHR: + intStack[_UINT - 1] = intStack[_UINT] >> intStack[_UINT - 1]; + _UINT--; + break; + + case OP_SHL: + intStack[_UINT - 1] = intStack[_UINT] << intStack[_UINT - 1]; + _UINT--; + break; + + case OP_AND: + intStack[_UINT - 1] = intStack[_UINT] && intStack[_UINT - 1]; + _UINT--; + break; + + case OP_OR: + intStack[_UINT - 1] = intStack[_UINT] || intStack[_UINT - 1]; + _UINT--; + break; + + case OP_ADD: + floatStack[_FLT - 1] = floatStack[_FLT] + floatStack[_FLT - 1]; + _FLT--; + break; + + case OP_SUB: + floatStack[_FLT - 1] = floatStack[_FLT] - floatStack[_FLT - 1]; + _FLT--; + break; + + case OP_MUL: + floatStack[_FLT - 1] = floatStack[_FLT] * floatStack[_FLT - 1]; + _FLT--; + break; + case OP_DIV: + floatStack[_FLT - 1] = floatStack[_FLT] / floatStack[_FLT - 1]; + _FLT--; + break; + case OP_NEG: + floatStack[_FLT] = -floatStack[_FLT]; + break; + + case OP_INC: + reg = code[ip++]; + gEvalState.setLocalFloatVariable(reg, gEvalState.getLocalFloatVariable(reg) + 1.0); + break; + + case OP_SETCURVAR: + var = CodeToSTE(code, ip); + ip += 2; + + // If a variable is set, then these must be NULL. It is necessary + // to set this here so that the vector parser can appropriately + // identify whether it's dealing with a vector. + prevField = NULL; + prevObject = NULL; + curObject = NULL; + + gEvalState.setCurVarName(var); + + // In order to let docblocks work properly with variables, we have + // clear the current docblock when we do an assign. This way it + // won't inappropriately carry forward to following function decls. + curFNDocBlock = NULL; + curNSDocBlock = NULL; + break; + + case OP_SETCURVAR_CREATE: + var = CodeToSTE(code, ip); + ip += 2; + + // See OP_SETCURVAR + prevField = NULL; + prevObject = NULL; + curObject = NULL; + + gEvalState.setCurVarNameCreate(var); + + // See OP_SETCURVAR for why we do this. + curFNDocBlock = NULL; + curNSDocBlock = NULL; + break; + + case OP_SETCURVAR_ARRAY: + var = STR.getSTValue(); + + // See OP_SETCURVAR + prevField = NULL; + prevObject = NULL; + curObject = NULL; + + gEvalState.setCurVarName(var); + + // See OP_SETCURVAR for why we do this. + curFNDocBlock = NULL; + curNSDocBlock = NULL; + break; + + case OP_SETCURVAR_ARRAY_CREATE: + var = STR.getSTValue(); + + // See OP_SETCURVAR + prevField = NULL; + prevObject = NULL; + curObject = NULL; + + gEvalState.setCurVarNameCreate(var); + + // See OP_SETCURVAR for why we do this. + curFNDocBlock = NULL; + curNSDocBlock = NULL; + break; + + case OP_LOADVAR_UINT: + intStack[_UINT + 1] = gEvalState.getIntVariable(); + _UINT++; + break; + + case OP_LOADVAR_FLT: + floatStack[_FLT + 1] = gEvalState.getFloatVariable(); + _FLT++; + break; + + case OP_LOADVAR_STR: + val = gEvalState.getStringVariable(); + STR.setStringValue(val); + break; + + case OP_SAVEVAR_UINT: + gEvalState.setIntVariable((S32)intStack[_UINT]); + break; + + case OP_SAVEVAR_FLT: + gEvalState.setFloatVariable(floatStack[_FLT]); + break; + + case OP_SAVEVAR_STR: + gEvalState.setStringVariable(STR.getStringValue()); + break; + + case OP_LOAD_LOCAL_VAR_UINT: + reg = code[ip++]; + intStack[_UINT + 1] = gEvalState.getLocalIntVariable(reg); + _UINT++; + break; + + case OP_LOAD_LOCAL_VAR_FLT: + reg = code[ip++]; + floatStack[_FLT + 1] = gEvalState.getLocalFloatVariable(reg); + _FLT++; + break; + + case OP_LOAD_LOCAL_VAR_STR: + reg = code[ip++]; + val = gEvalState.getLocalStringVariable(reg); + STR.setStringValue(val); + break; + + case OP_SAVE_LOCAL_VAR_UINT: + reg = code[ip++]; + gEvalState.setLocalIntVariable(reg, (S32)intStack[_UINT]); + break; + + case OP_SAVE_LOCAL_VAR_FLT: + reg = code[ip++]; + gEvalState.setLocalFloatVariable(reg, floatStack[_FLT]); + break; + + case OP_SAVE_LOCAL_VAR_STR: + reg = code[ip++]; + gEvalState.setLocalStringVariable(reg, STR.getStringValue(), (S32)STR.mLen); + break; + + case OP_SETCUROBJECT: + // Save the previous object for parsing vector fields. + prevObject = curObject; + val = STR.getStringValue(); + + // Sim::findObject will sometimes find valid objects from + // multi-component strings. This makes sure that doesn't + // happen. + for (const char* check = val; *check; check++) + { + if (*check == ' ') + { + val = ""; + break; + } + } + curObject = Sim::findObject(val); + break; + + case OP_SETCUROBJECT_INTERNAL: + ++ip; // To skip the recurse flag if the object wasnt found + if (curObject) + { + SimGroup* group = dynamic_cast(curObject); + if (group) + { + StringTableEntry intName = StringTable->insert(STR.getStringValue()); + bool recurse = code[ip - 1]; + SimObject* obj = group->findObjectByInternalName(intName, recurse); + intStack[_UINT + 1] = obj ? obj->getId() : 0; + _UINT++; + } + else + { + Con::errorf(ConsoleLogEntry::Script, "%s: Attempt to use -> on non-group %s of class %s.", getFileLine(ip - 2), curObject->getName(), curObject->getClassName()); + intStack[_UINT] = 0; + } + } + break; + + case OP_SETCUROBJECT_NEW: + curObject = currentNewObject; + break; + + case OP_SETCURFIELD: + // Save the previous field for parsing vector fields. + prevField = curField; + dStrcpy(prevFieldArray, curFieldArray, 256); + curField = CodeToSTE(code, ip); + curFieldArray[0] = 0; + ip += 2; + break; + + case OP_SETCURFIELD_ARRAY: + dStrcpy(curFieldArray, STR.getStringValue(), 256); + break; + + case OP_SETCURFIELD_TYPE: + if(curObject) + curObject->setDataFieldType(code[ip], curField, curFieldArray); + ip++; + break; + + case OP_LOADFIELD_UINT: + if (curObject) + intStack[_UINT + 1] = U32(dAtoi(curObject->getDataField(curField, curFieldArray))); + else + { + // The field is not being retrieved from an object. Maybe it's + // a special accessor? + char buff[FieldBufferSizeNumeric]; + memset(buff, 0, sizeof(buff)); + getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff); + intStack[_UINT + 1] = dAtoi(buff); + } + _UINT++; + break; + + case OP_LOADFIELD_FLT: + if (curObject) + floatStack[_FLT + 1] = dAtof(curObject->getDataField(curField, curFieldArray)); + else + { + // The field is not being retrieved from an object. Maybe it's + // a special accessor? + char buff[FieldBufferSizeNumeric]; + memset(buff, 0, sizeof(buff)); + getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff); + floatStack[_FLT + 1] = dAtof(buff); + } + _FLT++; + break; + + case OP_LOADFIELD_STR: + if (curObject) + { + val = curObject->getDataField(curField, curFieldArray); + STR.setStringValue(val); + } + else + { + // The field is not being retrieved from an object. Maybe it's + // a special accessor? + char buff[FieldBufferSizeString]; + memset(buff, 0, sizeof(buff)); + getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff); + STR.setStringValue(buff); + } + + break; + + case OP_SAVEFIELD_UINT: + STR.setIntValue((U32)intStack[_UINT]); + if (curObject) + curObject->setDataField(curField, curFieldArray, STR.getStringValue()); + else + { + // The field is not being set on an object. Maybe it's + // a special accessor? + setFieldComponent( prevObject, prevField, prevFieldArray, curField ); + prevObject = NULL; + } + break; + + case OP_SAVEFIELD_FLT: + STR.setFloatValue(floatStack[_FLT]); + if (curObject) + curObject->setDataField(curField, curFieldArray, STR.getStringValue()); + else + { + // The field is not being set on an object. Maybe it's + // a special accessor? + setFieldComponent( prevObject, prevField, prevFieldArray, curField ); + prevObject = NULL; + } + break; + + case OP_SAVEFIELD_STR: + if (curObject) + curObject->setDataField(curField, curFieldArray, STR.getStringValue()); + else + { + // The field is not being set on an object. Maybe it's + // a special accessor? + setFieldComponent( prevObject, prevField, prevFieldArray, curField ); + prevObject = NULL; + } + break; + + case OP_STR_TO_UINT: + intStack[_UINT + 1] = STR.getIntValue(); + _UINT++; + break; + + case OP_STR_TO_FLT: + floatStack[_FLT + 1] = STR.getFloatValue(); + _FLT++; + break; + + case OP_STR_TO_NONE: + // This exists simply to deal with certain typecast situations. + break; + + case OP_FLT_TO_UINT: + intStack[_UINT + 1] = (S64)floatStack[_FLT]; + _FLT--; + _UINT++; + break; + + case OP_FLT_TO_STR: + STR.setFloatValue(floatStack[_FLT]); + _FLT--; + break; + + case OP_FLT_TO_NONE: + _FLT--; + break; + + case OP_UINT_TO_FLT: + floatStack[_FLT + 1] = (F64)intStack[_UINT]; + _UINT--; + _FLT++; + break; + + case OP_UINT_TO_STR: + STR.setIntValue((U32)intStack[_UINT]); + _UINT--; + break; + + case OP_UINT_TO_NONE: + _UINT--; + break; + + case OP_LOADIMMED_UINT: + intStack[_UINT + 1] = code[ip++]; + _UINT++; + break; + + case OP_LOADIMMED_FLT: + floatStack[_FLT + 1] = curFloatTable[code[ip]]; + ip++; + _FLT++; + break; + case OP_TAG_TO_STR: + code[ip - 1] = OP_LOADIMMED_STR; + // it's possible the string has already been converted + if (U8(curStringTable[code[ip]]) != StringTagPrefixByte) + { + U32 id = GameAddTaggedString(curStringTable + code[ip]); + dSprintf(curStringTable + code[ip] + 1, 7, "%d", id); + *(curStringTable + code[ip]) = StringTagPrefixByte; + } + case OP_LOADIMMED_STR: + STR.setStringValue(curStringTable + code[ip++]); + break; + + case OP_DOCBLOCK_STR: + { + // If the first word of the doc is '\class' or '@class', then this + // is a namespace doc block, otherwise it is a function doc block. + const char* docblock = curStringTable + code[ip++]; + + const char* sansClass = dStrstr(docblock, "@class"); + if (!sansClass) + sansClass = dStrstr(docblock, "\\class"); + + if (sansClass) + { + // Don't save the class declaration. Scan past the 'class' + // keyword and up to the first whitespace. + sansClass += 7; + S32 index = 0; + while ((*sansClass != ' ') && (*sansClass != '\n') && *sansClass && (index < (nsDocLength - 1))) + { + nsDocBlockClass[index++] = *sansClass; + sansClass++; + } + nsDocBlockClass[index] = '\0'; + + curNSDocBlock = sansClass + 1; + } + else + curFNDocBlock = docblock; + } + + break; + + case OP_LOADIMMED_IDENT: + STR.setStringValue(CodeToSTE(code, ip)); + ip += 2; + break; + + case OP_CALLFUNC: + { + // This routingId is set when we query the object as to whether + // it handles this method. It is set to an enum from the table + // above indicating whether it handles it on a component it owns + // or just on the object. + S32 routingId = 0; + + fnName = CodeToSTE(code, ip); + fnNamespace = CodeToSTE(code, ip + 2); + U32 callType = code[ip + 4]; + + //if this is called from inside a function, append the ip and codeptr + if (!gEvalState.stack.empty()) + { + gEvalState.stack.last()->code = this; + gEvalState.stack.last()->ip = ip - 1; + } + + ip += 5; + gCallStack.argvc(fnName, callArgc, &callArgv); + + if (callType == FuncCallExprNode::FunctionCall) + { + // Note: This works even if the function was in a package. Reason being is when + // activatePackage() is called, it swaps the namespaceEntry into the global namespace + // (and reverts it when deactivatePackage is called). Method or Static related ones work + // as expected, as the namespace is resolved on the fly. + nsEntry = Namespace::global()->lookup(fnName); + if (!nsEntry) + { + Con::warnf(ConsoleLogEntry::General, + "%s: Unable to find function %s", + getFileLine(ip - 4), fnName); + //STR.popFrame(); + gCallStack.popFrame(); + break; + } + } + else if (callType == FuncCallExprNode::StaticCall) + { + // Try to look it up. + ns = Namespace::find(fnNamespace); + nsEntry = ns->lookup(fnName); + if (!nsEntry) + { + Con::warnf(ConsoleLogEntry::General, + "%s: Unable to find function %s%s%s", + getFileLine(ip - 4), fnNamespace ? fnNamespace : "", + fnNamespace ? "::" : "", fnName); + //STR.popFrame(); + gCallStack.popFrame(); + break; + } + } + else if (callType == FuncCallExprNode::MethodCall) + { + saveObject = gEvalState.thisObject; + + // Optimization: If we're an integer, we can lookup the value by SimObjectId + const ConsoleValue& simObjectLookupValue = callArgv[1]; + if (simObjectLookupValue.getType() == ConsoleValueType::cvInteger) + gEvalState.thisObject = Sim::findObject(static_cast(simObjectLookupValue.getInt())); + else + gEvalState.thisObject = Sim::findObject(simObjectLookupValue.getString()); + + if (gEvalState.thisObject == NULL) + { + Con::warnf( + ConsoleLogEntry::General, + "%s: Unable to find object: '%s' attempting to call function '%s'", + getFileLine(ip - 6), + simObjectLookupValue.getString(), + fnName + ); + //STR.popFrame(); + gCallStack.popFrame(); + STR.setStringValue(""); + break; + } + + ns = gEvalState.thisObject->getNamespace(); + if (ns) + nsEntry = ns->lookup(fnName); + else + nsEntry = NULL; + } + else // it's a ParentCall + { + if (thisNamespace) + { + ns = thisNamespace->mParent; + if (ns) + nsEntry = ns->lookup(fnName); + else + nsEntry = NULL; + } + else + { + ns = NULL; + nsEntry = NULL; + } + } + + if (!nsEntry || noCalls) + { + if (!noCalls) + { + Con::warnf(ConsoleLogEntry::General, "%s: Unknown command %s.", getFileLine(ip - 4), fnName); + if (callType == FuncCallExprNode::MethodCall) + { + Con::warnf(ConsoleLogEntry::General, " Object %s(%d) %s", + gEvalState.thisObject->getName() ? gEvalState.thisObject->getName() : "", + gEvalState.thisObject->getId(), Con::getNamespaceList(ns)); + } + } + gCallStack.popFrame(); + STR.setStringValue(""); + STR.setStringValue(""); + break; + } + if (nsEntry->mType == Namespace::Entry::ConsoleFunctionType) + { + if (nsEntry->mFunctionOffset) + { + ConsoleValue ret; + nsEntry->mCode->exec(nsEntry->mFunctionOffset, fnName, nsEntry->mNamespace, callArgc, callArgv, false, nsEntry->mPackage, ret); + STR.setStringValue(ret.getString()); + } + else // no body + STR.setStringValue(""); + + gCallStack.popFrame(); + } + else + { + if ((nsEntry->mMinArgs && S32(callArgc) < nsEntry->mMinArgs) || (nsEntry->mMaxArgs && S32(callArgc) > nsEntry->mMaxArgs)) + { + const char* nsName = ns ? ns->mName : ""; + Con::warnf(ConsoleLogEntry::Script, "%s: %s::%s - wrong number of arguments.", getFileLine(ip - 4), nsName, fnName); + Con::warnf(ConsoleLogEntry::Script, "%s: usage: %s", getFileLine(ip - 4), nsEntry->mUsage); + gCallStack.popFrame(); + STR.setStringValue(""); + } + else + { + switch (nsEntry->mType) + { + case Namespace::Entry::StringCallbackType: + { + const char* ret = nsEntry->cb.mStringCallbackFunc(gEvalState.thisObject, callArgc, callArgv); + gCallStack.popFrame(); + if (ret != STR.getStringValue()) + STR.setStringValue(ret); + else + STR.setLen(dStrlen(ret)); + break; + } + case Namespace::Entry::IntCallbackType: + { + S32 result = nsEntry->cb.mIntCallbackFunc(gEvalState.thisObject, callArgc, callArgv); + gCallStack.popFrame(); + if (code[ip] == OP_STR_TO_UINT) + { + ip++; + intStack[++_UINT] = result; + break; + } + else if (code[ip] == OP_STR_TO_FLT) + { + ip++; + floatStack[++_FLT] = result; + break; + } + else if (code[ip] == OP_STR_TO_NONE) + ip++; + else + STR.setIntValue(result); + break; + } + case Namespace::Entry::FloatCallbackType: + { + F64 result = nsEntry->cb.mFloatCallbackFunc(gEvalState.thisObject, callArgc, callArgv); + gCallStack.popFrame(); + if (code[ip] == OP_STR_TO_UINT) + { + ip++; + intStack[++_UINT] = (S64)result; + break; + } + else if (code[ip] == OP_STR_TO_FLT) + { + ip++; + floatStack[++_FLT] = result; + break; + } + else if (code[ip] == OP_STR_TO_NONE) + ip++; + else + STR.setFloatValue(result); + break; + } + case Namespace::Entry::VoidCallbackType: + { + nsEntry->cb.mVoidCallbackFunc(gEvalState.thisObject, callArgc, callArgv); + if (code[ip] != OP_STR_TO_NONE) + Con::warnf(ConsoleLogEntry::General, "%s: Call to %s in %s uses result of void function call.", getFileLine(ip - 4), fnName, functionName); + gCallStack.popFrame(); + STR.setStringValue(""); + break; + } + case Namespace::Entry::BoolCallbackType: + { + bool result = nsEntry->cb.mBoolCallbackFunc(gEvalState.thisObject, callArgc, callArgv); + gCallStack.popFrame(); + if (code[ip] == OP_STR_TO_UINT) + { + ip++; + intStack[++_UINT] = result; + break; + } + else if (code[ip] == OP_STR_TO_FLT) + { + ip++; + floatStack[++_FLT] = result; + break; + } + else if (code[ip] == OP_STR_TO_NONE) + ip++; + else + STR.setIntValue(result); + break; + } + } + } + } + + if (callType == FuncCallExprNode::MethodCall) + gEvalState.thisObject = saveObject; + break; + } + case OP_ADVANCE_STR: + STR.advance(); + break; + case OP_ADVANCE_STR_APPENDCHAR: + STR.advanceChar(code[ip++]); + break; + + case OP_ADVANCE_STR_COMMA: + STR.advanceChar('_'); + break; + + case OP_ADVANCE_STR_NUL: + STR.advanceChar(0); + break; + + case OP_REWIND_STR: + STR.rewind(); + break; + + case OP_TERMINATE_REWIND_STR: + STR.rewindTerminate(); + break; + + case OP_COMPARE_STR: + intStack[++_UINT] = STR.compare(); + break; + + case OP_PUSH: + gCallStack.pushString(STR.getStringValue(), STR.mLen); + break; + + case OP_PUSH_UINT: + gCallStack.pushInt((U32)intStack[_UINT--]); + break; + + case OP_PUSH_FLT: + gCallStack.pushFloat(floatStack[_FLT--]); + break; + + case OP_PUSH_FRAME: + gCallStack.pushFrame(code[ip++]); + break; + + case OP_ASSERT: + { + if (!intStack[_UINT--]) + { + const char* message = curStringTable + code[ip]; + + U32 breakLine, inst; + findBreakLine(ip - 1, breakLine, inst); + + if (PlatformAssert::processAssert(PlatformAssert::Fatal, + name ? name : "eval", + breakLine, + message)) + { + if (TelDebugger && TelDebugger->isConnected() && breakLine > 0) + { + TelDebugger->breakProcess(); + } + else + Platform::debugBreak(); + } + } + + ip++; + break; + } + + case OP_BREAK: + { + //append the ip and codeptr before managing the breakpoint! + AssertFatal(!gEvalState.stack.empty(), "Empty eval stack on break!"); + gEvalState.stack.last()->code = this; + gEvalState.stack.last()->ip = ip - 1; + + U32 breakLine; + findBreakLine(ip - 1, breakLine, instruction); + if (!breakLine) + goto breakContinue; + TelDebugger->executionStopped(this, breakLine); + + goto breakContinue; + } + + case OP_ITER_BEGIN_STR: + { + iterStack[_ITER].mIsStringIter = true; + /* fallthrough */ + } + + case OP_ITER_BEGIN: + { + StringTableEntry varName = CodeToSTE(code, ip); + U32 failIp = code[ip + 2]; + + IterStackRecord& iter = iterStack[_ITER]; + + iter.mVariable = gEvalState.getCurrentFrame().add(varName); + + if (iter.mIsStringIter) + { + iter.mData.mStr.mString = STR.getStringValue(); + iter.mData.mStr.mIndex = 0; + } + else + { + // Look up the object. + + SimSet* set; + if (!Sim::findObject(STR.getStringValue(), set)) + { + Con::errorf(ConsoleLogEntry::General, "No SimSet object '%s'", STR.getStringValue()); + Con::errorf(ConsoleLogEntry::General, "Did you mean to use 'foreach$' instead of 'foreach'?"); + ip = failIp; + continue; + } + + // Set up. + + iter.mData.mObj.mSet = set; + iter.mData.mObj.mIndex = 0; + } + + _ITER++; + iterDepth++; + + STR.push(); + + ip += 3; + break; + } + + case OP_ITER: + { + U32 breakIp = code[ip]; + IterStackRecord& iter = iterStack[_ITER - 1]; + + if (iter.mIsStringIter) + { + const char* str = iter.mData.mStr.mString; + + U32 startIndex = iter.mData.mStr.mIndex; + U32 endIndex = startIndex; + + // Break if at end. + + if (!str[startIndex]) + { + ip = breakIp; + continue; + } + + // Find right end of current component. + + if (!dIsspace(str[endIndex])) + do ++endIndex; + while (str[endIndex] && !dIsspace(str[endIndex])); + + // Extract component. + + if (endIndex != startIndex) + { + char savedChar = str[endIndex]; + const_cast(str)[endIndex] = '\0'; // We are on the string stack so this is okay. + iter.mVariable->setStringValue(&str[startIndex]); + const_cast(str)[endIndex] = savedChar; + } + else + iter.mVariable->setStringValue(""); + + // Skip separator. + if (str[endIndex] != '\0') + ++endIndex; + + iter.mData.mStr.mIndex = endIndex; + } + else + { + U32 index = iter.mData.mObj.mIndex; + SimSet* set = iter.mData.mObj.mSet; + + if (index >= set->size()) + { + ip = breakIp; + continue; + } + + iter.mVariable->setIntValue(set->at(index)->getId()); + iter.mData.mObj.mIndex = index + 1; + } + + ++ip; + break; + } + + case OP_ITER_END: + { + --_ITER; + --iterDepth; + + STR.rewind(); + + iterStack[_ITER].mIsStringIter = false; + break; + } + + case OP_INVALID: + + default: + // error! + goto execFinished; + } + } +execFinished: +#ifdef TORQUE_DEBUG + AssertFatal(returnValue.getType() == ConsoleValueType::cvNone, "returnValue was never set during script exec"); +#endif + + if (telDebuggerOn && setFrame < 0) + TelDebugger->popStackFrame(); + + if (popFrame) + { + gEvalState.popFrame(); + } + + if (argv) + { + if (gEvalState.traceOn) + { + traceBuffer[0] = 0; + dStrcat(traceBuffer, "Leaving ", TRACE_BUFFER_SIZE); + + if (packageName) + { + dStrcat(traceBuffer, "[", TRACE_BUFFER_SIZE); + dStrcat(traceBuffer, packageName, TRACE_BUFFER_SIZE); + dStrcat(traceBuffer, "]", TRACE_BUFFER_SIZE); + } + if (thisNamespace && thisNamespace->mName) + { + dSprintf(traceBuffer + dStrlen(traceBuffer), sizeof(traceBuffer) - dStrlen(traceBuffer), + "%s::%s() - return %s", thisNamespace->mName, thisFunctionName, returnValue.getString()); + } + else + { + dSprintf(traceBuffer + dStrlen(traceBuffer), sizeof(traceBuffer) - dStrlen(traceBuffer), + "%s() - return %s", thisFunctionName, returnValue.getString()); + } + Con::printf("%s", traceBuffer); + } + } + else + { + delete[] const_cast(globalStrings); + delete[] globalFloats; + globalStrings = NULL; + globalFloats = NULL; + } + smCurrentCodeBlock = saveCodeBlock; + if (saveCodeBlock && saveCodeBlock->name) + { + Con::gCurrentFile = saveCodeBlock->name; + Con::gCurrentRoot = saveCodeBlock->modPath; + } + + decRefCount(); + +#ifdef TORQUE_DEBUG + AssertFatal(!(STR.mStartStackSize > stackStart), "String stack not popped enough in script exec"); + AssertFatal(!(STR.mStartStackSize < stackStart), "String stack popped too much in script exec"); +#endif } //------------------------------------------------------------ diff --git a/Engine/source/console/compiler.h b/Engine/source/console/compiler.h index 26dc93c13..c58fff3e6 100644 --- a/Engine/source/console/compiler.h +++ b/Engine/source/console/compiler.h @@ -93,26 +93,28 @@ namespace Compiler OP_MUL, OP_DIV, OP_NEG, - OP_INC, - OP_DEC, OP_SETCURVAR, OP_SETCURVAR_CREATE, OP_SETCURVAR_ARRAY, - OP_SETCURVAR_ARRAY_VARLOOKUP, OP_SETCURVAR_ARRAY_CREATE, - OP_SETCURVAR_ARRAY_CREATE_VARLOOKUP, OP_LOADVAR_UINT,// 40 OP_LOADVAR_FLT, OP_LOADVAR_STR, - OP_LOADVAR_VAR, OP_SAVEVAR_UINT, OP_SAVEVAR_FLT, OP_SAVEVAR_STR, - OP_SAVEVAR_VAR, + + OP_LOAD_LOCAL_VAR_UINT, + OP_LOAD_LOCAL_VAR_FLT, + OP_LOAD_LOCAL_VAR_STR, + + OP_SAVE_LOCAL_VAR_UINT, + OP_SAVE_LOCAL_VAR_FLT, + OP_SAVE_LOCAL_VAR_STR, OP_SETCUROBJECT, OP_SETCUROBJECT_NEW, @@ -121,8 +123,6 @@ namespace Compiler OP_SETCURFIELD, OP_SETCURFIELD_ARRAY, // 50 OP_SETCURFIELD_TYPE, - OP_SETCURFIELD_ARRAY_VAR, - OP_SETCURFIELD_THIS, OP_LOADFIELD_UINT, OP_LOADFIELD_FLT, @@ -141,19 +141,15 @@ namespace Compiler OP_UINT_TO_FLT, OP_UINT_TO_STR, OP_UINT_TO_NONE, - OP_COPYVAR_TO_NONE, OP_LOADIMMED_UINT, OP_LOADIMMED_FLT, OP_TAG_TO_STR, OP_LOADIMMED_STR, // 70 - OP_DOCBLOCK_STR, + OP_DOCBLOCK_STR, // 76 OP_LOADIMMED_IDENT, - OP_CALLFUNC_RESOLVE, OP_CALLFUNC, - OP_CALLFUNC_POINTER, - OP_CALLFUNC_THIS, OP_ADVANCE_STR, OP_ADVANCE_STR_APPENDCHAR, @@ -166,8 +162,6 @@ namespace Compiler OP_PUSH, // String OP_PUSH_UINT, // Integer OP_PUSH_FLT, // Float - OP_PUSH_VAR, // Variable - OP_PUSH_THIS, // This pointer OP_PUSH_FRAME, // Frame OP_ASSERT, diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index 39d4b204d..50bdb5391 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -271,8 +271,6 @@ StringTableEntry gCurrentFile; StringTableEntry gCurrentRoot; /// @} -S32 gObjectCopyFailures = -1; - bool alwaysUseDebugOutput = true; bool useTimestamp = false; bool useRealTimestamp = false; @@ -327,6 +325,7 @@ void init() // Setup the console types. ConsoleBaseType::initialize(); + ConsoleValue::init(); // And finally, the ACR... AbstractClassRep::initialize(); @@ -344,10 +343,6 @@ void init() addVariable( "instantGroup", TypeRealString, &gInstantGroup, "The group that objects will be added to when they are created.\n" "@ingroup Console\n"); - addVariable("Con::objectCopyFailures", TypeS32, &gObjectCopyFailures, "If greater than zero then it counts the number of object creation " - "failures based on a missing copy object and does not report an error..\n" - "@ingroup Console\n"); - // Current script file name and root addVariable( "Con::File", TypeString, &gCurrentFile, "The currently executing script file.\n" "@ingroup FileSystem\n"); @@ -1590,11 +1585,9 @@ ConsoleValueRef _internalExecute(SimObject *object, S32 argc, ConsoleValueRef ar ICallMethod *com = dynamic_cast(object); if(com) { - STR.pushFrame(); - CSTK.pushFrame(); + gCallStack.pushFrame(0); com->callMethodArgList(argc, argv, false); - STR.popFrame(); - CSTK.popFrame(); + gCallStack.popFrame(); } } @@ -2523,70 +2516,20 @@ DefineEngineFunction( logWarning, void, ( const char* message ),, //------------------------------------------------------------------------------ -extern ConsoleValueStack CSTK; - -ConsoleValueRef::ConsoleValueRef(const ConsoleValueRef &ref) -{ - value = ref.value; -} - -ConsoleValueRef& ConsoleValueRef::operator=(const ConsoleValueRef &newValue) -{ - value = newValue.value; - return *this; -} - -ConsoleValueRef& ConsoleValueRef::operator=(const char *newValue) -{ - AssertFatal(value, "value should not be NULL"); - value->setStringValue(newValue); - return *this; -} - -ConsoleValueRef& ConsoleValueRef::operator=(S32 newValue) -{ - AssertFatal(value, "value should not be NULL"); - value->setIntValue(newValue); - return *this; -} - -ConsoleValueRef& ConsoleValueRef::operator=(U32 newValue) -{ - AssertFatal(value, "value should not be NULL"); - value->setIntValue(newValue); - return *this; -} - -ConsoleValueRef& ConsoleValueRef::operator=(F32 newValue) -{ - AssertFatal(value, "value should not be NULL"); - value->setFloatValue(newValue); - return *this; -} - -ConsoleValueRef& ConsoleValueRef::operator=(F64 newValue) -{ - AssertFatal(value, "value should not be NULL"); - value->setFloatValue(newValue); - return *this; -} - -//------------------------------------------------------------------------------ - -StringStackWrapper::StringStackWrapper(int targc, ConsoleValueRef targv[]) +ConsoleValueToStringArrayWrapper::ConsoleValueToStringArrayWrapper(int targc, ConsoleValue *targv) { argv = new const char*[targc]; argc = targc; - for (int i=0; i bufferLen) - sval = (char *) dRealloc(sval, newLen); - - dStrcpy(sval, internalValue, newLen); - bufferLen = newLen; - - return sval; - } -} - -StringStackPtr ConsoleValue::getStringStackPtr() -{ - if (type == TypeInternalStringStackPtr) - return (uintptr_t)sval; - else - return (uintptr_t)-1; -} - -bool ConsoleValue::getBoolValue() -{ - if(type == TypeInternalString || type == TypeInternalStackString || type == TypeInternalStringStackPtr) - return dAtob(getStringValue()); - if(type == TypeInternalFloat) - return fval > 0; - else if(type == TypeInternalInt) - return ival > 0; - else { - const char *value = Con::getData(type, dataPtr, 0, enumTable); - return dAtob(value); - } -} - -void ConsoleValue::setIntValue(S32 val) -{ - setFloatValue(val); -} - -void ConsoleValue::setIntValue(U32 val) -{ - if(type <= TypeInternalString) - { - fval = (F32)val; - ival = val; - if(bufferLen > 0) - { - dFree(sval); - bufferLen = 0; - } - - sval = typeValueEmpty; - type = TypeInternalInt; - } - else - { - const char *dptr = Con::getData(TypeS32, &val, 0); - Con::setData(type, dataPtr, 0, 1, &dptr, enumTable); - } -} - -void ConsoleValue::setBoolValue(bool val) -{ - return setIntValue(val ? 1 : 0); -} - -void ConsoleValue::setFloatValue(F32 val) -{ - if(type <= TypeInternalString) - { - fval = val; - ival = static_cast(val); - if(bufferLen > 0) - { - dFree(sval); - bufferLen = 0; - } - sval = typeValueEmpty; - type = TypeInternalFloat; - } - else - { - const char *dptr = Con::getData(TypeF32, &val, 0); - Con::setData(type, dataPtr, 0, 1, &dptr, enumTable); - } } //------------------------------------------------------------------------------ diff --git a/Engine/source/console/consoleInternal.cpp b/Engine/source/console/consoleInternal.cpp index 420d5a033..a498be154 100644 --- a/Engine/source/console/consoleInternal.cpp +++ b/Engine/source/console/consoleInternal.cpp @@ -183,13 +183,13 @@ void Dictionary::exportVariables(const char *varString, const char *fileName, bo for (s = sortList.begin(); s != sortList.end(); s++) { - switch ((*s)->value.type) + switch ((*s)->value.getType()) { - case ConsoleValue::TypeInternalInt: - dSprintf(buffer, sizeof(buffer), "%s = %d;%s", (*s)->name, (*s)->value.ival, cat); + case ConsoleValueType::cvInteger: + dSprintf(buffer, sizeof(buffer), "%s = %d;%s", (*s)->name, (*s)->value.getInt(), cat); break; - case ConsoleValue::TypeInternalFloat: - dSprintf(buffer, sizeof(buffer), "%s = %g;%s", (*s)->name, (*s)->value.fval, cat); + case ConsoleValueType::cvFloat: + dSprintf(buffer, sizeof(buffer), "%s = %g;%s", (*s)->name, (*s)->value.getFloat(), cat); break; default: expandEscape(expandBuffer, (*s)->getStringValue()); @@ -243,13 +243,11 @@ void Dictionary::exportVariables(const char *varString, Vector *names, V if (values) { - switch ((*s)->value.type) + switch ((*s)->value.getType()) { - case ConsoleValue::TypeInternalInt: - values->push_back(String::ToString((*s)->value.ival)); - break; - case ConsoleValue::TypeInternalFloat: - values->push_back(String::ToString((*s)->value.fval)); + case ConsoleValueType::cvInteger: + case ConsoleValueType::cvFloat: + values->push_back(String((*s)->value.getString())); break; default: expandEscape(expandBuffer, (*s)->getStringValue()); @@ -470,7 +468,6 @@ char *typeValueEmpty = ""; Dictionary::Entry::Entry(StringTableEntry in_name) { name = in_name; - value.type = ConsoleValue::TypeInternalString; notify = NULL; nextEntry = NULL; mUsage = NULL; @@ -508,150 +505,6 @@ const char *Dictionary::getVariable(StringTableEntry name, bool *entValid) return ""; } -void ConsoleValue::setStringValue(const char * value) -{ - if (value == NULL) value = typeValueEmpty; - - if (type <= ConsoleValue::TypeInternalString) - { - // Let's not remove empty-string-valued global vars from the dict. - // If we remove them, then they won't be exported, and sometimes - // it could be necessary to export such a global. There are very - // few empty-string global vars so there's no performance-related - // need to remove them from the dict. - /* - if(!value[0] && name[0] == '$') - { - gEvalState.globalVars.remove(this); - return; - } - */ - if (value == typeValueEmpty) - { - if (bufferLen > 0) - { - dFree(sval); - bufferLen = 0; - } - - sval = typeValueEmpty; - fval = 0.f; - ival = 0; - type = TypeInternalString; - return; - } - - U32 stringLen = dStrlen(value); - - // If it's longer than 256 bytes, it's certainly not a number. - // - // (This decision may come back to haunt you. Shame on you if it - // does.) - if (stringLen < 256) - { - fval = dAtof(value); - ival = dAtoi(value); - } - else - { - fval = 0.f; - ival = 0; - } - - // may as well pad to the next cache line - U32 newLen = ((stringLen + 1) + 15) & ~15; - - if (bufferLen == 0) - sval = (char *)dMalloc(newLen); - else if (newLen > bufferLen) - sval = (char *)dRealloc(sval, newLen); - - type = TypeInternalString; - - bufferLen = newLen; - dStrcpy(sval, value, newLen); - } - else - Con::setData(type, dataPtr, 0, 1, &value, enumTable); -} - - -void ConsoleValue::setStackStringValue(const char *value) -{ - if (value == NULL) value = typeValueEmpty; - - if (type <= ConsoleValue::TypeInternalString) - { - // sval might still be temporarily present so we need to check and free it - if (bufferLen > 0) - { - dFree(sval); - bufferLen = 0; - } - - if (value == typeValueEmpty) - { - sval = typeValueEmpty; - fval = 0.f; - ival = 0; - type = TypeInternalString; - return; - } - - U32 stringLen = dStrlen(value); - if (stringLen < 256) - { - fval = dAtof(value); - ival = dAtoi(value); - } - else - { - fval = 0.f; - ival = 0; - } - - type = TypeInternalStackString; - sval = (char*)value; - bufferLen = 0; - } - else - Con::setData(type, dataPtr, 0, 1, &value, enumTable); -} - -void ConsoleValue::setStringStackPtrValue(StringStackPtr ptrValue) -{ - if (type <= ConsoleValue::TypeInternalString) - { - const char *value = StringStackPtrRef(ptrValue).getPtr(&STR); - if (bufferLen > 0) - { - dFree(sval); - bufferLen = 0; - } - - U32 stringLen = dStrlen(value); - if (stringLen < 256) - { - fval = dAtof(value); - ival = dAtoi(value); - } - else - { - fval = 0.f; - ival = 0; - } - - type = TypeInternalStringStackPtr; - sval = (char*)(value - STR.mBuffer); - bufferLen = 0; - } - else - { - const char *value = StringStackPtrRef(ptrValue).getPtr(&STR); - Con::setData(type, dataPtr, 0, 1, &value, enumTable); - } -} - S32 Dictionary::getIntVariable(StringTableEntry name, bool *entValid) { Entry *ent = lookup(name); diff --git a/Engine/source/console/consoleInternal.h b/Engine/source/console/consoleInternal.h index 129da9dfb..151a75ac2 100644 --- a/Engine/source/console/consoleInternal.h +++ b/Engine/source/console/consoleInternal.h @@ -324,17 +324,17 @@ public: inline U32 getIntValue() { - return value.getIntValue(); + return value.getInt(); } inline F32 getFloatValue() { - return value.getFloatValue(); + return value.getFloat(); } inline const char *getStringValue() { - return value.getStringValue(); + return value.getString(); } void setIntValue(U32 val) @@ -345,7 +345,7 @@ public: return; } - value.setIntValue(val); + value.setInt(val); // Fire off the notification if we have one. if (notify) @@ -360,23 +360,7 @@ public: return; } - value.setFloatValue(val); - - // Fire off the notification if we have one. - if (notify) - notify->trigger(); - } - - void setStringStackPtrValue(StringStackPtr newValue) - { - if (mIsConstant) - { - Con::errorf("Cannot assign value to constant '%s'.", name); - return; - } - - value.setStringStackPtrValue(newValue); - + value.setFloat(val); // Fire off the notification if we have one. if (notify) @@ -391,8 +375,7 @@ public: return; } - value.setStringValue(newValue); - + value.setString(newValue, dStrlen(newValue)); // Fire off the notification if we have one. if (notify) @@ -471,6 +454,18 @@ public: void validate(); }; +struct ConsoleValueFrame +{ + ConsoleValue* values; + bool isReference; + + ConsoleValueFrame(ConsoleValue* vals, bool isRef) + { + values = vals; + isReference = isRef; + } +}; + class ExprEvalState { public: @@ -499,6 +494,9 @@ public: /// an interior pointer that will become invalid when the object changes address. Vector< Dictionary* > stack; + Vector< ConsoleValueFrame > localStack; + ConsoleValueFrame* currentRegisterArray; // contains array at to top of localStack + /// Dictionary globalVars; @@ -511,10 +509,43 @@ public: void setIntVariable(S32 val); void setFloatVariable(F64 val); void setStringVariable(const char *str); - void setStringStackPtrVariable(StringStackPtr str); - void setCopyVariable(); - void pushFrame(StringTableEntry frameName, Namespace *ns); + TORQUE_FORCEINLINE S32 getLocalIntVariable(S32 reg) + { + return currentRegisterArray->values[reg].getInt(); + } + + TORQUE_FORCEINLINE F64 getLocalFloatVariable(S32 reg) + { + return currentRegisterArray->values[reg].getFloat(); + } + + TORQUE_FORCEINLINE const char* getLocalStringVariable(S32 reg) + { + return currentRegisterArray->values[reg].getString(); + } + + TORQUE_FORCEINLINE void setLocalIntVariable(S32 reg, S64 val) + { + currentRegisterArray->values[reg].setInt(val); + } + + TORQUE_FORCEINLINE void setLocalFloatVariable(S32 reg, F64 val) + { + currentRegisterArray->values[reg].setFloat(val); + } + + TORQUE_FORCEINLINE void setLocalStringVariable(S32 reg, const char* val, S32 len) + { + currentRegisterArray->values[reg].setString(val, len); + } + + TORQUE_FORCEINLINE void setLocalStringTableEntryVariable(S32 reg, StringTableEntry val) + { + currentRegisterArray->values[reg].setStringTableEntry(val); + } + + void pushFrame(StringTableEntry frameName, Namespace *ns, S32 regCount); void popFrame(); /// Puts a reference to an existing stack frame diff --git a/Engine/source/console/consoleLogger.cpp b/Engine/source/console/consoleLogger.cpp index fc2095eae..d68cdb6c0 100644 --- a/Engine/source/console/consoleLogger.cpp +++ b/Engine/source/console/consoleLogger.cpp @@ -79,18 +79,18 @@ void ConsoleLogger::initPersistFields() //----------------------------------------------------------------------------- -bool ConsoleLogger::processArguments( S32 argc, ConsoleValueRef *argv ) +bool ConsoleLogger::processArguments( S32 argc, ConsoleValue *argv ) { if( argc == 0 ) return false; bool append = false; - if( argc == 2 ) - append = dAtob( argv[1] ); + if (argc == 2) + append = argv[1].getBool(); mAppend = append; - mFilename = StringTable->insert( argv[0] ); + mFilename = StringTable->insert( argv[0].getString() ); if( init() ) { diff --git a/Engine/source/console/consoleLogger.h b/Engine/source/console/consoleLogger.h index 901f45b17..e969f3ac1 100644 --- a/Engine/source/console/consoleLogger.h +++ b/Engine/source/console/consoleLogger.h @@ -81,7 +81,7 @@ class ConsoleLogger : public SimObject /// // Example script constructor usage. /// %obj = new ConsoleLogger( objName, logFileName, [append = false] ); /// @endcode - bool processArguments( S32 argc, ConsoleValueRef *argv ); + bool processArguments( S32 argc, ConsoleValue *argv ); /// Default constructor, make sure to initalize ConsoleLogger(); diff --git a/Engine/source/console/consoleValueStack.h b/Engine/source/console/consoleValueStack.h new file mode 100644 index 000000000..b88804dd5 --- /dev/null +++ b/Engine/source/console/consoleValueStack.h @@ -0,0 +1,121 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2013 GarageGames, LLC +// Copyright (c) 2021 TGEMIT Authors & Contributors +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +#ifndef _CONSOLE_CONSOLE_VALUE_STACK_H_ +#define _CONSOLE_CONSOLE_VALUE_STACK_H_ + +template +class ConsoleValueStack +{ + constexpr static S32 allocatorSize = sizeof(ConsoleValue) * StackSize; + + struct Frame + { + ConsoleValue* values; + S32 count; + S32 internalCounter; + }; + + Vector stack; + char* memory; + S32 sp; + + TORQUE_FORCEINLINE Frame alloc(S32 count) + { + AssertFatal(sp + count * sizeof(ConsoleValue) < allocatorSize, "ConsoleValueStack overflow"); + + ConsoleValue* ret = reinterpret_cast(memory + sp); + sp += count * sizeof(ConsoleValue); + + return { ret, count, 1 }; + } + + TORQUE_FORCEINLINE void deAlloc(S32 count) + { + sp -= count * sizeof(ConsoleValue); + AssertFatal(sp >= 0, "Popped ConsoleValueStack too far, underflow"); + } + +public: + ConsoleValueStack() + { + memory = (char*)dMalloc(allocatorSize); + for (S32 i = 0; i < allocatorSize; i += sizeof(ConsoleValue)) + { + constructInPlace(reinterpret_cast(memory + i)); + } + sp = 0; + } + + ~ConsoleValueStack() + { + dFree(memory); + } + + TORQUE_FORCEINLINE void pushFrame(S32 count) + { + AssertISV(count >= 0, "Must be >= 0 when pushing stack frame"); + + // +1 for function name in argv[0] + const Frame& frame = alloc(count + 1); + stack.push_back(frame); + } + + TORQUE_FORCEINLINE void popFrame() + { + AssertISV(stack.size() > 0, "Stack Underflow"); + + deAlloc(stack.last().count); + stack.pop_back(); + } + + TORQUE_FORCEINLINE void pushInt(S64 value) + { + Frame& frame = stack.last(); + frame.values[frame.internalCounter++].setInt(value); + } + + TORQUE_FORCEINLINE void pushFloat(F64 value) + { + Frame& frame = stack.last(); + frame.values[frame.internalCounter++].setFloat(value); + } + + TORQUE_FORCEINLINE void pushString(const char* value, S32 len) + { + Frame& frame = stack.last(); + frame.values[frame.internalCounter++].setString(value, len); + } + + TORQUE_FORCEINLINE void argvc(StringTableEntry fn, S32& argc, ConsoleValue** argv) + { + Frame& frame = stack.last(); + argc = frame.count; + + // First param is always function name + frame.values[0].setStringTableEntry(fn); + *argv = frame.values; + } +}; + +#endif diff --git a/Engine/source/console/sim.h b/Engine/source/console/sim.h index d43c14b1e..61ff469e0 100644 --- a/Engine/source/console/sim.h +++ b/Engine/source/console/sim.h @@ -125,15 +125,12 @@ namespace Sim SimDataBlockGroup *getDataBlockGroup(); SimGroup* getRootGroup(); - SimObject* findObject(ConsoleValueRef&); SimObject* findObject(SimObjectId); + SimObject* findObject(const ConsoleValue&); + SimObject* findObject(ConsoleValue*); SimObject* findObject(const char* name); SimObject* findObject(const char* fileName, S32 declarationLine); - template inline bool findObject(ConsoleValueRef &ref,T*&t) - { - t = dynamic_cast(findObject(ref)); - return t != NULL; - } + template inline bool findObject(SimObjectId iD,T*&t) { t = dynamic_cast(findObject(iD)); diff --git a/Engine/source/console/simManager.cpp b/Engine/source/console/simManager.cpp index fc8a77edd..b874f752e 100644 --- a/Engine/source/console/simManager.cpp +++ b/Engine/source/console/simManager.cpp @@ -328,11 +328,6 @@ SimObject* findObject(const char* fileName, S32 declarationLine) return gRootGroup->findObjectByLineNumber(fileName, declarationLine, true); } -SimObject* findObject(ConsoleValueRef &ref) -{ - return findObject((const char*)ref); -} - SimObject* findObject(const char* name) { PROFILE_SCOPE(SimFindObject); @@ -391,6 +386,24 @@ SimObject* findObject(const char* name) return obj->findObject(name + len + 1); } +SimObject* findObject(const ConsoleValue &val) +{ + if (val.getType() == ConsoleValueType::cvNone) + return NULL; + if (val.getType() == ConsoleValueType::cvInteger) + return findObject((SimObjectId)val.getInt()); + return findObject(val.getString()); +} + +SimObject* findObject(ConsoleValue* val) +{ + if (val->getType() == ConsoleValueType::cvNone) + return NULL; + if (val->getType() == ConsoleValueType::cvInteger) + return findObject((SimObjectId)val->getInt()); + return findObject(val->getString()); +} + SimObject* findObject(SimObjectId id) { return gIdDictionary->find(id); diff --git a/Engine/source/console/simSet.cpp b/Engine/source/console/simSet.cpp index 06024c2c6..32f564ff5 100644 --- a/Engine/source/console/simSet.cpp +++ b/Engine/source/console/simSet.cpp @@ -229,11 +229,16 @@ void SimSet::scriptSort( const String &scriptCallbackFn ) //----------------------------------------------------------------------------- -void SimSet::callOnChildren( const String &method, S32 argc, ConsoleValueRef argv[], bool executeOnChildGroups ) +void SimSet::callOnChildren( const String &method, S32 argc, ConsoleValue argv[], bool executeOnChildGroups ) { + // TODO(JTH): Implement + AssertISV(false, "TODO Implement"); + return; + + /* // Prep the arguments for the console exec... // Make sure and leave args[1] empty. - ConsoleValueRef args[21] = { }; + ConsoleValue args[21] = { }; ConsoleValue name_method; name_method.setStackStringValue(method.c_str()); args[0] = ConsoleValueRef::fromValue(&name_method); @@ -255,6 +260,7 @@ void SimSet::callOnChildren( const String &method, S32 argc, ConsoleValueRef arg childSet->callOnChildren( method, argc, argv, executeOnChildGroups ); } } + */ } //----------------------------------------------------------------------------- @@ -838,7 +844,7 @@ SimGroup* SimGroup::deepClone() //----------------------------------------------------------------------------- -bool SimGroup::processArguments(S32, ConsoleValueRef *argv) +bool SimGroup::processArguments(S32, ConsoleValue *argv) { return true; } diff --git a/Engine/source/console/simSet.h b/Engine/source/console/simSet.h index 01f636662..b1f8c3f24 100644 --- a/Engine/source/console/simSet.h +++ b/Engine/source/console/simSet.h @@ -218,7 +218,7 @@ class SimSet : public SimObject, public TamlChildren /// @} - void callOnChildren( const String &method, S32 argc, ConsoleValueRef argv[], bool executeOnChildGroups = true ); + void callOnChildren( const String &method, S32 argc, ConsoleValue argv[], bool executeOnChildGroups = true ); /// Return the number of objects in this set as well as all sets that are contained /// in this set and its children. @@ -464,7 +464,7 @@ class SimGroup: public SimSet virtual SimObject* findObject(const char* name); virtual void onRemove(); - virtual bool processArguments( S32 argc, ConsoleValueRef *argv ); + virtual bool processArguments( S32 argc, ConsoleValue *argv ); virtual SimObject* getObject(const S32& index); diff --git a/Engine/source/console/stringStack.cpp b/Engine/source/console/stringStack.cpp index 96aef1c86..cfe2d83f5 100644 --- a/Engine/source/console/stringStack.cpp +++ b/Engine/source/console/stringStack.cpp @@ -207,228 +207,3 @@ void StringStack::clearFrames() mStartStackSize = 0; mFunctionOffset = 0; } - - -void ConsoleValueStack::getArgcArgv(StringTableEntry name, U32 *argc, ConsoleValueRef **in_argv, bool popStackFrame /* = false */) -{ - U32 startStack = mStackFrames[mFrame-1]; - U32 argCount = getMin(mStackPos - startStack, (U32)MaxArgs - 1); - - *in_argv = mArgv; - mArgv[0].value = CSTK.pushStackString(name); - - for(U32 i = 0; i < argCount; i++) { - ConsoleValueRef *ref = &mArgv[i+1]; - ref->value = &mStack[startStack + i]; - } - argCount++; - - *argc = argCount; - - if(popStackFrame) - popFrame(); -} - -ConsoleValueStack::ConsoleValueStack() : -mFrame(0), -mStackPos(0) -{ - for (int i=0; itype) - { - case ConsoleValue::TypeInternalInt: - mStack[mStackPos++].setIntValue((S32)variable->getIntValue()); - case ConsoleValue::TypeInternalFloat: - mStack[mStackPos++].setFloatValue((F32)variable->getFloatValue()); - default: - mStack[mStackPos++].setStackStringValue(variable->getStringValue()); - } -} - -void ConsoleValueStack::pushValue(ConsoleValue &variable) -{ - if (mStackPos == ConsoleValueStack::MaxStackDepth) { - AssertFatal(false, "Console Value Stack is empty"); - return; - } - - switch (variable.type) - { - case ConsoleValue::TypeInternalInt: - mStack[mStackPos++].setIntValue((S32)variable.getIntValue()); - case ConsoleValue::TypeInternalFloat: - mStack[mStackPos++].setFloatValue((F32)variable.getFloatValue()); - case ConsoleValue::TypeInternalStringStackPtr: - mStack[mStackPos++].setStringStackPtrValue(variable.getStringStackPtr()); - default: - mStack[mStackPos++].setStringValue(variable.getStringValue()); - } -} - -ConsoleValue* ConsoleValueStack::reserveValues(U32 count) -{ - U32 startPos = mStackPos; - if (startPos+count >= ConsoleValueStack::MaxStackDepth) { - AssertFatal(false, "Console Value Stack is empty"); - return NULL; - } - - //Con::printf("[%i]CSTK reserveValues %i", mStackPos, count); - mStackPos += count; - return &mStack[startPos]; -} - -bool ConsoleValueStack::reserveValues(U32 count, ConsoleValueRef *outValues) -{ - U32 startPos = mStackPos; - if (startPos+count >= ConsoleValueStack::MaxStackDepth) { - AssertFatal(false, "Console Value Stack is empty"); - return false; - } - - //Con::printf("[%i]CSTK reserveValues %i", mStackPos, count); - for (U32 i=0; imBuffer + mOffset; } diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index 994606783..b0674765b 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -20,6 +20,7 @@ // IN THE SOFTWARE. //----------------------------------------------------------------------------- +#ifdef 0 #ifdef TORQUE_TESTS_ENABLED #include "testing/unitTesting.h" #include "platform/platform.h" @@ -393,3 +394,4 @@ TEST(Script, Basic_Package) } #endif +#endif diff --git a/Engine/source/console/test/consoleTest.cpp b/Engine/source/console/test/consoleTest.cpp index adea797a2..d1ced9ec9 100644 --- a/Engine/source/console/test/consoleTest.cpp +++ b/Engine/source/console/test/consoleTest.cpp @@ -1,3 +1,5 @@ +#ifdef 0 + #ifdef TORQUE_TESTS_ENABLED #include "testing/unitTesting.h" #include "platform/platform.h" @@ -253,3 +255,4 @@ TEST(Con, execute) } #endif +#endif diff --git a/Engine/source/console/test/engineAPITest.cpp b/Engine/source/console/test/engineAPITest.cpp index 48e780531..32981e260 100644 --- a/Engine/source/console/test/engineAPITest.cpp +++ b/Engine/source/console/test/engineAPITest.cpp @@ -1,3 +1,4 @@ +#if 0 #ifdef TORQUE_TESTS_ENABLED #include "testing/unitTesting.h" #include "platform/platform.h" @@ -147,4 +148,5 @@ TEST(EngineAPI, _EngineConsoleExecCallbackHelper) "All values should be printed in the correct order"; } -#endif \ No newline at end of file +#endif +#endif diff --git a/Engine/source/core/strings/stringFunctions.h b/Engine/source/core/strings/stringFunctions.h index 918273423..d0c91b734 100644 --- a/Engine/source/core/strings/stringFunctions.h +++ b/Engine/source/core/strings/stringFunctions.h @@ -200,6 +200,11 @@ inline F64 dAtod(const char *str) return strtod(str, NULL); } +inline S64 dAtol(const char* str) +{ + return strtol(str, NULL, 10); +} + inline char dToupper(const char c) { return toupper( c ); diff --git a/Engine/source/environment/waterObject.cpp b/Engine/source/environment/waterObject.cpp index 1d3da4aeb..f03bf0636 100644 --- a/Engine/source/environment/waterObject.cpp +++ b/Engine/source/environment/waterObject.cpp @@ -411,7 +411,7 @@ void WaterObject::inspectPostApply() setMaskBits( UpdateMask | WaveMask | TextureMask | SoundMask ); } -bool WaterObject::processArguments( S32 argc, ConsoleValueRef *argv ) +bool WaterObject::processArguments( S32 argc, ConsoleValue *argv ) { if( typeid( *this ) == typeid( WaterObject ) ) { diff --git a/Engine/source/environment/waterObject.h b/Engine/source/environment/waterObject.h index 94862e4c6..15e7b0d40 100644 --- a/Engine/source/environment/waterObject.h +++ b/Engine/source/environment/waterObject.h @@ -156,7 +156,7 @@ public: virtual bool onAdd(); virtual void onRemove(); virtual void inspectPostApply(); - virtual bool processArguments(S32 argc, ConsoleValueRef *argv); + virtual bool processArguments(S32 argc, ConsoleValue *argv); // NetObject virtual U32 packUpdate( NetConnection * conn, U32 mask, BitStream *stream ); diff --git a/Engine/source/gui/core/guiControl.cpp b/Engine/source/gui/core/guiControl.cpp index 7e0f27791..2011aa68b 100644 --- a/Engine/source/gui/core/guiControl.cpp +++ b/Engine/source/gui/core/guiControl.cpp @@ -319,7 +319,7 @@ void GuiControl::initPersistFields() //----------------------------------------------------------------------------- -bool GuiControl::processArguments(S32 argc, ConsoleValueRef *argv) +bool GuiControl::processArguments(S32 argc, ConsoleValue *argv) { // argv[0] - The GuiGroup to add this control to when it's created. // this is an optional parameter that may be specified at diff --git a/Engine/source/gui/core/guiControl.h b/Engine/source/gui/core/guiControl.h index 997213f75..e0b3c0a76 100644 --- a/Engine/source/gui/core/guiControl.h +++ b/Engine/source/gui/core/guiControl.h @@ -341,7 +341,7 @@ class GuiControl : public SimGroup GuiControl(); virtual ~GuiControl(); - virtual bool processArguments(S32 argc, ConsoleValueRef *argv); + virtual bool processArguments(S32 argc, ConsoleValue *argv); static void initPersistFields(); static void consoleInit(); diff --git a/Engine/source/gui/worldEditor/worldEditor.cpp b/Engine/source/gui/worldEditor/worldEditor.cpp index 1e4a795ce..cb0dffc3c 100644 --- a/Engine/source/gui/worldEditor/worldEditor.cpp +++ b/Engine/source/gui/worldEditor/worldEditor.cpp @@ -2858,17 +2858,17 @@ void WorldEditor::initPersistFields() //------------------------------------------------------------------------------ // These methods are needed for the console interfaces. -void WorldEditor::ignoreObjClass( U32 argc, ConsoleValueRef *argv ) +void WorldEditor::ignoreObjClass( U32 argc, ConsoleValue *argv ) { for(S32 i = 2; i < argc; i++) { - ClassInfo::Entry * entry = getClassEntry(argv[i]); + ClassInfo::Entry * entry = getClassEntry(argv[i].getString()); if(entry) entry->mIgnoreCollision = true; else { entry = new ClassInfo::Entry; - entry->mName = StringTable->insert(argv[i]); + entry->mName = StringTable->insert(argv[i].getString()); entry->mIgnoreCollision = true; if(!addClassEntry(entry)) delete entry; diff --git a/Engine/source/gui/worldEditor/worldEditor.h b/Engine/source/gui/worldEditor/worldEditor.h index 01c7d396c..afcdb599a 100644 --- a/Engine/source/gui/worldEditor/worldEditor.h +++ b/Engine/source/gui/worldEditor/worldEditor.h @@ -76,7 +76,7 @@ class WorldEditor : public EditTSCtrl Point3F p2; }; - void ignoreObjClass(U32 argc, ConsoleValueRef* argv); + void ignoreObjClass(U32 argc, ConsoleValue* argv); void clearIgnoreList(); static bool setObjectsUseBoxCenter( void *object, const char *index, const char *data ) { static_cast(object)->setObjectsUseBoxCenter( dAtob( data ) ); return false; }; diff --git a/Engine/source/platformWin32/winMath.cpp b/Engine/source/platformWin32/winMath.cpp index 3b6e3ec15..b273d25f0 100644 --- a/Engine/source/platformWin32/winMath.cpp +++ b/Engine/source/platformWin32/winMath.cpp @@ -55,31 +55,36 @@ DefineEngineStringlyVariadicFunction( mathInit, void, 1, 10, "( ... )" } for (argc--, argv++; argc; argc--, argv++) { - if (dStricmp(*argv, "DETECT") == 0) { + const char* str = (*argv).getString(); + if (dStricmp(str, "DETECT") == 0) { Math::init(0); return; } - if (dStricmp(*argv, "C") == 0) { + if (dStricmp(str, "C") == 0) { properties |= CPU_PROP_C; continue; } - if (dStricmp(*argv, "FPU") == 0) { + if (dStricmp(str, "FPU") == 0) { properties |= CPU_PROP_FPU; continue; } - if (dStricmp(*argv, "MMX") == 0) { + if (dStricmp(str, "MMX") == 0) { properties |= CPU_PROP_MMX; continue; } - if (dStricmp(*argv, "3DNOW") == 0) { + if (dStricmp(str, "3DNOW") == 0) { properties |= CPU_PROP_3DNOW; continue; } - if (dStricmp(*argv, "SSE") == 0) { + if (dStricmp(str, "SSE") == 0) { properties |= CPU_PROP_SSE; continue; } - Con::printf("Error: MathInit(): ignoring unknown math extension '%s'", argv->getStringValue()); + if (dStricmp(str, "SSE2") == 0) { + properties |= CPU_PROP_SSE2; + continue; + } + Con::printf("Error: MathInit(): ignoring unknown math extension '%s'", str); } Math::init(properties); } diff --git a/Engine/source/sfx/sfxSource.cpp b/Engine/source/sfx/sfxSource.cpp index abc5b35e1..47cab9f15 100644 --- a/Engine/source/sfx/sfxSource.cpp +++ b/Engine/source/sfx/sfxSource.cpp @@ -316,7 +316,7 @@ void SFXSource::initPersistFields() //----------------------------------------------------------------------------- -bool SFXSource::processArguments( S32 argc, ConsoleValueRef *argv ) +bool SFXSource::processArguments( S32 argc, ConsoleValue *argv ) { // Don't allow subclasses of this to be created via script. Force // usage of the SFXSystem functions. diff --git a/Engine/source/sfx/sfxSource.h b/Engine/source/sfx/sfxSource.h index 16ab6fd14..8d6bb129f 100644 --- a/Engine/source/sfx/sfxSource.h +++ b/Engine/source/sfx/sfxSource.h @@ -382,7 +382,7 @@ class SFXSource : public SimGroup /// We overload this to disable creation of /// a source via script 'new'. - virtual bool processArguments( S32 argc, ConsoleValueRef *argv ); + virtual bool processArguments( S32 argc, ConsoleValue *argv ); // Console getters/setters. static bool _setDescription( void *obj, const char *index, const char *data ); diff --git a/Engine/source/sfx/sfxTrack.cpp b/Engine/source/sfx/sfxTrack.cpp index 067a202ca..987650c0b 100644 --- a/Engine/source/sfx/sfxTrack.cpp +++ b/Engine/source/sfx/sfxTrack.cpp @@ -95,7 +95,7 @@ void SFXTrack::initPersistFields() //----------------------------------------------------------------------------- -bool SFXTrack::processArguments( S32 argc, ConsoleValueRef *argv ) +bool SFXTrack::processArguments( S32 argc, ConsoleValue *argv ) { if( typeid( *this ) == typeid( SFXTrack ) ) { diff --git a/Engine/source/sfx/sfxTrack.h b/Engine/source/sfx/sfxTrack.h index e30acd007..2beb5e3e6 100644 --- a/Engine/source/sfx/sfxTrack.h +++ b/Engine/source/sfx/sfxTrack.h @@ -61,7 +61,7 @@ class SFXTrack : public SimDataBlock StringTableEntry mParameters[ MaxNumParameters ]; /// Overload this to disable direct instantiation of this class via script 'new'. - virtual bool processArguments( S32 argc, ConsoleValueRef *argv ); + virtual bool processArguments( S32 argc, ConsoleValue *argv ); public: diff --git a/Engine/source/shaderGen/GLSL/customFeatureGLSL.cpp b/Engine/source/shaderGen/GLSL/customFeatureGLSL.cpp index 3b0467062..99414d133 100644 --- a/Engine/source/shaderGen/GLSL/customFeatureGLSL.cpp +++ b/Engine/source/shaderGen/GLSL/customFeatureGLSL.cpp @@ -238,7 +238,7 @@ void CustomFeatureGLSL::addVertTexCoord(String name) mVars.push_back(newVarHolder); } -void CustomFeatureGLSL::writeLine(String format, S32 argc, ConsoleValueRef * argv) +void CustomFeatureGLSL::writeLine(String format, S32 argc, ConsoleValue * argv) { //do the var/arg fetching here Vector varList; @@ -246,7 +246,7 @@ void CustomFeatureGLSL::writeLine(String format, S32 argc, ConsoleValueRef * arg for (U32 i = 0; i < argc; i++) { - String varName = argv[i].getStringValue(); + String varName = argv[i].getString(); Var* newVar = (Var*)LangElement::find(varName.c_str()); if (!newVar) { @@ -304,7 +304,7 @@ void CustomFeatureGLSL::writeLine(String format, S32 argc, ConsoleValueRef * arg if (!newVar) { //couldn't find that variable, bail out - Con::errorf("CustomShaderFeature::writeLine: unable to find variable %s, meaning it was not declared before being used!", argv[i].getStringValue()); + Con::errorf("CustomShaderFeature::writeLine: unable to find variable %s, meaning it was not declared before being used!", argv[i].getString()); return; } } diff --git a/Engine/source/shaderGen/GLSL/customFeatureGLSL.h b/Engine/source/shaderGen/GLSL/customFeatureGLSL.h index c2d0191cc..b8358a835 100644 --- a/Engine/source/shaderGen/GLSL/customFeatureGLSL.h +++ b/Engine/source/shaderGen/GLSL/customFeatureGLSL.h @@ -128,5 +128,5 @@ public: void addTexture(String name, String type, String samplerState, U32 arraySize); void addConnector(String name, String type, String elementName); void addVertTexCoord(String name); - void writeLine(String format, S32 argc, ConsoleValueRef* argv); + void writeLine(String format, S32 argc, ConsoleValue* argv); }; diff --git a/Engine/source/shaderGen/HLSL/customFeatureHLSL.cpp b/Engine/source/shaderGen/HLSL/customFeatureHLSL.cpp index fa0a3934e..91e2329c4 100644 --- a/Engine/source/shaderGen/HLSL/customFeatureHLSL.cpp +++ b/Engine/source/shaderGen/HLSL/customFeatureHLSL.cpp @@ -385,7 +385,7 @@ void CustomFeatureHLSL::addVertTexCoord(String name) mVars.push_back(newVarHolder); } -void CustomFeatureHLSL::writeLine(String format, S32 argc, ConsoleValueRef * argv) +void CustomFeatureHLSL::writeLine(String format, S32 argc, ConsoleValue *argv) { //do the var/arg fetching here Vector varList; @@ -393,7 +393,7 @@ void CustomFeatureHLSL::writeLine(String format, S32 argc, ConsoleValueRef * arg for (U32 i = 0; i < argc; i++) { - String varName = argv[i].getStringValue(); + String varName = argv[i].getString(); Var* newVar = (Var*)LangElement::find(varName.c_str()); if (!newVar) { @@ -451,7 +451,7 @@ void CustomFeatureHLSL::writeLine(String format, S32 argc, ConsoleValueRef * arg if (!newVar) { //couldn't find that variable, bail out - Con::errorf("CustomShaderFeature::writeLine: unable to find variable %s, meaning it was not declared before being used!", argv[i].getStringValue()); + Con::errorf("CustomShaderFeature::writeLine: unable to find variable %s, meaning it was not declared before being used!", argv[i].getString()); return; } } diff --git a/Engine/source/shaderGen/HLSL/customFeatureHLSL.h b/Engine/source/shaderGen/HLSL/customFeatureHLSL.h index dd1ad0a09..be89aeb50 100644 --- a/Engine/source/shaderGen/HLSL/customFeatureHLSL.h +++ b/Engine/source/shaderGen/HLSL/customFeatureHLSL.h @@ -128,5 +128,5 @@ public: void addTexture(String name, String type, String samplerState, U32 arraySize); void addConnector(String name, String type, String elementName); void addVertTexCoord(String name); - void writeLine(String format, S32 argc, ConsoleValueRef* argv); + void writeLine(String format, S32 argc, ConsoleValue* argv); }; diff --git a/Engine/source/shaderGen/customShaderFeature.cpp b/Engine/source/shaderGen/customShaderFeature.cpp index e17cdc088..c184cb128 100644 --- a/Engine/source/shaderGen/customShaderFeature.cpp +++ b/Engine/source/shaderGen/customShaderFeature.cpp @@ -189,7 +189,7 @@ bool CustomShaderFeatureData::hasFeature(String name) return false; } -void CustomShaderFeatureData::writeLine(String format, S32 argc, ConsoleValueRef* argv) +void CustomShaderFeatureData::writeLine(String format, S32 argc, ConsoleValue* argv) { #ifdef TORQUE_D3D11 if (GFX->getAdapterType() == GFXAdapterType::Direct3D11) diff --git a/Engine/source/shaderGen/customShaderFeature.h b/Engine/source/shaderGen/customShaderFeature.h index 57d91e989..fd76380c4 100644 --- a/Engine/source/shaderGen/customShaderFeature.h +++ b/Engine/source/shaderGen/customShaderFeature.h @@ -77,7 +77,7 @@ public: void addVertTexCoord(String name); bool hasFeature(String name); - void writeLine(String format, S32 argc, ConsoleValueRef *argv); + void writeLine(String format, S32 argc, ConsoleValue *argv); }; #endif From 5e81c021f5c2a3bffa68a2258dedb6b2821a0487 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Tue, 30 Mar 2021 23:58:07 -0400 Subject: [PATCH 003/399] start cleaning up ConsoleValueRef's --- Engine/source/console/codeBlock.h | 9 +- Engine/source/console/console.cpp | 172 ++++++---- Engine/source/console/console.h | 358 ++++++++++++--------- Engine/source/console/engineAPI.h | 6 +- Engine/source/console/simEvents.h | 2 - Engine/source/gui/editor/guiFilterCtrl.cpp | 2 +- Engine/source/platform/types.visualc.h | 11 +- Engine/source/sim/actionMap.cpp | 4 +- 8 files changed, 331 insertions(+), 233 deletions(-) diff --git a/Engine/source/console/codeBlock.h b/Engine/source/console/codeBlock.h index f789f1a92..1daa26bac 100644 --- a/Engine/source/console/codeBlock.h +++ b/Engine/source/console/codeBlock.h @@ -28,7 +28,6 @@ class Stream; class ConsoleValue; -class ConsoleValueRef; /// Core TorqueScript code management class. /// @@ -130,7 +129,7 @@ public: /// with, zero being the top of the stack. If the the index is /// -1 a new frame is created. If the index is out of range the /// top stack frame is used. - ConsoleValueRef compileExec(StringTableEntry fileName, const char *script, + ConsoleValue compileExec(StringTableEntry fileName, const char *script, bool noCalls, S32 setFrame = -1); /// Executes the existing code in the CodeBlock. The return string is any @@ -148,9 +147,9 @@ public: /// -1 a new frame is created. If the index is out of range the /// top stack frame is used. /// @param packageName The code package name or null. - ConsoleValueRef exec(U32 offset, const char *fnName, Namespace *ns, U32 argc, - ConsoleValueRef *argv, bool noCalls, StringTableEntry packageName, + ConsoleValue exec(U32 offset, const char *fnName, Namespace *ns, U32 argc, + ConsoleValue *argv, bool noCalls, StringTableEntry packageName, S32 setFrame = -1); }; -#endif \ No newline at end of file +#endif diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index 50bdb5391..efa46f148 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -41,9 +41,37 @@ #include "platform/threads/mutex.h" #include "core/util/journal/journal.h" #include "cinterface/cinterface.h" +#include "console/consoleValueStack.h" extern StringStack STR; -extern ConsoleValueStack CSTK; +extern ConsoleValueStack<4096> gCallStack; + +S32 ConsoleValue::sBufferOffset = 0; +char ConsoleValue::sConversionBuffer[ConversionBufferSize]; + +void ConsoleValue::init() +{ + sBufferOffset = 0; + dMemset(sConversionBuffer, '\0', ConversionBufferSize); +} + +char* ConsoleValue::convertToBuffer() const +{ + sBufferOffset += StringSize; + if (sBufferOffset > ConversionBufferSize) + { + dMemset(sConversionBuffer, '\0', ConversionBufferSize); + sBufferOffset = 0; + } + + char* offset = sConversionBuffer + sBufferOffset; + if (type == ConsoleValueType::cvFloat) + dSprintf(offset, StringSize, "%.9g", f); + else + dSprintf(offset, StringSize, "%lld", i); + + return offset; +} ConsoleDocFragment* ConsoleDocFragment::smFirst; ExprEvalState gEvalState; @@ -1469,7 +1497,7 @@ bool executeFile(const char* fileName, bool noCalls, bool journalScript) return ret; } -ConsoleValueRef evaluate(const char* string, bool echo, const char *fileName) +ConsoleValue evaluate(const char* string, bool echo, const char *fileName) { ConsoleStackFrameSaver stackSaver; stackSaver.save(); @@ -1486,11 +1514,11 @@ ConsoleValueRef evaluate(const char* string, bool echo, const char *fileName) fileName = StringTable->insert(fileName); CodeBlock *newCodeBlock = new CodeBlock(); - return newCodeBlock->compileExec(fileName, string, false, fileName ? -1 : 0); + return std::move(newCodeBlock->compileExec(fileName, string, false, fileName ? -1 : 0)); } //------------------------------------------------------------------------------ -ConsoleValueRef evaluatef(const char* string, ...) +ConsoleValue evaluatef(const char* string, ...) { ConsoleStackFrameSaver stackSaver; stackSaver.save(); @@ -1507,36 +1535,41 @@ ConsoleValueRef evaluatef(const char* string, ...) //------------------------------------------------------------------------------ // Internal execute for global function which does not save the stack -ConsoleValueRef _internalExecute(S32 argc, ConsoleValueRef argv[]) +ConsoleValue _internalExecute(S32 argc, ConsoleValue argv[]) { + StringTableEntry funcName = StringTable->insert(argv[0].getString()); + const char** argv_str = static_cast(malloc((argc - 1) * sizeof(char *))); for (int i = 0; i < argc - 1; i++) { - argv_str[i] = argv[i + 1]; + argv_str[i] = argv[i + 1].getString(); } bool result; - const char* methodRes = CInterface::CallFunction(NULL, argv[0], argv_str, argc - 1, &result); + const char* methodRes = CInterface::CallFunction(NULL, funcName, argv_str, argc - 1, &result); free(argv_str); if (result) { - return ConsoleValueRef::fromValue(CSTK.pushString(methodRes)); + ConsoleValue ret; + ret.setString(methodRes, dStrlen(methodRes)); + return std::move(ret); } Namespace::Entry *ent; - StringTableEntry funcName = StringTable->insert(argv[0]); + ent = Namespace::global()->lookup(funcName); if(!ent) { - warnf(ConsoleLogEntry::Script, "%s: Unknown command.", (const char*)argv[0]); + warnf(ConsoleLogEntry::Script, "%s: Unknown command.", funcName); STR.clearFunctionOffset(); - return ConsoleValueRef(); + return std::move(ConsoleValue()); } - return ent->execute(argc, argv, &gEvalState); + + return std::move(ent->execute(argc, argv, &gEvalState)); } -ConsoleValueRef execute(S32 argc, ConsoleValueRef argv[]) +ConsoleValue execute(S32 argc, ConsoleValue argv[]) { #ifdef TORQUE_MULTITHREAD if(isMainThread()) @@ -1558,23 +1591,23 @@ ConsoleValueRef execute(S32 argc, ConsoleValueRef argv[]) #endif } -ConsoleValueRef execute(S32 argc, const char *argv[]) +ConsoleValue execute(S32 argc, const char *argv[]) { ConsoleStackFrameSaver stackSaver; stackSaver.save(); - StringStackConsoleWrapper args(argc, argv); - return execute(args.count(), args); + StringArrayToConsoleValueWrapper args(argc, argv); + return std::move(execute(args.count(), args)); } //------------------------------------------------------------------------------ // Internal execute for object method which does not save the stack -ConsoleValueRef _internalExecute(SimObject *object, S32 argc, ConsoleValueRef argv[], bool thisCallOnly) +static ConsoleValue _internalExecute(SimObject *object, S32 argc, ConsoleValue argv[], bool thisCallOnly) { if(argc < 2) { STR.clearFunctionOffset(); - return ConsoleValueRef(); + return std::move(ConsoleValue()); } // [neo, 10/05/2007 - #3010] @@ -1591,65 +1624,65 @@ ConsoleValueRef _internalExecute(SimObject *object, S32 argc, ConsoleValueRef ar } } + StringTableEntry funcName = StringTable->insert(argv[0].getString()); + const char** argv_str = static_cast(malloc((argc - 2) * sizeof(char *))); for (int i = 0; i < argc - 2; i++) { - argv_str[i] = argv[i + 2]; + argv_str[i] = argv[i + 2].getString(); } bool result; - const char* methodRes = CInterface::CallMethod(object, argv[0], argv_str, argc - 2, &result); + const char* methodRes = CInterface::CallMethod(object, funcName, argv_str, argc - 2, &result); free(argv_str); if (result) { - return ConsoleValueRef::fromValue(CSTK.pushString(methodRes)); + ConsoleValue val; + val.setString(methodRes, dStrlen(methodRes)); + return std::move(val); } if(object->getNamespace()) { U32 ident = object->getId(); - ConsoleValueRef oldIdent(argv[1]); - - StringTableEntry funcName = StringTable->insert(argv[0]); + const char* oldIdent = argv[1].getString(); + Namespace::Entry *ent = object->getNamespace()->lookup(funcName); if(ent == NULL) { - //warnf(ConsoleLogEntry::Script, "%s: undefined for object '%s' - id %d", funcName, object->getName(), object->getId()); + warnf(ConsoleLogEntry::Script, "%s: undefined for object '%s' - id %d", funcName, object->getName(), object->getId()); STR.clearFunctionOffset(); - return ConsoleValueRef(); + return std::move(ConsoleValue()); } // Twiddle %this argument - ConsoleValue func_ident; - func_ident.setIntValue((S32)ident); - argv[1] = ConsoleValueRef::fromValue(&func_ident); + argv[1].setInt(ident); SimObject *save = gEvalState.thisObject; gEvalState.thisObject = object; - ConsoleValueRef ret = ent->execute(argc, argv, &gEvalState); + ConsoleValue ret = std::move(ent->execute(argc, argv, &gEvalState)); gEvalState.thisObject = save; // Twiddle it back - argv[1] = oldIdent; + argv[1].setString(oldIdent, dStrlen(oldIdent)); - return ret; + return std::move(ret); } - warnf(ConsoleLogEntry::Script, "Con::execute - %d has no namespace: %s", object->getId(), (const char*)argv[0]); + warnf(ConsoleLogEntry::Script, "Con::execute - %d has no namespace: %s", object->getId(), funcName); STR.clearFunctionOffset(); - return ConsoleValueRef(); + return std::move(ConsoleValue()); } - -ConsoleValueRef execute(SimObject *object, S32 argc, ConsoleValueRef argv[], bool thisCallOnly) +ConsoleValue execute(SimObject *object, S32 argc, ConsoleValue argv[], bool thisCallOnly) { if(argc < 2) { STR.clearFunctionOffset(); - return ConsoleValueRef(); + return std::move(ConsoleValue()); } ConsoleStackFrameSaver stackSaver; @@ -1659,7 +1692,7 @@ ConsoleValueRef execute(SimObject *object, S32 argc, ConsoleValueRef argv[], boo { if (isMainThread()) { - return _internalExecute(object, argc, argv, thisCallOnly); + return std::move(_internalExecute(object, argc, argv, thisCallOnly)); } else { @@ -1669,34 +1702,34 @@ ConsoleValueRef execute(SimObject *object, S32 argc, ConsoleValueRef argv[], boo } } - warnf(ConsoleLogEntry::Script, "Con::execute - %d has no namespace: %s", object->getId(), (const char*)argv[0]); + warnf(ConsoleLogEntry::Script, "Con::execute - %d has no namespace: %s", object->getId(), argv[0].getString()); STR.clearFunctionOffset(); - return ConsoleValueRef(); + return std::move(ConsoleValue()); } -ConsoleValueRef execute(SimObject *object, S32 argc, const char *argv[], bool thisCallOnly) +ConsoleValue execute(SimObject *object, S32 argc, const char *argv[], bool thisCallOnly) { ConsoleStackFrameSaver stackSaver; stackSaver.save(); - StringStackConsoleWrapper args(argc, argv); - return execute(object, args.count(), args, thisCallOnly); + StringArrayToConsoleValueWrapper args(argc, argv); + return std::move(execute(object, args.count(), args, thisCallOnly)); } -inline ConsoleValueRef _executef(SimObject *obj, S32 checkArgc, S32 argc, ConsoleValueRef *argv) +inline ConsoleValue _executef(SimObject *obj, S32 checkArgc, S32 argc, ConsoleValue *argv) { const U32 maxArg = 12; - AssertWarn(checkArgc == argc, "Incorrect arg count passed to Con::executef(SimObject*)"); + AssertFatal(checkArgc == argc, "Incorrect arg count passed to Con::executef(SimObject*)"); AssertFatal(argc <= maxArg - 1, "Too many args passed to Con::_executef(SimObject*). Please update the function to handle more."); - return execute(obj, argc, argv); + return std::move(execute(obj, argc, argv)); } //------------------------------------------------------------------------------ -inline ConsoleValueRef _executef(S32 checkArgc, S32 argc, ConsoleValueRef *argv) +inline ConsoleValue _executef(S32 checkArgc, S32 argc, ConsoleValue *argv) { const U32 maxArg = 10; AssertFatal(checkArgc == argc, "Incorrect arg count passed to Con::executef()"); AssertFatal(argc <= maxArg, "Too many args passed to Con::_executef(). Please update the function to handle more."); - return execute(argc, argv); + return std::move(execute(argc, argv)); } //------------------------------------------------------------------------------ @@ -1893,16 +1926,11 @@ StringTableEntry getModNameFromPath(const char *path) void postConsoleInput( RawData data ) { + // TODO(JTH): Mem leak // Schedule this to happen at the next time event. - ConsoleValue values[2]; - ConsoleValueRef argv[2]; - - values[0].init(); - values[0].setStringValue("eval"); - values[1].init(); - values[1].setStringValue((const char*)data.data); - argv[0].value = &values[0]; - argv[1].value = &values[1]; + ConsoleValue* argv = new ConsoleValue[2]; + argv[0].setString("eval", 4); + argv[1].setString(reinterpret_cast(data.data), dStrlen(reinterpret_cast(data.data))); Sim::postCurrentEvent(Sim::getRootGroup(), new SimConsoleEvent(2, argv, false)); } @@ -2555,27 +2583,29 @@ StringArrayToConsoleValueWrapper::~StringArrayToConsoleValueWrapper() //------------------------------------------------------------------------------ -ConsoleValueRef _BaseEngineConsoleCallbackHelper::_exec() +ConsoleValue _BaseEngineConsoleCallbackHelper::_exec() { - ConsoleValueRef returnValue; if( mThis ) { // Cannot invoke callback until object has been registered - if (mThis->isProperlyAdded()) { - returnValue = Con::_internalExecute( mThis, mArgc, mArgv, false ); - } else { - STR.clearFunctionOffset(); - returnValue = ConsoleValueRef(); + if (mThis->isProperlyAdded()) + { + ConsoleValue returnValue = std::move(Con::_internalExecute( mThis, mArgc, mArgv, false )); + mArgc = mInitialArgc; // reset + return returnValue; } - } - else - returnValue = Con::_internalExecute( mArgc, mArgv ); + STR.clearFunctionOffset(); + mArgc = mInitialArgc; // reset + return std::move(ConsoleValue()); + } + + ConsoleValue returnValue = std::move(Con::_internalExecute( mArgc, mArgv )); mArgc = mInitialArgc; // reset args - return returnValue; + return std::move(returnValue); } -ConsoleValueRef _BaseEngineConsoleCallbackHelper::_execLater(SimConsoleThreadExecEvent *evt) +ConsoleValue _BaseEngineConsoleCallbackHelper::_execLater(SimConsoleThreadExecEvent *evt) { mArgc = mInitialArgc; // reset args Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); @@ -2586,7 +2616,7 @@ ConsoleValueRef _BaseEngineConsoleCallbackHelper::_execLater(SimConsoleThreadExe void ConsoleStackFrameSaver::save() { - CSTK.pushFrame(); + gCallStack.pushFrame(0); STR.pushFrame(); mSaved = true; } @@ -2595,7 +2625,7 @@ void ConsoleStackFrameSaver::restore() { if (mSaved) { - CSTK.popFrame(); + gCallStack.popFrame(); STR.popFrame(); } } diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index ad4d4f622..ee44aaca8 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -117,188 +117,250 @@ struct ConsoleLogEntry typedef const char *StringTableEntry; extern char *typeValueEmpty; +enum ConsoleValueType +{ + cvNone = -5, + cvInteger = -4, + cvFloat = -3, + cvString = -2, + cvSTEntry = -1, + cvConsoleValueType = 0 +}; + +struct ConsoleValueConsoleType +{ + void* dataPtr; + EnumTable* enumTable; +}; + +// TODO: replace malloc/free with custom allocator... class ConsoleValue { -public: - - enum + union { - TypeInternalInt = -5, - TypeInternalFloat = -4, - TypeInternalStringStackPtr = -3, - TypeInternalStackString = -2, - TypeInternalString = -1, + F64 f; + S64 i; + char* s; + void* data; + ConsoleValueConsoleType* ct; }; S32 type; -public: - - // NOTE: This is protected to ensure no one outside - // of this structure is messing with it. - -#pragma warning( push ) -#pragma warning( disable : 4201 ) // warning C4201: nonstandard extension used : nameless struct/union - - // An variable is either a real dynamic type or - // its one exposed from C++ using a data pointer. - // - // We use this nameless union and struct setup - // to optimize the memory usage. - union + enum Constants { - struct - { - char *sval; - U32 ival; // doubles as strlen when type is TypeInternalString - F32 fval; - U32 bufferLen; - }; - - struct - { - /// The real data pointer. - void *dataPtr; - - /// The enum lookup table for enumerated types. - const EnumTable *enumTable; - }; + ConversionBufferSize = 1024, + StringSize = 16 }; - U32 getIntValue(); - S32 getSignedIntValue(); - F32 getFloatValue(); - const char *getStringValue(); - StringStackPtr getStringStackPtr(); - bool getBoolValue(); + static char sConversionBuffer[ConversionBufferSize]; + static S32 sBufferOffset; - void setIntValue(U32 val); - void setIntValue(S32 val); - void setFloatValue(F32 val); - void setStringValue(const char *value); - void setStackStringValue(const char *value); - void setStringStackPtrValue(StringStackPtr ptr); - void setBoolValue(bool val); + char* convertToBuffer() const; - void init() + TORQUE_FORCEINLINE bool isStringType() const { - ival = 0; - fval = 0; - sval = typeValueEmpty; - bufferLen = 0; - type = TypeInternalString; + return type == ConsoleValueType::cvString || type == ConsoleValueType::cvSTEntry; } - void cleanup() + TORQUE_FORCEINLINE bool isNumberType() const { - if ((type <= TypeInternalString) && (bufferLen > 0)) + return type == ConsoleValueType::cvFloat || type == ConsoleValueType::cvInteger; + } + + TORQUE_FORCEINLINE bool hasAllocatedData() const + { + return type == ConsoleValueType::cvString || type >= ConsoleValueType::cvConsoleValueType; + } + + TORQUE_FORCEINLINE const char* getConsoleData() const + { + return Con::getData(type, ct->dataPtr, 0, ct->enumTable); + } + + TORQUE_FORCEINLINE void cleanupData() + { + if (hasAllocatedData()) { - dFree(sval); - bufferLen = 0; + dFree(data); } - sval = typeValueEmpty; - type = ConsoleValue::TypeInternalString; - ival = 0; - fval = 0; } - ConsoleValue() { init(); }; - ~ConsoleValue() { cleanup(); }; -}; -// Proxy class for console variables -// Can point to existing console variables, -// or act like a free floating value. -class ConsoleValueRef -{ public: - ConsoleValue *value; + ConsoleValue() + { + type = ConsoleValueType::cvNone; + } - ConsoleValueRef() : value(0) { ; } - ~ConsoleValueRef() { ; } + ConsoleValue(ConsoleValue&& ref) + { + cleanupData(); + type = ref.type; - ConsoleValueRef(const ConsoleValueRef &ref); + switch (ref.type) + { + TORQUE_UNLIKELY + case cvNone: + break; + case cvInteger: + i = ref.i; + break; + case cvFloat: + f = ref.f; + break; + case cvSTEntry: + TORQUE_CASE_FALLTHROUGH + case cvString: + s = ref.s; + break; + default: + data = ref.data; + break; + } - static ConsoleValueRef fromValue(ConsoleValue *value) { ConsoleValueRef ref; ref.value = value; return ref; } + ref.type = cvNone; + } - const char *getStringValue() { return value ? value->getStringValue() : ""; } - StringStackPtr getStringStackPtrValue() { return value ? value->getStringStackPtr() : 0; } + ConsoleValue(const ConsoleValue&) = delete; + ConsoleValue& operator=(const ConsoleValue&) = delete; - inline U32 getIntValue() { return value ? value->getIntValue() : 0; } - inline S32 getSignedIntValue() { return value ? value->getSignedIntValue() : 0; } - inline F32 getFloatValue() { return value ? value->getFloatValue() : 0.0f; } - inline bool getBoolValue() { return value ? value->getBoolValue() : false; } + TORQUE_FORCEINLINE ~ConsoleValue() + { + cleanupData(); + } - inline operator const char*() { return getStringValue(); } - inline operator String() { return String(getStringValue()); } - inline operator U32() { return getIntValue(); } - inline operator S32() { return getSignedIntValue(); } - inline operator F32() { return getFloatValue(); } - inline operator bool() { return getBoolValue(); } + TORQUE_FORCEINLINE F64 getFloat() const + { + AssertFatal(type == ConsoleValueType::cvNone, "Attempted to access ConsoleValue when it has no value!"); + if (type == ConsoleValueType::cvFloat) + return f; + if (type == ConsoleValueType::cvInteger) + return i; + if (isStringType()) + return dAtof(s); + return dAtof(getConsoleData()); + } - inline bool isStringStackPtr() { return value ? value->type == ConsoleValue::TypeInternalStringStackPtr : false; } - inline bool isString() { return value ? value->type >= ConsoleValue::TypeInternalStringStackPtr : true; } - inline bool isInt() { return value ? value->type == ConsoleValue::TypeInternalInt : false; } - inline bool isFloat() { return value ? value->type == ConsoleValue::TypeInternalFloat : false; } - inline S32 getType() { return value ? value->type : -1; } + TORQUE_FORCEINLINE S64 getInt() const + { + AssertFatal(type == ConsoleValueType::cvNone, "Attempted to access ConsoleValue when it has no value!"); + if (type == ConsoleValueType::cvInteger) + return i; + if (type == ConsoleValueType::cvFloat) + return f; + if (isStringType()) + return dAtoi(s); + return dAtoi(getConsoleData()); + } - // Note: operators replace value - ConsoleValueRef& operator=(const ConsoleValueRef &other); - ConsoleValueRef& operator=(const char *newValue); - ConsoleValueRef& operator=(U32 newValue); - ConsoleValueRef& operator=(S32 newValue); - ConsoleValueRef& operator=(F32 newValue); - ConsoleValueRef& operator=(F64 newValue); + TORQUE_FORCEINLINE const char* getString() const + { + AssertFatal(type == ConsoleValueType::cvNone, "Attempted to access ConsoleValue when it has no value!"); + if (isStringType()) + return s; + if (isNumberType()) + return convertToBuffer(); + return getConsoleData(); + } + + TORQUE_FORCEINLINE bool getBool() const + { + AssertFatal(type == ConsoleValueType::cvNone, "Attempted to access ConsoleValue when it has no value!"); + if (type == ConsoleValueType::cvInteger) + return (bool)i; + if (type == ConsoleValueType::cvFloat) + return (bool)f; + if (isStringType()) + return dAtob(s); + return dAtob(getConsoleData()); + } + + TORQUE_FORCEINLINE void setFloat(const F64 val) + { + AssertFatal(type == ConsoleValueType::cvNone, "Attempted to access ConsoleValue when it has no value!"); + cleanupData(); + type = ConsoleValueType::cvFloat; + f = val; + } + + TORQUE_FORCEINLINE void setInt(const S64 val) + { + cleanupData(); + type = ConsoleValueType::cvInteger; + i = val; + } + + TORQUE_FORCEINLINE void setString(const char* val, S32 len) + { + cleanupData(); + + type = ConsoleValueType::cvString; + + s = (char*)dMalloc(len + 1); + s[len] = 0x0; + dStrcpy(s, val, len); + } + + TORQUE_FORCEINLINE void setBool(const bool val) + { + cleanupData(); + type = ConsoleValueType::cvInteger; + i = (int)val; + } + + TORQUE_FORCEINLINE void setStringTableEntry(StringTableEntry val) + { + cleanupData(); + type = ConsoleValueType::cvSTEntry; + s = const_cast(val); + } + + TORQUE_FORCEINLINE void setConsoleData(S32 consoleType, void* dataPtr, EnumTable* enumTable) + { + cleanupData(); + type = ConsoleValueType::cvSTEntry; + ct = new ConsoleValueConsoleType{ dataPtr, enumTable }; + } + + TORQUE_FORCEINLINE S32 getType() const + { + return type; + } + + static void init(); + static S32 getConstantBufferCount() { return (S32)ConversionBufferSize / StringSize; } }; -// Overrides to allow ConsoleValueRefs to be directly converted to S32&F32 - -inline S32 dAtoi(ConsoleValueRef &ref) -{ - return ref.getSignedIntValue(); -} - -inline F32 dAtof(ConsoleValueRef &ref) -{ - return ref.getFloatValue(); -} - -inline bool dAtob(ConsoleValue &ref) -{ - return ref.getBoolValue(); -} - - // Transparently converts ConsoleValue[] to const char** -class StringStackWrapper +class ConsoleValueToStringArrayWrapper { public: const char **argv; - int argc; + S32 argc; - StringStackWrapper(int targc, ConsoleValueRef targv[]); - ~StringStackWrapper(); + ConsoleValueToStringArrayWrapper(int targc, ConsoleValue* targv); + ~ConsoleValueToStringArrayWrapper(); - const char* operator[](int idx) { return argv[idx]; } + const char* operator[](S32 idx) { return argv[idx]; } operator const char**() { return argv; } - int count() { return argc; } + S32 count() { return argc; } }; // Transparently converts const char** to ConsoleValue -class StringStackConsoleWrapper +class StringArrayToConsoleValueWrapper { public: - ConsoleValue *argvValue; - ConsoleValueRef *argv; - int argc; + ConsoleValue *argv; + S32 argc; - StringStackConsoleWrapper(int targc, const char **targv); - ~StringStackConsoleWrapper(); + StringArrayToConsoleValueWrapper(int targc, const char **targv); + ~StringArrayToConsoleValueWrapper(); - ConsoleValueRef& operator[](int idx) { return argv[idx]; } - operator ConsoleValueRef*() { return argv; } + ConsoleValue& operator[](int idx) { return argv[idx]; } + operator ConsoleValue*() { return argv; } - int count() { return argc; } + S32 count() { return argc; } }; /// @defgroup console_callbacks Scripting Engine Callbacks @@ -319,11 +381,11 @@ public: /// @{ /// -typedef const char * (*StringCallback)(SimObject *obj, S32 argc, ConsoleValueRef argv[]); -typedef S32(*IntCallback)(SimObject *obj, S32 argc, ConsoleValueRef argv[]); -typedef F32(*FloatCallback)(SimObject *obj, S32 argc, ConsoleValueRef argv[]); -typedef void(*VoidCallback)(SimObject *obj, S32 argc, ConsoleValueRef argv[]); // We have it return a value so things don't break.. -typedef bool(*BoolCallback)(SimObject *obj, S32 argc, ConsoleValueRef argv[]); +typedef const char * (*StringCallback)(SimObject *obj, S32 argc, ConsoleValue argv[]); +typedef S32(*IntCallback)(SimObject *obj, S32 argc, ConsoleValue argv[]); +typedef F32(*FloatCallback)(SimObject *obj, S32 argc, ConsoleValue argv[]); +typedef void(*VoidCallback)(SimObject *obj, S32 argc, ConsoleValue argv[]); // We have it return a value so things don't break.. +typedef bool(*BoolCallback)(SimObject *obj, S32 argc, ConsoleValue argv[]); typedef void(*ConsumerCallback)(U32 level, const char *consoleLine); /// @} @@ -786,8 +848,8 @@ namespace Con /// char* result = execute(2, argv); /// @endcode /// NOTE: this function restores the console stack on return. - ConsoleValueRef execute(S32 argc, const char* argv[]); - ConsoleValueRef execute(S32 argc, ConsoleValueRef argv[]); + ConsoleValue execute(S32 argc, const char* argv[]); + ConsoleValue execute(S32 argc, ConsoleValue argv[]); /// Call a Torque Script member function of a SimObject from C/C++ code. /// @param object Object on which to execute the method call. @@ -802,8 +864,8 @@ namespace Con /// char* result = execute(mysimobject, 3, argv); /// @endcode /// NOTE: this function restores the console stack on return. - ConsoleValueRef execute(SimObject *object, S32 argc, const char* argv[], bool thisCallOnly = false); - ConsoleValueRef execute(SimObject *object, S32 argc, ConsoleValueRef argv[], bool thisCallOnly = false); + ConsoleValue execute(SimObject *object, S32 argc, const char* argv[], bool thisCallOnly = false); + ConsoleValue execute(SimObject *object, S32 argc, ConsoleValue argv[], bool thisCallOnly = false); /// Executes a script file and compiles it for use in script. /// @@ -821,13 +883,13 @@ namespace Con /// @param echo Should we echo the string to the console? /// @param fileName Indicate what file this code is coming from; used in error reporting and such. /// NOTE: This function restores the console stack on return. - ConsoleValueRef evaluate(const char* string, bool echo = false, const char *fileName = NULL); + ConsoleValue evaluate(const char* string, bool echo = false, const char *fileName = NULL); /// Evaluate an arbitrary line of script. /// /// This wraps dVsprintf(), so you can substitute parameters into the code being executed. /// NOTE: This function restores the console stack on return. - ConsoleValueRef evaluatef(const char* string, ...); + ConsoleValue evaluatef(const char* string, ...); /// @} @@ -915,10 +977,10 @@ namespace Con /// @see _EngineConsoleExecCallbackHelper /// template - ConsoleValueRef executef(R r, ArgTs ...argTs) + ConsoleValue executef(R r, ArgTs ...argTs) { _EngineConsoleExecCallbackHelper callback(r); - return callback.template call(argTs...); + return std::move(callback.template call(argTs...)); } /// } }; diff --git a/Engine/source/console/engineAPI.h b/Engine/source/console/engineAPI.h index aa8762f4b..553cc7e71 100644 --- a/Engine/source/console/engineAPI.h +++ b/Engine/source/console/engineAPI.h @@ -864,7 +864,7 @@ public: (Vector* vec) \ { \ _CHECK_ENGINE_INITIALIZED( name, returnType ); \ - StringStackConsoleWrapper args(vec->size(), vec->address()); \ + StringArrayToConsoleValueWrapper args(vec->size(), vec->address()); \ return EngineTypeTraits< returnType >::ReturnValue( \ _fn ## name ## impl(NULL, args.count(), args) \ ); \ @@ -895,7 +895,7 @@ public: (className* object, Vector* vec) \ { \ _CHECK_ENGINE_INITIALIZED( name, returnType ); \ - StringStackConsoleWrapper args(vec->size(), vec->address()); \ + StringArrayToConsoleValueWrapper args(vec->size(), vec->address()); \ _ ## className ## name ## frame frame {}; \ frame.object = static_cast< className* >( object ); \ return EngineTypeTraits< returnType >::ReturnValue( \ @@ -1226,7 +1226,7 @@ public: template struct _EngineConsoleExecCallbackHelper : public _BaseEngineConsoleCallbackHelper { private: - using Helper = engineAPI::detail::MarshallHelpers; + using Helper = engineAPI::detail::MarshallHelpers; public: _EngineConsoleExecCallbackHelper( SimObject* pThis ) diff --git a/Engine/source/console/simEvents.h b/Engine/source/console/simEvents.h index 861c7cdde..6fbb6a798 100644 --- a/Engine/source/console/simEvents.h +++ b/Engine/source/console/simEvents.h @@ -83,8 +83,6 @@ public: virtual void process(SimObject *object)=0; }; -class ConsoleValueRef; - /// Implementation of schedule() function. /// /// This allows you to set a console function to be diff --git a/Engine/source/gui/editor/guiFilterCtrl.cpp b/Engine/source/gui/editor/guiFilterCtrl.cpp index 6abc3d53c..1be90b8e2 100644 --- a/Engine/source/gui/editor/guiFilterCtrl.cpp +++ b/Engine/source/gui/editor/guiFilterCtrl.cpp @@ -83,7 +83,7 @@ DefineEngineStringlyVariadicMethod( GuiFilterCtrl, setValue, void, 3, 20, "(f1, { Filter filter; - StringStackWrapper args(argc - 2, argv + 2); + ConsoleValueToStringArrayWrapper args(argc - 2, argv + 2); filter.set(args.count(), args); object->set(filter); diff --git a/Engine/source/platform/types.visualc.h b/Engine/source/platform/types.visualc.h index 57dabc4dd..89fd38d4b 100644 --- a/Engine/source/platform/types.visualc.h +++ b/Engine/source/platform/types.visualc.h @@ -102,8 +102,17 @@ typedef unsigned _int64 U64; // disable warning caused by memory layer // see msdn.microsoft.com "Compiler Warning (level 1) C4291" for more details -#pragma warning(disable: 4291) +#pragma warning(disable: 4291) +#define TORQUE_FORCEINLINE __forceinline + +#if __cplusplus >= 201703L +#define TORQUE_CASE_FALLTHROUGH [[fallthrough]]; +#define TORQUE_UNLIKELY [[unlikely]] +#else +#define TORQUE_CASE_FALLTHROUGH __fallthrough +#define TORQUE_UNLIKELY +#endif #endif // INCLUDED_TYPES_VISUALC_H diff --git a/Engine/source/sim/actionMap.cpp b/Engine/source/sim/actionMap.cpp index e835273ed..40a41aa06 100644 --- a/Engine/source/sim/actionMap.cpp +++ b/Engine/source/sim/actionMap.cpp @@ -2080,7 +2080,7 @@ static ConsoleDocFragment _ActionMapbind2( DefineEngineStringlyVariadicMethod( ActionMap, bind, bool, 5, 10, "actionMap.bind( device, action, [modifier, spec, mod...], command )" "@hide") { - StringStackWrapper args(argc - 2, argv + 2); + ConsoleValueToStringArrayWrapper args(argc - 2, argv + 2); return object->processBind( args.count(), args, NULL ); } @@ -2136,7 +2136,7 @@ DefineEngineStringlyVariadicMethod( ActionMap, bindObj, bool, 6, 11, "(device, a return false; } - StringStackWrapper args(argc - 3, argv + 2); + ConsoleValueToStringArrayWrapper args(argc - 3, argv + 2); return object->processBind( args.count(), args, simObject ); } From 50df52ecfc9725604be2e66970e0f6959a957070 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Wed, 31 Mar 2021 21:09:23 -0400 Subject: [PATCH 004/399] more console refactor. --- Engine/source/T3D/assets/assetImporter.cpp | 4 +- Engine/source/afx/afxSelectron.cpp | 2 +- Engine/source/console/ICallMethod.h | 4 +- Engine/source/console/console.cpp | 4 +- Engine/source/console/console.h | 18 +-- Engine/source/console/consoleInternal.cpp | 30 +++-- Engine/source/console/consoleInternal.h | 2 +- Engine/source/console/engineAPI.h | 135 ++++++++++----------- Engine/source/console/simEvents.cpp | 59 +++++---- Engine/source/console/simEvents.h | 14 +-- Engine/source/console/simObject.cpp | 2 +- Engine/source/console/simObject.h | 2 +- Engine/source/console/simPersistSet.cpp | 2 +- Engine/source/console/simPersistSet.h | 2 +- Engine/source/console/test/ScriptTest.cpp | 28 ++--- 15 files changed, 150 insertions(+), 158 deletions(-) diff --git a/Engine/source/T3D/assets/assetImporter.cpp b/Engine/source/T3D/assets/assetImporter.cpp index f399fc108..8c25446b1 100644 --- a/Engine/source/T3D/assets/assetImporter.cpp +++ b/Engine/source/T3D/assets/assetImporter.cpp @@ -2546,8 +2546,8 @@ void AssetImporter::importAssets(AssetImportObject* assetItem) processCommand += childItem->assetType; if (isMethod(processCommand.c_str())) { - ConsoleValueRef importReturnVal = Con::executef(this, processCommand.c_str(), childItem); - assetPath = Torque::Path(importReturnVal.getStringValue()); + const char* importReturnVal = Con::executef(this, processCommand.c_str(), childItem).getString(); + assetPath = Torque::Path(importReturnVal); } } diff --git a/Engine/source/afx/afxSelectron.cpp b/Engine/source/afx/afxSelectron.cpp index 67cd32849..63157a4f1 100644 --- a/Engine/source/afx/afxSelectron.cpp +++ b/Engine/source/afx/afxSelectron.cpp @@ -1070,7 +1070,7 @@ afxSelectron::start_selectron(SceneObject* picked, U8 subcode, SimObject* extra) // CALL SCRIPT afxSelectronData::onPreactivate(%params, %extra) const char* result = Con::executef(datablock, "onPreactivate", Con::getIntArg(param_holder->getId()), - (extra) ? Con::getIntArg(extra->getId()) : ""); + (extra) ? Con::getIntArg(extra->getId()) : "").getString(); if (result && result[0] != '\0' && !dAtob(result)) { #if defined(TORQUE_DEBUG) diff --git a/Engine/source/console/ICallMethod.h b/Engine/source/console/ICallMethod.h index fdda77fa7..0c0d50299 100644 --- a/Engine/source/console/ICallMethod.h +++ b/Engine/source/console/ICallMethod.h @@ -27,7 +27,7 @@ class ICallMethod { public: virtual const char* callMethod( S32 argc, const char* methodName, ... ) = 0; - virtual const char* callMethodArgList( U32 argc, ConsoleValueRef argv[], bool callThis = true ) = 0; + virtual const char* callMethodArgList( U32 argc, ConsoleValue argv[], bool callThis = true ) = 0; }; -#endif \ No newline at end of file +#endif diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index efa46f148..150b3f823 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -2592,7 +2592,7 @@ ConsoleValue _BaseEngineConsoleCallbackHelper::_exec() { ConsoleValue returnValue = std::move(Con::_internalExecute( mThis, mArgc, mArgv, false )); mArgc = mInitialArgc; // reset - return returnValue; + return std::move(returnValue); } STR.clearFunctionOffset(); @@ -2609,7 +2609,7 @@ ConsoleValue _BaseEngineConsoleCallbackHelper::_execLater(SimConsoleThreadExecEv { mArgc = mInitialArgc; // reset args Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); - return evt->getCB().waitForResult(); + return std::move(evt->getCB().waitForResult()); } //------------------------------------------------------------------------------ diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index ee44aaca8..cb49911c2 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -1254,9 +1254,9 @@ public: static ConsoleConstructor cfg_ConsoleFunctionGroup_##groupName##_GroupBegin(NULL,#groupName,usage) # define ConsoleToolFunction(name,returnType,minArgs,maxArgs,usage1) \ - returnType ctf_##name(SimObject *, S32, ConsoleValueRef *argv); \ + returnType ctf_##name(SimObject *, S32, ConsoleValue *argv); \ ConsoleConstructor cc_##name##_obj(NULL,#name,ctf_##name,usage1,minArgs,maxArgs, true); \ - returnType ctf_##name(SimObject *, S32 argc, ConsoleValueRef *argv) + returnType ctf_##name(SimObject *, S32 argc, ConsoleValue *argv) # define ConsoleFunctionGroupEnd(groupName) \ static ConsoleConstructor cfg_##groupName##_GroupEnd(NULL,#groupName,NULL) @@ -1289,23 +1289,23 @@ public: // These are identical to what's above, we just want to null out the usage strings. # define ConsoleFunction(name,returnType,minArgs,maxArgs,usage1) \ - static returnType c##name(SimObject *, S32, ConsoleValueRef*); \ + static returnType c##name(SimObject *, S32, ConsoleValue*); \ static ConsoleConstructor g##name##obj(NULL,#name,c##name,"",minArgs,maxArgs);\ - static returnType c##name(SimObject *, S32 argc, ConsoleValueRef *argv) + static returnType c##name(SimObject *, S32 argc, ConsoleValue *argv) # define ConsoleToolFunction(name,returnType,minArgs,maxArgs,usage1) \ - static returnType c##name(SimObject *, S32, ConsoleValueRef*); \ + static returnType c##name(SimObject *, S32, ConsoleValue*); \ static ConsoleConstructor g##name##obj(NULL,#name,c##name,"",minArgs,maxArgs, true);\ - static returnType c##name(SimObject *, S32 argc, ConsoleValueRef *argv) + static returnType c##name(SimObject *, S32 argc, ConsoleValue *argv) # define ConsoleMethod(className,name,returnType,minArgs,maxArgs,usage1) \ - static inline returnType c##className##name(className *, S32, ConsoleValueRef *argv); \ - static returnType c##className##name##caster(SimObject *object, S32 argc, ConsoleValueRef *argv) { \ + static inline returnType c##className##name(className *, S32, ConsoleValue *argv); \ + static returnType c##className##name##caster(SimObject *object, S32 argc, ConsoleValue *argv) { \ conmethod_return_##returnType ) c##className##name(static_cast(object),argc,argv); \ }; \ static ConsoleConstructor \ className##name##obj(#className,#name,c##className##name##caster,"",minArgs,maxArgs); \ - static inline returnType c##className##name(className *object, S32 argc, ConsoleValueRef *argv) + static inline returnType c##className##name(className *object, S32 argc, ConsoleValue *argv) #define ConsoleDoc( text ) diff --git a/Engine/source/console/consoleInternal.cpp b/Engine/source/console/consoleInternal.cpp index a498be154..4fd2aaa0b 100644 --- a/Engine/source/console/consoleInternal.cpp +++ b/Engine/source/console/consoleInternal.cpp @@ -613,7 +613,7 @@ void Dictionary::validate() "Dictionary::validate() - Dictionary not owner of own hashtable!"); } -void ExprEvalState::pushFrame(StringTableEntry frameName, Namespace *ns) +void ExprEvalState::pushFrame(StringTableEntry frameName, Namespace *ns, S32 registerCount) { #ifdef DEBUG_SPEW validate(); @@ -1266,7 +1266,7 @@ void Namespace::markGroup(const char* name, const char* usage) extern S32 executeBlock(StmtNode *block, ExprEvalState *state); -ConsoleValueRef Namespace::Entry::execute(S32 argc, ConsoleValueRef *argv, ExprEvalState *state) +ConsoleValue Namespace::Entry::execute(S32 argc, ConsoleValue *argv, ExprEvalState *state) { STR.clearFunctionOffset(); @@ -1274,11 +1274,11 @@ ConsoleValueRef Namespace::Entry::execute(S32 argc, ConsoleValueRef *argv, ExprE { if (mFunctionOffset) { - return mCode->exec(mFunctionOffset, argv[0], mNamespace, argc, argv, false, mPackage); + return std::move(mCode->exec(mFunctionOffset, argv[0].getString(), mNamespace, argc, argv, false, mPackage)); } else { - return ConsoleValueRef(); + return std::move(ConsoleValue()); } } @@ -1288,7 +1288,7 @@ ConsoleValueRef Namespace::Entry::execute(S32 argc, ConsoleValueRef *argv, ExprE if (mToolOnly && !Con::isCurrentScriptToolScript()) { Con::errorf(ConsoleLogEntry::Script, "%s::%s - attempting to call tools only function from outside of tools", mNamespace->mName, mFunctionName); - return ConsoleValueRef(); + return std::move(ConsoleValue()); } #endif @@ -1296,25 +1296,31 @@ ConsoleValueRef Namespace::Entry::execute(S32 argc, ConsoleValueRef *argv, ExprE { Con::warnf(ConsoleLogEntry::Script, "%s::%s - wrong number of arguments.", mNamespace->mName, mFunctionName); Con::warnf(ConsoleLogEntry::Script, "usage: %s", mUsage); - return ConsoleValueRef(); + return std::move(ConsoleValue()); } + ConsoleValue result; switch (mType) { case StringCallbackType: - return ConsoleValueRef::fromValue(CSTK.pushStackString(cb.mStringCallbackFunc(state->thisObject, argc, argv))); + const char* str = cb.mStringCallbackFunc(state->thisObject, argc, argv); + result.setString(str, dStrlen(str)); + break; case IntCallbackType: - return ConsoleValueRef::fromValue(CSTK.pushUINT((U32)cb.mBoolCallbackFunc(state->thisObject, argc, argv))); + result.setInt(cb.mIntCallbackFunc(state->thisObject, argc, argv)); + break; case FloatCallbackType: - return ConsoleValueRef::fromValue(CSTK.pushFLT((U32)cb.mBoolCallbackFunc(state->thisObject, argc, argv))); + result.setFloat(cb.mBoolCallbackFunc(state->thisObject, argc, argv)); + break; case VoidCallbackType: cb.mVoidCallbackFunc(state->thisObject, argc, argv); - return ConsoleValueRef(); + break; case BoolCallbackType: - return ConsoleValueRef::fromValue(CSTK.pushUINT((U32)cb.mBoolCallbackFunc(state->thisObject, argc, argv))); + result.setBool(cb.mBoolCallbackFunc(state->thisObject, argc, argv)); + break; } - return ConsoleValueRef(); + return std::move(result); } //----------------------------------------------------------------------------- diff --git a/Engine/source/console/consoleInternal.h b/Engine/source/console/consoleInternal.h index 151a75ac2..ac61f5331 100644 --- a/Engine/source/console/consoleInternal.h +++ b/Engine/source/console/consoleInternal.h @@ -150,7 +150,7 @@ public: void clear(); /// - ConsoleValueRef execute(S32 argc, ConsoleValueRef* argv, ExprEvalState* state); + ConsoleValue execute(S32 argc, ConsoleValue* argv, ExprEvalState* state); /// Return a one-line documentation text string for the function. String getBriefDescription(String* outRemainingDocText = NULL) const; diff --git a/Engine/source/console/engineAPI.h b/Engine/source/console/engineAPI.h index 553cc7e71..8fefd5fdc 100644 --- a/Engine/source/console/engineAPI.h +++ b/Engine/source/console/engineAPI.h @@ -148,55 +148,45 @@ inline const char* EngineMarshallData( U32 value ) /// Marshal data from native into client form stored directly in /// client function invocation vector. template< typename T > -inline void EngineMarshallData( const T& arg, S32& argc, ConsoleValueRef *argv ) +inline void EngineMarshallData( const T& arg, S32& argc, ConsoleValue *argv ) { - argv[ argc ] = castConsoleTypeToString( arg ); - argc ++; + const char* str = castConsoleTypeToString(arg);; + argv[ argc++ ].setString(str, dStrlen(str)); } -inline void EngineMarshallData( bool arg, S32& argc, ConsoleValueRef *argv ) +inline void EngineMarshallData( bool arg, S32& argc, ConsoleValue *argv ) { - if( arg ) - argv[ argc ] = 1; - else - argv[ argc ] = 0; - argc ++; + argv[ argc++ ].setBool(arg); } -inline void EngineMarshallData( S32 arg, S32& argc, ConsoleValueRef *argv ) +inline void EngineMarshallData( S32 arg, S32& argc, ConsoleValue *argv ) { - argv[ argc ] = arg; - argc ++; + argv[ argc++ ].setInt(arg); } -inline void EngineMarshallData( U32 arg, S32& argc, ConsoleValueRef *argv ) +inline void EngineMarshallData( U32 arg, S32& argc, ConsoleValue *argv ) { EngineMarshallData( S32( arg ), argc, argv ); } -inline void EngineMarshallData( F32 arg, S32& argc, ConsoleValueRef *argv ) +inline void EngineMarshallData( F32 arg, S32& argc, ConsoleValue *argv ) { - argv[ argc ] = arg; - argc ++; + argv[ argc++ ].setFloat(arg); } -inline void EngineMarshallData( const char* arg, S32& argc, ConsoleValueRef *argv ) +inline void EngineMarshallData( const char* arg, S32& argc, ConsoleValue *argv ) { - argv[ argc ] = arg; - argc ++; + argv[ argc++ ].setString(arg, dStrlen(arg)); } -inline void EngineMarshallData( char* arg, S32& argc, ConsoleValueRef *argv ) +inline void EngineMarshallData( char* arg, S32& argc, ConsoleValue *argv ) { - argv[ argc ] = arg; - argc ++; + argv[ argc++ ].setString(arg, dStrlen(arg)); } template< typename T > -inline void EngineMarshallData( T* object, S32& argc, ConsoleValueRef *argv ) +inline void EngineMarshallData( T* object, S32& argc, ConsoleValue *argv ) { - argv[ argc ] = object ? object->getId() : 0; - argc ++; + argv[ argc++ ].setInt(object ? object->getId() : 0); } template< typename T > -inline void EngineMarshallData( const T* object, S32& argc, ConsoleValueRef *argv ) +inline void EngineMarshallData( const T* object, S32& argc, ConsoleValue *argv ) { - argv[ argc ] = object ? object->getId() : 0; - argc ++; + argv[ argc++ ].setInt(object ? object->getId() : 0); } /// Unmarshal data from client form to engine form. @@ -216,9 +206,9 @@ struct EngineUnmarshallData template<> struct EngineUnmarshallData< S32 > { - S32 operator()( ConsoleValueRef &ref ) const + S32 operator()( ConsoleValue &ref ) const { - return (S32)ref; + return (S32)ref.getInt(); } S32 operator()( const char* str ) const @@ -229,9 +219,9 @@ struct EngineUnmarshallData< S32 > template<> struct EngineUnmarshallData< U32 > { - U32 operator()( ConsoleValueRef &ref ) const + U32 operator()( ConsoleValue &ref ) const { - return (U32)((S32)ref); + return (U32)ref.getInt(); } U32 operator()( const char* str ) const @@ -242,9 +232,9 @@ struct EngineUnmarshallData< U32 > template<> struct EngineUnmarshallData< F32 > { - F32 operator()( ConsoleValueRef &ref ) const + F32 operator()( ConsoleValue &ref ) const { - return (F32)ref; + return (F32)ref.getFloat(); } F32 operator()( const char* str ) const @@ -255,9 +245,9 @@ struct EngineUnmarshallData< F32 > template<> struct EngineUnmarshallData< U8 > { - U8 operator()( ConsoleValueRef &ref ) const + U8 operator()( ConsoleValue &ref ) const { - return (U8)((S32)ref); + return (U8)((S32)ref.getInt()); } U8 operator()( const char* str ) const @@ -268,9 +258,9 @@ struct EngineUnmarshallData< U8 > template<> struct EngineUnmarshallData< const char* > { - const char* operator()( ConsoleValueRef &ref ) const + const char* operator()( ConsoleValue &ref ) const { - return ref.getStringValue(); + return ref.getString(); } const char* operator()( const char* str ) const @@ -281,9 +271,9 @@ struct EngineUnmarshallData< const char* > template< typename T > struct EngineUnmarshallData< T* > { - T* operator()( ConsoleValueRef &ref ) const + T* operator()( ConsoleValue &ref ) const { - return dynamic_cast< T* >( Sim::findObject( ref.getStringValue() ) ); + return dynamic_cast< T* >( Sim::findObject( ref ) ); } T* operator()( const char* str ) const @@ -294,17 +284,17 @@ struct EngineUnmarshallData< T* > template<> struct EngineUnmarshallData< void > { - void operator()( ConsoleValueRef& ) const {} + void operator()( ConsoleValue& ) const {} void operator()( const char* ) const {} }; template<> -struct EngineUnmarshallData< ConsoleValueRef > +struct EngineUnmarshallData< ConsoleValue > { - ConsoleValueRef operator()( ConsoleValueRef ref ) const + ConsoleValue operator()( ConsoleValue &ref ) const { - return ref; + return std::move(ref); } }; @@ -548,7 +538,7 @@ namespace engineAPI{ static const S32 NUM_ARGS = sizeof...(ArgTs) + startArgc; template - static IthArgType getRealArgValue(S32 argc, ConsoleValueRef *argv, const _EngineFunctionDefaultArguments< void(RealArgTs...) >& defaultArgs) + static IthArgType getRealArgValue(S32 argc, ConsoleValue *argv, const _EngineFunctionDefaultArguments< void(RealArgTs...) >& defaultArgs) { if((startArgc + index) < argc) { @@ -559,12 +549,12 @@ namespace engineAPI{ } template - static R dispatchHelper(S32 argc, ConsoleValueRef *argv, FunctionType fn, const _EngineFunctionDefaultArguments< void(ArgTs...) >& defaultArgs, Seq){ + static R dispatchHelper(S32 argc, ConsoleValue *argv, FunctionType fn, const _EngineFunctionDefaultArguments< void(ArgTs...) >& defaultArgs, Seq){ return fn(SelfType::getRealArgValue(argc, argv, defaultArgs) ...); } template - static R dispatchHelper(S32 argc, ConsoleValueRef *argv, MethodType fn, Frame* frame, const _EngineFunctionDefaultArguments< void( typename Frame::ObjectType*, ArgTs...) >& defaultArgs, Seq){ + static R dispatchHelper(S32 argc, ConsoleValue *argv, MethodType fn, Frame* frame, const _EngineFunctionDefaultArguments< void( typename Frame::ObjectType*, ArgTs...) >& defaultArgs, Seq){ return (frame->*fn)(SelfType::getRealArgValue(argc, argv, defaultArgs) ...); } @@ -579,9 +569,9 @@ namespace engineAPI{ } }; - template<> struct MarshallHelpers { - template static void marshallEach(S32 &argc, ConsoleValueRef *argv, const ArgTs& ...args){} - template static void marshallEach(S32 &argc, ConsoleValueRef *argv, const H& head, const Tail& ...tail){ + template<> struct MarshallHelpers { + template static void marshallEach(S32 &argc, ConsoleValue *argv, const ArgTs& ...args){} + template static void marshallEach(S32 &argc, ConsoleValue *argv, const H& head, const Tail& ...tail){ EngineMarshallData(head, argc, argv); marshallEach(argc, argv, tail...); } @@ -604,12 +594,12 @@ public: template using MethodType = typename Helper::template MethodType; static const S32 NUM_ARGS = Helper::NUM_ARGS; - static ReturnType thunk( S32 argc, ConsoleValueRef *argv, FunctionType fn, const _EngineFunctionDefaultArguments< void(ArgTs...) >& defaultArgs) + static ReturnType thunk( S32 argc, ConsoleValue *argv, FunctionType fn, const _EngineFunctionDefaultArguments< void(ArgTs...) >& defaultArgs) { return _EngineConsoleThunkReturnValue( Helper::dispatchHelper(argc, argv, fn, defaultArgs, SeqType())); } template< typename Frame > - static ReturnType thunk( S32 argc, ConsoleValueRef *argv, MethodType fn, Frame* frame, const _EngineFunctionDefaultArguments< void( typename Frame::ObjectType*, ArgTs...) >& defaultArgs) + static ReturnType thunk( S32 argc, ConsoleValue *argv, MethodType fn, Frame* frame, const _EngineFunctionDefaultArguments< void( typename Frame::ObjectType*, ArgTs...) >& defaultArgs) { return _EngineConsoleThunkReturnValue( Helper::dispatchHelper(argc, argv, fn, frame, defaultArgs, SeqType())); } @@ -627,12 +617,12 @@ public: template using MethodType = typename Helper::template MethodType; static const S32 NUM_ARGS = Helper::NUM_ARGS; - static void thunk( S32 argc, ConsoleValueRef *argv, FunctionType fn, const _EngineFunctionDefaultArguments< void(ArgTs...) >& defaultArgs) + static void thunk( S32 argc, ConsoleValue *argv, FunctionType fn, const _EngineFunctionDefaultArguments< void(ArgTs...) >& defaultArgs) { Helper::dispatchHelper(argc, argv, fn, defaultArgs, SeqType()); } template< typename Frame > - static void thunk( S32 argc, ConsoleValueRef *argv, MethodType fn, Frame* frame, const _EngineFunctionDefaultArguments< void( typename Frame::ObjectType*, ArgTs...) >& defaultArgs) + static void thunk( S32 argc, ConsoleValue *argv, MethodType fn, Frame* frame, const _EngineFunctionDefaultArguments< void( typename Frame::ObjectType*, ArgTs...) >& defaultArgs) { Helper::dispatchHelper(argc, argv, fn, frame, defaultArgs, SeqType()); } @@ -705,7 +695,7 @@ public: ( void* ) &fn ## name, \ 0 \ ); \ - static _EngineConsoleThunkType< returnType >::ReturnType _ ## name ## caster( SimObject*, S32 argc, ConsoleValueRef *argv ) \ + static _EngineConsoleThunkType< returnType >::ReturnType _ ## name ## caster( SimObject*, S32 argc, ConsoleValue *argv ) \ { \ return _EngineConsoleThunkType< returnType >::ReturnType( _EngineConsoleThunk< 1, returnType args >::thunk( \ argc, argv, &_fn ## name ## impl, _fn ## name ## DefaultArgs \ @@ -785,7 +775,7 @@ public: ( void* ) &fn ## className ## _ ## name, \ 0 \ ); \ - static _EngineConsoleThunkType< returnType >::ReturnType _ ## className ## name ## caster( SimObject* object, S32 argc, ConsoleValueRef *argv ) \ + static _EngineConsoleThunkType< returnType >::ReturnType _ ## className ## name ## caster( SimObject* object, S32 argc, ConsoleValue *argv ) \ { \ _ ## className ## name ## frame frame; \ frame.object = static_cast< className* >( object ); \ @@ -842,7 +832,7 @@ public: ( void* ) &fn ## className ## _ ## name, \ 0 \ ); \ - static _EngineConsoleThunkType< returnType >::ReturnType _ ## className ## name ## caster( SimObject*, S32 argc, ConsoleValueRef *argv )\ + static _EngineConsoleThunkType< returnType >::ReturnType _ ## className ## name ## caster( SimObject*, S32 argc, ConsoleValue *argv )\ { \ return _EngineConsoleThunkType< returnType >::ReturnType( _EngineConsoleThunk< 1, returnType args >::thunk( \ argc, argv, &_fn ## className ## name ## impl, _fn ## className ## name ## DefaultArgs \ @@ -859,7 +849,7 @@ public: static inline returnType _fn ## className ## name ## impl args # define DefineEngineStringlyVariadicFunction(name,returnType,minArgs,maxArgs,usage) \ - static inline returnType _fn ## name ## impl (SimObject *, S32 argc, ConsoleValueRef *argv); \ + static inline returnType _fn ## name ## impl (SimObject *, S32 argc, ConsoleValue *argv); \ TORQUE_API EngineTypeTraits< returnType >::ReturnValueType fn ## name \ (Vector* vec) \ { \ @@ -882,14 +872,14 @@ public: 0 \ ); \ ConsoleConstructor cc_##name##_obj(NULL,#name,_fn ## name ## impl,usage,minArgs,maxArgs); \ - returnType _fn ## name ## impl(SimObject *, S32 argc, ConsoleValueRef *argv) + returnType _fn ## name ## impl(SimObject *, S32 argc, ConsoleValue *argv) # define DefineEngineStringlyVariadicMethod(className, name,returnType,minArgs,maxArgs,usage) \ struct _ ## className ## name ## frame \ { \ typedef className ObjectType; \ className* object; \ - inline returnType _exec (S32 argc, ConsoleValueRef* argv) const; \ + inline returnType _exec (S32 argc, ConsoleValue* argv) const; \ }; \ TORQUE_API EngineTypeTraits< returnType >::ReturnValueType fn ## className ## _ ## name \ (className* object, Vector* vec) \ @@ -915,14 +905,14 @@ public: ( void* ) &fn ## className ## _ ## name, \ 0 \ ); \ - returnType cm_##className##_##name##_caster(SimObject* object, S32 argc, ConsoleValueRef* argv) { \ + returnType cm_##className##_##name##_caster(SimObject* object, S32 argc, ConsoleValue* argv) { \ AssertFatal( dynamic_cast( object ), "Object passed to " #name " is not a " #className "!" ); \ _ ## className ## name ## frame frame {}; \ frame.object = static_cast< className* >( object ); \ conmethod_return_##returnType ) frame._exec(argc,argv); \ }; \ ConsoleConstructor cc_##className##_##name##_obj(#className,#name,cm_##className##_##name##_caster,usage,minArgs,maxArgs); \ - inline returnType _ ## className ## name ## frame::_exec(S32 argc, ConsoleValueRef *argv) const + inline returnType _ ## className ## name ## frame::_exec(S32 argc, ConsoleValue *argv) const @@ -1167,10 +1157,10 @@ public: S32 mInitialArgc; S32 mArgc; StringTableEntry mCallbackName; - ConsoleValueRef mArgv[ MAX_ARGUMENTS + 2 ]; + ConsoleValue mArgv[ MAX_ARGUMENTS + 2 ]; - ConsoleValueRef _exec(); - ConsoleValueRef _execLater(SimConsoleThreadExecEvent *evt); + ConsoleValue _exec(); + ConsoleValue _execLater(SimConsoleThreadExecEvent *evt); _BaseEngineConsoleCallbackHelper(): mThis(NULL), mInitialArgc(0), mArgc(0), mCallbackName(StringTable->EmptyString()){;} }; @@ -1181,7 +1171,7 @@ public: struct _EngineConsoleCallbackHelper : public _BaseEngineConsoleCallbackHelper { private: - using Helper = engineAPI::detail::MarshallHelpers; + using Helper = engineAPI::detail::MarshallHelpers; public: _EngineConsoleCallbackHelper( StringTableEntry callbackName, SimObject* pThis ) @@ -1244,7 +1234,7 @@ public: { ConsoleStackFrameSaver sav; sav.save(); CSTK.reserveValues(mArgc+sizeof...(ArgTs), mArgv); - mArgv[ 0 ].value->setStackStringValue(simCB); + mArgv[ 0 ].setString(simCB, dStrlen(simCB)); Helper::marshallEach(mArgc, mArgv, args...); @@ -1255,7 +1245,7 @@ public: SimConsoleThreadExecCallback cb; SimConsoleThreadExecEvent *evt = new SimConsoleThreadExecEvent(mArgc+sizeof...(ArgTs), NULL, true, &cb); evt->populateArgs(mArgv); - mArgv[ 0 ].value->setStackStringValue(simCB); + mArgv[ 0 ].setString(simCB, dStrlen(simCB)); Helper::marshallEach(mArgc, mArgv, args...); @@ -1270,7 +1260,7 @@ public: template<> struct _EngineConsoleExecCallbackHelper : public _BaseEngineConsoleCallbackHelper { private: - using Helper = engineAPI::detail::MarshallHelpers; + using Helper = engineAPI::detail::MarshallHelpers; public: _EngineConsoleExecCallbackHelper( const char *callbackName ) { @@ -1285,10 +1275,9 @@ public: if (Con::isMainThread()) { ConsoleStackFrameSaver sav; sav.save(); - CSTK.reserveValues(mArgc+sizeof...(ArgTs), mArgv); - mArgv[ 0 ].value->setStackStringValue(mCallbackName); + mArgv[ 0 ].setStringTableEntry(mCallbackName); - Helper::marshallEach(mArgc, mArgv, args...); + Helper::marshallEach(mArgc, mArgv, args...); return R( EngineUnmarshallData< R >()( _exec() ) ); } @@ -1297,7 +1286,7 @@ public: SimConsoleThreadExecCallback cb; SimConsoleThreadExecEvent *evt = new SimConsoleThreadExecEvent(mArgc+sizeof...(ArgTs), NULL, false, &cb); evt->populateArgs(mArgv); - mArgv[ 0 ].value->setStackStringValue(mCallbackName); + mArgv[ 0 ].setStringTableEntry(mCallbackName); Helper::marshallEach(mArgc, mArgv, args...); diff --git a/Engine/source/console/simEvents.cpp b/Engine/source/console/simEvents.cpp index ab87f5f0b..97eb74d40 100644 --- a/Engine/source/console/simEvents.cpp +++ b/Engine/source/console/simEvents.cpp @@ -28,30 +28,23 @@ // Stupid globals not declared in a header extern ExprEvalState gEvalState; -SimConsoleEvent::SimConsoleEvent(S32 argc, ConsoleValueRef *argv, bool onObject) +SimConsoleEvent::SimConsoleEvent(S32 argc, ConsoleValue *argv, bool onObject) { mOnObject = onObject; mArgc = argc; - mArgv = new ConsoleValueRef[argc]; + mArgv = new ConsoleValue[argc]; for (int i=0; itype = ConsoleValue::TypeInternalString; - mArgv[i].value->init(); - if (argv) - { - mArgv[i].value->setStringValue((const char*)argv[i]); - } + if (argv) + { + mArgv->setString(argv[i].getString(), dStrlen(argv[i].getString())); + } } } SimConsoleEvent::~SimConsoleEvent() { - for (int i=0; irelease(); } -ConsoleValueRef SimConsoleThreadExecCallback::waitForResult() +ConsoleValue SimConsoleThreadExecCallback::waitForResult() { if(sem->acquire(true)) { - return retVal; + return std::move(retVal); } - return ConsoleValueRef(); + return ConsoleValue(); } //----------------------------------------------------------------------------- -SimConsoleThreadExecEvent::SimConsoleThreadExecEvent(S32 argc, ConsoleValueRef *argv, bool onObject, SimConsoleThreadExecCallback *callback) : +SimConsoleThreadExecEvent::SimConsoleThreadExecEvent(S32 argc, ConsoleValue *argv, bool onObject, SimConsoleThreadExecCallback *callback) : SimConsoleEvent(argc, argv, onObject), cb(callback) { } void SimConsoleThreadExecEvent::process(SimObject* object) { - ConsoleValueRef retVal; - if(mOnObject) - retVal = Con::execute(object, mArgc, mArgv); + if (cb) + { + if (mOnObject) + cb->handleCallback(std::move(Con::execute(object, mArgc, mArgv))); + else + cb->handleCallback(std::move(Con::execute(mArgc, mArgv))); + } else - retVal = Con::execute(mArgc, mArgv); - - if(cb) - cb->handleCallback(retVal); + { + if (mOnObject) + Con::execute(object, mArgc, mArgv); + else + Con::execute(mArgc, mArgv); + } } diff --git a/Engine/source/console/simEvents.h b/Engine/source/console/simEvents.h index 6fbb6a798..20fa53f5b 100644 --- a/Engine/source/console/simEvents.h +++ b/Engine/source/console/simEvents.h @@ -91,7 +91,7 @@ class SimConsoleEvent : public SimEvent { protected: S32 mArgc; - ConsoleValueRef *mArgv; + ConsoleValue *mArgv; bool mOnObject; public: @@ -108,13 +108,13 @@ public: /// /// @see Con::execute(S32 argc, const char *argv[]) /// @see Con::execute(SimObject *object, S32 argc, const char *argv[]) - SimConsoleEvent(S32 argc, ConsoleValueRef *argv, bool onObject); + SimConsoleEvent(S32 argc, ConsoleValue *argv, bool onObject); ~SimConsoleEvent(); virtual void process(SimObject *object); /// Creates a reference to our internal args list in argv - void populateArgs(ConsoleValueRef *argv); + void populateArgs(ConsoleValue *argv); }; @@ -123,13 +123,13 @@ public: struct SimConsoleThreadExecCallback { Semaphore *sem; - ConsoleValueRef retVal; + ConsoleValue retVal; SimConsoleThreadExecCallback(); ~SimConsoleThreadExecCallback(); - void handleCallback(ConsoleValueRef ret); - ConsoleValueRef waitForResult(); + void handleCallback(ConsoleValue ret); + ConsoleValue waitForResult(); }; class SimConsoleThreadExecEvent : public SimConsoleEvent @@ -137,7 +137,7 @@ class SimConsoleThreadExecEvent : public SimConsoleEvent SimConsoleThreadExecCallback *cb; public: - SimConsoleThreadExecEvent(S32 argc, ConsoleValueRef *argv, bool onObject, SimConsoleThreadExecCallback *callback); + SimConsoleThreadExecEvent(S32 argc, ConsoleValue *argv, bool onObject, SimConsoleThreadExecCallback *callback); SimConsoleThreadExecCallback& getCB() { return *cb; } virtual void process(SimObject *object); diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index ea0da309c..008ba9698 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -141,7 +141,7 @@ SimObject::~SimObject() //----------------------------------------------------------------------------- -bool SimObject::processArguments(S32 argc, ConsoleValueRef *argv) +bool SimObject::processArguments(S32 argc, ConsoleValue *argv) { return argc == 0; } diff --git a/Engine/source/console/simObject.h b/Engine/source/console/simObject.h index 102689b41..9cef85f0f 100644 --- a/Engine/source/console/simObject.h +++ b/Engine/source/console/simObject.h @@ -587,7 +587,7 @@ class SimObject: public ConsoleObject, public TamlCallbacks virtual ~SimObject(); - virtual bool processArguments(S32 argc, ConsoleValueRef *argv); ///< Process constructor options. (ie, new SimObject(1,2,3)) + virtual bool processArguments(S32 argc, ConsoleValue *argv); ///< Process constructor options. (ie, new SimObject(1,2,3)) /// @} diff --git a/Engine/source/console/simPersistSet.cpp b/Engine/source/console/simPersistSet.cpp index 00840c649..771e8ce0c 100644 --- a/Engine/source/console/simPersistSet.cpp +++ b/Engine/source/console/simPersistSet.cpp @@ -47,7 +47,7 @@ SimPersistSet::SimPersistSet() //----------------------------------------------------------------------------- -bool SimPersistSet::processArguments( S32 argc, ConsoleValueRef *argv ) +bool SimPersistSet::processArguments( S32 argc, ConsoleValue *argv ) { for( U32 i = 0; i < argc; ++ i ) { diff --git a/Engine/source/console/simPersistSet.h b/Engine/source/console/simPersistSet.h index d1769cff0..e09a828ff 100644 --- a/Engine/source/console/simPersistSet.h +++ b/Engine/source/console/simPersistSet.h @@ -58,7 +58,7 @@ class SimPersistSet : public SimSet // SimSet. virtual void addObject( SimObject* ); virtual void write( Stream &stream, U32 tabStop, U32 flags = 0 ); - virtual bool processArguments( S32 argc, ConsoleValueRef *argv ); + virtual bool processArguments( S32 argc, ConsoleValue *argv ); DECLARE_CONOBJECT( SimPersistSet ); DECLARE_CATEGORY( "Console" ); diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index b0674765b..1b937c755 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -20,7 +20,6 @@ // IN THE SOFTWARE. //----------------------------------------------------------------------------- -#ifdef 0 #ifdef TORQUE_TESTS_ENABLED #include "testing/unitTesting.h" #include "platform/platform.h" @@ -32,40 +31,40 @@ #include "console/stringStack.h" template -inline T Convert(ConsoleValueRef); +inline T Convert(ConsoleValue&); template<> -inline U32 Convert(ConsoleValueRef val) +inline U32 Convert(ConsoleValue &val) { - return val.getIntValue(); + return val.getInt(); } template<> -inline S32 Convert(ConsoleValueRef val) +inline S32 Convert(ConsoleValue &val) { - return val.getSignedIntValue(); + return val.getInt(); } template<> -inline bool Convert(ConsoleValueRef val) +inline bool Convert(ConsoleValue &val) { - return val.getBoolValue(); + return val.getBool(); } template<> -inline F32 Convert(ConsoleValueRef val) +inline F32 Convert(ConsoleValue &val) { - return val.getFloatValue(); + return val.getFloat(); } template<> -inline const char* Convert(ConsoleValueRef val) +inline const char* Convert(ConsoleValue &val) { - return val.getStringValue(); + return val.getString(); } template<> -inline SimObject* Convert(ConsoleValueRef val) +inline SimObject* Convert(ConsoleValue &val) { return Sim::findObject(val); } @@ -73,7 +72,7 @@ inline SimObject* Convert(ConsoleValueRef val) template inline T RunScript(const char* str) { - return Convert(Con::evaluate(str, false, NULL)); + return Convert(std::move(Con::evaluate(str, false, NULL))); } TEST(Script, Basic_Arithmetic) @@ -394,4 +393,3 @@ TEST(Script, Basic_Package) } #endif -#endif From 02447f0996643bb75e86f100b7ad98bbdfecbec8 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Wed, 31 Mar 2021 22:10:55 -0400 Subject: [PATCH 005/399] compile fixes. --- Engine/source/Verve/Core/VDataTable.cpp | 2 +- Engine/source/afx/afxMagicSpell.cpp | 16 +- Engine/source/afx/arcaneFX.cpp | 6 +- Engine/source/app/mainLoop.cpp | 4 - Engine/source/console/CMDgram.y | 7 +- Engine/source/console/CMDscan.cpp | 2723 ++++++------- Engine/source/console/cmdgram.cpp | 3388 ++++++++--------- Engine/source/console/codeBlock.cpp | 6 +- Engine/source/console/compiledEval.cpp | 12 +- Engine/source/console/console.cpp | 5 + Engine/source/console/console.h | 56 +- Engine/source/console/consoleInternal.cpp | 13 +- Engine/source/console/consoleInternal.h | 5 +- Engine/source/console/engineAPI.h | 6 +- Engine/source/console/engineDoc.cpp | 4 +- Engine/source/console/optimizer.cpp | 104 + Engine/source/console/simObject.cpp | 8 +- Engine/source/console/test/consoleTest.cpp | 2 +- .../gui/controls/guiGameListMenuCtrl.cpp | 6 +- .../source/shaderGen/customShaderFeature.cpp | 2 +- 20 files changed, 3207 insertions(+), 3168 deletions(-) create mode 100644 Engine/source/console/optimizer.cpp diff --git a/Engine/source/Verve/Core/VDataTable.cpp b/Engine/source/Verve/Core/VDataTable.cpp index f338c5ac4..9bb4b92ff 100644 --- a/Engine/source/Verve/Core/VDataTable.cpp +++ b/Engine/source/Verve/Core/VDataTable.cpp @@ -228,7 +228,7 @@ bool VDataTable::getValue( SimObject *pObject, const String &pFieldName, String case VDataTable::k_TypeExpression : { // Evaluate. - pValue = Con::evaluate( fieldValue, false ).getStringValue(); + pValue = Con::evaluate( fieldValue, false ).getString(); } break; diff --git a/Engine/source/afx/afxMagicSpell.cpp b/Engine/source/afx/afxMagicSpell.cpp index b45d7c131..9d05f0b80 100644 --- a/Engine/source/afx/afxMagicSpell.cpp +++ b/Engine/source/afx/afxMagicSpell.cpp @@ -2638,23 +2638,25 @@ DefineEngineStringlyVariadicMethod(afxMagicSpell, setTimeFactor, void, 3, 4, "(F "@ingroup AFX") { if (argc == 3) - object->setTimeFactor(dAtof(argv[2])); + object->setTimeFactor(argv[2].getFloat()); else { + F32 value = argv[3].getFloat(); + if (dStricmp(argv[2], "overall") == 0) object->setTimeFactor(dAtof(argv[3])); else if (dStricmp(argv[2], "casting") == 0) - object->setTimeFactor(afxMagicSpell::CASTING_PHRASE, dAtof(argv[3])); + object->setTimeFactor(afxMagicSpell::CASTING_PHRASE, value); else if (dStricmp(argv[2], "launch") == 0) - object->setTimeFactor(afxMagicSpell::LAUNCH_PHRASE, dAtof(argv[3])); + object->setTimeFactor(afxMagicSpell::LAUNCH_PHRASE, value); else if (dStricmp(argv[2], "delivery") == 0) - object->setTimeFactor(afxMagicSpell::DELIVERY_PHRASE, dAtof(argv[3])); + object->setTimeFactor(afxMagicSpell::DELIVERY_PHRASE, value); else if (dStricmp(argv[2], "impact") == 0) - object->setTimeFactor(afxMagicSpell::IMPACT_PHRASE, dAtof(argv[3])); + object->setTimeFactor(afxMagicSpell::IMPACT_PHRASE, value); else if (dStricmp(argv[2], "linger") == 0) - object->setTimeFactor(afxMagicSpell::LINGER_PHRASE, dAtof(argv[3])); + object->setTimeFactor(afxMagicSpell::LINGER_PHRASE, value); else - Con::errorf("afxMagicSpell::setTimeFactor() -- unknown spell phrase [%s].", argv[2].getStringValue()); + Con::errorf("afxMagicSpell::setTimeFactor() -- unknown spell phrase [%s].", argv[2].getString()); } } diff --git a/Engine/source/afx/arcaneFX.cpp b/Engine/source/afx/arcaneFX.cpp index 385c056f6..5c7ea3460 100644 --- a/Engine/source/afx/arcaneFX.cpp +++ b/Engine/source/afx/arcaneFX.cpp @@ -874,7 +874,7 @@ DefineEngineStringlyVariadicFunction(echoThru, const char*, 2, 0, "(string passt for (i = 2; i < argc; i++) dStrcat(ret, argv[i], len + 1); - Con::printf("%s -- [%s]", ret, argv[1].getStringValue()); + Con::printf("%s -- [%s]", ret, argv[1].getString()); ret[0] = 0; return argv[1]; @@ -894,7 +894,7 @@ DefineEngineStringlyVariadicFunction(warnThru, const char*, 2, 0, "(string passt for(i = 2; i < argc; i++) dStrcat(ret, argv[i], len + 1); - Con::warnf("%s -- [%s]", ret, argv[1].getStringValue()); + Con::warnf("%s -- [%s]", ret, argv[1].getString()); ret[0] = 0; return argv[1]; @@ -914,7 +914,7 @@ DefineEngineStringlyVariadicFunction(errorThru, const char*, 2, 0, "(string pass for(i = 2; i < argc; i++) dStrcat(ret, argv[i], len + 1); - Con::errorf("%s -- [%s]", ret, argv[1].getStringValue()); + Con::errorf("%s -- [%s]", ret, argv[1].getString()); ret[0] = 0; return argv[1]; diff --git a/Engine/source/app/mainLoop.cpp b/Engine/source/app/mainLoop.cpp index 13a331075..871a7cc88 100644 --- a/Engine/source/app/mainLoop.cpp +++ b/Engine/source/app/mainLoop.cpp @@ -45,7 +45,6 @@ #include "console/debugOutputConsumer.h" #include "console/consoleTypes.h" #include "console/engineAPI.h" -#include "console/codeInterpreter.h" #include "gfx/bitmap/gBitmap.h" #include "gfx/gFont.h" @@ -229,9 +228,6 @@ void StandardMainLoop::init() ManagedSingleton< ThreadManager >::createSingleton(); FrameAllocator::init(TORQUE_FRAME_SIZE); // See comments in torqueConfig.h - // Initialize the TorqueScript interpreter. - CodeInterpreter::init(); - // Yell if we can't initialize the network. if(!Net::init()) { diff --git a/Engine/source/console/CMDgram.y b/Engine/source/console/CMDgram.y index 6cfbf3311..0b15c0e93 100644 --- a/Engine/source/console/CMDgram.y +++ b/Engine/source/console/CMDgram.y @@ -456,6 +456,8 @@ expr { $$ = (ExprNode*)VarNode::alloc( $1.lineNumber, $1.value, NULL); } | VAR '[' aidx_expr ']' { $$ = (ExprNode*)VarNode::alloc( $1.lineNumber, $1.value, $3 ); } + ; +/* | rwDEFINE '(' var_list_decl ')' '{' statement_list '}' { const U32 bufLen = 64; @@ -471,7 +473,7 @@ expr $$ = StrConstNode::alloc( $1.lineNumber, (UTF8*)fName, false ); } - ; +*/ slot_acc : expr '.' IDENT @@ -551,9 +553,12 @@ funcall_expr { $$ = FuncCallExprNode::alloc( $1.lineNumber, $3.value, $1.value, $5, false); } | expr '.' IDENT '(' expr_list_decl ')' { $1->append($5); $$ = FuncCallExprNode::alloc( $1->dbgLineNumber, $3.value, NULL, $1, true); } + ; +/* | expr '(' expr_list_decl ')' { $$ = FuncPointerCallExprNode::alloc( $1->dbgLineNumber, $1, $3); } ; +*/ assert_expr : rwASSERT '(' expr ')' diff --git a/Engine/source/console/CMDscan.cpp b/Engine/source/console/CMDscan.cpp index c30ac7bc9..43a864570 100644 --- a/Engine/source/console/CMDscan.cpp +++ b/Engine/source/console/CMDscan.cpp @@ -20,8 +20,8 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: -* $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $ -*/ + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $ + */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 @@ -60,8 +60,8 @@ #endif /* ! __cplusplus */ #ifdef __TURBOC__ -#pragma warn -rch -#pragma warn -use + #pragma warn -rch + #pragma warn -use #include #include #define YY_USE_CONST @@ -85,22 +85,22 @@ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned -* integer for use as an array index. If the signed char is negative, -* we want to instead treat it as an 8-bit unsigned char, hence the -* double cast. -*/ + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, -* but we do it the disgusting crufty way forced on us by the ()-less -* definition of BEGIN. -*/ + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ #define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed -* to BEGIN to return to the state. The YYSTATE alias is for lex -* compatibility. -*/ + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ #define YY_START ((yy_start - 1) / 2) #define YYSTATE YY_START @@ -125,18 +125,18 @@ extern FILE *yyin, *yyout; #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition -* int a single C statement (which needs a semi-colon terminator). This -* avoids problems with code like: -* -* if ( condition_holds ) -* yyless( 5 ); -* else -* do_something_else(); -* -* Prior to using the do-while the compiler would get upset at the -* "else" because it interpreted the "if" statement as being all -* done when it reached the ';' after the yyless() call. -*/ + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ /* Return all but the first 'n' matched characters back to the input stream. */ @@ -153,75 +153,75 @@ extern FILE *yyin, *yyout; #define unput(c) yyunput( c, yytext_ptr ) /* The following is because we cannot portably get our hands on size_t -* (without autoconf's help, which isn't available because we want -* flex-generated scanners to compile on their own). -*/ + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ typedef unsigned int yy_size_t; struct yy_buffer_state -{ - FILE *yy_input_file; + { + FILE *yy_input_file; - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; - int yy_buffer_status; + int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ #define YY_BUFFER_EOF_PENDING 2 -}; + }; static YY_BUFFER_STATE yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the -* future we want to put the buffer states in a more general -* "scanner state". -*/ + * future we want to put the buffer states in a more general + * "scanner state". + */ #define YY_CURRENT_BUFFER yy_current_buffer @@ -234,32 +234,32 @@ static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *)0; +static char *yy_c_buf_p = (char *) 0; static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ - /* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ static int yy_did_buffer_switch_on_eof; -void yyrestart YY_PROTO((FILE *input_file)); +void yyrestart YY_PROTO(( FILE *input_file )); -void yy_switch_to_buffer YY_PROTO((YY_BUFFER_STATE new_buffer)); -void yy_load_buffer_state YY_PROTO((void)); -YY_BUFFER_STATE yy_create_buffer YY_PROTO((FILE *file, int size)); -void yy_delete_buffer YY_PROTO((YY_BUFFER_STATE b)); -void yy_init_buffer YY_PROTO((YY_BUFFER_STATE b, FILE *file)); -void yy_flush_buffer YY_PROTO((YY_BUFFER_STATE b)); +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) -YY_BUFFER_STATE yy_scan_buffer YY_PROTO((char *base, yy_size_t size)); -YY_BUFFER_STATE yy_scan_string YY_PROTO((yyconst char *str)); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO((yyconst char *bytes, int len)); +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); -static void *yy_flex_alloc YY_PROTO((yy_size_t)); -static void *yy_flex_realloc YY_PROTO((void *, yy_size_t)); -static void yy_flex_free YY_PROTO((void *)); +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer @@ -280,19 +280,19 @@ static void yy_flex_free YY_PROTO((void *)); #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *)0, *yyout = (FILE *)0; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern char *yytext; #define yytext_ptr yytext -static yy_state_type yy_get_previous_state YY_PROTO((void)); -static yy_state_type yy_try_NUL_trans YY_PROTO((yy_state_type current_state)); -static int yy_get_next_buffer YY_PROTO((void)); -static void yy_fatal_error YY_PROTO((yyconst char msg[])); +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* Done after the current pattern has been matched and before the -* corresponding action - sets up yytext. -*/ + * corresponding action - sets up yytext. + */ #define YY_DO_BEFORE_ACTION \ yytext_ptr = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ @@ -303,241 +303,241 @@ static void yy_fatal_error YY_PROTO((yyconst char msg[])); #define YY_NUM_RULES 94 #define YY_END_OF_BUFFER 95 static yyconst short int yy_accept[224] = -{ 0, -0, 0, 95, 93, 1, 5, 4, 51, 93, 93, -58, 57, 93, 41, 42, 45, 43, 56, 44, 50, -46, 90, 90, 52, 53, 47, 61, 48, 38, 36, -88, 88, 88, 88, 39, 40, 59, 88, 88, 88, -88, 88, 88, 88, 88, 88, 88, 88, 88, 88, -88, 54, 49, 55, 60, 1, 0, 9, 0, 6, -0, 0, 17, 87, 25, 12, 26, 0, 7, 0, -23, 16, 21, 15, 22, 31, 91, 37, 3, 24, -0, 90, 0, 0, 14, 19, 11, 8, 10, 20, -88, 33, 88, 88, 27, 88, 88, 88, 88, 88, + { 0, + 0, 0, 95, 93, 1, 5, 4, 51, 93, 93, + 58, 57, 93, 41, 42, 45, 43, 56, 44, 50, + 46, 90, 90, 52, 53, 47, 61, 48, 38, 36, + 88, 88, 88, 88, 39, 40, 59, 88, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, + 88, 54, 49, 55, 60, 1, 0, 9, 0, 6, + 0, 0, 17, 87, 25, 12, 26, 0, 7, 0, + 23, 16, 21, 15, 22, 31, 91, 37, 3, 24, + 0, 90, 0, 0, 14, 19, 11, 8, 10, 20, + 88, 33, 88, 88, 27, 88, 88, 88, 88, 88, -88, 69, 88, 88, 88, 88, 70, 62, 88, 88, -63, 88, 88, 88, 88, 88, 88, 28, 13, 18, -92, 87, 0, 32, 3, 3, 91, 0, 91, 89, -29, 30, 35, 34, 88, 88, 88, 88, 88, 88, -88, 88, 73, 88, 88, 76, 88, 88, 88, 88, -88, 88, 92, 0, 3, 2, 88, 88, 79, 88, -88, 88, 66, 88, 88, 88, 88, 88, 88, 88, -88, 85, 88, 3, 0, 88, 64, 88, 88, 88, -86, 88, 88, 88, 88, 88, 88, 88, 68, 0, -67, 88, 88, 88, 88, 88, 88, 88, 65, 88, + 88, 69, 88, 88, 88, 88, 70, 62, 88, 88, + 63, 88, 88, 88, 88, 88, 88, 28, 13, 18, + 92, 87, 0, 32, 3, 3, 91, 0, 91, 89, + 29, 30, 35, 34, 88, 88, 88, 88, 88, 88, + 88, 88, 73, 88, 88, 76, 88, 88, 88, 88, + 88, 88, 92, 0, 3, 2, 88, 88, 79, 88, + 88, 88, 66, 88, 88, 88, 88, 88, 88, 88, + 88, 85, 88, 3, 0, 88, 64, 88, 88, 88, + 86, 88, 88, 88, 88, 88, 88, 88, 68, 0, + 67, 88, 88, 88, 88, 88, 88, 88, 65, 88, -81, 0, 88, 88, 82, 72, 88, 88, 83, 88, -80, 0, 74, 88, 71, 75, 88, 88, 0, 78, -84, 77, 0 -}; + 81, 0, 88, 88, 82, 72, 88, 88, 83, 88, + 80, 0, 74, 88, 71, 75, 88, 88, 0, 78, + 84, 77, 0 + } ; static yyconst int yy_ec[256] = -{ 0, -1, 1, 1, 1, 1, 1, 1, 1, 2, 3, -2, 2, 4, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 2, 5, 6, 1, 7, 8, 9, 10, 11, -12, 13, 14, 15, 16, 17, 18, 19, 20, 20, -20, 20, 20, 20, 20, 20, 20, 21, 22, 23, -24, 25, 26, 27, 28, 29, 30, 31, 32, 31, -33, 33, 33, 33, 33, 34, 33, 35, 33, 36, -33, 33, 37, 38, 33, 33, 33, 39, 33, 33, -40, 41, 42, 43, 33, 1, 44, 45, 46, 47, + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 2, 2, 4, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 5, 6, 1, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 31, + 33, 33, 33, 33, 33, 34, 33, 35, 33, 36, + 33, 33, 37, 38, 33, 33, 33, 39, 33, 33, + 40, 41, 42, 43, 33, 1, 44, 45, 46, 47, -48, 49, 50, 51, 52, 33, 53, 54, 55, 56, -57, 58, 33, 59, 60, 61, 62, 33, 63, 39, -33, 33, 64, 65, 66, 67, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 48, 49, 50, 51, 52, 33, 53, 54, 55, 56, + 57, 58, 33, 59, 60, 61, 62, 33, 63, 39, + 33, 33, 64, 65, 66, 67, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1 -}; + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; static yyconst int yy_meta[68] = -{ 0, -1, 1, 2, 2, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 3, 4, 4, -5, 1, 1, 6, 1, 1, 1, 4, 4, 4, -4, 4, 7, 7, 7, 7, 7, 7, 7, 1, -1, 1, 1, 4, 4, 4, 4, 4, 4, 7, -7, 7, 7, 7, 7, 7, 7, 7, 7, 7, -7, 7, 7, 1, 1, 1, 1 -}; + { 0, + 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 4, 4, + 5, 1, 1, 6, 1, 1, 1, 4, 4, 4, + 4, 4, 7, 7, 7, 7, 7, 7, 7, 1, + 1, 1, 1, 4, 4, 4, 4, 4, 4, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 1, 1, 1, 1 + } ; static yyconst short int yy_base[237] = -{ 0, -0, 0, 337, 338, 334, 338, 338, 61, 63, 51, -53, 65, 66, 338, 338, 311, 64, 338, 66, 60, -68, 76, 80, 313, 338, 60, 309, 77, 338, 338, -0, 298, 295, 302, 338, 338, 305, 268, 268, 54, -61, 272, 59, 38, 62, 266, 280, 275, 62, 263, -270, 338, 89, 338, 338, 318, 295, 338, 111, 338, -314, 100, 338, 296, 338, 338, 338, 112, 338, 312, -338, 338, 338, 290, 338, 338, 107, 338, 296, 338, -110, 114, 121, 0, 338, 289, 338, 338, 338, 288, -0, 0, 281, 281, 338, 249, 260, 247, 250, 244, + { 0, + 0, 0, 337, 338, 334, 338, 338, 61, 63, 51, + 53, 65, 66, 338, 338, 311, 64, 338, 66, 60, + 68, 76, 80, 313, 338, 60, 309, 77, 338, 338, + 0, 298, 295, 302, 338, 338, 305, 268, 268, 54, + 61, 272, 59, 38, 62, 266, 280, 275, 62, 263, + 270, 338, 89, 338, 338, 318, 295, 338, 111, 338, + 314, 100, 338, 296, 338, 338, 338, 112, 338, 312, + 338, 338, 338, 290, 338, 338, 107, 338, 296, 338, + 110, 114, 121, 0, 338, 289, 338, 338, 338, 288, + 0, 0, 281, 281, 338, 249, 260, 247, 250, 244, -255, 0, 243, 248, 242, 244, 0, 0, 244, 235, -0, 251, 235, 239, 242, 231, 240, 338, 338, 338, -270, 269, 268, 338, 0, 139, 119, 125, 128, 0, -338, 338, 0, 0, 240, 243, 238, 224, 240, 239, -234, 221, 232, 233, 230, 0, 224, 214, 225, 213, -225, 218, 250, 249, 146, 152, 210, 215, 0, 215, -221, 203, 0, 216, 219, 201, 201, 216, 200, 204, -211, 0, 208, 155, 237, 193, 0, 197, 198, 197, -0, 204, 197, 190, 197, 190, 197, 193, 0, 225, -0, 180, 184, 179, 177, 153, 158, 151, 0, 134, + 255, 0, 243, 248, 242, 244, 0, 0, 244, 235, + 0, 251, 235, 239, 242, 231, 240, 338, 338, 338, + 270, 269, 268, 338, 0, 139, 119, 125, 128, 0, + 338, 338, 0, 0, 240, 243, 238, 224, 240, 239, + 234, 221, 232, 233, 230, 0, 224, 214, 225, 213, + 225, 218, 250, 249, 146, 152, 210, 215, 0, 215, + 221, 203, 0, 216, 219, 201, 201, 216, 200, 204, + 211, 0, 208, 155, 237, 193, 0, 197, 198, 197, + 0, 204, 197, 190, 197, 190, 197, 193, 0, 225, + 0, 180, 184, 179, 177, 153, 158, 151, 0, 134, -187, 157, 143, 144, 0, 176, 123, 126, 0, 112, -338, 160, 0, 115, 338, 0, 88, 76, 162, 0, -0, 0, 338, 170, 174, 181, 185, 189, 193, 200, -119, 204, 211, 218, 225, 232 -}; + 187, 157, 143, 144, 0, 176, 123, 126, 0, 112, + 338, 160, 0, 115, 338, 0, 88, 76, 162, 0, + 0, 0, 338, 170, 174, 181, 185, 189, 193, 200, + 119, 204, 211, 218, 225, 232 + } ; static yyconst short int yy_def[237] = -{ 0, -223, 1, 223, 223, 223, 223, 223, 223, 224, 225, -225, 223, 226, 223, 223, 223, 223, 223, 223, 223, -223, 223, 223, 223, 223, 223, 223, 223, 223, 223, -227, 227, 227, 227, 223, 223, 223, 227, 227, 227, -227, 227, 227, 227, 227, 227, 227, 227, 227, 227, -227, 223, 223, 223, 223, 223, 223, 223, 224, 223, -224, 228, 223, 229, 223, 223, 223, 226, 223, 226, -223, 223, 223, 223, 223, 223, 223, 223, 230, 223, -223, 223, 223, 231, 223, 223, 223, 223, 223, 223, -227, 227, 227, 227, 223, 227, 227, 227, 227, 227, + { 0, + 223, 1, 223, 223, 223, 223, 223, 223, 224, 225, + 225, 223, 226, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 227, 227, 227, 227, 223, 223, 223, 227, 227, 227, + 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, + 227, 223, 223, 223, 223, 223, 223, 223, 224, 223, + 224, 228, 223, 229, 223, 223, 223, 226, 223, 226, + 223, 223, 223, 223, 223, 223, 223, 223, 230, 223, + 223, 223, 223, 231, 223, 223, 223, 223, 223, 223, + 227, 227, 227, 227, 223, 227, 227, 227, 227, 227, -227, 227, 227, 227, 227, 227, 227, 227, 227, 227, -227, 227, 227, 227, 227, 227, 227, 223, 223, 223, -232, 229, 229, 223, 230, 233, 223, 223, 223, 231, -223, 223, 227, 227, 227, 227, 227, 227, 227, 227, -227, 227, 227, 227, 227, 227, 227, 227, 227, 227, -227, 227, 232, 232, 234, 223, 227, 227, 227, 227, -227, 227, 227, 227, 227, 227, 227, 227, 227, 227, -227, 227, 227, 234, 223, 227, 227, 227, 227, 227, -227, 227, 227, 227, 227, 227, 227, 227, 227, 223, -227, 227, 227, 227, 227, 227, 227, 227, 227, 227, + 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, + 227, 227, 227, 227, 227, 227, 227, 223, 223, 223, + 232, 229, 229, 223, 230, 233, 223, 223, 223, 231, + 223, 223, 227, 227, 227, 227, 227, 227, 227, 227, + 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, + 227, 227, 232, 232, 234, 223, 227, 227, 227, 227, + 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, + 227, 227, 227, 234, 223, 227, 227, 227, 227, 227, + 227, 227, 227, 227, 227, 227, 227, 227, 227, 223, + 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, -227, 235, 227, 227, 227, 227, 227, 227, 227, 227, -223, 236, 227, 227, 223, 227, 227, 227, 236, 227, -227, 227, 0, 223, 223, 223, 223, 223, 223, 223, -223, 223, 223, 223, 223, 223 -}; + 227, 235, 227, 227, 227, 227, 227, 227, 227, 227, + 223, 236, 227, 227, 223, 227, 227, 227, 236, 227, + 227, 227, 0, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223 + } ; static yyconst short int yy_nxt[406] = -{ 0, -4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -14, 15, 16, 17, 18, 19, 20, 21, 22, 23, -24, 25, 26, 27, 28, 29, 30, 31, 31, 31, -31, 31, 31, 31, 32, 31, 33, 34, 31, 35, -4, 36, 37, 38, 39, 40, 41, 42, 43, 31, -31, 44, 31, 31, 31, 45, 46, 47, 48, 49, -50, 31, 51, 52, 53, 54, 55, 57, 60, 62, -62, 62, 62, 66, 63, 69, 65, 72, 77, 77, -78, 74, 86, 87, 58, 79, 107, 73, 67, 75, -76, 80, 81, 108, 82, 82, 81, 98, 82, 82, + { 0, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 31, 31, + 31, 31, 31, 31, 32, 31, 33, 34, 31, 35, + 4, 36, 37, 38, 39, 40, 41, 42, 43, 31, + 31, 44, 31, 31, 31, 45, 46, 47, 48, 49, + 50, 31, 51, 52, 53, 54, 55, 57, 60, 62, + 62, 62, 62, 66, 63, 69, 65, 72, 77, 77, + 78, 74, 86, 87, 58, 79, 107, 73, 67, 75, + 76, 80, 81, 108, 82, 82, 81, 98, 82, 82, -89, 90, 104, 61, 100, 109, 70, 83, 101, 110, -99, 83, 118, 114, 84, 105, 60, 102, 62, 62, -106, 69, 130, 83, 115, 77, 77, 83, 127, 127, -81, 222, 82, 82, 128, 221, 128, 127, 127, 129, -129, 156, 156, 129, 129, 83, 129, 129, 156, 156, -83, 61, 70, 119, 156, 156, 125, 156, 156, 156, -156, 83, 156, 156, 156, 156, 83, 220, 218, 175, -59, 217, 59, 59, 59, 59, 59, 64, 216, 64, -64, 68, 215, 68, 68, 68, 68, 68, 91, 214, -213, 91, 121, 211, 210, 121, 122, 122, 209, 122, + 89, 90, 104, 61, 100, 109, 70, 83, 101, 110, + 99, 83, 118, 114, 84, 105, 60, 102, 62, 62, + 106, 69, 130, 83, 115, 77, 77, 83, 127, 127, + 81, 222, 82, 82, 128, 221, 128, 127, 127, 129, + 129, 156, 156, 129, 129, 83, 129, 129, 156, 156, + 83, 61, 70, 119, 156, 156, 125, 156, 156, 156, + 156, 83, 156, 156, 156, 156, 83, 220, 218, 175, + 59, 217, 59, 59, 59, 59, 59, 64, 216, 64, + 64, 68, 215, 68, 68, 68, 68, 68, 91, 214, + 213, 91, 121, 211, 210, 121, 122, 122, 209, 122, -125, 208, 125, 125, 125, 125, 125, 153, 153, 207, -153, 155, 155, 155, 155, 155, 155, 155, 174, 174, -174, 174, 174, 174, 174, 212, 212, 206, 212, 212, -212, 212, 219, 219, 219, 219, 219, 219, 219, 205, -204, 203, 202, 201, 200, 199, 198, 197, 196, 195, -194, 193, 192, 191, 190, 189, 188, 187, 186, 185, -184, 183, 182, 181, 180, 179, 178, 177, 176, 154, -154, 173, 172, 171, 170, 169, 168, 167, 166, 165, -164, 163, 162, 161, 160, 159, 158, 157, 123, 123, -154, 152, 151, 150, 149, 148, 147, 146, 145, 144, + 125, 208, 125, 125, 125, 125, 125, 153, 153, 207, + 153, 155, 155, 155, 155, 155, 155, 155, 174, 174, + 174, 174, 174, 174, 174, 212, 212, 206, 212, 212, + 212, 212, 219, 219, 219, 219, 219, 219, 219, 205, + 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, + 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, + 184, 183, 182, 181, 180, 179, 178, 177, 176, 154, + 154, 173, 172, 171, 170, 169, 168, 167, 166, 165, + 164, 163, 162, 161, 160, 159, 158, 157, 123, 123, + 154, 152, 151, 150, 149, 148, 147, 146, 145, 144, -143, 142, 141, 140, 139, 138, 137, 136, 135, 134, -133, 132, 131, 126, 124, 68, 123, 59, 120, 56, -117, 116, 113, 112, 111, 103, 97, 96, 95, 94, -93, 92, 88, 85, 71, 56, 223, 3, 223, 223, -223, 223, 223, 223, 223, 223, 223, 223, 223, 223, -223, 223, 223, 223, 223, 223, 223, 223, 223, 223, -223, 223, 223, 223, 223, 223, 223, 223, 223, 223, -223, 223, 223, 223, 223, 223, 223, 223, 223, 223, -223, 223, 223, 223, 223, 223, 223, 223, 223, 223, -223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, + 133, 132, 131, 126, 124, 68, 123, 59, 120, 56, + 117, 116, 113, 112, 111, 103, 97, 96, 95, 94, + 93, 92, 88, 85, 71, 56, 223, 3, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, -223, 223, 223, 223, 223 -}; + 223, 223, 223, 223, 223 + } ; static yyconst short int yy_chk[406] = -{ 0, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 8, 9, 10, -10, 11, 11, 12, 10, 13, 11, 17, 20, 20, -21, 19, 26, 26, 8, 21, 44, 17, 12, 19, -19, 21, 22, 44, 22, 22, 23, 40, 23, 23, + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 8, 9, 10, + 10, 11, 11, 12, 10, 13, 11, 17, 20, 20, + 21, 19, 26, 26, 8, 21, 44, 17, 12, 19, + 19, 21, 22, 44, 22, 22, 23, 40, 23, 23, -28, 28, 43, 9, 41, 45, 13, 22, 41, 45, -40, 23, 53, 49, 22, 43, 59, 41, 62, 62, -43, 68, 231, 22, 49, 77, 77, 23, 81, 81, -82, 218, 82, 82, 83, 217, 83, 127, 127, 83, -83, 126, 126, 128, 128, 82, 129, 129, 155, 155, -127, 59, 68, 53, 156, 156, 126, 174, 174, 202, -202, 82, 212, 212, 219, 219, 127, 214, 210, 156, -224, 208, 224, 224, 224, 224, 224, 225, 207, 225, -225, 226, 206, 226, 226, 226, 226, 226, 227, 204, -203, 227, 228, 201, 200, 228, 229, 229, 198, 229, + 28, 28, 43, 9, 41, 45, 13, 22, 41, 45, + 40, 23, 53, 49, 22, 43, 59, 41, 62, 62, + 43, 68, 231, 22, 49, 77, 77, 23, 81, 81, + 82, 218, 82, 82, 83, 217, 83, 127, 127, 83, + 83, 126, 126, 128, 128, 82, 129, 129, 155, 155, + 127, 59, 68, 53, 156, 156, 126, 174, 174, 202, + 202, 82, 212, 212, 219, 219, 127, 214, 210, 156, + 224, 208, 224, 224, 224, 224, 224, 225, 207, 225, + 225, 226, 206, 226, 226, 226, 226, 226, 227, 204, + 203, 227, 228, 201, 200, 228, 229, 229, 198, 229, -230, 197, 230, 230, 230, 230, 230, 232, 232, 196, -232, 233, 233, 233, 233, 233, 233, 233, 234, 234, -234, 234, 234, 234, 234, 235, 235, 195, 235, 235, -235, 235, 236, 236, 236, 236, 236, 236, 236, 194, -193, 192, 190, 188, 187, 186, 185, 184, 183, 182, -180, 179, 178, 176, 175, 173, 171, 170, 169, 168, -167, 166, 165, 164, 162, 161, 160, 158, 157, 154, -153, 152, 151, 150, 149, 148, 147, 145, 144, 143, -142, 141, 140, 139, 138, 137, 136, 135, 123, 122, -121, 117, 116, 115, 114, 113, 112, 110, 109, 106, + 230, 197, 230, 230, 230, 230, 230, 232, 232, 196, + 232, 233, 233, 233, 233, 233, 233, 233, 234, 234, + 234, 234, 234, 234, 234, 235, 235, 195, 235, 235, + 235, 235, 236, 236, 236, 236, 236, 236, 236, 194, + 193, 192, 190, 188, 187, 186, 185, 184, 183, 182, + 180, 179, 178, 176, 175, 173, 171, 170, 169, 168, + 167, 166, 165, 164, 162, 161, 160, 158, 157, 154, + 153, 152, 151, 150, 149, 148, 147, 145, 144, 143, + 142, 141, 140, 139, 138, 137, 136, 135, 123, 122, + 121, 117, 116, 115, 114, 113, 112, 110, 109, 106, -105, 104, 103, 101, 100, 99, 98, 97, 96, 94, -93, 90, 86, 79, 74, 70, 64, 61, 57, 56, -51, 50, 48, 47, 46, 42, 39, 38, 37, 34, -33, 32, 27, 24, 16, 5, 3, 223, 223, 223, -223, 223, 223, 223, 223, 223, 223, 223, 223, 223, -223, 223, 223, 223, 223, 223, 223, 223, 223, 223, -223, 223, 223, 223, 223, 223, 223, 223, 223, 223, -223, 223, 223, 223, 223, 223, 223, 223, 223, 223, -223, 223, 223, 223, 223, 223, 223, 223, 223, 223, -223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 105, 104, 103, 101, 100, 99, 98, 97, 96, 94, + 93, 90, 86, 79, 74, 70, 64, 61, 57, 56, + 51, 50, 48, 47, 46, 42, 39, 38, 37, 34, + 33, 32, 27, 24, 16, 5, 3, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, -223, 223, 223, 223, 223 -}; + 223, 223, 223, 223, 223 + } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; /* The intent behind this definition is that it'll catch -* any uses of REJECT which flex missed. -*/ + * any uses of REJECT which flex missed. + */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 @@ -568,7 +568,7 @@ struct Token // Can't have ctors in structs used in unions, so we have this. template< typename T > -inline Token< T > MakeToken(T value, U32 lineNumber) +inline Token< T > MakeToken( T value, U32 lineNumber ) { Token< T > result; result.value = value; @@ -634,30 +634,30 @@ void CMDrestart(FILE *in); #line 635 "CMDscan.cpp" /* Macros after this point can all be overridden by user definitions in -* section 1. -*/ + * section 1. + */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap YY_PROTO((void)); +extern "C" int yywrap YY_PROTO(( void )); #else -extern int yywrap YY_PROTO((void)); +extern int yywrap YY_PROTO(( void )); #endif #endif #ifndef YY_NO_UNPUT -static void yyunput YY_PROTO((int c, char *buf_ptr)); +static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO((char *, yyconst char *, int)); +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus -static int yyinput YY_PROTO((void)); +static int yyinput YY_PROTO(( void )); #else -static int input YY_PROTO((void)); +static int input YY_PROTO(( void )); #endif #endif @@ -666,13 +666,13 @@ static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = 0; #ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO((int new_state)); +static void yy_push_state YY_PROTO(( int new_state )); #endif #ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO((void)); +static void yy_pop_state YY_PROTO(( void )); #endif #ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO((void)); +static int yy_top_state YY_PROTO(( void )); #endif #else @@ -690,9 +690,9 @@ YY_MALLOC_DECL #endif #else /* Just try to get by without declaring the routines. This will fail -* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) -* or sizeof(void*) != sizeof(int). -*/ + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ #endif #endif @@ -705,14 +705,14 @@ YY_MALLOC_DECL #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, -* we now use fwrite(). -*/ + * we now use fwrite(). + */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, -* is returned in "result". -*/ + * is returned in "result". + */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( yy_current_buffer->yy_is_interactive ) \ @@ -733,9 +733,9 @@ YY_MALLOC_DECL #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - -* we don't want an extra ';' after the "return" because that will cause -* some compilers to complain about unreachable statements. -*/ + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif @@ -751,15 +751,15 @@ YY_MALLOC_DECL #endif /* Default declaration of generated scanner - a define so the user can -* easily add parameters. -*/ + * easily add parameters. + */ #ifndef YY_DECL #define YY_DECL int yylex YY_PROTO(( void )) #endif /* Code executed at the beginning of each rule, after yytext and yyleng -* have been set up. -*/ + * have been set up. + */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif @@ -773,894 +773,895 @@ YY_MALLOC_DECL YY_USER_ACTION YY_DECL -{ - register yy_state_type yy_current_state; -register char *yy_cp, *yy_bp; -register int yy_act; + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; #line 105 "CMDscan.l" -; + ; #line 785 "CMDscan.cpp" -if (yy_init) -{ - yy_init = 0; + if ( yy_init ) + { + yy_init = 0; #ifdef YY_USER_INIT - YY_USER_INIT; + YY_USER_INIT; #endif - if (!yy_start) - yy_start = 1; /* first start state */ + if ( ! yy_start ) + yy_start = 1; /* first start state */ - if (!yyin) - yyin = stdin; + if ( ! yyin ) + yyin = stdin; - if (!yyout) - yyout = stdout; + if ( ! yyout ) + yyout = stdout; - if (!yy_current_buffer) - yy_current_buffer = - yy_create_buffer(yyin, YY_BUF_SIZE); + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); - yy_load_buffer_state(); -} + yy_load_buffer_state(); + } -while (1) /* loops until end-of-file is reached */ -{ - yy_cp = yy_c_buf_p; + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; - /* Support of yytext. */ - *yy_cp = yy_hold_char; + /* Support of yytext. */ + *yy_cp = yy_hold_char; - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; - yy_current_state = yy_start; + yy_current_state = yy_start; yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if (yy_accept[yy_current_state]) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) - { - yy_current_state = (int)yy_def[yy_current_state]; - if (yy_current_state >= 224) - yy_c = yy_meta[(unsigned int)yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; - ++yy_cp; - } while (yy_base[yy_current_state] != 338); + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 224 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 338 ); yy_find_action: - yy_act = yy_accept[yy_current_state]; - if (yy_act == 0) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + yy_act = yy_accept[yy_current_state]; + } - YY_DO_BEFORE_ACTION; + YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ - switch (yy_act) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yy_hold_char; + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + goto yy_find_action; - case 1: - YY_RULE_SETUP +case 1: +YY_RULE_SETUP #line 107 "CMDscan.l" - {} - YY_BREAK - case 2: - YY_RULE_SETUP +{ } + YY_BREAK +case 2: +YY_RULE_SETUP #line 108 "CMDscan.l" - { return(Sc_ScanDocBlock()); } - YY_BREAK - case 3: - YY_RULE_SETUP +{ return(Sc_ScanDocBlock()); } + YY_BREAK +case 3: +YY_RULE_SETUP #line 109 "CMDscan.l" - ; - YY_BREAK - case 4: - YY_RULE_SETUP +; + YY_BREAK +case 4: +YY_RULE_SETUP #line 110 "CMDscan.l" - ; - YY_BREAK - case 5: - YY_RULE_SETUP +; + YY_BREAK +case 5: +YY_RULE_SETUP #line 111 "CMDscan.l" - { lineIndex++; } - YY_BREAK - case 6: - YY_RULE_SETUP +{lineIndex++;} + YY_BREAK +case 6: +YY_RULE_SETUP #line 112 "CMDscan.l" - { return(Sc_ScanString(STRATOM)); } - YY_BREAK - case 7: - YY_RULE_SETUP +{ return(Sc_ScanString(STRATOM)); } + YY_BREAK +case 7: +YY_RULE_SETUP #line 113 "CMDscan.l" - { return(Sc_ScanString(TAGATOM)); } - YY_BREAK - case 8: - YY_RULE_SETUP +{ return(Sc_ScanString(TAGATOM)); } + YY_BREAK +case 8: +YY_RULE_SETUP #line 114 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opEQ, lineIndex); return opEQ; } - YY_BREAK - case 9: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opEQ, lineIndex ); return opEQ; } + YY_BREAK +case 9: +YY_RULE_SETUP #line 115 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opNE, lineIndex); return opNE; } - YY_BREAK - case 10: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opNE, lineIndex ); return opNE; } + YY_BREAK +case 10: +YY_RULE_SETUP #line 116 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opGE, lineIndex); return opGE; } - YY_BREAK - case 11: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opGE, lineIndex ); return opGE; } + YY_BREAK +case 11: +YY_RULE_SETUP #line 117 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opLE, lineIndex); return opLE; } - YY_BREAK - case 12: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opLE, lineIndex ); return opLE; } + YY_BREAK +case 12: +YY_RULE_SETUP #line 118 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opAND, lineIndex); return opAND; } - YY_BREAK - case 13: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opAND, lineIndex ); return opAND; } + YY_BREAK +case 13: +YY_RULE_SETUP #line 119 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opOR, lineIndex); return opOR; } - YY_BREAK - case 14: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opOR, lineIndex ); return opOR; } + YY_BREAK +case 14: +YY_RULE_SETUP #line 120 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opCOLONCOLON, lineIndex); return opCOLONCOLON; } - YY_BREAK - case 15: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opCOLONCOLON, lineIndex ); return opCOLONCOLON; } + YY_BREAK +case 15: +YY_RULE_SETUP #line 121 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opMINUSMINUS, lineIndex); return opMINUSMINUS; } - YY_BREAK - case 16: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opMINUSMINUS, lineIndex ); return opMINUSMINUS; } + YY_BREAK +case 16: +YY_RULE_SETUP #line 122 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opPLUSPLUS, lineIndex); return opPLUSPLUS; } - YY_BREAK - case 17: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opPLUSPLUS, lineIndex ); return opPLUSPLUS; } + YY_BREAK +case 17: +YY_RULE_SETUP #line 123 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opSTREQ, lineIndex); return opSTREQ; } - YY_BREAK - case 18: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opSTREQ, lineIndex ); return opSTREQ; } + YY_BREAK +case 18: +YY_RULE_SETUP #line 124 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opSTRNE, lineIndex); return opSTRNE; } - YY_BREAK - case 19: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opSTRNE, lineIndex ); return opSTRNE; } + YY_BREAK +case 19: +YY_RULE_SETUP #line 125 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opSHL, lineIndex); return opSHL; } - YY_BREAK - case 20: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opSHL, lineIndex ); return opSHL; } + YY_BREAK +case 20: +YY_RULE_SETUP #line 126 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opSHR, lineIndex); return opSHR; } - YY_BREAK - case 21: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opSHR, lineIndex ); return opSHR; } + YY_BREAK +case 21: +YY_RULE_SETUP #line 127 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opPLASN, lineIndex); return opPLASN; } - YY_BREAK - case 22: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opPLASN, lineIndex ); return opPLASN; } + YY_BREAK +case 22: +YY_RULE_SETUP #line 128 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opMIASN, lineIndex); return opMIASN; } - YY_BREAK - case 23: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opMIASN, lineIndex ); return opMIASN; } + YY_BREAK +case 23: +YY_RULE_SETUP #line 129 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opMLASN, lineIndex); return opMLASN; } - YY_BREAK - case 24: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opMLASN, lineIndex ); return opMLASN; } + YY_BREAK +case 24: +YY_RULE_SETUP #line 130 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opDVASN, lineIndex); return opDVASN; } - YY_BREAK - case 25: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opDVASN, lineIndex ); return opDVASN; } + YY_BREAK +case 25: +YY_RULE_SETUP #line 131 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opMODASN, lineIndex); return opMODASN; } - YY_BREAK - case 26: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opMODASN, lineIndex ); return opMODASN; } + YY_BREAK +case 26: +YY_RULE_SETUP #line 132 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opANDASN, lineIndex); return opANDASN; } - YY_BREAK - case 27: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opANDASN, lineIndex ); return opANDASN; } + YY_BREAK +case 27: +YY_RULE_SETUP #line 133 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opXORASN, lineIndex); return opXORASN; } - YY_BREAK - case 28: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opXORASN, lineIndex ); return opXORASN; } + YY_BREAK +case 28: +YY_RULE_SETUP #line 134 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opORASN, lineIndex); return opORASN; } - YY_BREAK - case 29: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opORASN, lineIndex ); return opORASN; } + YY_BREAK +case 29: +YY_RULE_SETUP #line 135 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opSLASN, lineIndex); return opSLASN; } - YY_BREAK - case 30: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opSLASN, lineIndex ); return opSLASN; } + YY_BREAK +case 30: +YY_RULE_SETUP #line 136 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opSRASN, lineIndex); return opSRASN; } - YY_BREAK - case 31: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opSRASN, lineIndex ); return opSRASN; } + YY_BREAK +case 31: +YY_RULE_SETUP #line 137 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opINTNAME, lineIndex); return opINTNAME; } - YY_BREAK - case 32: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opINTNAME, lineIndex ); return opINTNAME; } + YY_BREAK +case 32: +YY_RULE_SETUP #line 138 "CMDscan.l" - { CMDlval.i = MakeToken< int >(opINTNAMER, lineIndex); return opINTNAMER; } - YY_BREAK - case 33: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( opINTNAMER, lineIndex ); return opINTNAMER; } + YY_BREAK +case 33: +YY_RULE_SETUP #line 139 "CMDscan.l" - { CMDlval.i = MakeToken< int >('\n', lineIndex); return '@'; } - YY_BREAK - case 34: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( '\n', lineIndex ); return '@'; } + YY_BREAK +case 34: +YY_RULE_SETUP #line 140 "CMDscan.l" - { CMDlval.i = MakeToken< int >('\t', lineIndex); return '@'; } - YY_BREAK - case 35: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( '\t', lineIndex ); return '@'; } + YY_BREAK +case 35: +YY_RULE_SETUP #line 141 "CMDscan.l" - { CMDlval.i = MakeToken< int >(' ', lineIndex); return '@'; } - YY_BREAK - case 36: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( ' ', lineIndex ); return '@'; } + YY_BREAK +case 36: +YY_RULE_SETUP #line 142 "CMDscan.l" - { CMDlval.i = MakeToken< int >(0, lineIndex); return '@'; } - YY_BREAK - case 37: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( 0, lineIndex ); return '@'; } + YY_BREAK +case 37: +YY_RULE_SETUP #line 143 "CMDscan.l" - { /* this comment stops syntax highlighting from getting messed up when editing the lexer in TextPad */ - int c = 0, l; - for (; ; ) +{ /* this comment stops syntax highlighting from getting messed up when editing the lexer in TextPad */ + int c = 0, l; + for ( ; ; ) { l = c; c = yyinput(); // Is this an open comment? - if (c == EOF) + if ( c == EOF ) { - CMDerror("unexpected end of file found in comment"); + CMDerror( "unexpected end of file found in comment" ); break; } // Increment line numbers. - else if (c == '\n') + else if ( c == '\n' ) lineIndex++; // Did we find the end of the comment? - else if (l == '*' && c == '/') + else if ( l == '*' && c == '/' ) break; } - } - YY_BREAK - case 38: + } + YY_BREAK +case 38: #line 167 "CMDscan.l" - case 39: +case 39: #line 168 "CMDscan.l" - case 40: +case 40: #line 169 "CMDscan.l" - case 41: +case 41: #line 170 "CMDscan.l" - case 42: +case 42: #line 171 "CMDscan.l" - case 43: +case 43: #line 172 "CMDscan.l" - case 44: +case 44: #line 173 "CMDscan.l" - case 45: +case 45: #line 174 "CMDscan.l" - case 46: +case 46: #line 175 "CMDscan.l" - case 47: +case 47: #line 176 "CMDscan.l" - case 48: +case 48: #line 177 "CMDscan.l" - case 49: +case 49: #line 178 "CMDscan.l" - case 50: +case 50: #line 179 "CMDscan.l" - case 51: +case 51: #line 180 "CMDscan.l" - case 52: +case 52: #line 181 "CMDscan.l" - case 53: +case 53: #line 182 "CMDscan.l" - case 54: +case 54: #line 183 "CMDscan.l" - case 55: +case 55: #line 184 "CMDscan.l" - case 56: +case 56: #line 185 "CMDscan.l" - case 57: +case 57: #line 186 "CMDscan.l" - case 58: +case 58: #line 187 "CMDscan.l" - case 59: +case 59: #line 188 "CMDscan.l" - case 60: +case 60: #line 189 "CMDscan.l" - case 61: - YY_RULE_SETUP +case 61: +YY_RULE_SETUP #line 189 "CMDscan.l" - { CMDlval.i = MakeToken< int >(CMDtext[0], lineIndex); return CMDtext[0]; } - YY_BREAK - case 62: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( CMDtext[ 0 ], lineIndex ); return CMDtext[ 0 ]; } + YY_BREAK +case 62: +YY_RULE_SETUP #line 190 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwIN, lineIndex); return(rwIN); } - YY_BREAK - case 63: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwIN, lineIndex ); return(rwIN); } + YY_BREAK +case 63: +YY_RULE_SETUP #line 191 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwCASEOR, lineIndex); return(rwCASEOR); } - YY_BREAK - case 64: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwCASEOR, lineIndex ); return(rwCASEOR); } + YY_BREAK +case 64: +YY_RULE_SETUP #line 192 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwBREAK, lineIndex); return(rwBREAK); } - YY_BREAK - case 65: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwBREAK, lineIndex ); return(rwBREAK); } + YY_BREAK +case 65: +YY_RULE_SETUP #line 193 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwRETURN, lineIndex); return(rwRETURN); } - YY_BREAK - case 66: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwRETURN, lineIndex ); return(rwRETURN); } + YY_BREAK +case 66: +YY_RULE_SETUP #line 194 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwELSE, lineIndex); return(rwELSE); } - YY_BREAK - case 67: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwELSE, lineIndex ); return(rwELSE); } + YY_BREAK +case 67: +YY_RULE_SETUP #line 195 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwASSERT, lineIndex); return(rwASSERT); } - YY_BREAK - case 68: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwASSERT, lineIndex ); return(rwASSERT); } + YY_BREAK +case 68: +YY_RULE_SETUP #line 196 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwWHILE, lineIndex); return(rwWHILE); } - YY_BREAK - case 69: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwWHILE, lineIndex ); return(rwWHILE); } + YY_BREAK +case 69: +YY_RULE_SETUP #line 197 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwDO, lineIndex); return(rwDO); } - YY_BREAK - case 70: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwDO, lineIndex ); return(rwDO); } + YY_BREAK +case 70: +YY_RULE_SETUP #line 198 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwIF, lineIndex); return(rwIF); } - YY_BREAK - case 71: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwIF, lineIndex ); return(rwIF); } + YY_BREAK +case 71: +YY_RULE_SETUP #line 199 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwFOREACHSTR, lineIndex); return(rwFOREACHSTR); } - YY_BREAK - case 72: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwFOREACHSTR, lineIndex ); return(rwFOREACHSTR); } + YY_BREAK +case 72: +YY_RULE_SETUP #line 200 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwFOREACH, lineIndex); return(rwFOREACH); } - YY_BREAK - case 73: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwFOREACH, lineIndex ); return(rwFOREACH); } + YY_BREAK +case 73: +YY_RULE_SETUP #line 201 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwFOR, lineIndex); return(rwFOR); } - YY_BREAK - case 74: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwFOR, lineIndex ); return(rwFOR); } + YY_BREAK +case 74: +YY_RULE_SETUP #line 202 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwCONTINUE, lineIndex); return(rwCONTINUE); } - YY_BREAK - case 75: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwCONTINUE, lineIndex ); return(rwCONTINUE); } + YY_BREAK +case 75: +YY_RULE_SETUP #line 203 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwDEFINE, lineIndex); return(rwDEFINE); } - YY_BREAK - case 76: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwDEFINE, lineIndex ); return(rwDEFINE); } + YY_BREAK +case 76: +YY_RULE_SETUP #line 204 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwDECLARE, lineIndex); return(rwDECLARE); } - YY_BREAK - case 77: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwDECLARE, lineIndex ); return(rwDECLARE); } + YY_BREAK +case 77: +YY_RULE_SETUP #line 205 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwDECLARESINGLETON, lineIndex); return(rwDECLARESINGLETON); } - YY_BREAK - case 78: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwDECLARESINGLETON, lineIndex ); return(rwDECLARESINGLETON); } + YY_BREAK +case 78: +YY_RULE_SETUP #line 206 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwDATABLOCK, lineIndex); return(rwDATABLOCK); } - YY_BREAK - case 79: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwDATABLOCK, lineIndex ); return(rwDATABLOCK); } + YY_BREAK +case 79: +YY_RULE_SETUP #line 207 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwCASE, lineIndex); return(rwCASE); } - YY_BREAK - case 80: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwCASE, lineIndex ); return(rwCASE); } + YY_BREAK +case 80: +YY_RULE_SETUP #line 208 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwSWITCHSTR, lineIndex); return(rwSWITCHSTR); } - YY_BREAK - case 81: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwSWITCHSTR, lineIndex ); return(rwSWITCHSTR); } + YY_BREAK +case 81: +YY_RULE_SETUP #line 209 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwSWITCH, lineIndex); return(rwSWITCH); } - YY_BREAK - case 82: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwSWITCH, lineIndex ); return(rwSWITCH); } + YY_BREAK +case 82: +YY_RULE_SETUP #line 210 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwDEFAULT, lineIndex); return(rwDEFAULT); } - YY_BREAK - case 83: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwDEFAULT, lineIndex ); return(rwDEFAULT); } + YY_BREAK +case 83: +YY_RULE_SETUP #line 211 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwPACKAGE, lineIndex); return(rwPACKAGE); } - YY_BREAK - case 84: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwPACKAGE, lineIndex ); return(rwPACKAGE); } + YY_BREAK +case 84: +YY_RULE_SETUP #line 212 "CMDscan.l" - { CMDlval.i = MakeToken< int >(rwNAMESPACE, lineIndex); return(rwNAMESPACE); } - YY_BREAK - case 85: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( rwNAMESPACE, lineIndex ); return(rwNAMESPACE); } + YY_BREAK +case 85: +YY_RULE_SETUP #line 213 "CMDscan.l" - { CMDlval.i = MakeToken< int >(1, lineIndex); return INTCONST; } - YY_BREAK - case 86: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( 1, lineIndex ); return INTCONST; } + YY_BREAK +case 86: +YY_RULE_SETUP #line 214 "CMDscan.l" - { CMDlval.i = MakeToken< int >(0, lineIndex); return INTCONST; } - YY_BREAK - case 87: - YY_RULE_SETUP +{ CMDlval.i = MakeToken< int >( 0, lineIndex ); return INTCONST; } + YY_BREAK +case 87: +YY_RULE_SETUP #line 215 "CMDscan.l" - { return(Sc_ScanVar()); } - YY_BREAK - case 88: - YY_RULE_SETUP +{ return(Sc_ScanVar()); } + YY_BREAK +case 88: +YY_RULE_SETUP #line 216 "CMDscan.l" - { return Sc_ScanIdent(); } - YY_BREAK - case 89: - YY_RULE_SETUP +{ return Sc_ScanIdent(); } + YY_BREAK +case 89: +YY_RULE_SETUP #line 217 "CMDscan.l" - return(Sc_ScanHex()); - YY_BREAK - case 90: - YY_RULE_SETUP +return(Sc_ScanHex()); + YY_BREAK +case 90: +YY_RULE_SETUP #line 218 "CMDscan.l" - { CMDtext[CMDleng] = 0; CMDlval.i = MakeToken< int >(dAtoi(CMDtext), lineIndex); return INTCONST; } - YY_BREAK - case 91: - YY_RULE_SETUP +{ CMDtext[CMDleng] = 0; CMDlval.i = MakeToken< int >( dAtoi(CMDtext), lineIndex ); return INTCONST; } + YY_BREAK +case 91: +YY_RULE_SETUP #line 219 "CMDscan.l" - return Sc_ScanNum(); - YY_BREAK - case 92: - YY_RULE_SETUP +return Sc_ScanNum(); + YY_BREAK +case 92: +YY_RULE_SETUP #line 220 "CMDscan.l" - return(ILLEGAL_TOKEN); - YY_BREAK - case 93: - YY_RULE_SETUP +return(ILLEGAL_TOKEN); + YY_BREAK +case 93: +YY_RULE_SETUP #line 221 "CMDscan.l" - return(ILLEGAL_TOKEN); - YY_BREAK - case 94: - YY_RULE_SETUP +return(ILLEGAL_TOKEN); + YY_BREAK +case 94: +YY_RULE_SETUP #line 222 "CMDscan.l" - ECHO; - YY_BREAK +ECHO; + YY_BREAK #line 1291 "CMDscan.cpp" - case YY_STATE_EOF(INITIAL): - yyterminate(); +case YY_STATE_EOF(INITIAL): + yyterminate(); - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int)(yy_cp - yytext_ptr) - 1; + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; - if (yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if (yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars]) - { /* This was really a NUL. */ - yy_state_type yy_next_state; + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state(); - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ - yy_next_state = yy_try_NUL_trans(yy_current_state); + yy_next_state = yy_try_NUL_trans( yy_current_state ); - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_bp = yytext_ptr + YY_MORE_ADJ; - if (yy_next_state) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } - else switch (yy_get_next_buffer()) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; - if (yywrap()) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } - else - { - if (!yy_did_buffer_switch_on_eof) - YY_NEW_FILE; - } - break; - } + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state(); - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state(); - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found"); - } /* end of action switch */ -} /* end of scanning one token */ -} /* end of yylex */ + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ - /* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ - static int yy_get_next_buffer() -{ - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; - if (yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1]) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed"); + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); - if (yy_current_buffer->yy_fill_buffer == 0) - { /* Don't try to fill the buffer, so this is an EOF. */ - if (yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1) - { - /* We matched a singled characater, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a singled characater, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } - /* Try to read more data. */ + /* Try to read more data. */ - /* First move last chars to start of buffer. */ - number_to_move = (int)(yy_c_buf_p - yytext_ptr) - 1; + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - for (i = 0; i < number_to_move; ++i) - *(dest++) = *(source++); + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); - if (yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_n_chars = 0; + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_n_chars = 0; - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; - while (num_to_read <= 0) - { /* Not enough room in the buffer - grow it. */ + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT - YY_FATAL_ERROR( - "input buffer overflow, can't enlarge buffer because scanner uses REJECT"); + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; - int yy_c_buf_p_offset = - (int)(yy_c_buf_p - b->yy_ch_buf); + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); - if (b->yy_is_our_buffer) - { - int new_size = b->yy_buf_size * 2; + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; - if (new_size <= 0) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc((void *)b->yy_ch_buf, - b->yy_buf_size + 2); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; - if (!b->yy_ch_buf) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow"); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; #endif - } + } - if (num_to_read > YY_READ_BUF_SIZE) - num_to_read = YY_READ_BUF_SIZE; + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; - /* Read in more data. */ - YY_INPUT((&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read); - } + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + } - if (yy_n_chars == 0) - { - if (number_to_move == YY_MORE_ADJ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin); - } + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } - else - ret_val = EOB_ACT_CONTINUE_SCAN; + else + ret_val = EOB_ACT_CONTINUE_SCAN; - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - return ret_val; -} + return ret_val; + } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state() -{ - register yy_state_type yy_current_state; - register char *yy_cp; + { + register yy_state_type yy_current_state; + register char *yy_cp; - yy_current_state = yy_start; + yy_current_state = yy_start; - for (yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if (yy_accept[yy_current_state]) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) - { - yy_current_state = (int)yy_def[yy_current_state]; - if (yy_current_state >= 224) - yy_c = yy_meta[(unsigned int)yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; - } + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 224 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } - return yy_current_state; -} + return yy_current_state; + } /* yy_try_NUL_trans - try to make a transition on the NUL character -* -* synopsis -* next_state = yy_try_NUL_trans( current_state ); -*/ + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ #ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state) +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) #else -static yy_state_type yy_try_NUL_trans(yy_current_state) +static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif -{ - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; + { + register int yy_is_jam; + register char *yy_cp = yy_c_buf_p; - register YY_CHAR yy_c = 1; - if (yy_accept[yy_current_state]) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) - { - yy_current_state = (int)yy_def[yy_current_state]; - if (yy_current_state >= 224) - yy_c = yy_meta[(unsigned int)yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; - yy_is_jam = (yy_current_state == 223); + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 224 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 223); - return yy_is_jam ? 0 : yy_current_state; -} + return yy_is_jam ? 0 : yy_current_state; + } #ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS -static void yyunput(int c, register char *yy_bp) +static void yyunput( int c, register char *yy_bp ) #else -static void yyunput(c, yy_bp) +static void yyunput( c, yy_bp ) int c; register char *yy_bp; #endif -{ - register char *yy_cp = yy_c_buf_p; + { + register char *yy_cp = yy_c_buf_p; - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; - if (yy_cp < yy_current_buffer->yy_ch_buf + 2) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; - while (source > yy_current_buffer->yy_ch_buf) - *--dest = *--source; + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; - yy_cp += (int)(dest - source); - yy_bp += (int)(dest - source); - yy_n_chars = yy_current_buffer->yy_buf_size; + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_n_chars = yy_current_buffer->yy_buf_size; - if (yy_cp < yy_current_buffer->yy_ch_buf + 2) - YY_FATAL_ERROR("flex scanner push-back overflow"); - } + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } - *--yy_cp = (char)c; + *--yy_cp = (char) c; - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; -} + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } #endif /* ifndef YY_NO_UNPUT */ @@ -1669,384 +1670,384 @@ static int yyinput() #else static int input() #endif -{ - int c; + { + int c; - *yy_c_buf_p = yy_hold_char; + *yy_c_buf_p = yy_hold_char; - if (*yy_c_buf_p == YY_END_OF_BUFFER_CHAR) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if (yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars]) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; - else - { /* need more input */ - yytext_ptr = yy_c_buf_p; - ++yy_c_buf_p; + else + { /* need more input */ + yytext_ptr = yy_c_buf_p; + ++yy_c_buf_p; - switch (yy_get_next_buffer()) - { - case EOB_ACT_END_OF_FILE: - { - if (yywrap()) - { - yy_c_buf_p = - yytext_ptr + YY_MORE_ADJ; - return EOF; - } + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + { + yy_c_buf_p = + yytext_ptr + YY_MORE_ADJ; + return EOF; + } - if (!yy_did_buffer_switch_on_eof) - YY_NEW_FILE; + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; #ifdef __cplusplus - return yyinput(); + return yyinput(); #else - return input(); + return input(); #endif - } + } - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - break; + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + break; - case EOB_ACT_LAST_MATCH: + case EOB_ACT_LAST_MATCH: #ifdef __cplusplus - YY_FATAL_ERROR( - "unexpected last match in yyinput()"); + YY_FATAL_ERROR( + "unexpected last match in yyinput()" ); #else - YY_FATAL_ERROR( - "unexpected last match in input()"); + YY_FATAL_ERROR( + "unexpected last match in input()" ); #endif - } - } - } + } + } + } - c = *(unsigned char *)yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; - return c; -} + return c; + } #ifdef YY_USE_PROTOS -void yyrestart(FILE *input_file) +void yyrestart( FILE *input_file ) #else -void yyrestart(input_file) +void yyrestart( input_file ) FILE *input_file; #endif -{ - if (!yy_current_buffer) - yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - yy_init_buffer(yy_current_buffer, input_file); - yy_load_buffer_state(); -} + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } #ifdef YY_USE_PROTOS -void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer) +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) #else -void yy_switch_to_buffer(new_buffer) +void yy_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; #endif -{ - if (yy_current_buffer == new_buffer) - return; + { + if ( yy_current_buffer == new_buffer ) + return; - if (yy_current_buffer) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } - yy_current_buffer = new_buffer; - yy_load_buffer_state(); + yy_current_buffer = new_buffer; + yy_load_buffer_state(); - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; -} + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } #ifdef YY_USE_PROTOS -void yy_load_buffer_state(void) +void yy_load_buffer_state( void ) #else void yy_load_buffer_state() #endif -{ - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; -} + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } #ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer(FILE *file, int size) +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) #else -YY_BUFFER_STATE yy_create_buffer(file, size) +YY_BUFFER_STATE yy_create_buffer( file, size ) FILE *file; int size; #endif -{ - YY_BUFFER_STATE b; + { + YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE)yy_flex_alloc(sizeof(struct yy_buffer_state)); - if (!b) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = size; - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *)yy_flex_alloc(b->yy_buf_size + 2); - if (!b->yy_ch_buf) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_is_our_buffer = 1; + b->yy_is_our_buffer = 1; - yy_init_buffer(b, file); + yy_init_buffer( b, file ); - return b; -} + return b; + } #ifdef YY_USE_PROTOS -void yy_delete_buffer(YY_BUFFER_STATE b) +void yy_delete_buffer( YY_BUFFER_STATE b ) #else -void yy_delete_buffer(b) +void yy_delete_buffer( b ) YY_BUFFER_STATE b; #endif -{ - if (!b) - return; + { + if ( ! b ) + return; - if (b == yy_current_buffer) - yy_current_buffer = (YY_BUFFER_STATE)0; + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; - if (b->yy_is_our_buffer) - yy_flex_free((void *)b->yy_ch_buf); + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); - yy_flex_free((void *)b); -} + yy_flex_free( (void *) b ); + } #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO((int)); +extern int isatty YY_PROTO(( int )); #endif #endif #ifdef YY_USE_PROTOS -void yy_init_buffer(YY_BUFFER_STATE b, FILE *file) +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) #else -void yy_init_buffer(b, file) +void yy_init_buffer( b, file ) YY_BUFFER_STATE b; FILE *file; #endif -{ - yy_flush_buffer(b); + { + yy_flush_buffer( b ); - b->yy_input_file = file; - b->yy_fill_buffer = 1; + b->yy_input_file = file; + b->yy_fill_buffer = 1; #if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; + b->yy_is_interactive = 1; #else #if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; + b->yy_is_interactive = 0; #else - b->yy_is_interactive = file ? (isatty(fileno(file)) > 0) : 0; + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif -} + } #ifdef YY_USE_PROTOS -void yy_flush_buffer(YY_BUFFER_STATE b) +void yy_flush_buffer( YY_BUFFER_STATE b ) #else -void yy_flush_buffer(b) +void yy_flush_buffer( b ) YY_BUFFER_STATE b; #endif -{ - b->yy_n_chars = 0; + { + b->yy_n_chars = 0; - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - b->yy_buf_pos = &b->yy_ch_buf[0]; + b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; - if (b == yy_current_buffer) - yy_load_buffer_state(); -} + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } #ifndef YY_NO_SCAN_BUFFER #ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size) +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) #else -YY_BUFFER_STATE yy_scan_buffer(base, size) +YY_BUFFER_STATE yy_scan_buffer( base, size ) char *base; yy_size_t size; #endif -{ - YY_BUFFER_STATE b; + { + YY_BUFFER_STATE b; - if (size < 2 || - base[size - 2] != YY_END_OF_BUFFER_CHAR || - base[size - 1] != YY_END_OF_BUFFER_CHAR) - /* They forgot to leave room for the EOB's. */ - return 0; + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; - b = (YY_BUFFER_STATE)yy_flex_alloc(sizeof(struct yy_buffer_state)); - if (!b) - YY_FATAL_ERROR("out of dynamic memory in yy_scan_buffer()"); + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; - yy_switch_to_buffer(b); + yy_switch_to_buffer( b ); - return b; -} + return b; + } #endif #ifndef YY_NO_SCAN_STRING #ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string(yyconst char *str) +YY_BUFFER_STATE yy_scan_string( yyconst char *str ) #else -YY_BUFFER_STATE yy_scan_string(str) +YY_BUFFER_STATE yy_scan_string( str ) yyconst char *str; #endif -{ - int len; - for (len = 0; str[len]; ++len) - ; + { + int len; + for ( len = 0; str[len]; ++len ) + ; - return yy_scan_bytes(str, len); -} + return yy_scan_bytes( str, len ); + } #endif #ifndef YY_NO_SCAN_BYTES #ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes(yyconst char *bytes, int len) +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) #else -YY_BUFFER_STATE yy_scan_bytes(bytes, len) +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) yyconst char *bytes; int len; #endif -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *)yy_flex_alloc(n); - if (!buf) - YY_FATAL_ERROR("out of dynamic memory in yy_scan_bytes()"); + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - for (i = 0; i < len; ++i) - buf[i] = bytes[i]; + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; - buf[len] = buf[len + 1] = YY_END_OF_BUFFER_CHAR; + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - b = yy_scan_buffer(buf, n); - if (!b) - YY_FATAL_ERROR("bad buffer in yy_scan_bytes()"); + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; - return b; -} + return b; + } #endif #ifndef YY_NO_PUSH_STATE #ifdef YY_USE_PROTOS -static void yy_push_state(int new_state) +static void yy_push_state( int new_state ) #else -static void yy_push_state(new_state) +static void yy_push_state( new_state ) int new_state; #endif -{ - if (yy_start_stack_ptr >= yy_start_stack_depth) - { - yy_size_t new_size; + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof(int); + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); - if (!yy_start_stack) - yy_start_stack = (int *)yy_flex_alloc(new_size); + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); - else - yy_start_stack = (int *)yy_flex_realloc( - (void *)yy_start_stack, new_size); + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); - if (!yy_start_stack) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack"); - } + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } - yy_start_stack[yy_start_stack_ptr++] = YY_START; + yy_start_stack[yy_start_stack_ptr++] = YY_START; - BEGIN(new_state); -} + BEGIN(new_state); + } #endif #ifndef YY_NO_POP_STATE static void yy_pop_state() -{ - if (--yy_start_stack_ptr < 0) - YY_FATAL_ERROR("start-condition stack underflow"); + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); - BEGIN(yy_start_stack[yy_start_stack_ptr]); -} + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } #endif #ifndef YY_NO_TOP_STATE static int yy_top_state() -{ - return yy_start_stack[yy_start_stack_ptr - 1]; -} + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } #endif #ifndef YY_EXIT_FAILURE @@ -2054,15 +2055,15 @@ static int yy_top_state() #endif #ifdef YY_USE_PROTOS -static void yy_fatal_error(yyconst char msg[]) +static void yy_fatal_error( yyconst char msg[] ) #else -static void yy_fatal_error(msg) +static void yy_fatal_error( msg ) char msg[]; #endif -{ - (void)fprintf(stderr, "%s\n", msg); - exit(YY_EXIT_FAILURE); -} + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } @@ -2086,65 +2087,65 @@ char msg[]; #ifndef yytext_ptr #ifdef YY_USE_PROTOS -static void yy_flex_strncpy(char *s1, yyconst char *s2, int n) +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) #else -static void yy_flex_strncpy(s1, s2, n) +static void yy_flex_strncpy( s1, s2, n ) char *s1; yyconst char *s2; int n; #endif -{ - register int i; - for (i = 0; i < n; ++i) - s1[i] = s2[i]; -} + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } #endif #ifdef YY_USE_PROTOS -static void *yy_flex_alloc(yy_size_t size) +static void *yy_flex_alloc( yy_size_t size ) #else -static void *yy_flex_alloc(size) +static void *yy_flex_alloc( size ) yy_size_t size; #endif -{ - return (void *)malloc(size); -} + { + return (void *) malloc( size ); + } #ifdef YY_USE_PROTOS -static void *yy_flex_realloc(void *ptr, yy_size_t size) +static void *yy_flex_realloc( void *ptr, yy_size_t size ) #else -static void *yy_flex_realloc(ptr, size) +static void *yy_flex_realloc( ptr, size ) void *ptr; yy_size_t size; #endif -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *)realloc((char *)ptr, size); -} + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } #ifdef YY_USE_PROTOS -static void yy_flex_free(void *ptr) +static void yy_flex_free( void *ptr ) #else -static void yy_flex_free(ptr) +static void yy_flex_free( ptr ) void *ptr; #endif -{ - free(ptr); -} + { + free( ptr ); + } #if YY_MAIN int main() -{ - yylex(); - return 0; -} + { + yylex(); + return 0; + } #endif #line 222 "CMDscan.l" @@ -2172,59 +2173,59 @@ void CMDerror(char *format, ...) const int BUFMAX = 1024; char tempBuf[BUFMAX]; va_list args; - va_start(args, format); + va_start( args, format ); #ifdef TORQUE_OS_WIN - _vsnprintf(tempBuf, BUFMAX, format, args); + _vsnprintf( tempBuf, BUFMAX, format, args ); #else - vsnprintf(tempBuf, BUFMAX, format, args); + vsnprintf( tempBuf, BUFMAX, format, args ); #endif - va_end(args); + va_end(args); - if (fileName) + if(fileName) { Con::errorf(ConsoleLogEntry::Script, "%s Line: %d - %s", fileName, lineIndex, tempBuf); #ifndef NO_ADVANCED_ERROR_REPORT // dhc - lineIndex is bogus. let's try to add some sanity back in. - int i, j, n; + int i,j,n; char c; int linediv = 1; // first, walk the buffer, trying to detect line ending type. // this is imperfect, if inconsistant line endings exist... - for (i = 0; iBUFMAX >> 2) break; // at least get a little data + c = scanBuffer[scanIndex-i]; + if ((c=='\r' || c=='\n') && i>BUFMAX>>2) break; // at least get a little data n++; i++; } // find next lineending - while (n>1) // cap at half-buf-size forward + while (n>1) // cap at half-buf-size forward { - c = scanBuffer[scanIndex + j]; - if (c == 0) break; - if ((c == '\r' || c == '\n') && j>BUFMAX >> 2) break; // at least get a little data + c = scanBuffer[scanIndex+j]; + if (c==0) break; + if ((c=='\r' || c=='\n') && j>BUFMAX>>2) break; // at least get a little data n++; j++; } if (i) i--; // chop off extra linefeed. if (j) j--; // chop off extra linefeed. - // build our little text block - if (i) dStrncpy(tempBuf, scanBuffer + scanIndex - i, i); - dStrncpy(tempBuf + i, "##", 2); // bracketing. - tempBuf[i + 2] = scanBuffer[scanIndex]; // copy the halt character. - dStrncpy(tempBuf + i + 3, "##", 2); // bracketing. - if (j) dStrncpy(tempBuf + i + 5, scanBuffer + scanIndex + 1, j); // +1 to go past current char. - tempBuf[i + j + 5] = 0; // null terminate - for (n = 0; n>> Advanced script error report. Line %d.", lineIndex); Con::warnf(ConsoleLogEntry::Script, ">>> Some error context, with ## on sides of error halt:"); @@ -2241,7 +2242,7 @@ void CMDerror(char *format, ...) Con::setVariable("$ScriptError", tempBuf); // We also need to mark that we came up with a new error. - static S32 sScriptErrorHash = 1000; + static S32 sScriptErrorHash=1000; Con::setIntVariable("$ScriptErrorHash", sScriptErrorHash++); } else @@ -2259,7 +2260,7 @@ void CMDSetScanBuffer(const char *sb, const char *fn) int CMDgetc() { int ret = scanBuffer[scanIndex]; - if (ret) + if(ret) scanIndex++; else ret = -1; @@ -2277,13 +2278,13 @@ static int Sc_ScanVar() CMDtext[CMDleng] = 0; // Make it a stringtable string! - CMDlval.s = MakeToken< StringTableEntry >(StringTable->insert(CMDtext), lineIndex); + CMDlval.s = MakeToken< StringTableEntry >( StringTable->insert(CMDtext), lineIndex ); return(VAR); } static int charConv(int in) { - switch (in) + switch(in) { case 'r': return '\r'; @@ -2298,11 +2299,11 @@ static int charConv(int in) static int getHexDigit(char c) { - if (c >= '0' && c <= '9') + if(c >= '0' && c <= '9') return c - '0'; - if (c >= 'A' && c <= 'F') + if(c >= 'A' && c <= 'F') return c - 'A' + 10; - if (c >= 'a' && c <= 'f') + if(c >= 'a' && c <= 'f') return c - 'a' + 10; return -1; } @@ -2310,41 +2311,41 @@ static int getHexDigit(char c) static int Sc_ScanDocBlock() { S32 len = dStrlen(CMDtext); - char* text = (char *)consoleAlloc(len + 1); + char* text = (char *) consoleAlloc(len + 1); S32 line = lineIndex; - for (S32 i = 0, j = 0; j <= len; j++) + for( S32 i = 0, j = 0; j <= len; j++ ) { - if ((j <= (len - 2)) && (CMDtext[j] == '/') && (CMDtext[j + 1] == '/') && (CMDtext[j + 2] == '/')) + if( ( j <= (len - 2) ) && ( CMDtext[j] == '/' ) && ( CMDtext[j + 1] == '/' ) && ( CMDtext[j + 2] == '/' ) ) { j += 2; continue; } - if (CMDtext[j] == '\r') + if( CMDtext[j] == '\r' ) continue; - if (CMDtext[j] == '\n') + if( CMDtext[j] == '\n' ) lineIndex++; text[i++] = CMDtext[j]; } - CMDlval.str = MakeToken< char* >(text, line); + CMDlval.str = MakeToken< char* >( text, line ); return(DOCBLOCK); } static int Sc_ScanString(int ret) { CMDtext[CMDleng - 1] = 0; - if (!collapseEscape(CMDtext + 1)) + if(!collapseEscape(CMDtext+1)) return -1; - dsize_t bufferLen = dStrlen(CMDtext); - char* buffer = (char*)consoleAlloc(bufferLen); - dStrcpy(buffer, CMDtext + 1, bufferLen); + dsize_t bufferLen = dStrlen( CMDtext ); + char* buffer = ( char* ) consoleAlloc( bufferLen ); + dStrcpy( buffer, CMDtext + 1, bufferLen ); - CMDlval.str = MakeToken< char* >(buffer, lineIndex); + CMDlval.str = MakeToken< char* >( buffer, lineIndex ); return ret; } @@ -2354,96 +2355,96 @@ static int Sc_ScanIdent() CMDtext[CMDleng] = 0; - if ((type = ConsoleBaseType::getTypeByName(CMDtext)) != NULL) + if((type = ConsoleBaseType::getTypeByName(CMDtext)) != NULL) { /* It's a type */ - CMDlval.i = MakeToken< int >(type->getTypeID(), lineIndex); + CMDlval.i = MakeToken< int >( type->getTypeID(), lineIndex ); return TYPEIDENT; } /* It's an identifier */ - CMDlval.s = MakeToken< StringTableEntry >(StringTable->insert(CMDtext), lineIndex); + CMDlval.s = MakeToken< StringTableEntry >( StringTable->insert(CMDtext), lineIndex ); return IDENT; } void expandEscape(char *dest, const char *src) { U8 c; - while ((c = (U8)*src++) != 0) + while((c = (U8) *src++) != 0) { - if (c == '\"') + if(c == '\"') { *dest++ = '\\'; *dest++ = '\"'; } - else if (c == '\\') + else if(c == '\\') { *dest++ = '\\'; *dest++ = '\\'; } - else if (c == '\r') + else if(c == '\r') { *dest++ = '\\'; *dest++ = 'r'; } - else if (c == '\n') + else if(c == '\n') { *dest++ = '\\'; *dest++ = 'n'; } - else if (c == '\t') + else if(c == '\t') { *dest++ = '\\'; *dest++ = 't'; } - else if (c == '\'') + else if(c == '\'') { *dest++ = '\\'; *dest++ = '\''; } - else if ((c >= 1 && c <= 7) || - (c >= 11 && c <= 12) || - (c >= 14 && c <= 15)) + else if((c >= 1 && c <= 7) || + (c >= 11 && c <= 12) || + (c >= 14 && c <= 15)) { - /* Remap around: \b = 0x8, \t = 0x9, \n = 0xa, \r = 0xd */ - static U8 expandRemap[15] = { 0x0, - 0x0, - 0x1, - 0x2, - 0x3, - 0x4, - 0x5, - 0x6, - 0x0, - 0x0, - 0x0, - 0x7, - 0x8, - 0x0, - 0x9 }; + /* Remap around: \b = 0x8, \t = 0x9, \n = 0xa, \r = 0xd */ + static U8 expandRemap[15] = { 0x0, + 0x0, + 0x1, + 0x2, + 0x3, + 0x4, + 0x5, + 0x6, + 0x0, + 0x0, + 0x0, + 0x7, + 0x8, + 0x0, + 0x9 }; *dest++ = '\\'; *dest++ = 'c'; - if (c == 15) + if(c == 15) *dest++ = 'r'; - else if (c == 16) + else if(c == 16) *dest++ = 'p'; - else if (c == 17) + else if(c == 17) *dest++ = 'o'; else *dest++ = expandRemap[c] + '0'; } - else if (c < 32) + else if(c < 32) { *dest++ = '\\'; *dest++ = 'x'; S32 dig1 = c >> 4; S32 dig2 = c & 0xf; - if (dig1 < 10) + if(dig1 < 10) dig1 += '0'; else dig1 += 'A' - 10; - if (dig2 < 10) + if(dig2 < 10) dig2 += '0'; else dig2 += 'A' - 10; @@ -2459,56 +2460,56 @@ void expandEscape(char *dest, const char *src) bool collapseEscape(char *buf) { S32 len = dStrlen(buf) + 1; - for (S32 i = 0; i < len;) + for(S32 i = 0; i < len;) { - if (buf[i] == '\\') + if(buf[i] == '\\') { - if (buf[i + 1] == 'x') + if(buf[i+1] == 'x') { - S32 dig1 = getHexDigit(buf[i + 2]); - if (dig1 == -1) + S32 dig1 = getHexDigit(buf[i+2]); + if(dig1 == -1) return false; - S32 dig2 = getHexDigit(buf[i + 3]); - if (dig2 == -1) + S32 dig2 = getHexDigit(buf[i+3]); + if(dig2 == -1) return false; buf[i] = dig1 * 16 + dig2; dMemmove(buf + i + 1, buf + i + 4, len - i - 3); len -= 3; i++; } - else if (buf[i + 1] == 'c') + else if(buf[i+1] == 'c') { /* Remap around: \b = 0x8, \t = 0x9, \n = 0xa, \r = 0xd */ static U8 collapseRemap[10] = { 0x1, - 0x2, - 0x3, - 0x4, - 0x5, - 0x6, - 0x7, - 0xb, - 0xc, - 0xe }; + 0x2, + 0x3, + 0x4, + 0x5, + 0x6, + 0x7, + 0xb, + 0xc, + 0xe }; - if (buf[i + 2] == 'r') - buf[i] = 15; - else if (buf[i + 2] == 'p') + if(buf[i+2] == 'r') + buf[i] = 15; + else if(buf[i+2] == 'p') buf[i] = 16; - else if (buf[i + 2] == 'o') + else if(buf[i+2] == 'o') buf[i] = 17; else { - int dig1 = buf[i + 2] - '0'; - if (dig1 < 0 || dig1 > 9) - return false; - buf[i] = collapseRemap[dig1]; + int dig1 = buf[i+2] - '0'; + if(dig1 < 0 || dig1 > 9) + return false; + buf[i] = collapseRemap[dig1]; } // Make sure we don't put 0x1 at the beginning of the string. if ((buf[i] == 0x1) && (i == 0)) { buf[i] = 0x2; - buf[i + 1] = 0x1; + buf[i+1] = 0x1; dMemmove(buf + i + 2, buf + i + 3, len - i - 1); len -= 1; } @@ -2521,7 +2522,7 @@ bool collapseEscape(char *buf) } else { - buf[i] = charConv(buf[i + 1]); + buf[i] = charConv(buf[i+1]); dMemmove(buf + i + 1, buf + i + 2, len - i - 1); len--; i++; @@ -2536,7 +2537,7 @@ bool collapseEscape(char *buf) static int Sc_ScanNum() { CMDtext[CMDleng] = 0; - CMDlval.f = MakeToken< double >(dAtof(CMDtext), lineIndex); + CMDlval.f = MakeToken< double >( dAtof(CMDtext), lineIndex ); return(FLTCONST); } @@ -2544,7 +2545,7 @@ static int Sc_ScanHex() { S32 val = 0; dSscanf(CMDtext, "%x", &val); - CMDlval.i = MakeToken< int >(val, lineIndex); + CMDlval.i = MakeToken< int >( val, lineIndex ); return INTCONST; } diff --git a/Engine/source/console/cmdgram.cpp b/Engine/source/console/cmdgram.cpp index b5051786b..aab109792 100644 --- a/Engine/source/console/cmdgram.cpp +++ b/Engine/source/console/cmdgram.cpp @@ -1,6 +1,6 @@ /* A Bison parser, made from cmdgram.y with Bison version GNU Bison version 1.24 -*/ + */ #define YYBISON 1 /* Identify Bison output. */ @@ -129,13 +129,13 @@ struct Token #line 44 "cmdgram.y" -/* Reserved Word Definitions */ + /* Reserved Word Definitions */ #line 55 "cmdgram.y" -/* Constants and Identifier Definitions */ + /* Constants and Identifier Definitions */ #line 69 "cmdgram.y" -/* Operator Definitions */ + /* Operator Definitions */ #line 82 "cmdgram.y" typedef union { @@ -158,16 +158,16 @@ typedef union { #ifndef YYLTYPE typedef -struct yyltype -{ - int timestamp; - int first_line; - int first_column; - int last_line; - int last_column; - char *text; -} -yyltype; + struct yyltype + { + int timestamp; + int first_line; + int first_column; + int last_line; + int last_column; + char *text; + } + yyltype; #define YYLTYPE yyltype #endif @@ -182,165 +182,164 @@ yyltype; -#define YYFINAL 391 +#define YYFINAL 380 #define YYFLAG -32768 #define YYNTBASE 100 #define YYTRANSLATE(x) ((unsigned)(x) <= 329 ? yytranslate[x] : 140) -static const char yytranslate[] = { 0, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 64, 2, 2, 2, 54, 53, 2, 55, -56, 46, 44, 57, 45, 51, 47, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 58, 59, 48, -50, 49, 96, 65, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -92, 2, 99, 62, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 60, 52, 61, 63, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 2, 2, 2, 1, 2, 3, 4, 5, -6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -36, 37, 38, 39, 40, 41, 42, 43, 66, 67, -68, 69, 70, 71, 72, 73, 74, 75, 76, 77, -78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -88, 89, 90, 91, 93, 94, 95, 97, 98 +static const char yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 64, 2, 2, 2, 54, 53, 2, 55, + 56, 46, 44, 57, 45, 51, 47, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 58, 59, 48, + 50, 49, 96, 65, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 92, 2, 99, 62, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 60, 52, 61, 63, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 93, 94, 95, 97, 98 }; #if YYDEBUG != 0 -static const short yyprhs[] = { 0, -0, 2, 3, 6, 8, 10, 12, 19, 21, 24, -25, 28, 30, 32, 34, 36, 38, 40, 43, 46, -49, 53, 56, 61, 68, 70, 79, 90, 91, 93, -95, 99, 110, 121, 129, 142, 152, 163, 171, 172, -175, 176, 178, 179, 182, 183, 185, 187, 190, 193, -197, 201, 203, 211, 219, 224, 232, 238, 240, 244, -250, 258, 264, 271, 281, 290, 299, 307, 316, 324, -332, 339, 347, 355, 357, 359, 363, 367, 371, 375, -379, 383, 387, 391, 395, 398, 401, 403, 409, 413, -417, 421, 425, 429, 433, 437, 441, 445, 449, 453, -457, 461, 464, 467, 469, 471, 473, 475, 477, 479, -481, 483, 485, 490, 498, 502, 509, 513, 517, 519, -523, 525, 527, 530, 533, 536, 539, 542, 545, 548, -551, 554, 557, 559, 561, 563, 567, 574, 577, 583, -586, 590, 596, 601, 608, 615, 620, 625, 632, 633, -635, 637, 641, 642, 644, 646, 649, 654, 660, 665, -673, 682, 684 +static const short yyprhs[] = { 0, + 0, 2, 3, 6, 8, 10, 12, 19, 21, 24, + 25, 28, 30, 32, 34, 36, 38, 40, 43, 46, + 49, 53, 56, 61, 68, 70, 79, 90, 91, 93, + 95, 99, 110, 121, 129, 142, 152, 163, 171, 172, + 175, 176, 178, 179, 182, 183, 185, 187, 190, 193, + 197, 201, 203, 211, 219, 224, 232, 238, 240, 244, + 250, 258, 264, 271, 281, 290, 299, 307, 316, 324, + 332, 339, 347, 355, 357, 359, 363, 367, 371, 375, + 379, 383, 387, 391, 395, 398, 401, 403, 409, 413, + 417, 421, 425, 429, 433, 437, 441, 445, 449, 453, + 457, 461, 464, 467, 469, 471, 473, 475, 477, 479, + 481, 483, 485, 490, 494, 501, 505, 509, 511, 515, + 517, 519, 522, 525, 528, 531, 534, 537, 540, 543, + 546, 549, 551, 553, 555, 559, 566, 569, 575, 578, + 582, 588, 593, 600, 607, 612, 619, 620, 622, 624, + 628, 629, 631, 633, 636, 641, 647, 652, 660, 669, + 671 }; -static const short yyrhs[] = { 101, -0, 0, 101, 102, 0, 106, 0, 107, 0, 103, -0, 29, 38, 60, 104, 61, 59, 0, 107, 0, -104, 107, 0, 0, 105, 106, 0, 121, 0, 122, -0, 123, 0, 124, 0, 110, 0, 118, 0, 7, -59, 0, 9, 59, 0, 13, 59, 0, 13, 126, -59, 0, 125, 59, 0, 36, 50, 126, 59, 0, -36, 50, 126, 57, 126, 59, 0, 40, 0, 3, -38, 55, 108, 56, 60, 105, 61, 0, 3, 38, -91, 38, 55, 108, 56, 60, 105, 61, 0, 0, -109, 0, 37, 0, 109, 57, 37, 0, 24, 129, -55, 126, 112, 56, 60, 136, 61, 59, 0, 5, -129, 55, 113, 112, 114, 56, 60, 115, 61, 0, -5, 129, 55, 113, 112, 114, 56, 0, 5, 129, -55, 92, 113, 99, 112, 114, 56, 60, 115, 61, -0, 5, 129, 55, 92, 113, 99, 112, 114, 56, -0, 6, 129, 55, 113, 112, 114, 56, 60, 115, -61, 0, 6, 129, 55, 113, 112, 114, 56, 0, -0, 58, 38, 0, 0, 126, 0, 0, 57, 135, -0, 0, 137, 0, 116, 0, 137, 116, 0, 111, -59, 0, 116, 111, 59, 0, 60, 105, 61, 0, -106, 0, 25, 55, 126, 56, 60, 119, 61, 0, -27, 55, 126, 56, 60, 119, 61, 0, 26, 120, -58, 105, 0, 26, 120, 58, 105, 19, 58, 105, -0, 26, 120, 58, 105, 119, 0, 126, 0, 120, -28, 126, 0, 11, 55, 126, 56, 117, 0, 11, -55, 126, 56, 117, 8, 117, 0, 14, 55, 126, -56, 117, 0, 15, 117, 14, 55, 126, 56, 0, -20, 55, 126, 59, 126, 59, 126, 56, 117, 0, -20, 55, 126, 59, 126, 59, 56, 117, 0, 20, -55, 126, 59, 59, 126, 56, 117, 0, 20, 55, -126, 59, 59, 56, 117, 0, 20, 55, 59, 126, -59, 126, 56, 117, 0, 20, 55, 59, 126, 59, -56, 117, 0, 20, 55, 59, 59, 126, 56, 117, -0, 20, 55, 59, 59, 56, 117, 0, 21, 55, -37, 23, 126, 56, 117, 0, 22, 55, 37, 23, -126, 56, 117, 0, 131, 0, 131, 0, 55, 126, -56, 0, 126, 62, 126, 0, 126, 54, 126, 0, -126, 53, 126, 0, 126, 52, 126, 0, 126, 44, -126, 0, 126, 45, 126, 0, 126, 46, 126, 0, -126, 47, 126, 0, 45, 126, 0, 46, 126, 0, -36, 0, 126, 96, 126, 58, 126, 0, 126, 48, -126, 0, 126, 49, 126, 0, 126, 86, 126, 0, -126, 87, 126, 0, 126, 84, 126, 0, 126, 85, -126, 0, 126, 89, 126, 0, 126, 71, 126, 0, -126, 72, 126, 0, 126, 88, 126, 0, 126, 90, -126, 0, 126, 97, 126, 0, 126, 65, 126, 0, -64, 126, 0, 63, 126, 0, 42, 0, 43, 0, -35, 0, 7, 0, 127, 0, 128, 0, 38, 0, -41, 0, 37, 0, 37, 92, 139, 99, 0, 3, -55, 108, 56, 60, 105, 61, 0, 126, 51, 38, -0, 126, 51, 38, 92, 139, 99, 0, 126, 66, -129, 0, 126, 67, 129, 0, 38, 0, 55, 126, -56, 0, 69, 0, 68, 0, 73, 126, 0, 74, -126, 0, 75, 126, 0, 76, 126, 0, 77, 126, -0, 78, 126, 0, 79, 126, 0, 80, 126, 0, -81, 126, 0, 82, 126, 0, 132, 0, 133, 0, -111, 0, 37, 50, 126, 0, 37, 92, 139, 99, -50, 126, 0, 37, 130, 0, 37, 92, 139, 99, -130, 0, 127, 130, 0, 127, 50, 126, 0, 127, -50, 60, 135, 61, 0, 38, 55, 134, 56, 0, -38, 91, 38, 55, 134, 56, 0, 126, 51, 38, -55, 134, 56, 0, 126, 55, 134, 56, 0, 32, -55, 126, 56, 0, 32, 55, 126, 57, 41, 56, -0, 0, 135, 0, 126, 0, 135, 57, 126, 0, -0, 137, 0, 138, 0, 137, 138, 0, 38, 50, -126, 59, 0, 39, 38, 50, 126, 59, 0, 24, -50, 126, 59, 0, 38, 92, 139, 99, 50, 126, -59, 0, 39, 38, 92, 139, 99, 50, 126, 59, -0, 126, 0, 139, 57, 126, 0 +static const short yyrhs[] = { 101, + 0, 0, 101, 102, 0, 106, 0, 107, 0, 103, + 0, 29, 38, 60, 104, 61, 59, 0, 107, 0, + 104, 107, 0, 0, 105, 106, 0, 121, 0, 122, + 0, 123, 0, 124, 0, 110, 0, 118, 0, 7, + 59, 0, 9, 59, 0, 13, 59, 0, 13, 126, + 59, 0, 125, 59, 0, 36, 50, 126, 59, 0, + 36, 50, 126, 57, 126, 59, 0, 40, 0, 3, + 38, 55, 108, 56, 60, 105, 61, 0, 3, 38, + 91, 38, 55, 108, 56, 60, 105, 61, 0, 0, + 109, 0, 37, 0, 109, 57, 37, 0, 24, 129, + 55, 126, 112, 56, 60, 136, 61, 59, 0, 5, + 129, 55, 113, 112, 114, 56, 60, 115, 61, 0, + 5, 129, 55, 113, 112, 114, 56, 0, 5, 129, + 55, 92, 113, 99, 112, 114, 56, 60, 115, 61, + 0, 5, 129, 55, 92, 113, 99, 112, 114, 56, + 0, 6, 129, 55, 113, 112, 114, 56, 60, 115, + 61, 0, 6, 129, 55, 113, 112, 114, 56, 0, + 0, 58, 38, 0, 0, 126, 0, 0, 57, 135, + 0, 0, 137, 0, 116, 0, 137, 116, 0, 111, + 59, 0, 116, 111, 59, 0, 60, 105, 61, 0, + 106, 0, 25, 55, 126, 56, 60, 119, 61, 0, + 27, 55, 126, 56, 60, 119, 61, 0, 26, 120, + 58, 105, 0, 26, 120, 58, 105, 19, 58, 105, + 0, 26, 120, 58, 105, 119, 0, 126, 0, 120, + 28, 126, 0, 11, 55, 126, 56, 117, 0, 11, + 55, 126, 56, 117, 8, 117, 0, 14, 55, 126, + 56, 117, 0, 15, 117, 14, 55, 126, 56, 0, + 20, 55, 126, 59, 126, 59, 126, 56, 117, 0, + 20, 55, 126, 59, 126, 59, 56, 117, 0, 20, + 55, 126, 59, 59, 126, 56, 117, 0, 20, 55, + 126, 59, 59, 56, 117, 0, 20, 55, 59, 126, + 59, 126, 56, 117, 0, 20, 55, 59, 126, 59, + 56, 117, 0, 20, 55, 59, 59, 126, 56, 117, + 0, 20, 55, 59, 59, 56, 117, 0, 21, 55, + 37, 23, 126, 56, 117, 0, 22, 55, 37, 23, + 126, 56, 117, 0, 131, 0, 131, 0, 55, 126, + 56, 0, 126, 62, 126, 0, 126, 54, 126, 0, + 126, 53, 126, 0, 126, 52, 126, 0, 126, 44, + 126, 0, 126, 45, 126, 0, 126, 46, 126, 0, + 126, 47, 126, 0, 45, 126, 0, 46, 126, 0, + 36, 0, 126, 96, 126, 58, 126, 0, 126, 48, + 126, 0, 126, 49, 126, 0, 126, 86, 126, 0, + 126, 87, 126, 0, 126, 84, 126, 0, 126, 85, + 126, 0, 126, 89, 126, 0, 126, 71, 126, 0, + 126, 72, 126, 0, 126, 88, 126, 0, 126, 90, + 126, 0, 126, 97, 126, 0, 126, 65, 126, 0, + 64, 126, 0, 63, 126, 0, 42, 0, 43, 0, + 35, 0, 7, 0, 127, 0, 128, 0, 38, 0, + 41, 0, 37, 0, 37, 92, 139, 99, 0, 126, + 51, 38, 0, 126, 51, 38, 92, 139, 99, 0, + 126, 66, 129, 0, 126, 67, 129, 0, 38, 0, + 55, 126, 56, 0, 69, 0, 68, 0, 73, 126, + 0, 74, 126, 0, 75, 126, 0, 76, 126, 0, + 77, 126, 0, 78, 126, 0, 79, 126, 0, 80, + 126, 0, 81, 126, 0, 82, 126, 0, 132, 0, + 133, 0, 111, 0, 37, 50, 126, 0, 37, 92, + 139, 99, 50, 126, 0, 37, 130, 0, 37, 92, + 139, 99, 130, 0, 127, 130, 0, 127, 50, 126, + 0, 127, 50, 60, 135, 61, 0, 38, 55, 134, + 56, 0, 38, 91, 38, 55, 134, 56, 0, 126, + 51, 38, 55, 134, 56, 0, 32, 55, 126, 56, + 0, 32, 55, 126, 57, 41, 56, 0, 0, 135, + 0, 126, 0, 135, 57, 126, 0, 0, 137, 0, + 138, 0, 137, 138, 0, 38, 50, 126, 59, 0, + 39, 38, 50, 126, 59, 0, 24, 50, 126, 59, + 0, 38, 92, 139, 99, 50, 126, 59, 0, 39, + 38, 92, 139, 99, 50, 126, 59, 0, 126, 0, + 139, 57, 126, 0 }; #endif #if YYDEBUG != 0 static const short yyrline[] = { 0, -161, 166, 168, 173, 175, 177, 182, 187, 189, 194, -196, 201, 202, 203, 204, 205, 206, 207, 209, 211, -213, 215, 217, 219, 221, 226, 228, 233, 235, 240, -242, 247, 252, 254, 256, 258, 260, 262, 267, 269, -274, 276, 281, 283, 288, 290, 292, 294, 299, 301, -306, 308, 313, 315, 320, 322, 324, 329, 331, 336, -338, 343, 345, 350, 352, 354, 356, 358, 360, 362, -364, 369, 371, 376, 381, 383, 385, 387, 389, 391, -393, 395, 397, 399, 401, 403, 405, 407, 409, 411, -413, 415, 417, 419, 421, 423, 425, 427, 429, 431, -433, 435, 437, 439, 441, 443, 445, 447, 449, 451, -453, 455, 457, 459, 477, 479, 484, 486, 491, 493, -498, 500, 502, 504, 506, 508, 510, 512, 514, 516, -518, 520, 525, 527, 529, 531, 533, 535, 537, 539, -541, 543, 548, 550, 552, 554, 559, 561, 566, 568, -573, 575, 580, 582, 587, 589, 594, 596, 598, 600, -602, 607, 609 + 161, 166, 168, 173, 175, 177, 182, 187, 189, 194, + 196, 201, 202, 203, 204, 205, 206, 207, 209, 211, + 213, 215, 217, 219, 221, 226, 228, 233, 235, 240, + 242, 247, 252, 254, 256, 258, 260, 262, 267, 269, + 274, 276, 281, 283, 288, 290, 292, 294, 299, 301, + 306, 308, 313, 315, 320, 322, 324, 329, 331, 336, + 338, 343, 345, 350, 352, 354, 356, 358, 360, 362, + 364, 369, 371, 376, 381, 383, 385, 387, 389, 391, + 393, 395, 397, 399, 401, 403, 405, 407, 409, 411, + 413, 415, 417, 419, 421, 423, 425, 427, 429, 431, + 433, 435, 437, 439, 441, 443, 445, 447, 449, 451, + 453, 455, 457, 479, 481, 486, 488, 493, 495, 500, + 502, 504, 506, 508, 510, 512, 514, 516, 518, 520, + 522, 527, 529, 531, 533, 535, 537, 539, 541, 543, + 545, 550, 552, 554, 564, 566, 571, 573, 578, 580, + 585, 587, 592, 594, 599, 601, 603, 605, 607, 612, + 614 }; -static const char * const yytname[] = { "$","error","$undefined.","rwDEFINE", +static const char * const yytname[] = { "$","error","$undefined.","rwDEFINE", "rwENDDEF","rwDECLARE","rwDECLARESINGLETON","rwBREAK","rwELSE","rwCONTINUE", "rwGLOBAL","rwIF","rwNIL","rwRETURN","rwWHILE","rwDO","rwENDIF","rwENDWHILE", "rwENDFOR","rwDEFAULT","rwFOR","rwFOREACH","rwFOREACHSTR","rwIN","rwDATABLOCK", @@ -363,805 +362,747 @@ static const char * const yytname[] = { "$","error","$undefined.","rwDEFINE", }; #endif -static const short yyr1[] = { 0, -100, 101, 101, 102, 102, 102, 103, 104, 104, 105, -105, 106, 106, 106, 106, 106, 106, 106, 106, 106, -106, 106, 106, 106, 106, 107, 107, 108, 108, 109, -109, 110, 111, 111, 111, 111, 111, 111, 112, 112, -113, 113, 114, 114, 115, 115, 115, 115, 116, 116, -117, 117, 118, 118, 119, 119, 119, 120, 120, 121, -121, 122, 122, 123, 123, 123, 123, 123, 123, 123, -123, 124, 124, 125, 126, 126, 126, 126, 126, 126, -126, 126, 126, 126, 126, 126, 126, 126, 126, 126, -126, 126, 126, 126, 126, 126, 126, 126, 126, 126, -126, 126, 126, 126, 126, 126, 126, 126, 126, 126, -126, 126, 126, 126, 127, 127, 128, 128, 129, 129, -130, 130, 130, 130, 130, 130, 130, 130, 130, 130, -130, 130, 131, 131, 131, 131, 131, 131, 131, 131, -131, 131, 132, 132, 132, 132, 133, 133, 134, 134, -135, 135, 136, 136, 137, 137, 138, 138, 138, 138, -138, 139, 139 +static const short yyr1[] = { 0, + 100, 101, 101, 102, 102, 102, 103, 104, 104, 105, + 105, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 107, 107, 108, 108, 109, + 109, 110, 111, 111, 111, 111, 111, 111, 112, 112, + 113, 113, 114, 114, 115, 115, 115, 115, 116, 116, + 117, 117, 118, 118, 119, 119, 119, 120, 120, 121, + 121, 122, 122, 123, 123, 123, 123, 123, 123, 123, + 123, 124, 124, 125, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 127, 127, 128, 128, 129, 129, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 132, 132, 132, 133, 133, 134, 134, 135, 135, + 136, 136, 137, 137, 138, 138, 138, 138, 138, 139, + 139 }; -static const short yyr2[] = { 0, -1, 0, 2, 1, 1, 1, 6, 1, 2, 0, -2, 1, 1, 1, 1, 1, 1, 2, 2, 2, -3, 2, 4, 6, 1, 8, 10, 0, 1, 1, -3, 10, 10, 7, 12, 9, 10, 7, 0, 2, -0, 1, 0, 2, 0, 1, 1, 2, 2, 3, -3, 1, 7, 7, 4, 7, 5, 1, 3, 5, -7, 5, 6, 9, 8, 8, 7, 8, 7, 7, -6, 7, 7, 1, 1, 3, 3, 3, 3, 3, -3, 3, 3, 3, 2, 2, 1, 5, 3, 3, -3, 3, 3, 3, 3, 3, 3, 3, 3, 3, -3, 2, 2, 1, 1, 1, 1, 1, 1, 1, -1, 1, 4, 7, 3, 6, 3, 3, 1, 3, -1, 1, 2, 2, 2, 2, 2, 2, 2, 2, -2, 2, 1, 1, 1, 3, 6, 2, 5, 2, -3, 5, 4, 6, 6, 4, 4, 6, 0, 1, -1, 3, 0, 1, 1, 2, 4, 5, 4, 7, -8, 1, 3 +static const short yyr2[] = { 0, + 1, 0, 2, 1, 1, 1, 6, 1, 2, 0, + 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, + 3, 2, 4, 6, 1, 8, 10, 0, 1, 1, + 3, 10, 10, 7, 12, 9, 10, 7, 0, 2, + 0, 1, 0, 2, 0, 1, 1, 2, 2, 3, + 3, 1, 7, 7, 4, 7, 5, 1, 3, 5, + 7, 5, 6, 9, 8, 8, 7, 8, 7, 7, + 6, 7, 7, 1, 1, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 2, 2, 1, 5, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 4, 3, 6, 3, 3, 1, 3, 1, + 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 1, 1, 1, 3, 6, 2, 5, 2, 3, + 5, 4, 6, 6, 4, 6, 0, 1, 1, 3, + 0, 1, 1, 2, 4, 5, 4, 7, 8, 1, + 3 }; -static const short yydefact[] = { 2, -1, 0, 0, 0, 107, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 106, 87, -112, 110, 25, 111, 104, 105, 0, 0, 0, 0, -0, 3, 6, 4, 5, 16, 135, 17, 12, 13, -14, 15, 0, 0, 108, 109, 75, 133, 134, 0, -28, 119, 0, 0, 0, 18, 19, 0, 0, 107, -87, 20, 0, 75, 0, 10, 52, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 122, 121, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 138, 149, 0, 85, 86, 0, 103, 102, 22, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -149, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 140, 28, 0, -30, 0, 29, 0, 41, 41, 0, 21, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 136, 123, 124, 125, 126, 127, 128, 129, 130, -131, 132, 162, 0, 151, 0, 150, 0, 76, 81, -82, 83, 84, 89, 90, 115, 80, 79, 78, 0, -77, 101, 117, 118, 96, 97, 93, 94, 91, 92, -98, 95, 99, 0, 100, 0, 141, 0, 0, 0, -0, 120, 41, 39, 42, 39, 0, 0, 51, 11, -0, 0, 0, 0, 0, 0, 39, 0, 0, 0, -0, 8, 147, 0, 0, 23, 0, 113, 143, 0, -149, 149, 0, 146, 0, 0, 0, 28, 10, 31, -0, 0, 43, 43, 60, 62, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 9, 0, -0, 163, 0, 139, 152, 0, 0, 0, 88, 142, -10, 0, 0, 39, 40, 0, 0, 0, 0, 63, -71, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 7, 148, 24, 137, 144, 145, 116, -0, 0, 114, 43, 44, 34, 38, 61, 70, 69, -0, 67, 0, 0, 0, 72, 73, 153, 0, 58, -53, 54, 26, 10, 0, 45, 45, 68, 66, 65, -0, 0, 0, 0, 0, 154, 155, 0, 10, 0, -36, 0, 0, 47, 46, 0, 64, 0, 0, 0, -0, 0, 156, 59, 55, 27, 45, 49, 33, 0, -48, 37, 0, 0, 0, 0, 0, 32, 0, 57, -0, 50, 159, 157, 0, 0, 0, 10, 35, 0, -158, 0, 56, 0, 0, 160, 0, 161, 0, 0, -0 +static const short yydefact[] = { 2, + 1, 0, 0, 0, 107, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 106, 87, + 112, 110, 25, 111, 104, 105, 0, 0, 0, 0, + 0, 3, 6, 4, 5, 16, 134, 17, 12, 13, + 14, 15, 0, 0, 108, 109, 75, 132, 133, 0, + 118, 0, 0, 0, 18, 19, 0, 107, 87, 20, + 0, 75, 0, 10, 52, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 121, 120, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, + 147, 0, 85, 86, 0, 103, 102, 22, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 139, 28, 0, 0, 41, 41, + 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 135, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 160, 0, 149, 0, + 148, 0, 76, 81, 82, 83, 84, 89, 90, 114, + 80, 79, 78, 77, 101, 116, 117, 96, 97, 93, + 94, 91, 92, 98, 95, 99, 0, 100, 0, 140, + 30, 0, 29, 0, 119, 41, 39, 42, 39, 0, + 0, 51, 11, 0, 0, 0, 0, 0, 0, 39, + 0, 0, 0, 8, 145, 0, 0, 23, 0, 113, + 142, 0, 147, 147, 0, 0, 0, 0, 0, 28, + 0, 0, 43, 43, 60, 62, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, + 0, 161, 0, 138, 150, 0, 0, 0, 88, 141, + 10, 31, 0, 39, 40, 0, 0, 0, 0, 63, + 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 146, 24, 136, 143, 144, 115, + 0, 0, 43, 44, 34, 38, 61, 70, 69, 0, + 67, 0, 0, 0, 72, 73, 151, 0, 58, 53, + 54, 26, 10, 0, 45, 45, 68, 66, 65, 0, + 0, 0, 0, 0, 152, 153, 0, 10, 0, 36, + 0, 0, 47, 46, 0, 64, 0, 0, 0, 0, + 0, 154, 59, 55, 27, 45, 49, 33, 0, 48, + 37, 0, 0, 0, 0, 0, 32, 0, 57, 0, + 50, 157, 155, 0, 0, 0, 10, 35, 0, 156, + 0, 56, 0, 0, 158, 0, 159, 0, 0, 0 }; -static const short yydefgoto[] = { 389, -1, 32, 33, 221, 140, 67, 35, 132, 133, 36, -37, 243, 204, 277, 343, 344, 68, 38, 292, 319, -39, 40, 41, 42, 43, 44, 45, 46, 54, 92, -64, 48, 49, 166, 167, 335, 345, 337, 164 +static const short yydefgoto[] = { 378, + 1, 32, 33, 213, 134, 65, 35, 192, 193, 36, + 37, 233, 197, 267, 332, 333, 66, 38, 282, 308, + 39, 40, 41, 42, 43, 44, 45, 46, 53, 90, + 62, 48, 49, 160, 161, 324, 334, 326, 158 }; -static const short yypact[] = { -32768, -213, -7, 55, 55, -37, -25, -18, 490, -13, 422, -5, 14, 41, 55, 47, 49, 9, 51,-32768, 57, -566, -23,-32768,-32768,-32768,-32768, 1187, 1187, 1187, 1187, -1187,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768, -5, 2650, 3021,-32768, 35,-32768,-32768, -12, -62,-32768, 1187, 67, 68,-32768,-32768, 1187, 69,-32768, --32768,-32768, 1300,-32768, 1187,-32768,-32768, 103, 835, 88, -89, 77, 1187, 1187, 73, 1187, 1187, 1187,-32768,-32768, -1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187, -1187,-32768, 1187, 96, 219, 219, 1354, 219, 219,-32768, -1187, 1187, 1187, 1187, 1187, 1187, 97, 1187, 1187, 1187, -1187, 1187, 1187, 55, 55, 1187, 1187, 1187, 1187, 1187, -1187, 1187, 1187, 1187, 1187, 1187, 879,-32768, 62, 98, --32768, 81, 91, 1408, 21, 1187, 1462,-32768, 1516, 556, -95, 923, 1570, 123, 131, 1187, 1624, 1678, 152, 1192, -1246, 2650, 2650, 2650, 2650, 2650, 2650, 2650, 2650, 2650, -2650, 2650, 2650, -38, 2650, 100, 104, 111,-32768, 145, -145, 219, 219, 3015, 3015, -40, 2845, 2939, 219, 112, -2892, 143,-32768,-32768, 277, 277, 2986, 2986, 3015, 3015, -2798, 2751, 143, 1732, 143, 1187, 2650, 113, 116, 107, -135,-32768, 1187, 119, 2650, 119, 422, 422,-32768,-32768, -1187, 967, 1786, 1011, 1187, 1187, 1840, 122, 126, 157, -13,-32768,-32768, 162, 1187,-32768, 1187, 3041,-32768, 1187, -1187, 1187, 1187,-32768, 1187, 44, 144, 62,-32768,-32768, -106, 170, 156, 156, 209,-32768, 1894, 422, 1948, 1055, -1099, 2002, 2056, 2110, 165, 197, 197, 166,-32768, 173, -2164, 2650, 1187,-32768, 2650, 174, 175, -28, 2704,-32768, --32768, 176, 656, 119,-32768, 1187, 180, 183, 422,-32768, --32768, 422, 422, 2218, 422, 2272, 1143, 422, 422, 181, -1187, 182, 185,-32768,-32768,-32768, 2650,-32768,-32768,-32768, -701, 184,-32768, 156, 104, 192, 200,-32768,-32768,-32768, -422,-32768, 422, 422, 2326,-32768,-32768, 76, 12, 2650, --32768,-32768,-32768,-32768, 201, 92, 92,-32768,-32768,-32768, -422, 211, -20, 224, 202, 76,-32768, 1187,-32768, 746, -204, 206, 205, 39, 92, 208,-32768, 1187, 1187, 1187, --17, 212,-32768, 2650, 138,-32768, 92,-32768,-32768, 216, -39,-32768, 2380, 2434, -21, 1187, 1187,-32768, 221,-32768, -222,-32768,-32768,-32768, 217, 2488, -8,-32768,-32768, 1187, --32768, 230, 791, 2542, 1187,-32768, 2596,-32768, 289, 290, --32768 +static const short yypact[] = {-32768, + 396, -30, -7, -7, -5, 29, -39, 166, -29, 488, + -26, 37, 40, -7, 46, 74, 97, 82,-32768, 94, + -36, -28,-32768,-32768,-32768,-32768, 1001, 1001, 1001, 1001, + 1001,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768, 92, 2464, 2726,-32768, 105,-32768,-32768, -27, +-32768, 1001, 110, 111,-32768,-32768, 1001,-32768,-32768,-32768, + 1114,-32768, 1001,-32768,-32768, 156, 707, 137, 139, 123, + 1001, 1001, 120, 1001, 1001, 1001,-32768,-32768, 1001, 1001, + 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001,-32768, + 1001, 143, 27, 27, 1168, 27, 27,-32768, 1001, 1001, + 1001, 1001, 1001, 1001, 144, 1001, 1001, 1001, 1001, 1001, + -7, -7, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, + 1001, 1001, 1001, 749,-32768, 146, 147, 1222, 44, 1001, + 1276,-32768, 1330, 548, 129, 791, 1384, 163, 167, 1001, + 1438, 1492, 186, 1006, 1060, 2464, 2464, 2464, 2464, 2464, + 2464, 2464, 2464, 2464, 2464, 2464, 2464, -47, 2464, 135, + 136, 140,-32768, 713, 713, 27, 27, 2721, 2721, -33, + 2605, 2663, 27, 2634, 2785,-32768,-32768, 291, 291, 2692, + 2692, 2721, 2721, 2576, 2547, 2785, 1546, 2785, 1001, 2464, +-32768, 138, 153, 141,-32768, 1001, 134, 2464, 134, 488, + 488,-32768,-32768, 1001, 318, 1600, 833, 1001, 1001, 1654, + 154, 155, 14,-32768,-32768, 172, 1001,-32768, 1001, 2746, +-32768, 1001, 1001, 1001, 1001, 1001, 48, 157, 160, 146, + 117, 185, 169, 169, 216,-32768, 1708, 488, 1762, 875, + 917, 1816, 1870, 1924, 171, 207, 207, 175,-32768, 180, + 1978, 2464, 1001,-32768, 2464, 183, 184, -46, 2518,-32768, +-32768,-32768, 189, 134,-32768, 1001, 193, 194, 488,-32768, +-32768, 488, 488, 2032, 488, 2086, 959, 488, 488, 181, + 1001, 190, 196,-32768,-32768,-32768, 2464,-32768,-32768,-32768, + 593, 182, 169, 136, 195, 199,-32768,-32768,-32768, 488, +-32768, 488, 488, 2140,-32768,-32768, 59, -3, 2464,-32768, +-32768,-32768,-32768, 198, 214, 214,-32768,-32768,-32768, 488, + 210, -35, 228, 206, 59,-32768, 1001,-32768, 638, 213, + 211, 215, 98, 214, 220,-32768, 1001, 1001, 1001, -32, + 223,-32768, 2464, 443,-32768, 214,-32768,-32768, 224, 98, +-32768, 2194, 2248, -38, 1001, 1001,-32768, 217,-32768, 225, +-32768,-32768,-32768, 234, 2302, -37,-32768,-32768, 1001,-32768, + 235, 683, 2356, 1001,-32768, 2410,-32768, 287, 288,-32768 }; -static const short yypgoto[] = { -32768, --32768,-32768,-32768,-32768, -236, 0, -132, -118,-32768,-32768, --306, -192, -113, -231, -262, -54, -202,-32768, -247,-32768, --32768,-32768,-32768,-32768,-32768, 288,-32768,-32768, 4, -43, --1,-32768,-32768, -104, -184,-32768, -26, -295, -229 +static const short yypgoto[] = {-32768, +-32768,-32768,-32768,-32768, -255, 0, -139, 63,-32768,-32768, + -128, -187, -125, -221, -281, -45, 31,-32768, -244,-32768, +-32768,-32768,-32768,-32768,-32768, 39,-32768,-32768, 20, -43, + -1,-32768,-32768, -107, -182,-32768, -13, -304, -189 }; -#define YYLAST 3123 +#define YYLAST 2857 -static const short yytable[] = { 47, -34, 128, 273, 268, 245, 246, 180, 55, 47, 293, -198, 236, 278, 244, 232, 220, 222, 72, 227, 342, -342, 56, 206, 59, 255, 3, 4, 60, 227, 349, -50, 93, 366, 57, 301, 227, 58, 360, 342, 338, -353, 65, 129, 3, 4, 281, 75, 51, 227, 353, -342, 233, 18, 100, 360, 19, 61, 21, 22, 69, -228, 24, 25, 26, 346, 27, 28, 94, 70, 339, -300, 350, 325, 258, 367, 29, 308, 375, 130, 309, -310, 304, 312, 30, 31, 316, 317, 340, 259, 241, -382, 305, 52, -74, 371, 71, 3, 4, 131, 332, -230, 73, 355, 74, 270, 76, 77, 370, 328, 53, -329, 330, 203, 333, 334, 332, 141, 183, 184, 272, -365, 135, 136, 51, 144, 145, 266, 267, 347, 333, -334, 146, 149, 168, 176, 199, 200, 377, 47, 210, -59, 383, 3, 4, 5, 215, 6, 201, 7, 211, -8, 9, 10, 216, 220, 229, 369, 11, 12, 13, -230, 14, 15, 291, 16, 231, 239, 234, 237, 18, -238, 240, 19, 20, 21, 22, 242, 23, 24, 25, -26, 256, 27, 28, 264, 257, 101, 102, 103, 104, -103, 104, 29, 107, 50, 107, 110, 111, 110, 111, -30, 31, 260, 271, 274, 47, 47, 275, 114, 115, -114, 115, 276, 116, 117, 2, 279, 3, 4, 5, -290, 6, 291, 7, 294, 8, 9, 10, 295, 298, -299, 302, 11, 12, 13, 306, 14, 15, 307, 16, -318, 17, 321, 324, 18, 322, 47, 19, 20, 21, -22, 326, 23, 24, 25, 26, 341, 27, 28, 327, -348, 351, 352, 357, 358, 359, 380, 29, 362, 107, -368, 47, 210, 111, 372, 30, 31, 47, 378, 385, -47, 47, 379, 47, 114, 115, 47, 47, 390, 391, -361, 336, 0, 0, 0, 63, 0, 0, 0, 47, -210, 0, 0, 0, 0, 0, 0, 0, 0, 47, -0, 47, 47, 0, 95, 96, 97, 98, 99, 0, -101, 102, 103, 104, 0, 0, 0, 107, 0, 47, -110, 111, 0, 0, 0, 0, 0, 0, 47, 210, -134, 0, 114, 115, 0, 137, 0, 0, 0, 0, -0, 0, 139, 47, 210, 0, 143, 0, 0, 0, -147, 148, 0, 150, 151, 152, 0, 0, 153, 154, -155, 156, 157, 158, 159, 160, 161, 162, 163, 0, -165, 47, 210, 0, 0, 0, 0, 0, 170, 171, -172, 173, 174, 175, 0, 177, 178, 179, 165, 181, -182, 0, 0, 185, 186, 187, 188, 189, 190, 191, -192, 193, 194, 195, 197, 0, 0, 0, 0, 0, -0, 0, 205, 205, 59, 0, 3, 4, 5, 213, -6, 0, 7, 217, 8, 9, 10, 0, 0, 0, -0, 11, 12, 13, 0, 14, 15, 0, 16, 0, -0, 0, 0, 18, 0, 0, 19, 20, 21, 22, -0, 23, 24, 25, 26, 0, 27, 28, 0, 0, -0, 0, 0, 0, 0, 0, 29, 0, 0, 0, -0, 66, 0, 165, 30, 31, 0, 0, 0, 0, -205, 0, 59, 0, 3, 4, 60, 0, 247, 249, -0, 252, 253, 254, 0, 0, 0, 0, 0, 0, -0, 0, 261, 0, 262, 0, 0, 265, 165, 165, -163, 18, 269, 0, 19, 61, 21, 22, 0, 0, -24, 25, 26, 0, 27, 28, 0, 284, 286, 0, -0, 0, 0, 0, 29, 0, 0, 0, 62, 0, -297, 0, 30, 31, 0, 0, 0, 0, 59, 0, -3, 4, 5, 165, 6, 0, 7, 0, 8, 9, -10, 0, 0, 0, 315, 11, 12, 13, 320, 14, -15, 0, 16, 0, 0, 0, 0, 18, 0, 0, -19, 20, 21, 22, 0, 23, 24, 25, 26, 0, -27, 28, 0, 0, 0, 0, 0, 0, 0, 0, -29, 0, 0, 0, 0, 78, 209, 0, 30, 31, -0, 0, 0, 0, 0, 354, 0, 0, 0, 0, -0, 0, 0, 79, 80, 363, 364, 163, 81, 82, -83, 84, 85, 86, 87, 88, 89, 90, 0, 0, -0, 0, 0, 376, 163, 0, 0, 91, 59, 0, -3, 4, 5, 0, 6, 0, 7, 384, 8, 9, -10, 0, 387, 0, 0, 11, 12, 13, 0, 14, -15, 0, 16, 0, 0, 0, 0, 18, 0, 0, -19, 20, 21, 22, 0, 23, 24, 25, 26, 0, -27, 28, 0, 59, 0, 3, 4, 5, 0, 6, -29, 7, 0, 8, 9, 10, 303, 0, 30, 31, -11, 12, 13, 0, 14, 15, 0, 16, 0, 0, -0, 0, 18, 0, 0, 19, 20, 21, 22, 0, -23, 24, 25, 26, 0, 27, 28, 0, 59, 0, -3, 4, 5, 0, 6, 29, 7, 0, 8, 9, -10, 323, 0, 30, 31, 11, 12, 13, 0, 14, -15, 0, 16, 0, 0, 0, 0, 18, 0, 0, -19, 20, 21, 22, 0, 23, 24, 25, 26, 0, -27, 28, 0, 59, 0, 3, 4, 5, 0, 6, -29, 7, 0, 8, 9, 10, 356, 0, 30, 31, -11, 12, 13, 0, 14, 15, 0, 16, 0, 0, -0, 0, 18, 0, 0, 19, 20, 21, 22, 0, -23, 24, 25, 26, 0, 27, 28, 59, 0, 3, -4, 60, 0, 0, 0, 29, 0, 0, 0, 0, -0, 0, 0, 30, 31, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 18, 0, 0, 19, -61, 21, 22, 0, 0, 24, 25, 26, 0, 27, -28, 59, 0, 3, 4, 60, 0, 0, 0, 29, -0, 0, 0, 142, 0, 0, 0, 30, 31, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, 0, 0, 19, 61, 21, 22, 0, 0, 24, -25, 26, 0, 27, 28, 59, 0, 3, 4, 60, -0, 0, 0, 29, 0, 0, 0, 0, 196, 0, -0, 30, 31, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 18, 0, 0, 19, 61, 21, -22, 0, 0, 24, 25, 26, 0, 27, 28, 59, -0, 3, 4, 60, 0, 0, 0, 29, 0, 0, -0, 212, 0, 0, 0, 30, 31, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 18, 0, -0, 19, 61, 21, 22, 0, 0, 24, 25, 26, -0, 27, 28, 59, 0, 3, 4, 60, 0, 0, -0, 29, 248, 0, 0, 0, 0, 0, 0, 30, -31, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 18, 0, 0, 19, 61, 21, 22, 0, -0, 24, 25, 26, 0, 27, 28, 59, 0, 3, -4, 60, 0, 0, 0, 29, 0, 0, 0, 251, -0, 0, 0, 30, 31, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 18, 0, 0, 19, -61, 21, 22, 0, 0, 24, 25, 26, 0, 27, -28, 59, 0, 3, 4, 60, 0, 0, 0, 29, -283, 0, 0, 0, 0, 0, 0, 30, 31, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, 0, 0, 19, 61, 21, 22, 0, 0, 24, -25, 26, 0, 27, 28, 59, 0, 3, 4, 60, -0, 0, 0, 29, 285, 0, 0, 0, 0, 0, -0, 30, 31, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 18, 0, 0, 19, 61, 21, -22, 0, 0, 24, 25, 26, 0, 27, 28, 59, -0, 3, 4, 60, 0, 0, 0, 29, 314, 0, -0, 0, 0, 0, 0, 30, 31, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 18, 0, -0, 19, 61, 21, 22, 0, 0, 24, 25, 26, -0, 27, 28, 0, 0, 101, 102, 103, 104, 105, -106, 29, 107, 108, 109, 110, 111, 223, 224, 30, -31, 0, 0, 112, 0, 0, 113, 114, 115, 0, -0, 0, 116, 117, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 118, 119, 120, 121, 122, -123, 124, 0, 0, 0, 0, 0, 125, 126, 101, -102, 103, 104, 105, 106, 0, 107, 108, 109, 110, -111, 0, 225, 0, 226, 0, 0, 112, 0, 0, -113, 114, 115, 0, 0, 0, 116, 117, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 118, -119, 120, 121, 122, 123, 124, 0, 0, 0, 0, -0, 125, 126, 101, 102, 103, 104, 105, 106, 0, -107, 108, 109, 110, 111, 0, 0, 0, 138, 0, -0, 112, 0, 0, 113, 114, 115, 0, 0, 0, -116, 117, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 118, 119, 120, 121, 122, 123, 124, -0, 0, 0, 0, 0, 125, 126, 101, 102, 103, -104, 105, 106, 0, 107, 108, 109, 110, 111, 169, -0, 0, 0, 0, 0, 112, 0, 0, 113, 114, -115, 0, 0, 0, 116, 117, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 118, 119, 120, -121, 122, 123, 124, 0, 0, 0, 0, 0, 125, -126, 101, 102, 103, 104, 105, 106, 0, 107, 108, -109, 110, 111, 202, 0, 0, 0, 0, 0, 112, -0, 0, 113, 114, 115, 0, 0, 0, 116, 117, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 118, 119, 120, 121, 122, 123, 124, 0, 0, -0, 0, 0, 125, 126, 101, 102, 103, 104, 105, -106, 0, 107, 108, 109, 110, 111, 207, 0, 0, -0, 0, 0, 112, 0, 0, 113, 114, 115, 0, -0, 0, 116, 117, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 118, 119, 120, 121, 122, -123, 124, 0, 0, 0, 0, 0, 125, 126, 101, -102, 103, 104, 105, 106, 0, 107, 108, 109, 110, -111, 208, 0, 0, 0, 0, 0, 112, 0, 0, -113, 114, 115, 0, 0, 0, 116, 117, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 118, -119, 120, 121, 122, 123, 124, 0, 0, 0, 0, -0, 125, 126, 101, 102, 103, 104, 105, 106, 0, -107, 108, 109, 110, 111, 0, 0, 0, 214, 0, -0, 112, 0, 0, 113, 114, 115, 0, 0, 0, -116, 117, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 118, 119, 120, 121, 122, 123, 124, -0, 0, 0, 0, 0, 125, 126, 101, 102, 103, -104, 105, 106, 0, 107, 108, 109, 110, 111, 218, -0, 0, 0, 0, 0, 112, 0, 0, 113, 114, -115, 0, 0, 0, 116, 117, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 118, 119, 120, -121, 122, 123, 124, 0, 0, 0, 0, 0, 125, -126, 101, 102, 103, 104, 105, 106, 0, 107, 108, -109, 110, 111, 219, 0, 0, 0, 0, 0, 112, -0, 0, 113, 114, 115, 0, 0, 0, 116, 117, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 118, 119, 120, 121, 122, 123, 124, 0, 0, -0, 0, 0, 125, 126, 101, 102, 103, 104, 105, -106, 0, 107, 108, 109, 110, 111, 0, 0, 235, -0, 0, 0, 112, 0, 0, 113, 114, 115, 0, -0, 0, 116, 117, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 118, 119, 120, 121, 122, -123, 124, 0, 0, 0, 0, 0, 125, 126, 101, -102, 103, 104, 105, 106, 0, 107, 108, 109, 110, -111, 0, 0, 0, 250, 0, 0, 112, 0, 0, -113, 114, 115, 0, 0, 0, 116, 117, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 118, -119, 120, 121, 122, 123, 124, 0, 0, 0, 0, -0, 125, 126, 101, 102, 103, 104, 105, 106, 0, -107, 108, 109, 110, 111, 0, 0, 242, 0, 0, -0, 112, 0, 0, 113, 114, 115, 0, 0, 0, -116, 117, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 118, 119, 120, 121, 122, 123, 124, -0, 0, 0, 0, 0, 125, 126, 101, 102, 103, -104, 105, 106, 0, 107, 108, 109, 110, 111, 280, -0, 0, 0, 0, 0, 112, 0, 0, 113, 114, -115, 0, 0, 0, 116, 117, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 118, 119, 120, -121, 122, 123, 124, 0, 0, 0, 0, 0, 125, -126, 101, 102, 103, 104, 105, 106, 0, 107, 108, -109, 110, 111, 282, 0, 0, 0, 0, 0, 112, -0, 0, 113, 114, 115, 0, 0, 0, 116, 117, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 118, 119, 120, 121, 122, 123, 124, 0, 0, -0, 0, 0, 125, 126, 101, 102, 103, 104, 105, -106, 0, 107, 108, 109, 110, 111, 0, 0, 0, -287, 0, 0, 112, 0, 0, 113, 114, 115, 0, -0, 0, 116, 117, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 118, 119, 120, 121, 122, -123, 124, 0, 0, 0, 0, 0, 125, 126, 101, -102, 103, 104, 105, 106, 0, 107, 108, 109, 110, -111, 288, 0, 0, 0, 0, 0, 112, 0, 0, -113, 114, 115, 0, 0, 0, 116, 117, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 118, -119, 120, 121, 122, 123, 124, 0, 0, 0, 0, -0, 125, 126, 101, 102, 103, 104, 105, 106, 0, -107, 108, 109, 110, 111, 289, 0, 0, 0, 0, -0, 112, 0, 0, 113, 114, 115, 0, 0, 0, -116, 117, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 118, 119, 120, 121, 122, 123, 124, -0, 0, 0, 0, 0, 125, 126, 101, 102, 103, -104, 105, 106, 0, 107, 108, 109, 110, 111, 0, -0, 0, 296, 0, 0, 112, 0, 0, 113, 114, -115, 0, 0, 0, 116, 117, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 118, 119, 120, -121, 122, 123, 124, 0, 0, 0, 0, 0, 125, -126, 101, 102, 103, 104, 105, 106, 0, 107, 108, -109, 110, 111, 311, 0, 0, 0, 0, 0, 112, -0, 0, 113, 114, 115, 0, 0, 0, 116, 117, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 118, 119, 120, 121, 122, 123, 124, 0, 0, -0, 0, 0, 125, 126, 101, 102, 103, 104, 105, -106, 0, 107, 108, 109, 110, 111, 313, 0, 0, -0, 0, 0, 112, 0, 0, 113, 114, 115, 0, -0, 0, 116, 117, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 118, 119, 120, 121, 122, -123, 124, 0, 0, 0, 0, 0, 125, 126, 101, -102, 103, 104, 105, 106, 0, 107, 108, 109, 110, -111, 331, 0, 0, 0, 0, 0, 112, 0, 0, -113, 114, 115, 0, 0, 0, 116, 117, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 118, -119, 120, 121, 122, 123, 124, 0, 0, 0, 0, -0, 125, 126, 101, 102, 103, 104, 105, 106, 0, -107, 108, 109, 110, 111, 0, 0, 0, 373, 0, -0, 112, 0, 0, 113, 114, 115, 0, 0, 0, -116, 117, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 118, 119, 120, 121, 122, 123, 124, -0, 0, 0, 0, 0, 125, 126, 101, 102, 103, -104, 105, 106, 0, 107, 108, 109, 110, 111, 0, -0, 0, 374, 0, 0, 112, 0, 0, 113, 114, -115, 0, 0, 0, 116, 117, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 118, 119, 120, -121, 122, 123, 124, 0, 0, 0, 0, 0, 125, -126, 101, 102, 103, 104, 105, 106, 0, 107, 108, -109, 110, 111, 0, 0, 0, 381, 0, 0, 112, -0, 0, 113, 114, 115, 0, 0, 0, 116, 117, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 118, 119, 120, 121, 122, 123, 124, 0, 0, -0, 0, 0, 125, 126, 101, 102, 103, 104, 105, -106, 0, 107, 108, 109, 110, 111, 0, 0, 0, -386, 0, 0, 112, 0, 0, 113, 114, 115, 0, -0, 0, 116, 117, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 118, 119, 120, 121, 122, -123, 124, 0, 0, 0, 0, 0, 125, 126, 101, -102, 103, 104, 105, 106, 0, 107, 108, 109, 110, -111, 0, 0, 0, 388, 0, 0, 112, 0, 0, -113, 114, 115, 0, 0, 0, 116, 117, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 118, -119, 120, 121, 122, 123, 124, 0, 0, 0, 0, -0, 125, 126, 101, 102, 103, 104, 105, 106, 0, -107, 108, 109, 110, 111, 0, 0, 0, 0, 0, -0, 112, 0, 0, 113, 114, 115, 0, 0, 0, -116, 117, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 118, 119, 120, 121, 122, 123, 124, -0, 0, 0, 0, 0, 125, 126, 101, 102, 103, -104, 105, 106, 0, 107, 108, 109, 110, 111, 0, -0, 0, 0, 0, 0, 112, 0, 0, 113, 114, -115, 0, 0, 0, 116, 117, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 118, 119, 120, -121, 122, 123, 124, 101, 102, 103, 104, 105, 106, -126, 107, 108, 109, 110, 111, 0, 0, 0, 0, -0, 0, 112, 0, 0, 113, 114, 115, 0, 0, -0, 116, 117, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 118, 119, 120, 121, 122, 0, -124, 101, 102, 103, 104, 105, 106, 126, 107, 108, -109, 110, 111, 0, 0, 0, 0, 0, 0, 112, -0, 0, 113, 114, 115, 0, 0, 0, 116, 117, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 118, 119, 120, 121, 0, 0, 124, 101, 102, -103, 104, 105, 106, 126, 107, 0, 109, 110, 111, -0, 0, 0, 0, 0, 0, 112, 0, 0, 113, -114, 115, 0, 0, 0, 116, 117, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 118, 119, -120, 121, 0, 0, 124, 101, 102, 103, 104, 105, -106, 126, 107, 0, 109, 110, 111, 0, 0, 0, -0, 0, 0, 0, 0, 0, 113, 114, 115, 0, -0, 0, 116, 117, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 118, 119, 120, 121, 0, -0, 124, 101, 102, 103, 104, 105, 106, 126, 107, -0, 0, 110, 111, 0, 0, 0, 0, 0, 0, -0, 0, 0, 113, 114, 115, 0, 0, 0, 116, -117, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 118, 119, 120, 121, 0, 0, 124, 101, -102, 103, 104, 105, 106, 126, 107, 0, 0, 110, -111, 0, 0, 0, 0, 0, 0, 0, 0, 0, -113, 114, 115, 0, 0, 0, 116, 117, 101, 102, -103, 104, 0, 0, 0, 107, 0, 0, 110, 111, -127, 120, 121, 0, 0, 124, 0, 0, 0, 113, -114, 115, 126, 0, 0, 116, 117, 0, 79, 80, -263, 0, 0, 81, 82, 83, 84, 85, 86, 87, -88, 89, 90, 0, 124, 0, 0, 0, 79, 80, -0, 126, 0, 81, 82, 83, 84, 85, 86, 87, -88, 89, 90 +static const short yytable[] = { 47, + 34, 125, 283, 214, 199, 291, 227, 50, 47, 219, + 219, 234, 268, 76, 338, 57, 2, 355, 219, 219, + 342, 224, 245, 54, 327, 63, 91, 126, 67, 342, + 51, 77, 78, 70, 335, 258, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 61, 52, 3, 4, + 58, 220, 290, 55, 328, 89, 339, 329, 225, 356, + 364, 371, 92, 127, 360, 93, 94, 95, 96, 97, + 231, 314, 344, 249, 248, 18, 293, 105, 19, 59, + 21, 22, 321, 294, 24, 25, 26, 56, 27, 28, + 128, 68, 111, 112, 69, 131, 322, 323, 29, 359, + 71, 133, 3, 4, 222, 137, 30, 31, 260, 141, + 142, 372, 144, 145, 146, 256, 257, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 72, 159, + 176, 177, 47, 203, 73, 196, 74, 164, 165, 166, + 167, 168, 169, 75, 171, 172, 173, 174, 175, 354, + 98, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 190, -74, 129, 130, 366, 198, 198, 135, + 3, 4, 58, 138, 206, 139, 254, 140, 210, 143, + 162, 170, 191, 204, 194, 208, 331, 331, 2, 209, + 221, 232, 222, 228, 223, 230, 262, 18, 47, 47, + 19, 59, 21, 22, 349, 331, 24, 25, 26, 229, + 27, 28, 250, 246, 247, 264, 261, 331, 3, 4, + 29, 349, 265, 269, 60, 266, 280, 159, 30, 31, + 235, 236, 281, 284, 198, 285, 47, 321, 288, 289, + 307, 313, 237, 239, 292, 242, 243, 244, 295, 296, + 310, 322, 323, 330, 315, 251, 311, 252, 316, 337, + 255, 159, 159, 157, 259, 340, 341, 47, 271, 347, + 47, 47, 346, 47, 367, 348, 47, 47, 274, 276, + 351, 357, 361, 369, 374, 368, 379, 380, 350, 47, + 203, 287, 263, 325, 0, 0, 0, 0, 47, 297, + 47, 47, 298, 299, 159, 301, 0, 0, 305, 306, + 0, 0, 0, 0, 0, 304, 0, 0, 47, 309, + 0, 0, 3, 4, 58, 0, 0, 47, 203, 0, + 317, 0, 318, 319, 99, 100, 101, 102, 0, 0, + 0, 105, 47, 203, 108, 0, 0, 0, 0, 18, + 336, 0, 19, 59, 21, 22, 111, 112, 24, 25, + 26, 0, 27, 28, 0, 343, 0, 0, 0, 0, + 47, 203, 29, 238, 0, 352, 353, 157, 0, 0, + 30, 31, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 365, 157, 0, 0, 0, 2, 0, + 3, 4, 5, 0, 6, 0, 7, 373, 8, 9, + 10, 0, 376, 0, 0, 11, 12, 13, 0, 14, + 15, 0, 16, 0, 17, 0, 0, 18, 0, 0, + 19, 20, 21, 22, 0, 23, 24, 25, 26, 0, + 27, 28, 0, 0, 0, 0, 0, 3, 4, 5, + 29, 6, 0, 7, 0, 8, 9, 10, 30, 31, + 0, 358, 11, 12, 13, 0, 14, 15, 281, 16, + 0, 0, 0, 0, 18, 0, 0, 19, 20, 21, + 22, 0, 23, 24, 25, 26, 0, 27, 28, 0, + 0, 0, 3, 4, 5, 0, 6, 29, 7, 0, + 8, 9, 10, 0, 0, 30, 31, 11, 12, 13, + 0, 14, 15, 0, 16, 0, 0, 0, 0, 18, + 0, 0, 19, 20, 21, 22, 0, 23, 24, 25, + 26, 0, 27, 28, 0, 0, 0, 0, 0, 0, + 0, 0, 29, 0, 0, 0, 0, 64, 0, 0, + 30, 31, 3, 4, 5, 0, 6, 0, 7, 0, + 8, 9, 10, 0, 0, 0, 0, 11, 12, 13, + 0, 14, 15, 0, 16, 0, 0, 0, 0, 18, + 0, 0, 19, 20, 21, 22, 0, 23, 24, 25, + 26, 0, 27, 28, 0, 0, 0, 3, 4, 5, + 0, 6, 29, 7, 0, 8, 9, 10, 202, 0, + 30, 31, 11, 12, 13, 0, 14, 15, 0, 16, + 0, 0, 0, 0, 18, 0, 0, 19, 20, 21, + 22, 0, 23, 24, 25, 26, 0, 27, 28, 0, + 0, 0, 3, 4, 5, 0, 6, 29, 7, 0, + 8, 9, 10, 312, 0, 30, 31, 11, 12, 13, + 0, 14, 15, 0, 16, 0, 0, 0, 0, 18, + 0, 0, 19, 20, 21, 22, 0, 23, 24, 25, + 26, 0, 27, 28, 0, 0, 0, 3, 4, 5, + 0, 6, 29, 7, 0, 8, 9, 10, 345, 0, + 30, 31, 11, 12, 13, 0, 14, 15, 0, 16, + 0, 3, 4, 58, 18, 0, 0, 19, 20, 21, + 22, 0, 23, 24, 25, 26, 0, 27, 28, 0, + 0, 0, 0, 0, 0, 0, 0, 29, 18, 0, + 0, 19, 59, 21, 22, 30, 31, 24, 25, 26, + 0, 27, 28, 3, 4, 58, 0, 0, 101, 102, + 0, 29, 0, 105, 0, 136, 108, 0, 0, 30, + 31, 0, 0, 0, 0, 0, 0, 0, 111, 112, + 18, 0, 0, 19, 59, 21, 22, 0, 0, 24, + 25, 26, 0, 27, 28, 3, 4, 58, 0, 0, + 0, 0, 0, 29, 0, 0, 0, 0, 189, 0, + 0, 30, 31, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 18, 0, 0, 19, 59, 21, 22, 0, + 0, 24, 25, 26, 0, 27, 28, 3, 4, 58, + 0, 0, 0, 0, 0, 29, 0, 0, 0, 205, + 0, 0, 0, 30, 31, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 18, 0, 0, 19, 59, 21, + 22, 0, 0, 24, 25, 26, 0, 27, 28, 3, + 4, 58, 0, 0, 0, 0, 0, 29, 0, 0, + 0, 241, 0, 0, 0, 30, 31, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 18, 0, 0, 19, + 59, 21, 22, 0, 0, 24, 25, 26, 0, 27, + 28, 3, 4, 58, 0, 0, 0, 0, 0, 29, + 273, 0, 0, 0, 0, 0, 0, 30, 31, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, + 0, 19, 59, 21, 22, 0, 0, 24, 25, 26, + 0, 27, 28, 3, 4, 58, 0, 0, 0, 0, + 0, 29, 275, 0, 0, 0, 0, 0, 0, 30, + 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 18, 0, 0, 19, 59, 21, 22, 0, 0, 24, + 25, 26, 0, 27, 28, 3, 4, 58, 0, 0, + 0, 0, 0, 29, 303, 0, 0, 0, 0, 0, + 0, 30, 31, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 18, 0, 0, 19, 59, 21, 22, 0, + 0, 24, 25, 26, 0, 27, 28, 0, 0, 99, + 100, 101, 102, 103, 104, 29, 105, 106, 107, 108, + 0, 215, 216, 30, 31, 0, 0, 109, 0, 0, + 110, 111, 112, 0, 0, 0, 113, 114, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, + 116, 117, 118, 119, 120, 121, 0, 0, 0, 0, + 0, 122, 123, 99, 100, 101, 102, 103, 104, 0, + 105, 106, 107, 108, 0, 0, 217, 0, 218, 0, + 0, 109, 0, 0, 110, 111, 112, 0, 0, 0, + 113, 114, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 115, 116, 117, 118, 119, 120, 121, + 0, 0, 0, 0, 0, 122, 123, 99, 100, 101, + 102, 103, 104, 0, 105, 106, 107, 108, 0, 0, + 0, 0, 132, 0, 0, 109, 0, 0, 110, 111, + 112, 0, 0, 0, 113, 114, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 115, 116, 117, + 118, 119, 120, 121, 0, 0, 0, 0, 0, 122, + 123, 99, 100, 101, 102, 103, 104, 0, 105, 106, + 107, 108, 0, 163, 0, 0, 0, 0, 0, 109, + 0, 0, 110, 111, 112, 0, 0, 0, 113, 114, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 115, 116, 117, 118, 119, 120, 121, 0, 0, + 0, 0, 0, 122, 123, 99, 100, 101, 102, 103, + 104, 0, 105, 106, 107, 108, 0, 195, 0, 0, + 0, 0, 0, 109, 0, 0, 110, 111, 112, 0, + 0, 0, 113, 114, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 115, 116, 117, 118, 119, + 120, 121, 0, 0, 0, 0, 0, 122, 123, 99, + 100, 101, 102, 103, 104, 0, 105, 106, 107, 108, + 0, 200, 0, 0, 0, 0, 0, 109, 0, 0, + 110, 111, 112, 0, 0, 0, 113, 114, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, + 116, 117, 118, 119, 120, 121, 0, 0, 0, 0, + 0, 122, 123, 99, 100, 101, 102, 103, 104, 0, + 105, 106, 107, 108, 0, 201, 0, 0, 0, 0, + 0, 109, 0, 0, 110, 111, 112, 0, 0, 0, + 113, 114, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 115, 116, 117, 118, 119, 120, 121, + 0, 0, 0, 0, 0, 122, 123, 99, 100, 101, + 102, 103, 104, 0, 105, 106, 107, 108, 0, 0, + 0, 0, 207, 0, 0, 109, 0, 0, 110, 111, + 112, 0, 0, 0, 113, 114, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 115, 116, 117, + 118, 119, 120, 121, 0, 0, 0, 0, 0, 122, + 123, 99, 100, 101, 102, 103, 104, 0, 105, 106, + 107, 108, 0, 211, 0, 0, 0, 0, 0, 109, + 0, 0, 110, 111, 112, 0, 0, 0, 113, 114, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 115, 116, 117, 118, 119, 120, 121, 0, 0, + 0, 0, 0, 122, 123, 99, 100, 101, 102, 103, + 104, 0, 105, 106, 107, 108, 0, 212, 0, 0, + 0, 0, 0, 109, 0, 0, 110, 111, 112, 0, + 0, 0, 113, 114, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 115, 116, 117, 118, 119, + 120, 121, 0, 0, 0, 0, 0, 122, 123, 99, + 100, 101, 102, 103, 104, 0, 105, 106, 107, 108, + 0, 0, 0, 226, 0, 0, 0, 109, 0, 0, + 110, 111, 112, 0, 0, 0, 113, 114, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, + 116, 117, 118, 119, 120, 121, 0, 0, 0, 0, + 0, 122, 123, 99, 100, 101, 102, 103, 104, 0, + 105, 106, 107, 108, 0, 0, 0, 0, 240, 0, + 0, 109, 0, 0, 110, 111, 112, 0, 0, 0, + 113, 114, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 115, 116, 117, 118, 119, 120, 121, + 0, 0, 0, 0, 0, 122, 123, 99, 100, 101, + 102, 103, 104, 0, 105, 106, 107, 108, 0, 0, + 0, 232, 0, 0, 0, 109, 0, 0, 110, 111, + 112, 0, 0, 0, 113, 114, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 115, 116, 117, + 118, 119, 120, 121, 0, 0, 0, 0, 0, 122, + 123, 99, 100, 101, 102, 103, 104, 0, 105, 106, + 107, 108, 0, 270, 0, 0, 0, 0, 0, 109, + 0, 0, 110, 111, 112, 0, 0, 0, 113, 114, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 115, 116, 117, 118, 119, 120, 121, 0, 0, + 0, 0, 0, 122, 123, 99, 100, 101, 102, 103, + 104, 0, 105, 106, 107, 108, 0, 272, 0, 0, + 0, 0, 0, 109, 0, 0, 110, 111, 112, 0, + 0, 0, 113, 114, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 115, 116, 117, 118, 119, + 120, 121, 0, 0, 0, 0, 0, 122, 123, 99, + 100, 101, 102, 103, 104, 0, 105, 106, 107, 108, + 0, 0, 0, 0, 277, 0, 0, 109, 0, 0, + 110, 111, 112, 0, 0, 0, 113, 114, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, + 116, 117, 118, 119, 120, 121, 0, 0, 0, 0, + 0, 122, 123, 99, 100, 101, 102, 103, 104, 0, + 105, 106, 107, 108, 0, 278, 0, 0, 0, 0, + 0, 109, 0, 0, 110, 111, 112, 0, 0, 0, + 113, 114, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 115, 116, 117, 118, 119, 120, 121, + 0, 0, 0, 0, 0, 122, 123, 99, 100, 101, + 102, 103, 104, 0, 105, 106, 107, 108, 0, 279, + 0, 0, 0, 0, 0, 109, 0, 0, 110, 111, + 112, 0, 0, 0, 113, 114, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 115, 116, 117, + 118, 119, 120, 121, 0, 0, 0, 0, 0, 122, + 123, 99, 100, 101, 102, 103, 104, 0, 105, 106, + 107, 108, 0, 0, 0, 0, 286, 0, 0, 109, + 0, 0, 110, 111, 112, 0, 0, 0, 113, 114, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 115, 116, 117, 118, 119, 120, 121, 0, 0, + 0, 0, 0, 122, 123, 99, 100, 101, 102, 103, + 104, 0, 105, 106, 107, 108, 0, 300, 0, 0, + 0, 0, 0, 109, 0, 0, 110, 111, 112, 0, + 0, 0, 113, 114, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 115, 116, 117, 118, 119, + 120, 121, 0, 0, 0, 0, 0, 122, 123, 99, + 100, 101, 102, 103, 104, 0, 105, 106, 107, 108, + 0, 302, 0, 0, 0, 0, 0, 109, 0, 0, + 110, 111, 112, 0, 0, 0, 113, 114, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, + 116, 117, 118, 119, 120, 121, 0, 0, 0, 0, + 0, 122, 123, 99, 100, 101, 102, 103, 104, 0, + 105, 106, 107, 108, 0, 320, 0, 0, 0, 0, + 0, 109, 0, 0, 110, 111, 112, 0, 0, 0, + 113, 114, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 115, 116, 117, 118, 119, 120, 121, + 0, 0, 0, 0, 0, 122, 123, 99, 100, 101, + 102, 103, 104, 0, 105, 106, 107, 108, 0, 0, + 0, 0, 362, 0, 0, 109, 0, 0, 110, 111, + 112, 0, 0, 0, 113, 114, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 115, 116, 117, + 118, 119, 120, 121, 0, 0, 0, 0, 0, 122, + 123, 99, 100, 101, 102, 103, 104, 0, 105, 106, + 107, 108, 0, 0, 0, 0, 363, 0, 0, 109, + 0, 0, 110, 111, 112, 0, 0, 0, 113, 114, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 115, 116, 117, 118, 119, 120, 121, 0, 0, + 0, 0, 0, 122, 123, 99, 100, 101, 102, 103, + 104, 0, 105, 106, 107, 108, 0, 0, 0, 0, + 370, 0, 0, 109, 0, 0, 110, 111, 112, 0, + 0, 0, 113, 114, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 115, 116, 117, 118, 119, + 120, 121, 0, 0, 0, 0, 0, 122, 123, 99, + 100, 101, 102, 103, 104, 0, 105, 106, 107, 108, + 0, 0, 0, 0, 375, 0, 0, 109, 0, 0, + 110, 111, 112, 0, 0, 0, 113, 114, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, + 116, 117, 118, 119, 120, 121, 0, 0, 0, 0, + 0, 122, 123, 99, 100, 101, 102, 103, 104, 0, + 105, 106, 107, 108, 0, 0, 0, 0, 377, 0, + 0, 109, 0, 0, 110, 111, 112, 0, 0, 0, + 113, 114, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 115, 116, 117, 118, 119, 120, 121, + 0, 0, 0, 0, 0, 122, 123, 99, 100, 101, + 102, 103, 104, 0, 105, 106, 107, 108, 0, 0, + 0, 0, 0, 0, 0, 109, 0, 0, 110, 111, + 112, 0, 0, 0, 113, 114, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 115, 116, 117, + 118, 119, 120, 121, 0, 0, 0, 0, 0, 122, + 123, 99, 100, 101, 102, 103, 104, 0, 105, 106, + 107, 108, 0, 0, 0, 0, 0, 0, 0, 109, + 0, 0, 110, 111, 112, 0, 0, 0, 113, 114, + 99, 100, 101, 102, 103, 104, 0, 105, 106, 107, + 108, 115, 116, 117, 118, 119, 120, 121, 109, 0, + 0, 110, 111, 112, 123, 0, 0, 113, 114, 99, + 100, 101, 102, 103, 104, 0, 105, 106, 107, 108, + 115, 116, 117, 118, 119, 0, 121, 109, 0, 0, + 110, 111, 112, 123, 0, 0, 113, 114, 99, 100, + 101, 102, 103, 104, 0, 105, 0, 107, 108, 115, + 116, 117, 118, 0, 0, 121, 109, 0, 0, 110, + 111, 112, 123, 0, 0, 113, 114, 99, 100, 101, + 102, 103, 104, 0, 105, 0, 107, 108, 115, 116, + 117, 118, 0, 0, 121, 0, 0, 0, 110, 111, + 112, 123, 0, 0, 113, 114, 99, 100, 101, 102, + 103, 104, 0, 105, 0, 0, 108, 115, 116, 117, + 118, 0, 0, 121, 0, 0, 0, 110, 111, 112, + 123, 0, 0, 113, 114, 99, 100, 101, 102, 103, + 104, 0, 105, 0, 0, 108, 115, 116, 117, 118, + 0, 0, 121, 0, 0, 0, 110, 111, 112, 123, + 0, 0, 113, 114, 99, 100, 101, 102, 0, 0, + 0, 105, 0, 0, 108, 124, 0, 117, 118, 0, + 0, 121, 0, 0, 0, 110, 111, 112, 123, 0, + 0, 113, 114, 77, 78, 253, 0, 0, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 0, 0, + 121, 0, 0, 77, 78, 0, 0, 123, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 99, 100, + 101, 102, 0, 0, 0, 105, 0, 0, 108, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 111, 112, 0, 0, 0, 113, 114 }; -static const short yycheck[] = { 1, -1, 45, 239, 233, 207, 208, 111, 4, 10, 257, -129, 196, 244, 206, 55, 3, 149, 14, 57, 326, -327, 59, 136, 3, 217, 5, 6, 7, 57, 50, -38, 55, 50, 59, 271, 57, 55, 344, 345, 28, -336, 55, 55, 5, 6, 248, 38, 55, 57, 345, -357, 92, 32, 59, 361, 35, 36, 37, 38, 55, -99, 41, 42, 43, 327, 45, 46, 91, 55, 58, -99, 92, 304, 61, 92, 55, 279, 99, 91, 282, -283, 274, 285, 63, 64, 288, 289, 324, 221, 203, -99, 276, 38, 59, 357, 55, 5, 6, 37, 24, -57, 55, 339, 55, 61, 55, 50, 355, 311, 55, -313, 314, 92, 38, 39, 24, 14, 114, 115, 238, -350, 55, 55, 55, 37, 37, 231, 232, 331, 38, -39, 55, 60, 38, 38, 38, 56, 367, 140, 140, -3, 378, 5, 6, 7, 23, 9, 57, 11, 55, -13, 14, 15, 23, 3, 56, 19, 20, 21, 22, -57, 24, 25, 26, 27, 55, 60, 56, 56, 32, -55, 37, 35, 36, 37, 38, 58, 40, 41, 42, -43, 60, 45, 46, 228, 60, 44, 45, 46, 47, -46, 47, 55, 51, 38, 51, 54, 55, 54, 55, -63, 64, 41, 60, 99, 207, 208, 38, 66, 67, -66, 67, 57, 71, 72, 3, 8, 5, 6, 7, -56, 9, 26, 11, 59, 13, 14, 15, 56, 56, -56, 56, 20, 21, 22, 56, 24, 25, 56, 27, -60, 29, 61, 60, 32, 61, 248, 35, 36, 37, -38, 60, 40, 41, 42, 43, 56, 45, 46, 60, -50, 38, 61, 60, 59, 61, 50, 55, 61, 51, -59, 273, 273, 55, 59, 63, 64, 279, 58, 50, -282, 283, 61, 285, 66, 67, 288, 289, 0, 0, -345, 318, -1, -1, -1, 8, -1, -1, -1, 301, -301, -1, -1, -1, -1, -1, -1, -1, -1, 311, --1, 313, 314, -1, 27, 28, 29, 30, 31, -1, -44, 45, 46, 47, -1, -1, -1, 51, -1, 331, -54, 55, -1, -1, -1, -1, -1, -1, 340, 340, -53, -1, 66, 67, -1, 58, -1, -1, -1, -1, --1, -1, 65, 355, 355, -1, 69, -1, -1, -1, -73, 74, -1, 76, 77, 78, -1, -1, 81, 82, -83, 84, 85, 86, 87, 88, 89, 90, 91, -1, -93, 383, 383, -1, -1, -1, -1, -1, 101, 102, -103, 104, 105, 106, -1, 108, 109, 110, 111, 112, -113, -1, -1, 116, 117, 118, 119, 120, 121, 122, -123, 124, 125, 126, 127, -1, -1, -1, -1, -1, --1, -1, 135, 136, 3, -1, 5, 6, 7, 142, -9, -1, 11, 146, 13, 14, 15, -1, -1, -1, --1, 20, 21, 22, -1, 24, 25, -1, 27, -1, --1, -1, -1, 32, -1, -1, 35, 36, 37, 38, --1, 40, 41, 42, 43, -1, 45, 46, -1, -1, --1, -1, -1, -1, -1, -1, 55, -1, -1, -1, --1, 60, -1, 196, 63, 64, -1, -1, -1, -1, -203, -1, 3, -1, 5, 6, 7, -1, 211, 212, --1, 214, 215, 216, -1, -1, -1, -1, -1, -1, --1, -1, 225, -1, 227, -1, -1, 230, 231, 232, -233, 32, 235, -1, 35, 36, 37, 38, -1, -1, -41, 42, 43, -1, 45, 46, -1, 250, 251, -1, --1, -1, -1, -1, 55, -1, -1, -1, 59, -1, -263, -1, 63, 64, -1, -1, -1, -1, 3, -1, -5, 6, 7, 276, 9, -1, 11, -1, 13, 14, -15, -1, -1, -1, 287, 20, 21, 22, 291, 24, -25, -1, 27, -1, -1, -1, -1, 32, -1, -1, -35, 36, 37, 38, -1, 40, 41, 42, 43, -1, -45, 46, -1, -1, -1, -1, -1, -1, -1, -1, -55, -1, -1, -1, -1, 50, 61, -1, 63, 64, --1, -1, -1, -1, -1, 338, -1, -1, -1, -1, --1, -1, -1, 68, 69, 348, 349, 350, 73, 74, -75, 76, 77, 78, 79, 80, 81, 82, -1, -1, --1, -1, -1, 366, 367, -1, -1, 92, 3, -1, -5, 6, 7, -1, 9, -1, 11, 380, 13, 14, -15, -1, 385, -1, -1, 20, 21, 22, -1, 24, -25, -1, 27, -1, -1, -1, -1, 32, -1, -1, -35, 36, 37, 38, -1, 40, 41, 42, 43, -1, -45, 46, -1, 3, -1, 5, 6, 7, -1, 9, -55, 11, -1, 13, 14, 15, 61, -1, 63, 64, -20, 21, 22, -1, 24, 25, -1, 27, -1, -1, --1, -1, 32, -1, -1, 35, 36, 37, 38, -1, -40, 41, 42, 43, -1, 45, 46, -1, 3, -1, -5, 6, 7, -1, 9, 55, 11, -1, 13, 14, -15, 61, -1, 63, 64, 20, 21, 22, -1, 24, -25, -1, 27, -1, -1, -1, -1, 32, -1, -1, -35, 36, 37, 38, -1, 40, 41, 42, 43, -1, -45, 46, -1, 3, -1, 5, 6, 7, -1, 9, -55, 11, -1, 13, 14, 15, 61, -1, 63, 64, -20, 21, 22, -1, 24, 25, -1, 27, -1, -1, --1, -1, 32, -1, -1, 35, 36, 37, 38, -1, -40, 41, 42, 43, -1, 45, 46, 3, -1, 5, -6, 7, -1, -1, -1, 55, -1, -1, -1, -1, --1, -1, -1, 63, 64, -1, -1, -1, -1, -1, --1, -1, -1, -1, -1, -1, 32, -1, -1, 35, -36, 37, 38, -1, -1, 41, 42, 43, -1, 45, -46, 3, -1, 5, 6, 7, -1, -1, -1, 55, --1, -1, -1, 59, -1, -1, -1, 63, 64, -1, --1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -32, -1, -1, 35, 36, 37, 38, -1, -1, 41, -42, 43, -1, 45, 46, 3, -1, 5, 6, 7, --1, -1, -1, 55, -1, -1, -1, -1, 60, -1, --1, 63, 64, -1, -1, -1, -1, -1, -1, -1, --1, -1, -1, -1, 32, -1, -1, 35, 36, 37, -38, -1, -1, 41, 42, 43, -1, 45, 46, 3, --1, 5, 6, 7, -1, -1, -1, 55, -1, -1, --1, 59, -1, -1, -1, 63, 64, -1, -1, -1, --1, -1, -1, -1, -1, -1, -1, -1, 32, -1, --1, 35, 36, 37, 38, -1, -1, 41, 42, 43, --1, 45, 46, 3, -1, 5, 6, 7, -1, -1, --1, 55, 56, -1, -1, -1, -1, -1, -1, 63, -64, -1, -1, -1, -1, -1, -1, -1, -1, -1, --1, -1, 32, -1, -1, 35, 36, 37, 38, -1, --1, 41, 42, 43, -1, 45, 46, 3, -1, 5, -6, 7, -1, -1, -1, 55, -1, -1, -1, 59, --1, -1, -1, 63, 64, -1, -1, -1, -1, -1, --1, -1, -1, -1, -1, -1, 32, -1, -1, 35, -36, 37, 38, -1, -1, 41, 42, 43, -1, 45, -46, 3, -1, 5, 6, 7, -1, -1, -1, 55, -56, -1, -1, -1, -1, -1, -1, 63, 64, -1, --1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -32, -1, -1, 35, 36, 37, 38, -1, -1, 41, -42, 43, -1, 45, 46, 3, -1, 5, 6, 7, --1, -1, -1, 55, 56, -1, -1, -1, -1, -1, --1, 63, 64, -1, -1, -1, -1, -1, -1, -1, --1, -1, -1, -1, 32, -1, -1, 35, 36, 37, -38, -1, -1, 41, 42, 43, -1, 45, 46, 3, --1, 5, 6, 7, -1, -1, -1, 55, 56, -1, --1, -1, -1, -1, -1, 63, 64, -1, -1, -1, --1, -1, -1, -1, -1, -1, -1, -1, 32, -1, --1, 35, 36, 37, 38, -1, -1, 41, 42, 43, --1, 45, 46, -1, -1, 44, 45, 46, 47, 48, -49, 55, 51, 52, 53, 54, 55, 56, 57, 63, -64, -1, -1, 62, -1, -1, 65, 66, 67, -1, --1, -1, 71, 72, -1, -1, -1, -1, -1, -1, --1, -1, -1, -1, -1, 84, 85, 86, 87, 88, -89, 90, -1, -1, -1, -1, -1, 96, 97, 44, -45, 46, 47, 48, 49, -1, 51, 52, 53, 54, -55, -1, 57, -1, 59, -1, -1, 62, -1, -1, -65, 66, 67, -1, -1, -1, 71, 72, -1, -1, --1, -1, -1, -1, -1, -1, -1, -1, -1, 84, -85, 86, 87, 88, 89, 90, -1, -1, -1, -1, --1, 96, 97, 44, 45, 46, 47, 48, 49, -1, -51, 52, 53, 54, 55, -1, -1, -1, 59, -1, --1, 62, -1, -1, 65, 66, 67, -1, -1, -1, -71, 72, -1, -1, -1, -1, -1, -1, -1, -1, --1, -1, -1, 84, 85, 86, 87, 88, 89, 90, --1, -1, -1, -1, -1, 96, 97, 44, 45, 46, -47, 48, 49, -1, 51, 52, 53, 54, 55, 56, --1, -1, -1, -1, -1, 62, -1, -1, 65, 66, -67, -1, -1, -1, 71, 72, -1, -1, -1, -1, --1, -1, -1, -1, -1, -1, -1, 84, 85, 86, -87, 88, 89, 90, -1, -1, -1, -1, -1, 96, -97, 44, 45, 46, 47, 48, 49, -1, 51, 52, -53, 54, 55, 56, -1, -1, -1, -1, -1, 62, --1, -1, 65, 66, 67, -1, -1, -1, 71, 72, --1, -1, -1, -1, -1, -1, -1, -1, -1, -1, --1, 84, 85, 86, 87, 88, 89, 90, -1, -1, --1, -1, -1, 96, 97, 44, 45, 46, 47, 48, -49, -1, 51, 52, 53, 54, 55, 56, -1, -1, --1, -1, -1, 62, -1, -1, 65, 66, 67, -1, --1, -1, 71, 72, -1, -1, -1, -1, -1, -1, --1, -1, -1, -1, -1, 84, 85, 86, 87, 88, -89, 90, -1, -1, -1, -1, -1, 96, 97, 44, -45, 46, 47, 48, 49, -1, 51, 52, 53, 54, -55, 56, -1, -1, -1, -1, -1, 62, -1, -1, -65, 66, 67, -1, -1, -1, 71, 72, -1, -1, --1, -1, -1, -1, -1, -1, -1, -1, -1, 84, -85, 86, 87, 88, 89, 90, -1, -1, -1, -1, --1, 96, 97, 44, 45, 46, 47, 48, 49, -1, -51, 52, 53, 54, 55, -1, -1, -1, 59, -1, --1, 62, -1, -1, 65, 66, 67, -1, -1, -1, -71, 72, -1, -1, -1, -1, -1, -1, -1, -1, --1, -1, -1, 84, 85, 86, 87, 88, 89, 90, --1, -1, -1, -1, -1, 96, 97, 44, 45, 46, -47, 48, 49, -1, 51, 52, 53, 54, 55, 56, --1, -1, -1, -1, -1, 62, -1, -1, 65, 66, -67, -1, -1, -1, 71, 72, -1, -1, -1, -1, --1, -1, -1, -1, -1, -1, -1, 84, 85, 86, -87, 88, 89, 90, -1, -1, -1, -1, -1, 96, -97, 44, 45, 46, 47, 48, 49, -1, 51, 52, -53, 54, 55, 56, -1, -1, -1, -1, -1, 62, --1, -1, 65, 66, 67, -1, -1, -1, 71, 72, --1, -1, -1, -1, -1, -1, -1, -1, -1, -1, --1, 84, 85, 86, 87, 88, 89, 90, -1, -1, --1, -1, -1, 96, 97, 44, 45, 46, 47, 48, -49, -1, 51, 52, 53, 54, 55, -1, -1, 58, --1, -1, -1, 62, -1, -1, 65, 66, 67, -1, --1, -1, 71, 72, -1, -1, -1, -1, -1, -1, --1, -1, -1, -1, -1, 84, 85, 86, 87, 88, -89, 90, -1, -1, -1, -1, -1, 96, 97, 44, -45, 46, 47, 48, 49, -1, 51, 52, 53, 54, -55, -1, -1, -1, 59, -1, -1, 62, -1, -1, -65, 66, 67, -1, -1, -1, 71, 72, -1, -1, --1, -1, -1, -1, -1, -1, -1, -1, -1, 84, -85, 86, 87, 88, 89, 90, -1, -1, -1, -1, --1, 96, 97, 44, 45, 46, 47, 48, 49, -1, -51, 52, 53, 54, 55, -1, -1, 58, -1, -1, --1, 62, -1, -1, 65, 66, 67, -1, -1, -1, -71, 72, -1, -1, -1, -1, -1, -1, -1, -1, --1, -1, -1, 84, 85, 86, 87, 88, 89, 90, --1, -1, -1, -1, -1, 96, 97, 44, 45, 46, -47, 48, 49, -1, 51, 52, 53, 54, 55, 56, --1, -1, -1, -1, -1, 62, -1, -1, 65, 66, -67, -1, -1, -1, 71, 72, -1, -1, -1, -1, --1, -1, -1, -1, -1, -1, -1, 84, 85, 86, -87, 88, 89, 90, -1, -1, -1, -1, -1, 96, -97, 44, 45, 46, 47, 48, 49, -1, 51, 52, -53, 54, 55, 56, -1, -1, -1, -1, -1, 62, --1, -1, 65, 66, 67, -1, -1, -1, 71, 72, --1, -1, -1, -1, -1, -1, -1, -1, -1, -1, --1, 84, 85, 86, 87, 88, 89, 90, -1, -1, --1, -1, -1, 96, 97, 44, 45, 46, 47, 48, -49, -1, 51, 52, 53, 54, 55, -1, -1, -1, -59, -1, -1, 62, -1, -1, 65, 66, 67, -1, --1, -1, 71, 72, -1, -1, -1, -1, -1, -1, --1, -1, -1, -1, -1, 84, 85, 86, 87, 88, -89, 90, -1, -1, -1, -1, -1, 96, 97, 44, -45, 46, 47, 48, 49, -1, 51, 52, 53, 54, -55, 56, -1, -1, -1, -1, -1, 62, -1, -1, -65, 66, 67, -1, -1, -1, 71, 72, -1, -1, --1, -1, -1, -1, -1, -1, -1, -1, -1, 84, -85, 86, 87, 88, 89, 90, -1, -1, -1, -1, --1, 96, 97, 44, 45, 46, 47, 48, 49, -1, -51, 52, 53, 54, 55, 56, -1, -1, -1, -1, --1, 62, -1, -1, 65, 66, 67, -1, -1, -1, -71, 72, -1, -1, -1, -1, -1, -1, -1, -1, --1, -1, -1, 84, 85, 86, 87, 88, 89, 90, --1, -1, -1, -1, -1, 96, 97, 44, 45, 46, -47, 48, 49, -1, 51, 52, 53, 54, 55, -1, --1, -1, 59, -1, -1, 62, -1, -1, 65, 66, -67, -1, -1, -1, 71, 72, -1, -1, -1, -1, --1, -1, -1, -1, -1, -1, -1, 84, 85, 86, -87, 88, 89, 90, -1, -1, -1, -1, -1, 96, -97, 44, 45, 46, 47, 48, 49, -1, 51, 52, -53, 54, 55, 56, -1, -1, -1, -1, -1, 62, --1, -1, 65, 66, 67, -1, -1, -1, 71, 72, --1, -1, -1, -1, -1, -1, -1, -1, -1, -1, --1, 84, 85, 86, 87, 88, 89, 90, -1, -1, --1, -1, -1, 96, 97, 44, 45, 46, 47, 48, -49, -1, 51, 52, 53, 54, 55, 56, -1, -1, --1, -1, -1, 62, -1, -1, 65, 66, 67, -1, --1, -1, 71, 72, -1, -1, -1, -1, -1, -1, --1, -1, -1, -1, -1, 84, 85, 86, 87, 88, -89, 90, -1, -1, -1, -1, -1, 96, 97, 44, -45, 46, 47, 48, 49, -1, 51, 52, 53, 54, -55, 56, -1, -1, -1, -1, -1, 62, -1, -1, -65, 66, 67, -1, -1, -1, 71, 72, -1, -1, --1, -1, -1, -1, -1, -1, -1, -1, -1, 84, -85, 86, 87, 88, 89, 90, -1, -1, -1, -1, --1, 96, 97, 44, 45, 46, 47, 48, 49, -1, -51, 52, 53, 54, 55, -1, -1, -1, 59, -1, --1, 62, -1, -1, 65, 66, 67, -1, -1, -1, -71, 72, -1, -1, -1, -1, -1, -1, -1, -1, --1, -1, -1, 84, 85, 86, 87, 88, 89, 90, --1, -1, -1, -1, -1, 96, 97, 44, 45, 46, -47, 48, 49, -1, 51, 52, 53, 54, 55, -1, --1, -1, 59, -1, -1, 62, -1, -1, 65, 66, -67, -1, -1, -1, 71, 72, -1, -1, -1, -1, --1, -1, -1, -1, -1, -1, -1, 84, 85, 86, -87, 88, 89, 90, -1, -1, -1, -1, -1, 96, -97, 44, 45, 46, 47, 48, 49, -1, 51, 52, -53, 54, 55, -1, -1, -1, 59, -1, -1, 62, --1, -1, 65, 66, 67, -1, -1, -1, 71, 72, --1, -1, -1, -1, -1, -1, -1, -1, -1, -1, --1, 84, 85, 86, 87, 88, 89, 90, -1, -1, --1, -1, -1, 96, 97, 44, 45, 46, 47, 48, -49, -1, 51, 52, 53, 54, 55, -1, -1, -1, -59, -1, -1, 62, -1, -1, 65, 66, 67, -1, --1, -1, 71, 72, -1, -1, -1, -1, -1, -1, --1, -1, -1, -1, -1, 84, 85, 86, 87, 88, -89, 90, -1, -1, -1, -1, -1, 96, 97, 44, -45, 46, 47, 48, 49, -1, 51, 52, 53, 54, -55, -1, -1, -1, 59, -1, -1, 62, -1, -1, -65, 66, 67, -1, -1, -1, 71, 72, -1, -1, --1, -1, -1, -1, -1, -1, -1, -1, -1, 84, -85, 86, 87, 88, 89, 90, -1, -1, -1, -1, --1, 96, 97, 44, 45, 46, 47, 48, 49, -1, -51, 52, 53, 54, 55, -1, -1, -1, -1, -1, --1, 62, -1, -1, 65, 66, 67, -1, -1, -1, -71, 72, -1, -1, -1, -1, -1, -1, -1, -1, --1, -1, -1, 84, 85, 86, 87, 88, 89, 90, --1, -1, -1, -1, -1, 96, 97, 44, 45, 46, -47, 48, 49, -1, 51, 52, 53, 54, 55, -1, --1, -1, -1, -1, -1, 62, -1, -1, 65, 66, -67, -1, -1, -1, 71, 72, -1, -1, -1, -1, --1, -1, -1, -1, -1, -1, -1, 84, 85, 86, -87, 88, 89, 90, 44, 45, 46, 47, 48, 49, -97, 51, 52, 53, 54, 55, -1, -1, -1, -1, --1, -1, 62, -1, -1, 65, 66, 67, -1, -1, --1, 71, 72, -1, -1, -1, -1, -1, -1, -1, --1, -1, -1, -1, 84, 85, 86, 87, 88, -1, -90, 44, 45, 46, 47, 48, 49, 97, 51, 52, -53, 54, 55, -1, -1, -1, -1, -1, -1, 62, --1, -1, 65, 66, 67, -1, -1, -1, 71, 72, --1, -1, -1, -1, -1, -1, -1, -1, -1, -1, --1, 84, 85, 86, 87, -1, -1, 90, 44, 45, -46, 47, 48, 49, 97, 51, -1, 53, 54, 55, --1, -1, -1, -1, -1, -1, 62, -1, -1, 65, -66, 67, -1, -1, -1, 71, 72, -1, -1, -1, --1, -1, -1, -1, -1, -1, -1, -1, 84, 85, -86, 87, -1, -1, 90, 44, 45, 46, 47, 48, -49, 97, 51, -1, 53, 54, 55, -1, -1, -1, --1, -1, -1, -1, -1, -1, 65, 66, 67, -1, --1, -1, 71, 72, -1, -1, -1, -1, -1, -1, --1, -1, -1, -1, -1, 84, 85, 86, 87, -1, --1, 90, 44, 45, 46, 47, 48, 49, 97, 51, --1, -1, 54, 55, -1, -1, -1, -1, -1, -1, --1, -1, -1, 65, 66, 67, -1, -1, -1, 71, -72, -1, -1, -1, -1, -1, -1, -1, -1, -1, --1, -1, 84, 85, 86, 87, -1, -1, 90, 44, -45, 46, 47, 48, 49, 97, 51, -1, -1, 54, -55, -1, -1, -1, -1, -1, -1, -1, -1, -1, -65, 66, 67, -1, -1, -1, 71, 72, 44, 45, -46, 47, -1, -1, -1, 51, -1, -1, 54, 55, -50, 86, 87, -1, -1, 90, -1, -1, -1, 65, -66, 67, 97, -1, -1, 71, 72, -1, 68, 69, -50, -1, -1, 73, 74, 75, 76, 77, 78, 79, -80, 81, 82, -1, 90, -1, -1, -1, 68, 69, --1, 97, -1, 73, 74, 75, 76, 77, 78, 79, -80, 81, 82 +static const short yycheck[] = { 1, + 1, 45, 247, 143, 130, 261, 189, 38, 10, 57, + 57, 199, 234, 50, 50, 55, 3, 50, 57, 57, + 325, 55, 210, 4, 28, 55, 55, 55, 55, 334, + 38, 68, 69, 14, 316, 225, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 8, 55, 5, 6, + 7, 99, 99, 59, 58, 92, 92, 313, 92, 92, + 99, 99, 91, 91, 346, 27, 28, 29, 30, 31, + 196, 293, 328, 213, 61, 32, 264, 51, 35, 36, + 37, 38, 24, 266, 41, 42, 43, 59, 45, 46, + 52, 55, 66, 67, 55, 57, 38, 39, 55, 344, + 55, 63, 5, 6, 57, 67, 63, 64, 61, 71, + 72, 367, 74, 75, 76, 223, 224, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 55, 91, + 111, 112, 134, 134, 38, 92, 55, 99, 100, 101, + 102, 103, 104, 50, 106, 107, 108, 109, 110, 339, + 59, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 59, 55, 55, 356, 129, 130, 14, + 5, 6, 7, 37, 136, 37, 220, 55, 140, 60, + 38, 38, 37, 55, 38, 23, 315, 316, 3, 23, + 56, 58, 57, 56, 55, 55, 37, 32, 200, 201, + 35, 36, 37, 38, 333, 334, 41, 42, 43, 57, + 45, 46, 41, 60, 60, 99, 60, 346, 5, 6, + 55, 350, 38, 8, 59, 57, 56, 189, 63, 64, + 200, 201, 26, 59, 196, 56, 238, 24, 56, 56, + 60, 60, 204, 205, 56, 207, 208, 209, 56, 56, + 61, 38, 39, 56, 60, 217, 61, 219, 60, 50, + 222, 223, 224, 225, 226, 38, 61, 269, 238, 59, + 272, 273, 60, 275, 58, 61, 278, 279, 240, 241, + 61, 59, 59, 50, 50, 61, 0, 0, 334, 291, + 291, 253, 230, 307, -1, -1, -1, -1, 300, 269, + 302, 303, 272, 273, 266, 275, -1, -1, 278, 279, + -1, -1, -1, -1, -1, 277, -1, -1, 320, 281, + -1, -1, 5, 6, 7, -1, -1, 329, 329, -1, + 300, -1, 302, 303, 44, 45, 46, 47, -1, -1, + -1, 51, 344, 344, 54, -1, -1, -1, -1, 32, + 320, -1, 35, 36, 37, 38, 66, 67, 41, 42, + 43, -1, 45, 46, -1, 327, -1, -1, -1, -1, + 372, 372, 55, 56, -1, 337, 338, 339, -1, -1, + 63, 64, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 355, 356, -1, -1, -1, 3, -1, + 5, 6, 7, -1, 9, -1, 11, 369, 13, 14, + 15, -1, 374, -1, -1, 20, 21, 22, -1, 24, + 25, -1, 27, -1, 29, -1, -1, 32, -1, -1, + 35, 36, 37, 38, -1, 40, 41, 42, 43, -1, + 45, 46, -1, -1, -1, -1, -1, 5, 6, 7, + 55, 9, -1, 11, -1, 13, 14, 15, 63, 64, + -1, 19, 20, 21, 22, -1, 24, 25, 26, 27, + -1, -1, -1, -1, 32, -1, -1, 35, 36, 37, + 38, -1, 40, 41, 42, 43, -1, 45, 46, -1, + -1, -1, 5, 6, 7, -1, 9, 55, 11, -1, + 13, 14, 15, -1, -1, 63, 64, 20, 21, 22, + -1, 24, 25, -1, 27, -1, -1, -1, -1, 32, + -1, -1, 35, 36, 37, 38, -1, 40, 41, 42, + 43, -1, 45, 46, -1, -1, -1, -1, -1, -1, + -1, -1, 55, -1, -1, -1, -1, 60, -1, -1, + 63, 64, 5, 6, 7, -1, 9, -1, 11, -1, + 13, 14, 15, -1, -1, -1, -1, 20, 21, 22, + -1, 24, 25, -1, 27, -1, -1, -1, -1, 32, + -1, -1, 35, 36, 37, 38, -1, 40, 41, 42, + 43, -1, 45, 46, -1, -1, -1, 5, 6, 7, + -1, 9, 55, 11, -1, 13, 14, 15, 61, -1, + 63, 64, 20, 21, 22, -1, 24, 25, -1, 27, + -1, -1, -1, -1, 32, -1, -1, 35, 36, 37, + 38, -1, 40, 41, 42, 43, -1, 45, 46, -1, + -1, -1, 5, 6, 7, -1, 9, 55, 11, -1, + 13, 14, 15, 61, -1, 63, 64, 20, 21, 22, + -1, 24, 25, -1, 27, -1, -1, -1, -1, 32, + -1, -1, 35, 36, 37, 38, -1, 40, 41, 42, + 43, -1, 45, 46, -1, -1, -1, 5, 6, 7, + -1, 9, 55, 11, -1, 13, 14, 15, 61, -1, + 63, 64, 20, 21, 22, -1, 24, 25, -1, 27, + -1, 5, 6, 7, 32, -1, -1, 35, 36, 37, + 38, -1, 40, 41, 42, 43, -1, 45, 46, -1, + -1, -1, -1, -1, -1, -1, -1, 55, 32, -1, + -1, 35, 36, 37, 38, 63, 64, 41, 42, 43, + -1, 45, 46, 5, 6, 7, -1, -1, 46, 47, + -1, 55, -1, 51, -1, 59, 54, -1, -1, 63, + 64, -1, -1, -1, -1, -1, -1, -1, 66, 67, + 32, -1, -1, 35, 36, 37, 38, -1, -1, 41, + 42, 43, -1, 45, 46, 5, 6, 7, -1, -1, + -1, -1, -1, 55, -1, -1, -1, -1, 60, -1, + -1, 63, 64, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 32, -1, -1, 35, 36, 37, 38, -1, + -1, 41, 42, 43, -1, 45, 46, 5, 6, 7, + -1, -1, -1, -1, -1, 55, -1, -1, -1, 59, + -1, -1, -1, 63, 64, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 32, -1, -1, 35, 36, 37, + 38, -1, -1, 41, 42, 43, -1, 45, 46, 5, + 6, 7, -1, -1, -1, -1, -1, 55, -1, -1, + -1, 59, -1, -1, -1, 63, 64, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 32, -1, -1, 35, + 36, 37, 38, -1, -1, 41, 42, 43, -1, 45, + 46, 5, 6, 7, -1, -1, -1, -1, -1, 55, + 56, -1, -1, -1, -1, -1, -1, 63, 64, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, + -1, 35, 36, 37, 38, -1, -1, 41, 42, 43, + -1, 45, 46, 5, 6, 7, -1, -1, -1, -1, + -1, 55, 56, -1, -1, -1, -1, -1, -1, 63, + 64, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 32, -1, -1, 35, 36, 37, 38, -1, -1, 41, + 42, 43, -1, 45, 46, 5, 6, 7, -1, -1, + -1, -1, -1, 55, 56, -1, -1, -1, -1, -1, + -1, 63, 64, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 32, -1, -1, 35, 36, 37, 38, -1, + -1, 41, 42, 43, -1, 45, 46, -1, -1, 44, + 45, 46, 47, 48, 49, 55, 51, 52, 53, 54, + -1, 56, 57, 63, 64, -1, -1, 62, -1, -1, + 65, 66, 67, -1, -1, -1, 71, 72, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 84, + 85, 86, 87, 88, 89, 90, -1, -1, -1, -1, + -1, 96, 97, 44, 45, 46, 47, 48, 49, -1, + 51, 52, 53, 54, -1, -1, 57, -1, 59, -1, + -1, 62, -1, -1, 65, 66, 67, -1, -1, -1, + 71, 72, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 84, 85, 86, 87, 88, 89, 90, + -1, -1, -1, -1, -1, 96, 97, 44, 45, 46, + 47, 48, 49, -1, 51, 52, 53, 54, -1, -1, + -1, -1, 59, -1, -1, 62, -1, -1, 65, 66, + 67, -1, -1, -1, 71, 72, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 84, 85, 86, + 87, 88, 89, 90, -1, -1, -1, -1, -1, 96, + 97, 44, 45, 46, 47, 48, 49, -1, 51, 52, + 53, 54, -1, 56, -1, -1, -1, -1, -1, 62, + -1, -1, 65, 66, 67, -1, -1, -1, 71, 72, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 84, 85, 86, 87, 88, 89, 90, -1, -1, + -1, -1, -1, 96, 97, 44, 45, 46, 47, 48, + 49, -1, 51, 52, 53, 54, -1, 56, -1, -1, + -1, -1, -1, 62, -1, -1, 65, 66, 67, -1, + -1, -1, 71, 72, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 84, 85, 86, 87, 88, + 89, 90, -1, -1, -1, -1, -1, 96, 97, 44, + 45, 46, 47, 48, 49, -1, 51, 52, 53, 54, + -1, 56, -1, -1, -1, -1, -1, 62, -1, -1, + 65, 66, 67, -1, -1, -1, 71, 72, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 84, + 85, 86, 87, 88, 89, 90, -1, -1, -1, -1, + -1, 96, 97, 44, 45, 46, 47, 48, 49, -1, + 51, 52, 53, 54, -1, 56, -1, -1, -1, -1, + -1, 62, -1, -1, 65, 66, 67, -1, -1, -1, + 71, 72, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 84, 85, 86, 87, 88, 89, 90, + -1, -1, -1, -1, -1, 96, 97, 44, 45, 46, + 47, 48, 49, -1, 51, 52, 53, 54, -1, -1, + -1, -1, 59, -1, -1, 62, -1, -1, 65, 66, + 67, -1, -1, -1, 71, 72, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 84, 85, 86, + 87, 88, 89, 90, -1, -1, -1, -1, -1, 96, + 97, 44, 45, 46, 47, 48, 49, -1, 51, 52, + 53, 54, -1, 56, -1, -1, -1, -1, -1, 62, + -1, -1, 65, 66, 67, -1, -1, -1, 71, 72, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 84, 85, 86, 87, 88, 89, 90, -1, -1, + -1, -1, -1, 96, 97, 44, 45, 46, 47, 48, + 49, -1, 51, 52, 53, 54, -1, 56, -1, -1, + -1, -1, -1, 62, -1, -1, 65, 66, 67, -1, + -1, -1, 71, 72, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 84, 85, 86, 87, 88, + 89, 90, -1, -1, -1, -1, -1, 96, 97, 44, + 45, 46, 47, 48, 49, -1, 51, 52, 53, 54, + -1, -1, -1, 58, -1, -1, -1, 62, -1, -1, + 65, 66, 67, -1, -1, -1, 71, 72, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 84, + 85, 86, 87, 88, 89, 90, -1, -1, -1, -1, + -1, 96, 97, 44, 45, 46, 47, 48, 49, -1, + 51, 52, 53, 54, -1, -1, -1, -1, 59, -1, + -1, 62, -1, -1, 65, 66, 67, -1, -1, -1, + 71, 72, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 84, 85, 86, 87, 88, 89, 90, + -1, -1, -1, -1, -1, 96, 97, 44, 45, 46, + 47, 48, 49, -1, 51, 52, 53, 54, -1, -1, + -1, 58, -1, -1, -1, 62, -1, -1, 65, 66, + 67, -1, -1, -1, 71, 72, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 84, 85, 86, + 87, 88, 89, 90, -1, -1, -1, -1, -1, 96, + 97, 44, 45, 46, 47, 48, 49, -1, 51, 52, + 53, 54, -1, 56, -1, -1, -1, -1, -1, 62, + -1, -1, 65, 66, 67, -1, -1, -1, 71, 72, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 84, 85, 86, 87, 88, 89, 90, -1, -1, + -1, -1, -1, 96, 97, 44, 45, 46, 47, 48, + 49, -1, 51, 52, 53, 54, -1, 56, -1, -1, + -1, -1, -1, 62, -1, -1, 65, 66, 67, -1, + -1, -1, 71, 72, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 84, 85, 86, 87, 88, + 89, 90, -1, -1, -1, -1, -1, 96, 97, 44, + 45, 46, 47, 48, 49, -1, 51, 52, 53, 54, + -1, -1, -1, -1, 59, -1, -1, 62, -1, -1, + 65, 66, 67, -1, -1, -1, 71, 72, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 84, + 85, 86, 87, 88, 89, 90, -1, -1, -1, -1, + -1, 96, 97, 44, 45, 46, 47, 48, 49, -1, + 51, 52, 53, 54, -1, 56, -1, -1, -1, -1, + -1, 62, -1, -1, 65, 66, 67, -1, -1, -1, + 71, 72, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 84, 85, 86, 87, 88, 89, 90, + -1, -1, -1, -1, -1, 96, 97, 44, 45, 46, + 47, 48, 49, -1, 51, 52, 53, 54, -1, 56, + -1, -1, -1, -1, -1, 62, -1, -1, 65, 66, + 67, -1, -1, -1, 71, 72, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 84, 85, 86, + 87, 88, 89, 90, -1, -1, -1, -1, -1, 96, + 97, 44, 45, 46, 47, 48, 49, -1, 51, 52, + 53, 54, -1, -1, -1, -1, 59, -1, -1, 62, + -1, -1, 65, 66, 67, -1, -1, -1, 71, 72, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 84, 85, 86, 87, 88, 89, 90, -1, -1, + -1, -1, -1, 96, 97, 44, 45, 46, 47, 48, + 49, -1, 51, 52, 53, 54, -1, 56, -1, -1, + -1, -1, -1, 62, -1, -1, 65, 66, 67, -1, + -1, -1, 71, 72, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 84, 85, 86, 87, 88, + 89, 90, -1, -1, -1, -1, -1, 96, 97, 44, + 45, 46, 47, 48, 49, -1, 51, 52, 53, 54, + -1, 56, -1, -1, -1, -1, -1, 62, -1, -1, + 65, 66, 67, -1, -1, -1, 71, 72, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 84, + 85, 86, 87, 88, 89, 90, -1, -1, -1, -1, + -1, 96, 97, 44, 45, 46, 47, 48, 49, -1, + 51, 52, 53, 54, -1, 56, -1, -1, -1, -1, + -1, 62, -1, -1, 65, 66, 67, -1, -1, -1, + 71, 72, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 84, 85, 86, 87, 88, 89, 90, + -1, -1, -1, -1, -1, 96, 97, 44, 45, 46, + 47, 48, 49, -1, 51, 52, 53, 54, -1, -1, + -1, -1, 59, -1, -1, 62, -1, -1, 65, 66, + 67, -1, -1, -1, 71, 72, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 84, 85, 86, + 87, 88, 89, 90, -1, -1, -1, -1, -1, 96, + 97, 44, 45, 46, 47, 48, 49, -1, 51, 52, + 53, 54, -1, -1, -1, -1, 59, -1, -1, 62, + -1, -1, 65, 66, 67, -1, -1, -1, 71, 72, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 84, 85, 86, 87, 88, 89, 90, -1, -1, + -1, -1, -1, 96, 97, 44, 45, 46, 47, 48, + 49, -1, 51, 52, 53, 54, -1, -1, -1, -1, + 59, -1, -1, 62, -1, -1, 65, 66, 67, -1, + -1, -1, 71, 72, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 84, 85, 86, 87, 88, + 89, 90, -1, -1, -1, -1, -1, 96, 97, 44, + 45, 46, 47, 48, 49, -1, 51, 52, 53, 54, + -1, -1, -1, -1, 59, -1, -1, 62, -1, -1, + 65, 66, 67, -1, -1, -1, 71, 72, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 84, + 85, 86, 87, 88, 89, 90, -1, -1, -1, -1, + -1, 96, 97, 44, 45, 46, 47, 48, 49, -1, + 51, 52, 53, 54, -1, -1, -1, -1, 59, -1, + -1, 62, -1, -1, 65, 66, 67, -1, -1, -1, + 71, 72, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 84, 85, 86, 87, 88, 89, 90, + -1, -1, -1, -1, -1, 96, 97, 44, 45, 46, + 47, 48, 49, -1, 51, 52, 53, 54, -1, -1, + -1, -1, -1, -1, -1, 62, -1, -1, 65, 66, + 67, -1, -1, -1, 71, 72, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 84, 85, 86, + 87, 88, 89, 90, -1, -1, -1, -1, -1, 96, + 97, 44, 45, 46, 47, 48, 49, -1, 51, 52, + 53, 54, -1, -1, -1, -1, -1, -1, -1, 62, + -1, -1, 65, 66, 67, -1, -1, -1, 71, 72, + 44, 45, 46, 47, 48, 49, -1, 51, 52, 53, + 54, 84, 85, 86, 87, 88, 89, 90, 62, -1, + -1, 65, 66, 67, 97, -1, -1, 71, 72, 44, + 45, 46, 47, 48, 49, -1, 51, 52, 53, 54, + 84, 85, 86, 87, 88, -1, 90, 62, -1, -1, + 65, 66, 67, 97, -1, -1, 71, 72, 44, 45, + 46, 47, 48, 49, -1, 51, -1, 53, 54, 84, + 85, 86, 87, -1, -1, 90, 62, -1, -1, 65, + 66, 67, 97, -1, -1, 71, 72, 44, 45, 46, + 47, 48, 49, -1, 51, -1, 53, 54, 84, 85, + 86, 87, -1, -1, 90, -1, -1, -1, 65, 66, + 67, 97, -1, -1, 71, 72, 44, 45, 46, 47, + 48, 49, -1, 51, -1, -1, 54, 84, 85, 86, + 87, -1, -1, 90, -1, -1, -1, 65, 66, 67, + 97, -1, -1, 71, 72, 44, 45, 46, 47, 48, + 49, -1, 51, -1, -1, 54, 84, 85, 86, 87, + -1, -1, 90, -1, -1, -1, 65, 66, 67, 97, + -1, -1, 71, 72, 44, 45, 46, 47, -1, -1, + -1, 51, -1, -1, 54, 50, -1, 86, 87, -1, + -1, 90, -1, -1, -1, 65, 66, 67, 97, -1, + -1, 71, 72, 68, 69, 50, -1, -1, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, -1, -1, + 90, -1, -1, 68, 69, -1, -1, 97, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 44, 45, + 46, 47, -1, -1, -1, 51, -1, -1, 54, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 66, 67, -1, -1, -1, 71, 72 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "bison.simple" /* Skeleton output parser for bison, -Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* As a special exception, when this file is copied by Bison into a -Bison output file, you may use that output file without restriction. -This special exception was added by the Free Software Foundation -in version 1.24 of Bison. */ + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ #ifndef alloca #ifdef __GNUC__ @@ -1175,15 +1116,15 @@ in version 1.24 of Bison. */ #else /* not MSDOS, or __TURBOC__ */ #if defined(_AIX) #include -#pragma alloca + #pragma alloca #else /* not MSDOS, __TURBOC__, or _AIX */ #ifdef __hpux #ifdef __cplusplus extern "C" { - void *alloca(unsigned int); +void *alloca (unsigned int); }; #else /* not __cplusplus */ -void *alloca(); +void *alloca (); #endif /* not __cplusplus */ #endif /* __hpux */ #endif /* not _AIX */ @@ -1193,13 +1134,13 @@ void *alloca(); #endif /* alloca not defined. */ /* This is the parser code that is written into each bison parser -when the %semantic_parser declaration is not specified in the grammar. -It was written by Richard Stallman by simplifying the hairy parser -used when %semantic_parser is specified. */ + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ /* Note: there must be only one dollar sign in this file. -It is replaced by the list of actions, each action -as one case of the switch. */ + It is replaced by the list of actions, each action + as one case of the switch. */ #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) @@ -1209,9 +1150,9 @@ as one case of the switch. */ #define YYABORT return(1) #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. -This remains here temporarily to ease the -transition to the new meaning of YYERROR, for GCC. -Once GCC version 2 has supplanted version 1, this can go. */ + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(token, value) \ @@ -1255,11 +1196,11 @@ while (0) int yychar; /* the lookahead symbol */ YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ + /* lookahead symbol */ #ifdef YYLSP_NEEDED YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ + /* symbol */ #endif int yynerrs; /* number of parse errors so far */ @@ -1267,18 +1208,18 @@ int yynerrs; /* number of parse errors so far */ #if YYDEBUG != 0 int yydebug; /* nonzero means print parse trace */ - /* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ #endif - /* YYINITDEPTH indicates the initial size of the parser's stacks */ +/* YYINITDEPTH indicates the initial size of the parser's stacks */ #ifndef YYINITDEPTH #define YYINITDEPTH 200 #endif - /* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ #if YYMAXDEPTH == 0 #undef YYMAXDEPTH @@ -1288,57 +1229,57 @@ int yydebug; /* nonzero means print parse trace */ #define YYMAXDEPTH 10000 #endif - /* Prevent warning if -Wstrict-prototypes. */ +/* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ -int yyparse(void); +int yyparse (void); #endif - + #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ #define __yy_memcpy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) #else /* not GNU C or C++ */ #ifndef __cplusplus /* This is the most reliable way to avoid incompatibilities -in available built-in functions on various systems. */ + in available built-in functions on various systems. */ static void -__yy_memcpy(from, to, count) -char *from; -char *to; -int count; +__yy_memcpy (from, to, count) + char *from; + char *to; + int count; { - register char *f = from; - register char *t = to; - register int i = count; + register char *f = from; + register char *t = to; + register int i = count; - while (i-- > 0) - *t++ = *f++; + while (i-- > 0) + *t++ = *f++; } #else /* __cplusplus */ /* This is the most reliable way to avoid incompatibilities -in available built-in functions on various systems. */ + in available built-in functions on various systems. */ static void -__yy_memcpy(char *from, char *to, int count) +__yy_memcpy (char *from, char *to, int count) { - register char *f = from; - register char *t = to; - register int i = count; + register char *f = from; + register char *t = to; + register int i = count; - while (i-- > 0) - *t++ = *f++; + while (i-- > 0) + *t++ = *f++; } #endif #endif - + #line 192 "bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed -into yyparse. The argument should have type void *. -It should actually point to an object. -Grammar actions can access the variable by casting it -to the proper pointer type. */ + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ #ifdef YYPARSE_PARAM #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; @@ -1349,78 +1290,78 @@ to the proper pointer type. */ int yyparse(YYPARSE_PARAM) -YYPARSE_PARAM_DECL + YYPARSE_PARAM_DECL { - register int yystate; - register int yyn; - register short *yyssp; - register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ #ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else #define YYPOPSTACK (yyvsp--, yyssp--) #endif - int yystacksize = YYINITDEPTH; + int yystacksize = YYINITDEPTH; #ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; + int yychar; + YYSTYPE yylval; + int yynerrs; #ifdef YYLSP_NEEDED - YYLTYPE yylloc; + YYLTYPE yylloc; #endif #endif - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ - int yylen; + int yylen; #if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); + if (yydebug) + fprintf(stderr, "Starting parse\n"); #endif - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ - yyssp = yyss - 1; - yyvsp = yyvs; + yyssp = yyss - 1; + yyvsp = yyvs; #ifdef YYLSP_NEEDED - yylsp = yyls; + yylsp = yyls; #endif - /* Push a new state, which is found in yystate . */ - /* In all cases, when you get here, the value and location stacks +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yynewstate: - *++yyssp = yystate; + *++yyssp = yystate; - if (yyssp >= yyss + yystacksize - 1) - { + if (yyssp >= yyss + yystacksize - 1) + { /* Give user a chance to reallocate the stack */ /* Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; @@ -1434,20 +1375,20 @@ yynewstate: #ifdef yyoverflow /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ + the data in use in that stack, in bytes. */ #ifdef YYLSP_NEEDED /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ + but that might be undefined if yyoverflow is a macro. */ yyoverflow("parser stack overflow", - &yyss1, size * sizeof(*yyssp), - &yyvs1, size * sizeof(*yyvsp), - &yyls1, size * sizeof(*yylsp), - &yystacksize); + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); #else yyoverflow("parser stack overflow", - &yyss1, size * sizeof(*yyssp), - &yyvs1, size * sizeof(*yyvsp), - &yystacksize); + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); #endif yyss = yyss1; yyvs = yyvs1; @@ -1457,20 +1398,20 @@ yynewstate: #else /* no yyoverflow */ /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) - { - yyerror("parser stack overflow"); - return 2; - } + { + yyerror("parser stack overflow"); + return 2; + } yystacksize *= 2; if (yystacksize > YYMAXDEPTH) - yystacksize = YYMAXDEPTH; - yyss = (short *)alloca(yystacksize * sizeof(*yyssp)); - __yy_memcpy((char *)yyss1, (char *)yyss, size * sizeof(*yyssp)); - yyvs = (YYSTYPE *)alloca(yystacksize * sizeof(*yyvsp)); - __yy_memcpy((char *)yyvs1, (char *)yyvs, size * sizeof(*yyvsp)); + yystacksize = YYMAXDEPTH; + yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp)); + yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp)); #ifdef YYLSP_NEEDED - yyls = (YYLTYPE *)alloca(yystacksize * sizeof(*yylsp)); - __yy_memcpy((char *)yyls1, (char *)yyls, size * sizeof(*yylsp)); + yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp)); #endif #endif /* no yyoverflow */ @@ -1482,995 +1423,972 @@ yynewstate: #if YYDEBUG != 0 if (yydebug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); + fprintf(stderr, "Stack size increased to %d\n", yystacksize); #endif if (yyssp >= yyss + yystacksize - 1) - YYABORT; - } + YYABORT; + } #if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Entering state %d\n", yystate); + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); #endif - goto yybackup; -yybackup: + goto yybackup; + yybackup: - /* Do appropriate processing given the current state. */ - /* Read a lookahead token if we need one and don't already have one. */ - /* yyresume: */ +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ - /* First try to decide what to do without reference to lookahead token. */ + /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yydefault; + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ - if (yychar == YYEMPTY) - { + if (yychar == YYEMPTY) + { #if YYDEBUG != 0 if (yydebug) - fprintf(stderr, "Reading a token: "); + fprintf(stderr, "Reading a token: "); #endif yychar = YYLEX; - } + } - /* Convert token to internal form (in yychar1) for indexing tables with */ + /* Convert token to internal form (in yychar1) for indexing tables with */ - if (yychar <= 0) /* This means end of input. */ - { + if (yychar <= 0) /* This means end of input. */ + { yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more */ #if YYDEBUG != 0 if (yydebug) - fprintf(stderr, "Now at end of input.\n"); + fprintf(stderr, "Now at end of input.\n"); #endif - } - else - { + } + else + { yychar1 = YYTRANSLATE(yychar); #if YYDEBUG != 0 if (yydebug) - { - fprintf(stderr, "Next token is %d (%s", yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ #ifdef YYPRINT - YYPRINT(stderr, yychar, yylval); + YYPRINT (stderr, yychar, yylval); #endif - fprintf(stderr, ")\n"); - } + fprintf (stderr, ")\n"); + } #endif - } + } - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) - goto yydefault; + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + goto yydefault; - yyn = yytable[yyn]; + yyn = yytable[yyn]; - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ - if (yyn < 0) - { + if (yyn < 0) + { if (yyn == YYFLAG) - goto yyerrlab; + goto yyerrlab; yyn = -yyn; goto yyreduce; - } - else if (yyn == 0) - goto yyerrlab; + } + else if (yyn == 0) + goto yyerrlab; - if (yyn == YYFINAL) - YYACCEPT; + if (yyn == YYFINAL) + YYACCEPT; - /* Shift the lookahead token. */ + /* Shift the lookahead token. */ #if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); #endif - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; - *++yyvsp = yylval; + *++yyvsp = yylval; #ifdef YYLSP_NEEDED - *++yylsp = yylloc; + *++yylsp = yylloc; #endif - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; - yystate = yyn; - goto yynewstate; + yystate = yyn; + goto yynewstate; - /* Do the default action for the current state. */ +/* Do the default action for the current state. */ yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; - /* Do a reduction. yyn is the number of a rule to reduce with. */ +/* Do a reduction. yyn is the number of a rule to reduce with. */ yyreduce: - yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1 - yylen]; /* implement default value of the action */ + yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ #if YYDEBUG != 0 - if (yydebug) - { + if (yydebug) + { int i; - fprintf(stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf(stderr, "%s ", yytname[yyrhs[i]]); - fprintf(stderr, " -> %s\n", yytname[yyr1[yyn]]); - } + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } #endif - switch (yyn) { + switch (yyn) { - case 1: +case 1: #line 162 "cmdgram.y" - {; - break; } - case 2: +{ ; + break;} +case 2: #line 167 "cmdgram.y" - { yyval.stmt = nil; ; - break; } - case 3: +{ yyval.stmt = nil; ; + break;} +case 3: #line 169 "cmdgram.y" - { if (!gStatementList) { gStatementList = yyvsp[0].stmt; } - else { gStatementList->append(yyvsp[0].stmt); }; - break; } - case 4: +{ if(!gStatementList) { gStatementList = yyvsp[0].stmt; } else { gStatementList->append(yyvsp[0].stmt); } ; + break;} +case 4: #line 174 "cmdgram.y" - { yyval.stmt = yyvsp[0].stmt; ; - break; } - case 5: +{ yyval.stmt = yyvsp[0].stmt; ; + break;} +case 5: #line 176 "cmdgram.y" - { yyval.stmt = yyvsp[0].stmt; ; - break; } - case 6: +{ yyval.stmt = yyvsp[0].stmt; ; + break;} +case 6: #line 178 "cmdgram.y" - { yyval.stmt = yyvsp[0].stmt; ; - break; } - case 7: +{ yyval.stmt = yyvsp[0].stmt; ; + break;} +case 7: #line 183 "cmdgram.y" - { yyval.stmt = yyvsp[-2].stmt; for (StmtNode *walk = (yyvsp[-2].stmt); walk; walk = walk->getNext()) walk->setPackage(yyvsp[-4].s.value); ; - break; } - case 8: +{ yyval.stmt = yyvsp[-2].stmt; for(StmtNode *walk = (yyvsp[-2].stmt);walk;walk = walk->getNext() ) walk->setPackage(yyvsp[-4].s.value); ; + break;} +case 8: #line 188 "cmdgram.y" - { yyval.stmt = yyvsp[0].stmt; ; - break; } - case 9: +{ yyval.stmt = yyvsp[0].stmt; ; + break;} +case 9: #line 190 "cmdgram.y" - { yyval.stmt = yyvsp[-1].stmt; (yyvsp[-1].stmt)->append(yyvsp[0].stmt); ; - break; } - case 10: +{ yyval.stmt = yyvsp[-1].stmt; (yyvsp[-1].stmt)->append(yyvsp[0].stmt); ; + break;} +case 10: #line 195 "cmdgram.y" - { yyval.stmt = nil; ; - break; } - case 11: +{ yyval.stmt = nil; ; + break;} +case 11: #line 197 "cmdgram.y" - { if (!yyvsp[-1].stmt) { yyval.stmt = yyvsp[0].stmt; } - else { (yyvsp[-1].stmt)->append(yyvsp[0].stmt); yyval.stmt = yyvsp[-1].stmt; }; - break; } - case 18: +{ if(!yyvsp[-1].stmt) { yyval.stmt = yyvsp[0].stmt; } else { (yyvsp[-1].stmt)->append(yyvsp[0].stmt); yyval.stmt = yyvsp[-1].stmt; } ; + break;} +case 18: #line 208 "cmdgram.y" - { yyval.stmt = BreakStmtNode::alloc(yyvsp[-1].i.lineNumber); ; - break; } - case 19: +{ yyval.stmt = BreakStmtNode::alloc( yyvsp[-1].i.lineNumber ); ; + break;} +case 19: #line 210 "cmdgram.y" - { yyval.stmt = ContinueStmtNode::alloc(yyvsp[-1].i.lineNumber); ; - break; } - case 20: +{ yyval.stmt = ContinueStmtNode::alloc( yyvsp[-1].i.lineNumber ); ; + break;} +case 20: #line 212 "cmdgram.y" - { yyval.stmt = ReturnStmtNode::alloc(yyvsp[-1].i.lineNumber, NULL); ; - break; } - case 21: +{ yyval.stmt = ReturnStmtNode::alloc( yyvsp[-1].i.lineNumber, NULL ); ; + break;} +case 21: #line 214 "cmdgram.y" - { yyval.stmt = ReturnStmtNode::alloc(yyvsp[-2].i.lineNumber, yyvsp[-1].expr); ; - break; } - case 22: +{ yyval.stmt = ReturnStmtNode::alloc( yyvsp[-2].i.lineNumber, yyvsp[-1].expr ); ; + break;} +case 22: #line 216 "cmdgram.y" - { yyval.stmt = yyvsp[-1].stmt; ; - break; } - case 23: +{ yyval.stmt = yyvsp[-1].stmt; ; + break;} +case 23: #line 218 "cmdgram.y" - { yyval.stmt = TTagSetStmtNode::alloc(yyvsp[-3].s.lineNumber, yyvsp[-3].s.value, yyvsp[-1].expr, NULL); ; - break; } - case 24: +{ yyval.stmt = TTagSetStmtNode::alloc( yyvsp[-3].s.lineNumber, yyvsp[-3].s.value, yyvsp[-1].expr, NULL ); ; + break;} +case 24: #line 220 "cmdgram.y" - { yyval.stmt = TTagSetStmtNode::alloc(yyvsp[-5].s.lineNumber, yyvsp[-5].s.value, yyvsp[-3].expr, yyvsp[-1].expr); ; - break; } - case 25: +{ yyval.stmt = TTagSetStmtNode::alloc( yyvsp[-5].s.lineNumber, yyvsp[-5].s.value, yyvsp[-3].expr, yyvsp[-1].expr ); ; + break;} +case 25: #line 222 "cmdgram.y" - { yyval.stmt = StrConstNode::alloc(yyvsp[0].str.lineNumber, yyvsp[0].str.value, false, true); ; - break; } - case 26: +{ yyval.stmt = StrConstNode::alloc( yyvsp[0].str.lineNumber, yyvsp[0].str.value, false, true ); ; + break;} +case 26: #line 227 "cmdgram.y" - { yyval.stmt = FunctionDeclStmtNode::alloc(yyvsp[-7].i.lineNumber, yyvsp[-6].s.value, NULL, yyvsp[-4].var, yyvsp[-1].stmt); ; - break; } - case 27: +{ yyval.stmt = FunctionDeclStmtNode::alloc( yyvsp[-7].i.lineNumber, yyvsp[-6].s.value, NULL, yyvsp[-4].var, yyvsp[-1].stmt ); ; + break;} +case 27: #line 229 "cmdgram.y" - { yyval.stmt = FunctionDeclStmtNode::alloc(yyvsp[-9].i.lineNumber, yyvsp[-6].s.value, yyvsp[-8].s.value, yyvsp[-4].var, yyvsp[-1].stmt); ; - break; } - case 28: +{ yyval.stmt = FunctionDeclStmtNode::alloc( yyvsp[-9].i.lineNumber, yyvsp[-6].s.value, yyvsp[-8].s.value, yyvsp[-4].var, yyvsp[-1].stmt ); ; + break;} +case 28: #line 234 "cmdgram.y" - { yyval.var = NULL; ; - break; } - case 29: +{ yyval.var = NULL; ; + break;} +case 29: #line 236 "cmdgram.y" - { yyval.var = yyvsp[0].var; ; - break; } - case 30: +{ yyval.var = yyvsp[0].var; ; + break;} +case 30: #line 241 "cmdgram.y" - { yyval.var = VarNode::alloc(yyvsp[0].s.lineNumber, yyvsp[0].s.value, NULL); ; - break; } - case 31: +{ yyval.var = VarNode::alloc( yyvsp[0].s.lineNumber, yyvsp[0].s.value, NULL ); ; + break;} +case 31: #line 243 "cmdgram.y" - { yyval.var = yyvsp[-2].var; ((StmtNode*)(yyvsp[-2].var))->append((StmtNode*)VarNode::alloc(yyvsp[0].s.lineNumber, yyvsp[0].s.value, NULL)); ; - break; } - case 32: +{ yyval.var = yyvsp[-2].var; ((StmtNode*)(yyvsp[-2].var))->append((StmtNode*)VarNode::alloc( yyvsp[0].s.lineNumber, yyvsp[0].s.value, NULL ) ); ; + break;} +case 32: #line 248 "cmdgram.y" - { yyval.stmt = ObjectDeclNode::alloc(yyvsp[-9].i.lineNumber, yyvsp[-8].expr, yyvsp[-6].expr, NULL, yyvsp[-5].s.value, yyvsp[-2].slist, NULL, true, false, false); ; - break; } - case 33: +{ yyval.stmt = ObjectDeclNode::alloc( yyvsp[-9].i.lineNumber, yyvsp[-8].expr, yyvsp[-6].expr, NULL, yyvsp[-5].s.value, yyvsp[-2].slist, NULL, true, false, false); ; + break;} +case 33: #line 253 "cmdgram.y" - { yyval.od = ObjectDeclNode::alloc(yyvsp[-9].i.lineNumber, yyvsp[-8].expr, yyvsp[-6].expr, yyvsp[-4].expr, yyvsp[-5].s.value, yyvsp[-1].odcl.slots, yyvsp[-1].odcl.decls, false, false, false); ; - break; } - case 34: +{ yyval.od = ObjectDeclNode::alloc( yyvsp[-9].i.lineNumber, yyvsp[-8].expr, yyvsp[-6].expr, yyvsp[-4].expr, yyvsp[-5].s.value, yyvsp[-1].odcl.slots, yyvsp[-1].odcl.decls, false, false, false); ; + break;} +case 34: #line 255 "cmdgram.y" - { yyval.od = ObjectDeclNode::alloc(yyvsp[-6].i.lineNumber, yyvsp[-5].expr, yyvsp[-3].expr, yyvsp[-1].expr, yyvsp[-2].s.value, NULL, NULL, false, false, false); ; - break; } - case 35: +{ yyval.od = ObjectDeclNode::alloc( yyvsp[-6].i.lineNumber, yyvsp[-5].expr, yyvsp[-3].expr, yyvsp[-1].expr, yyvsp[-2].s.value, NULL, NULL, false, false, false); ; + break;} +case 35: #line 257 "cmdgram.y" - { yyval.od = ObjectDeclNode::alloc(yyvsp[-11].i.lineNumber, yyvsp[-10].expr, yyvsp[-7].expr, yyvsp[-4].expr, yyvsp[-5].s.value, yyvsp[-1].odcl.slots, yyvsp[-1].odcl.decls, false, true, false); ; - break; } - case 36: +{ yyval.od = ObjectDeclNode::alloc( yyvsp[-11].i.lineNumber, yyvsp[-10].expr, yyvsp[-7].expr, yyvsp[-4].expr, yyvsp[-5].s.value, yyvsp[-1].odcl.slots, yyvsp[-1].odcl.decls, false, true, false); ; + break;} +case 36: #line 259 "cmdgram.y" - { yyval.od = ObjectDeclNode::alloc(yyvsp[-8].i.lineNumber, yyvsp[-7].expr, yyvsp[-4].expr, yyvsp[-1].expr, yyvsp[-2].s.value, NULL, NULL, false, true, false); ; - break; } - case 37: +{ yyval.od = ObjectDeclNode::alloc( yyvsp[-8].i.lineNumber, yyvsp[-7].expr, yyvsp[-4].expr, yyvsp[-1].expr, yyvsp[-2].s.value, NULL, NULL, false, true, false); ; + break;} +case 37: #line 261 "cmdgram.y" - { yyval.od = ObjectDeclNode::alloc(yyvsp[-9].i.lineNumber, yyvsp[-8].expr, yyvsp[-6].expr, yyvsp[-4].expr, yyvsp[-5].s.value, yyvsp[-1].odcl.slots, yyvsp[-1].odcl.decls, false, false, true); ; - break; } - case 38: +{ yyval.od = ObjectDeclNode::alloc( yyvsp[-9].i.lineNumber, yyvsp[-8].expr, yyvsp[-6].expr, yyvsp[-4].expr, yyvsp[-5].s.value, yyvsp[-1].odcl.slots, yyvsp[-1].odcl.decls, false, false, true); ; + break;} +case 38: #line 263 "cmdgram.y" - { yyval.od = ObjectDeclNode::alloc(yyvsp[-6].i.lineNumber, yyvsp[-5].expr, yyvsp[-3].expr, yyvsp[-1].expr, yyvsp[-2].s.value, NULL, NULL, false, false, true); ; - break; } - case 39: +{ yyval.od = ObjectDeclNode::alloc( yyvsp[-6].i.lineNumber, yyvsp[-5].expr, yyvsp[-3].expr, yyvsp[-1].expr, yyvsp[-2].s.value, NULL, NULL, false, false, true); ; + break;} +case 39: #line 268 "cmdgram.y" - { yyval.s.value = NULL; ; - break; } - case 40: +{ yyval.s.value = NULL; ; + break;} +case 40: #line 270 "cmdgram.y" - { yyval.s = yyvsp[0].s; ; - break; } - case 41: +{ yyval.s = yyvsp[0].s; ; + break;} +case 41: #line 275 "cmdgram.y" - { yyval.expr = StrConstNode::alloc(CodeBlock::smCurrentParser->getCurrentLine(), "", false); ; - break; } - case 42: +{ yyval.expr = StrConstNode::alloc( CodeBlock::smCurrentParser->getCurrentLine(), "", false); ; + break;} +case 42: #line 277 "cmdgram.y" - { yyval.expr = yyvsp[0].expr; ; - break; } - case 43: +{ yyval.expr = yyvsp[0].expr; ; + break;} +case 43: #line 282 "cmdgram.y" - { yyval.expr = NULL; ; - break; } - case 44: +{ yyval.expr = NULL; ; + break;} +case 44: #line 284 "cmdgram.y" - { yyval.expr = yyvsp[0].expr; ; - break; } - case 45: +{ yyval.expr = yyvsp[0].expr; ; + break;} +case 45: #line 289 "cmdgram.y" - { yyval.odcl.slots = NULL; yyval.odcl.decls = NULL; ; - break; } - case 46: +{ yyval.odcl.slots = NULL; yyval.odcl.decls = NULL; ; + break;} +case 46: #line 291 "cmdgram.y" - { yyval.odcl.slots = yyvsp[0].slist; yyval.odcl.decls = NULL; ; - break; } - case 47: +{ yyval.odcl.slots = yyvsp[0].slist; yyval.odcl.decls = NULL; ; + break;} +case 47: #line 293 "cmdgram.y" - { yyval.odcl.slots = NULL; yyval.odcl.decls = yyvsp[0].od; ; - break; } - case 48: +{ yyval.odcl.slots = NULL; yyval.odcl.decls = yyvsp[0].od; ; + break;} +case 48: #line 295 "cmdgram.y" - { yyval.odcl.slots = yyvsp[-1].slist; yyval.odcl.decls = yyvsp[0].od; ; - break; } - case 49: +{ yyval.odcl.slots = yyvsp[-1].slist; yyval.odcl.decls = yyvsp[0].od; ; + break;} +case 49: #line 300 "cmdgram.y" - { yyval.od = yyvsp[-1].od; ; - break; } - case 50: +{ yyval.od = yyvsp[-1].od; ; + break;} +case 50: #line 302 "cmdgram.y" - { yyvsp[-2].od->append(yyvsp[-1].od); yyval.od = yyvsp[-2].od; ; - break; } - case 51: +{ yyvsp[-2].od->append(yyvsp[-1].od); yyval.od = yyvsp[-2].od; ; + break;} +case 51: #line 307 "cmdgram.y" - { yyval.stmt = yyvsp[-1].stmt; ; - break; } - case 52: +{ yyval.stmt = yyvsp[-1].stmt; ; + break;} +case 52: #line 309 "cmdgram.y" - { yyval.stmt = yyvsp[0].stmt; ; - break; } - case 53: +{ yyval.stmt = yyvsp[0].stmt; ; + break;} +case 53: #line 314 "cmdgram.y" - { yyval.stmt = yyvsp[-1].ifnode; yyvsp[-1].ifnode->propagateSwitchExpr(yyvsp[-4].expr, false); ; - break; } - case 54: +{ yyval.stmt = yyvsp[-1].ifnode; yyvsp[-1].ifnode->propagateSwitchExpr(yyvsp[-4].expr, false); ; + break;} +case 54: #line 316 "cmdgram.y" - { yyval.stmt = yyvsp[-1].ifnode; yyvsp[-1].ifnode->propagateSwitchExpr(yyvsp[-4].expr, true); ; - break; } - case 55: +{ yyval.stmt = yyvsp[-1].ifnode; yyvsp[-1].ifnode->propagateSwitchExpr(yyvsp[-4].expr, true); ; + break;} +case 55: #line 321 "cmdgram.y" - { yyval.ifnode = IfStmtNode::alloc(yyvsp[-3].i.lineNumber, yyvsp[-2].expr, yyvsp[0].stmt, NULL, false); ; - break; } - case 56: +{ yyval.ifnode = IfStmtNode::alloc( yyvsp[-3].i.lineNumber, yyvsp[-2].expr, yyvsp[0].stmt, NULL, false); ; + break;} +case 56: #line 323 "cmdgram.y" - { yyval.ifnode = IfStmtNode::alloc(yyvsp[-6].i.lineNumber, yyvsp[-5].expr, yyvsp[-3].stmt, yyvsp[0].stmt, false); ; - break; } - case 57: +{ yyval.ifnode = IfStmtNode::alloc( yyvsp[-6].i.lineNumber, yyvsp[-5].expr, yyvsp[-3].stmt, yyvsp[0].stmt, false); ; + break;} +case 57: #line 325 "cmdgram.y" - { yyval.ifnode = IfStmtNode::alloc(yyvsp[-4].i.lineNumber, yyvsp[-3].expr, yyvsp[-1].stmt, yyvsp[0].ifnode, true); ; - break; } - case 58: +{ yyval.ifnode = IfStmtNode::alloc( yyvsp[-4].i.lineNumber, yyvsp[-3].expr, yyvsp[-1].stmt, yyvsp[0].ifnode, true); ; + break;} +case 58: #line 330 "cmdgram.y" - { yyval.expr = yyvsp[0].expr;; - break; } - case 59: +{ yyval.expr = yyvsp[0].expr;; + break;} +case 59: #line 332 "cmdgram.y" - { (yyvsp[-2].expr)->append(yyvsp[0].expr); yyval.expr = yyvsp[-2].expr; ; - break; } - case 60: +{ (yyvsp[-2].expr)->append(yyvsp[0].expr); yyval.expr=yyvsp[-2].expr; ; + break;} +case 60: #line 337 "cmdgram.y" - { yyval.stmt = IfStmtNode::alloc(yyvsp[-4].i.lineNumber, yyvsp[-2].expr, yyvsp[0].stmt, NULL, false); ; - break; } - case 61: +{ yyval.stmt = IfStmtNode::alloc(yyvsp[-4].i.lineNumber, yyvsp[-2].expr, yyvsp[0].stmt, NULL, false); ; + break;} +case 61: #line 339 "cmdgram.y" - { yyval.stmt = IfStmtNode::alloc(yyvsp[-6].i.lineNumber, yyvsp[-4].expr, yyvsp[-2].stmt, yyvsp[0].stmt, false); ; - break; } - case 62: +{ yyval.stmt = IfStmtNode::alloc(yyvsp[-6].i.lineNumber, yyvsp[-4].expr, yyvsp[-2].stmt, yyvsp[0].stmt, false); ; + break;} +case 62: #line 344 "cmdgram.y" - { yyval.stmt = LoopStmtNode::alloc(yyvsp[-4].i.lineNumber, nil, yyvsp[-2].expr, nil, yyvsp[0].stmt, false); ; - break; } - case 63: +{ yyval.stmt = LoopStmtNode::alloc(yyvsp[-4].i.lineNumber, nil, yyvsp[-2].expr, nil, yyvsp[0].stmt, false); ; + break;} +case 63: #line 346 "cmdgram.y" - { yyval.stmt = LoopStmtNode::alloc(yyvsp[-3].i.lineNumber, nil, yyvsp[-1].expr, nil, yyvsp[-4].stmt, true); ; - break; } - case 64: +{ yyval.stmt = LoopStmtNode::alloc(yyvsp[-3].i.lineNumber, nil, yyvsp[-1].expr, nil, yyvsp[-4].stmt, true); ; + break;} +case 64: #line 351 "cmdgram.y" - { yyval.stmt = LoopStmtNode::alloc(yyvsp[-8].i.lineNumber, yyvsp[-6].expr, yyvsp[-4].expr, yyvsp[-2].expr, yyvsp[0].stmt, false); ; - break; } - case 65: +{ yyval.stmt = LoopStmtNode::alloc(yyvsp[-8].i.lineNumber, yyvsp[-6].expr, yyvsp[-4].expr, yyvsp[-2].expr, yyvsp[0].stmt, false); ; + break;} +case 65: #line 353 "cmdgram.y" - { yyval.stmt = LoopStmtNode::alloc(yyvsp[-7].i.lineNumber, yyvsp[-5].expr, yyvsp[-3].expr, NULL, yyvsp[0].stmt, false); ; - break; } - case 66: +{ yyval.stmt = LoopStmtNode::alloc(yyvsp[-7].i.lineNumber, yyvsp[-5].expr, yyvsp[-3].expr, NULL, yyvsp[0].stmt, false); ; + break;} +case 66: #line 355 "cmdgram.y" - { yyval.stmt = LoopStmtNode::alloc(yyvsp[-7].i.lineNumber, yyvsp[-5].expr, NULL, yyvsp[-2].expr, yyvsp[0].stmt, false); ; - break; } - case 67: +{ yyval.stmt = LoopStmtNode::alloc(yyvsp[-7].i.lineNumber, yyvsp[-5].expr, NULL, yyvsp[-2].expr, yyvsp[0].stmt, false); ; + break;} +case 67: #line 357 "cmdgram.y" - { yyval.stmt = LoopStmtNode::alloc(yyvsp[-6].i.lineNumber, yyvsp[-4].expr, NULL, NULL, yyvsp[0].stmt, false); ; - break; } - case 68: +{ yyval.stmt = LoopStmtNode::alloc(yyvsp[-6].i.lineNumber, yyvsp[-4].expr, NULL, NULL, yyvsp[0].stmt, false); ; + break;} +case 68: #line 359 "cmdgram.y" - { yyval.stmt = LoopStmtNode::alloc(yyvsp[-7].i.lineNumber, NULL, yyvsp[-4].expr, yyvsp[-2].expr, yyvsp[0].stmt, false); ; - break; } - case 69: +{ yyval.stmt = LoopStmtNode::alloc(yyvsp[-7].i.lineNumber, NULL, yyvsp[-4].expr, yyvsp[-2].expr, yyvsp[0].stmt, false); ; + break;} +case 69: #line 361 "cmdgram.y" - { yyval.stmt = LoopStmtNode::alloc(yyvsp[-6].i.lineNumber, NULL, yyvsp[-3].expr, NULL, yyvsp[0].stmt, false); ; - break; } - case 70: +{ yyval.stmt = LoopStmtNode::alloc(yyvsp[-6].i.lineNumber, NULL, yyvsp[-3].expr, NULL, yyvsp[0].stmt, false); ; + break;} +case 70: #line 363 "cmdgram.y" - { yyval.stmt = LoopStmtNode::alloc(yyvsp[-6].i.lineNumber, NULL, NULL, yyvsp[-2].expr, yyvsp[0].stmt, false); ; - break; } - case 71: +{ yyval.stmt = LoopStmtNode::alloc(yyvsp[-6].i.lineNumber, NULL, NULL, yyvsp[-2].expr, yyvsp[0].stmt, false); ; + break;} +case 71: #line 365 "cmdgram.y" - { yyval.stmt = LoopStmtNode::alloc(yyvsp[-5].i.lineNumber, NULL, NULL, NULL, yyvsp[0].stmt, false); ; - break; } - case 72: +{ yyval.stmt = LoopStmtNode::alloc(yyvsp[-5].i.lineNumber, NULL, NULL, NULL, yyvsp[0].stmt, false); ; + break;} +case 72: #line 370 "cmdgram.y" - { yyval.stmt = IterStmtNode::alloc(yyvsp[-6].i.lineNumber, yyvsp[-4].s.value, yyvsp[-2].expr, yyvsp[0].stmt, false); ; - break; } - case 73: +{ yyval.stmt = IterStmtNode::alloc( yyvsp[-6].i.lineNumber, yyvsp[-4].s.value, yyvsp[-2].expr, yyvsp[0].stmt, false ); ; + break;} +case 73: #line 372 "cmdgram.y" - { yyval.stmt = IterStmtNode::alloc(yyvsp[-6].i.lineNumber, yyvsp[-4].s.value, yyvsp[-2].expr, yyvsp[0].stmt, true); ; - break; } - case 74: +{ yyval.stmt = IterStmtNode::alloc( yyvsp[-6].i.lineNumber, yyvsp[-4].s.value, yyvsp[-2].expr, yyvsp[0].stmt, true ); ; + break;} +case 74: #line 377 "cmdgram.y" - { yyval.stmt = yyvsp[0].expr; ; - break; } - case 75: +{ yyval.stmt = yyvsp[0].expr; ; + break;} +case 75: #line 382 "cmdgram.y" - { yyval.expr = yyvsp[0].expr; ; - break; } - case 76: +{ yyval.expr = yyvsp[0].expr; ; + break;} +case 76: #line 384 "cmdgram.y" - { yyval.expr = yyvsp[-1].expr; ; - break; } - case 77: +{ yyval.expr = yyvsp[-1].expr; ; + break;} +case 77: #line 386 "cmdgram.y" - { yyval.expr = IntBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 78: +{ yyval.expr = IntBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 78: #line 388 "cmdgram.y" - { yyval.expr = IntBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 79: +{ yyval.expr = IntBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 79: #line 390 "cmdgram.y" - { yyval.expr = IntBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 80: +{ yyval.expr = IntBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 80: #line 392 "cmdgram.y" - { yyval.expr = IntBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 81: +{ yyval.expr = IntBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 81: #line 394 "cmdgram.y" - { yyval.expr = FloatBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 82: +{ yyval.expr = FloatBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 82: #line 396 "cmdgram.y" - { yyval.expr = FloatBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 83: +{ yyval.expr = FloatBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 83: #line 398 "cmdgram.y" - { yyval.expr = FloatBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 84: +{ yyval.expr = FloatBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 84: #line 400 "cmdgram.y" - { yyval.expr = FloatBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 85: +{ yyval.expr = FloatBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 85: #line 402 "cmdgram.y" - { yyval.expr = FloatUnaryExprNode::alloc(yyvsp[-1].i.lineNumber, yyvsp[-1].i.value, yyvsp[0].expr); ; - break; } - case 86: +{ yyval.expr = FloatUnaryExprNode::alloc( yyvsp[-1].i.lineNumber, yyvsp[-1].i.value, yyvsp[0].expr); ; + break;} +case 86: #line 404 "cmdgram.y" - { yyval.expr = TTagDerefNode::alloc(yyvsp[-1].i.lineNumber, yyvsp[0].expr); ; - break; } - case 87: +{ yyval.expr = TTagDerefNode::alloc( yyvsp[-1].i.lineNumber, yyvsp[0].expr ); ; + break;} +case 87: #line 406 "cmdgram.y" - { yyval.expr = TTagExprNode::alloc(yyvsp[0].s.lineNumber, yyvsp[0].s.value); ; - break; } - case 88: +{ yyval.expr = TTagExprNode::alloc( yyvsp[0].s.lineNumber, yyvsp[0].s.value ); ; + break;} +case 88: #line 408 "cmdgram.y" - { yyval.expr = ConditionalExprNode::alloc(yyvsp[-4].expr->dbgLineNumber, yyvsp[-4].expr, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 89: +{ yyval.expr = ConditionalExprNode::alloc( yyvsp[-4].expr->dbgLineNumber, yyvsp[-4].expr, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 89: #line 410 "cmdgram.y" - { yyval.expr = IntBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 90: +{ yyval.expr = IntBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 90: #line 412 "cmdgram.y" - { yyval.expr = IntBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 91: +{ yyval.expr = IntBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 91: #line 414 "cmdgram.y" - { yyval.expr = IntBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 92: +{ yyval.expr = IntBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 92: #line 416 "cmdgram.y" - { yyval.expr = IntBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 93: +{ yyval.expr = IntBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 93: #line 418 "cmdgram.y" - { yyval.expr = IntBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 94: +{ yyval.expr = IntBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 94: #line 420 "cmdgram.y" - { yyval.expr = IntBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 95: +{ yyval.expr = IntBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 95: #line 422 "cmdgram.y" - { yyval.expr = IntBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 96: +{ yyval.expr = IntBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 96: #line 424 "cmdgram.y" - { yyval.expr = IntBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 97: +{ yyval.expr = IntBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 97: #line 426 "cmdgram.y" - { yyval.expr = IntBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 98: +{ yyval.expr = IntBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 98: #line 428 "cmdgram.y" - { yyval.expr = IntBinaryExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - case 99: +{ yyval.expr = IntBinaryExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-1].i.value, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +case 99: #line 430 "cmdgram.y" - { yyval.expr = StreqExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-2].expr, yyvsp[0].expr, true); ; - break; } - case 100: +{ yyval.expr = StreqExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-2].expr, yyvsp[0].expr, true); ; + break;} +case 100: #line 432 "cmdgram.y" - { yyval.expr = StreqExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-2].expr, yyvsp[0].expr, false); ; - break; } - case 101: +{ yyval.expr = StreqExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-2].expr, yyvsp[0].expr, false); ; + break;} +case 101: #line 434 "cmdgram.y" - { yyval.expr = StrcatExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].i.value); ; - break; } - case 102: +{ yyval.expr = StrcatExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].i.value); ; + break;} +case 102: #line 436 "cmdgram.y" - { yyval.expr = IntUnaryExprNode::alloc(yyvsp[-1].i.lineNumber, yyvsp[-1].i.value, yyvsp[0].expr); ; - break; } - case 103: +{ yyval.expr = IntUnaryExprNode::alloc(yyvsp[-1].i.lineNumber, yyvsp[-1].i.value, yyvsp[0].expr); ; + break;} +case 103: #line 438 "cmdgram.y" - { yyval.expr = IntUnaryExprNode::alloc(yyvsp[-1].i.lineNumber, yyvsp[-1].i.value, yyvsp[0].expr); ; - break; } - case 104: +{ yyval.expr = IntUnaryExprNode::alloc(yyvsp[-1].i.lineNumber, yyvsp[-1].i.value, yyvsp[0].expr); ; + break;} +case 104: #line 440 "cmdgram.y" - { yyval.expr = StrConstNode::alloc(yyvsp[0].str.lineNumber, yyvsp[0].str.value, true); ; - break; } - case 105: +{ yyval.expr = StrConstNode::alloc( yyvsp[0].str.lineNumber, yyvsp[0].str.value, true); ; + break;} +case 105: #line 442 "cmdgram.y" - { yyval.expr = FloatNode::alloc(yyvsp[0].f.lineNumber, yyvsp[0].f.value); ; - break; } - case 106: +{ yyval.expr = FloatNode::alloc( yyvsp[0].f.lineNumber, yyvsp[0].f.value ); ; + break;} +case 106: #line 444 "cmdgram.y" - { yyval.expr = IntNode::alloc(yyvsp[0].i.lineNumber, yyvsp[0].i.value); ; - break; } - case 107: +{ yyval.expr = IntNode::alloc( yyvsp[0].i.lineNumber, yyvsp[0].i.value ); ; + break;} +case 107: #line 446 "cmdgram.y" - { yyval.expr = ConstantNode::alloc(yyvsp[0].i.lineNumber, StringTable->insert("break")); ; - break; } - case 108: +{ yyval.expr = ConstantNode::alloc( yyvsp[0].i.lineNumber, StringTable->insert("break")); ; + break;} +case 108: #line 448 "cmdgram.y" - { yyval.expr = SlotAccessNode::alloc(yyvsp[0].slot.lineNumber, yyvsp[0].slot.object, yyvsp[0].slot.array, yyvsp[0].slot.slotName); ; - break; } - case 109: +{ yyval.expr = SlotAccessNode::alloc( yyvsp[0].slot.lineNumber, yyvsp[0].slot.object, yyvsp[0].slot.array, yyvsp[0].slot.slotName ); ; + break;} +case 109: #line 450 "cmdgram.y" - { yyval.expr = InternalSlotAccessNode::alloc(yyvsp[0].intslot.lineNumber, yyvsp[0].intslot.object, yyvsp[0].intslot.slotExpr, yyvsp[0].intslot.recurse); ; - break; } - case 110: +{ yyval.expr = InternalSlotAccessNode::alloc( yyvsp[0].intslot.lineNumber, yyvsp[0].intslot.object, yyvsp[0].intslot.slotExpr, yyvsp[0].intslot.recurse); ; + break;} +case 110: #line 452 "cmdgram.y" - { yyval.expr = ConstantNode::alloc(yyvsp[0].s.lineNumber, yyvsp[0].s.value); ; - break; } - case 111: +{ yyval.expr = ConstantNode::alloc( yyvsp[0].s.lineNumber, yyvsp[0].s.value ); ; + break;} +case 111: #line 454 "cmdgram.y" - { yyval.expr = StrConstNode::alloc(yyvsp[0].str.lineNumber, yyvsp[0].str.value, false); ; - break; } - case 112: +{ yyval.expr = StrConstNode::alloc( yyvsp[0].str.lineNumber, yyvsp[0].str.value, false); ; + break;} +case 112: #line 456 "cmdgram.y" - { yyval.expr = (ExprNode*)VarNode::alloc(yyvsp[0].s.lineNumber, yyvsp[0].s.value, NULL); ; - break; } - case 113: +{ yyval.expr = (ExprNode*)VarNode::alloc( yyvsp[0].s.lineNumber, yyvsp[0].s.value, NULL); ; + break;} +case 113: #line 458 "cmdgram.y" - { yyval.expr = (ExprNode*)VarNode::alloc(yyvsp[-3].s.lineNumber, yyvsp[-3].s.value, yyvsp[-1].expr); ; - break; } - case 114: -#line 460 "cmdgram.y" - { - const U32 bufLen = 64; - UTF8 buffer[bufLen]; - dSprintf(buffer, bufLen, "__anonymous_function%d", gAnonFunctionID++); - StringTableEntry fName = StringTable->insert(buffer); - StmtNode *fndef = FunctionDeclStmtNode::alloc(yyvsp[-6].i.lineNumber, fName, NULL, yyvsp[-4].var, yyvsp[-1].stmt); - - if (!gAnonFunctionList) - gAnonFunctionList = fndef; - else - gAnonFunctionList->append(fndef); - - yyval.expr = StrConstNode::alloc(yyvsp[-6].i.lineNumber, (UTF8*)fName, false); - ; - break; } - case 115: -#line 478 "cmdgram.y" - { yyval.slot.lineNumber = yyvsp[-2].expr->dbgLineNumber; yyval.slot.object = yyvsp[-2].expr; yyval.slot.slotName = yyvsp[0].s.value; yyval.slot.array = NULL; ; - break; } - case 116: +{ yyval.expr = (ExprNode*)VarNode::alloc( yyvsp[-3].s.lineNumber, yyvsp[-3].s.value, yyvsp[-1].expr ); ; + break;} +case 114: #line 480 "cmdgram.y" - { yyval.slot.lineNumber = yyvsp[-5].expr->dbgLineNumber; yyval.slot.object = yyvsp[-5].expr; yyval.slot.slotName = yyvsp[-3].s.value; yyval.slot.array = yyvsp[-1].expr; ; - break; } - case 117: -#line 485 "cmdgram.y" - { yyval.intslot.lineNumber = yyvsp[-2].expr->dbgLineNumber; yyval.intslot.object = yyvsp[-2].expr; yyval.intslot.slotExpr = yyvsp[0].expr; yyval.intslot.recurse = false; ; - break; } - case 118: +{ yyval.slot.lineNumber = yyvsp[-2].expr->dbgLineNumber; yyval.slot.object = yyvsp[-2].expr; yyval.slot.slotName = yyvsp[0].s.value; yyval.slot.array = NULL; ; + break;} +case 115: +#line 482 "cmdgram.y" +{ yyval.slot.lineNumber = yyvsp[-5].expr->dbgLineNumber; yyval.slot.object = yyvsp[-5].expr; yyval.slot.slotName = yyvsp[-3].s.value; yyval.slot.array = yyvsp[-1].expr; ; + break;} +case 116: #line 487 "cmdgram.y" - { yyval.intslot.lineNumber = yyvsp[-2].expr->dbgLineNumber; yyval.intslot.object = yyvsp[-2].expr; yyval.intslot.slotExpr = yyvsp[0].expr; yyval.intslot.recurse = true; ; - break; } - case 119: -#line 492 "cmdgram.y" - { yyval.expr = ConstantNode::alloc(yyvsp[0].s.lineNumber, yyvsp[0].s.value); ; - break; } - case 120: +{ yyval.intslot.lineNumber = yyvsp[-2].expr->dbgLineNumber; yyval.intslot.object = yyvsp[-2].expr; yyval.intslot.slotExpr = yyvsp[0].expr; yyval.intslot.recurse = false; ; + break;} +case 117: +#line 489 "cmdgram.y" +{ yyval.intslot.lineNumber = yyvsp[-2].expr->dbgLineNumber; yyval.intslot.object = yyvsp[-2].expr; yyval.intslot.slotExpr = yyvsp[0].expr; yyval.intslot.recurse = true; ; + break;} +case 118: #line 494 "cmdgram.y" - { yyval.expr = yyvsp[-1].expr; ; - break; } - case 121: -#line 499 "cmdgram.y" - { yyval.asn.lineNumber = yyvsp[0].i.lineNumber; yyval.asn.token = opPLUSPLUS; yyval.asn.expr = FloatNode::alloc(yyvsp[0].i.lineNumber, 1); ; - break; } - case 122: +{ yyval.expr = ConstantNode::alloc( yyvsp[0].s.lineNumber, yyvsp[0].s.value ); ; + break;} +case 119: +#line 496 "cmdgram.y" +{ yyval.expr = yyvsp[-1].expr; ; + break;} +case 120: #line 501 "cmdgram.y" - { yyval.asn.lineNumber = yyvsp[0].i.lineNumber; yyval.asn.token = opMINUSMINUS; yyval.asn.expr = FloatNode::alloc(yyvsp[0].i.lineNumber, 1); ; - break; } - case 123: +{ yyval.asn.lineNumber = yyvsp[0].i.lineNumber; yyval.asn.token = opPLUSPLUS; yyval.asn.expr = FloatNode::alloc( yyvsp[0].i.lineNumber, 1 ); ; + break;} +case 121: #line 503 "cmdgram.y" - { yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = '+'; yyval.asn.expr = yyvsp[0].expr; ; - break; } - case 124: +{ yyval.asn.lineNumber = yyvsp[0].i.lineNumber; yyval.asn.token = opMINUSMINUS; yyval.asn.expr = FloatNode::alloc( yyvsp[0].i.lineNumber, 1 ); ; + break;} +case 122: #line 505 "cmdgram.y" - { yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = '-'; yyval.asn.expr = yyvsp[0].expr; ; - break; } - case 125: +{ yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = '+'; yyval.asn.expr = yyvsp[0].expr; ; + break;} +case 123: #line 507 "cmdgram.y" - { yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = '*'; yyval.asn.expr = yyvsp[0].expr; ; - break; } - case 126: +{ yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = '-'; yyval.asn.expr = yyvsp[0].expr; ; + break;} +case 124: #line 509 "cmdgram.y" - { yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = '/'; yyval.asn.expr = yyvsp[0].expr; ; - break; } - case 127: +{ yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = '*'; yyval.asn.expr = yyvsp[0].expr; ; + break;} +case 125: #line 511 "cmdgram.y" - { yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = '%'; yyval.asn.expr = yyvsp[0].expr; ; - break; } - case 128: +{ yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = '/'; yyval.asn.expr = yyvsp[0].expr; ; + break;} +case 126: #line 513 "cmdgram.y" - { yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = '&'; yyval.asn.expr = yyvsp[0].expr; ; - break; } - case 129: +{ yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = '%'; yyval.asn.expr = yyvsp[0].expr; ; + break;} +case 127: #line 515 "cmdgram.y" - { yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = '^'; yyval.asn.expr = yyvsp[0].expr; ; - break; } - case 130: +{ yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = '&'; yyval.asn.expr = yyvsp[0].expr; ; + break;} +case 128: #line 517 "cmdgram.y" - { yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = '|'; yyval.asn.expr = yyvsp[0].expr; ; - break; } - case 131: +{ yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = '^'; yyval.asn.expr = yyvsp[0].expr; ; + break;} +case 129: #line 519 "cmdgram.y" - { yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = opSHL; yyval.asn.expr = yyvsp[0].expr; ; - break; } - case 132: +{ yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = '|'; yyval.asn.expr = yyvsp[0].expr; ; + break;} +case 130: #line 521 "cmdgram.y" - { yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = opSHR; yyval.asn.expr = yyvsp[0].expr; ; - break; } - case 133: -#line 526 "cmdgram.y" - { yyval.expr = yyvsp[0].expr; ; - break; } - case 134: +{ yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = opSHL; yyval.asn.expr = yyvsp[0].expr; ; + break;} +case 131: +#line 523 "cmdgram.y" +{ yyval.asn.lineNumber = yyvsp[-1].i.lineNumber; yyval.asn.token = opSHR; yyval.asn.expr = yyvsp[0].expr; ; + break;} +case 132: #line 528 "cmdgram.y" - { yyval.expr = yyvsp[0].expr; ; - break; } - case 135: +{ yyval.expr = yyvsp[0].expr; ; + break;} +case 133: #line 530 "cmdgram.y" - { yyval.expr = yyvsp[0].od; ; - break; } - case 136: +{ yyval.expr = yyvsp[0].expr; ; + break;} +case 134: #line 532 "cmdgram.y" - { yyval.expr = AssignExprNode::alloc(yyvsp[-2].s.lineNumber, yyvsp[-2].s.value, NULL, yyvsp[0].expr); ; - break; } - case 137: +{ yyval.expr = yyvsp[0].od; ; + break;} +case 135: #line 534 "cmdgram.y" - { yyval.expr = AssignExprNode::alloc(yyvsp[-5].s.lineNumber, yyvsp[-5].s.value, yyvsp[-3].expr, yyvsp[0].expr); ; - break; } - case 138: +{ yyval.expr = AssignExprNode::alloc( yyvsp[-2].s.lineNumber, yyvsp[-2].s.value, NULL, yyvsp[0].expr); ; + break;} +case 136: #line 536 "cmdgram.y" - { yyval.expr = AssignOpExprNode::alloc(yyvsp[-1].s.lineNumber, yyvsp[-1].s.value, NULL, yyvsp[0].asn.expr, yyvsp[0].asn.token); ; - break; } - case 139: +{ yyval.expr = AssignExprNode::alloc( yyvsp[-5].s.lineNumber, yyvsp[-5].s.value, yyvsp[-3].expr, yyvsp[0].expr); ; + break;} +case 137: #line 538 "cmdgram.y" - { yyval.expr = AssignOpExprNode::alloc(yyvsp[-4].s.lineNumber, yyvsp[-4].s.value, yyvsp[-2].expr, yyvsp[0].asn.expr, yyvsp[0].asn.token); ; - break; } - case 140: +{ yyval.expr = AssignOpExprNode::alloc( yyvsp[-1].s.lineNumber, yyvsp[-1].s.value, NULL, yyvsp[0].asn.expr, yyvsp[0].asn.token); ; + break;} +case 138: #line 540 "cmdgram.y" - { yyval.expr = SlotAssignOpNode::alloc(yyvsp[-1].slot.lineNumber, yyvsp[-1].slot.object, yyvsp[-1].slot.slotName, yyvsp[-1].slot.array, yyvsp[0].asn.token, yyvsp[0].asn.expr); ; - break; } - case 141: +{ yyval.expr = AssignOpExprNode::alloc( yyvsp[-4].s.lineNumber, yyvsp[-4].s.value, yyvsp[-2].expr, yyvsp[0].asn.expr, yyvsp[0].asn.token); ; + break;} +case 139: #line 542 "cmdgram.y" - { yyval.expr = SlotAssignNode::alloc(yyvsp[-2].slot.lineNumber, yyvsp[-2].slot.object, yyvsp[-2].slot.array, yyvsp[-2].slot.slotName, yyvsp[0].expr); ; - break; } - case 142: +{ yyval.expr = SlotAssignOpNode::alloc( yyvsp[-1].slot.lineNumber, yyvsp[-1].slot.object, yyvsp[-1].slot.slotName, yyvsp[-1].slot.array, yyvsp[0].asn.token, yyvsp[0].asn.expr); ; + break;} +case 140: #line 544 "cmdgram.y" - { yyval.expr = SlotAssignNode::alloc(yyvsp[-4].slot.lineNumber, yyvsp[-4].slot.object, yyvsp[-4].slot.array, yyvsp[-4].slot.slotName, yyvsp[-1].expr); ; - break; } - case 143: -#line 549 "cmdgram.y" - { yyval.expr = FuncCallExprNode::alloc(yyvsp[-3].s.lineNumber, yyvsp[-3].s.value, NULL, yyvsp[-1].expr, false); ; - break; } - case 144: +{ yyval.expr = SlotAssignNode::alloc( yyvsp[-2].slot.lineNumber, yyvsp[-2].slot.object, yyvsp[-2].slot.array, yyvsp[-2].slot.slotName, yyvsp[0].expr); ; + break;} +case 141: +#line 546 "cmdgram.y" +{ yyval.expr = SlotAssignNode::alloc( yyvsp[-4].slot.lineNumber, yyvsp[-4].slot.object, yyvsp[-4].slot.array, yyvsp[-4].slot.slotName, yyvsp[-1].expr); ; + break;} +case 142: #line 551 "cmdgram.y" - { yyval.expr = FuncCallExprNode::alloc(yyvsp[-5].s.lineNumber, yyvsp[-3].s.value, yyvsp[-5].s.value, yyvsp[-1].expr, false); ; - break; } - case 145: +{ yyval.expr = FuncCallExprNode::alloc( yyvsp[-3].s.lineNumber, yyvsp[-3].s.value, NULL, yyvsp[-1].expr, false); ; + break;} +case 143: #line 553 "cmdgram.y" - { yyvsp[-5].expr->append(yyvsp[-1].expr); yyval.expr = FuncCallExprNode::alloc(yyvsp[-5].expr->dbgLineNumber, yyvsp[-3].s.value, NULL, yyvsp[-5].expr, true); ; - break; } - case 146: +{ yyval.expr = FuncCallExprNode::alloc( yyvsp[-5].s.lineNumber, yyvsp[-3].s.value, yyvsp[-5].s.value, yyvsp[-1].expr, false); ; + break;} +case 144: #line 555 "cmdgram.y" - { yyval.expr = FuncPointerCallExprNode::alloc(yyvsp[-3].expr->dbgLineNumber, yyvsp[-3].expr, yyvsp[-1].expr); ; - break; } - case 147: -#line 560 "cmdgram.y" - { yyval.expr = AssertCallExprNode::alloc(yyvsp[-3].i.lineNumber, yyvsp[-1].expr, NULL); ; - break; } - case 148: -#line 562 "cmdgram.y" - { yyval.expr = AssertCallExprNode::alloc(yyvsp[-5].i.lineNumber, yyvsp[-3].expr, yyvsp[-1].str.value); ; - break; } - case 149: +{ yyvsp[-5].expr->append(yyvsp[-1].expr); yyval.expr = FuncCallExprNode::alloc( yyvsp[-5].expr->dbgLineNumber, yyvsp[-3].s.value, NULL, yyvsp[-5].expr, true); ; + break;} +case 145: +#line 565 "cmdgram.y" +{ yyval.expr = AssertCallExprNode::alloc( yyvsp[-3].i.lineNumber, yyvsp[-1].expr, NULL ); ; + break;} +case 146: #line 567 "cmdgram.y" - { yyval.expr = NULL; ; - break; } - case 150: -#line 569 "cmdgram.y" - { yyval.expr = yyvsp[0].expr; ; - break; } - case 151: +{ yyval.expr = AssertCallExprNode::alloc( yyvsp[-5].i.lineNumber, yyvsp[-3].expr, yyvsp[-1].str.value ); ; + break;} +case 147: +#line 572 "cmdgram.y" +{ yyval.expr = NULL; ; + break;} +case 148: #line 574 "cmdgram.y" - { yyval.expr = yyvsp[0].expr; ; - break; } - case 152: -#line 576 "cmdgram.y" - { (yyvsp[-2].expr)->append(yyvsp[0].expr); yyval.expr = yyvsp[-2].expr; ; - break; } - case 153: +{ yyval.expr = yyvsp[0].expr; ; + break;} +case 149: +#line 579 "cmdgram.y" +{ yyval.expr = yyvsp[0].expr; ; + break;} +case 150: #line 581 "cmdgram.y" - { yyval.slist = NULL; ; - break; } - case 154: -#line 583 "cmdgram.y" - { yyval.slist = yyvsp[0].slist; ; - break; } - case 155: +{ (yyvsp[-2].expr)->append(yyvsp[0].expr); yyval.expr = yyvsp[-2].expr; ; + break;} +case 151: +#line 586 "cmdgram.y" +{ yyval.slist = NULL; ; + break;} +case 152: #line 588 "cmdgram.y" - { yyval.slist = yyvsp[0].slist; ; - break; } - case 156: -#line 590 "cmdgram.y" - { yyvsp[-1].slist->append(yyvsp[0].slist); yyval.slist = yyvsp[-1].slist; ; - break; } - case 157: +{ yyval.slist = yyvsp[0].slist; ; + break;} +case 153: +#line 593 "cmdgram.y" +{ yyval.slist = yyvsp[0].slist; ; + break;} +case 154: #line 595 "cmdgram.y" - { yyval.slist = SlotAssignNode::alloc(yyvsp[-3].s.lineNumber, NULL, NULL, yyvsp[-3].s.value, yyvsp[-1].expr); ; - break; } - case 158: -#line 597 "cmdgram.y" - { yyval.slist = SlotAssignNode::alloc(yyvsp[-4].i.lineNumber, NULL, NULL, yyvsp[-3].s.value, yyvsp[-1].expr, yyvsp[-4].i.value); ; - break; } - case 159: -#line 599 "cmdgram.y" - { yyval.slist = SlotAssignNode::alloc(yyvsp[-3].i.lineNumber, NULL, NULL, StringTable->insert("datablock"), yyvsp[-1].expr); ; - break; } - case 160: -#line 601 "cmdgram.y" - { yyval.slist = SlotAssignNode::alloc(yyvsp[-6].s.lineNumber, NULL, yyvsp[-4].expr, yyvsp[-6].s.value, yyvsp[-1].expr); ; - break; } - case 161: -#line 603 "cmdgram.y" - { yyval.slist = SlotAssignNode::alloc(yyvsp[-7].i.lineNumber, NULL, yyvsp[-4].expr, yyvsp[-6].s.value, yyvsp[-1].expr, yyvsp[-7].i.value); ; - break; } - case 162: +{ yyvsp[-1].slist->append(yyvsp[0].slist); yyval.slist = yyvsp[-1].slist; ; + break;} +case 155: +#line 600 "cmdgram.y" +{ yyval.slist = SlotAssignNode::alloc( yyvsp[-3].s.lineNumber, NULL, NULL, yyvsp[-3].s.value, yyvsp[-1].expr); ; + break;} +case 156: +#line 602 "cmdgram.y" +{ yyval.slist = SlotAssignNode::alloc( yyvsp[-4].i.lineNumber, NULL, NULL, yyvsp[-3].s.value, yyvsp[-1].expr, yyvsp[-4].i.value); ; + break;} +case 157: +#line 604 "cmdgram.y" +{ yyval.slist = SlotAssignNode::alloc( yyvsp[-3].i.lineNumber, NULL, NULL, StringTable->insert("datablock"), yyvsp[-1].expr); ; + break;} +case 158: +#line 606 "cmdgram.y" +{ yyval.slist = SlotAssignNode::alloc( yyvsp[-6].s.lineNumber, NULL, yyvsp[-4].expr, yyvsp[-6].s.value, yyvsp[-1].expr); ; + break;} +case 159: #line 608 "cmdgram.y" - { yyval.expr = yyvsp[0].expr; ; - break; } - case 163: -#line 610 "cmdgram.y" - { yyval.expr = CommaCatExprNode::alloc(yyvsp[-2].expr->dbgLineNumber, yyvsp[-2].expr, yyvsp[0].expr); ; - break; } - } +{ yyval.slist = SlotAssignNode::alloc( yyvsp[-7].i.lineNumber, NULL, yyvsp[-4].expr, yyvsp[-6].s.value, yyvsp[-1].expr, yyvsp[-7].i.value); ; + break;} +case 160: +#line 613 "cmdgram.y" +{ yyval.expr = yyvsp[0].expr; ; + break;} +case 161: +#line 615 "cmdgram.y" +{ yyval.expr = CommaCatExprNode::alloc( yyvsp[-2].expr->dbgLineNumber, yyvsp[-2].expr, yyvsp[0].expr); ; + break;} +} /* the action file gets copied in in place of this dollarsign */ #line 487 "bison.simple" - - yyvsp -= yylen; - yyssp -= yylen; + + yyvsp -= yylen; + yyssp -= yylen; #ifdef YYLSP_NEEDED - yylsp -= yylen; + yylsp -= yylen; #endif #if YYDEBUG != 0 - if (yydebug) - { + if (yydebug) + { short *ssp1 = yyss - 1; - fprintf(stderr, "state stack now"); + fprintf (stderr, "state stack now"); while (ssp1 != yyssp) - fprintf(stderr, " %d", *++ssp1); - fprintf(stderr, "\n"); - } + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } #endif - *++yyvsp = yyval; + *++yyvsp = yyval; #ifdef YYLSP_NEEDED - yylsp++; - if (yylen == 0) - { + yylsp++; + if (yylen == 0) + { yylsp->first_line = yylloc.first_line; yylsp->first_column = yylloc.first_column; - yylsp->last_line = (yylsp - 1)->last_line; - yylsp->last_column = (yylsp - 1)->last_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; yylsp->text = 0; - } - else - { - yylsp->last_line = (yylsp + yylen - 1)->last_line; - yylsp->last_column = (yylsp + yylen - 1)->last_column; - } + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } #endif - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ - yyn = yyr1[yyn]; + yyn = yyr1[yyn]; - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTBASE]; + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTBASE]; - goto yynewstate; + goto yynewstate; yyerrlab: /* here on detecting error */ - if (!yyerrstatus) - /* If not already recovering from an error, report this error. */ - { + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ + { ++yynerrs; #ifdef YYERROR_VERBOSE yyn = yypact[yystate]; if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; + { + int size = 0; + char *msg; + int x, count; - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *)malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - yyerror(msg); - free(msg); - } - else - yyerror("parse error; also virtual memory exceeded"); - } + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + yyerror(msg); + free(msg); + } + else + yyerror ("parse error; also virtual memory exceeded"); + } else #endif /* YYERROR_VERBOSE */ - yyerror("parse error"); - } + yyerror("parse error"); + } - goto yyerrlab1; + goto yyerrlab1; yyerrlab1: /* here on error raised explicitly by an action */ - if (yyerrstatus == 3) - { + if (yyerrstatus == 3) + { /* if just tried and failed to reuse lookahead token after an error, discard it. */ /* return failure if at end of input */ if (yychar == YYEOF) - YYABORT; + YYABORT; #if YYDEBUG != 0 if (yydebug) - fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); #endif yychar = YYEMPTY; - } + } - /* Else will try to reuse lookahead token - after shifting the error token. */ + /* Else will try to reuse lookahead token + after shifting the error token. */ - yyerrstatus = 3; /* Each real token shifted decrements this */ + yyerrstatus = 3; /* Each real token shifted decrements this */ - goto yyerrhandle; + goto yyerrhandle; yyerrdefault: /* current state does not do anything special for the error token. */ #if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto yydefault; + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; #endif yyerrpop: /* pop the current state because it cannot handle the error token */ - if (yyssp == yyss) YYABORT; - yyvsp--; - yystate = *--yyssp; + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; #ifdef YYLSP_NEEDED - yylsp--; + yylsp--; #endif #if YYDEBUG != 0 - if (yydebug) - { + if (yydebug) + { short *ssp1 = yyss - 1; - fprintf(stderr, "Error: state stack now"); + fprintf (stderr, "Error: state stack now"); while (ssp1 != yyssp) - fprintf(stderr, " %d", *++ssp1); - fprintf(stderr, "\n"); - } + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } #endif yyerrhandle: - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; - yyn = yytable[yyn]; - if (yyn < 0) - { + yyn = yytable[yyn]; + if (yyn < 0) + { if (yyn == YYFLAG) - goto yyerrpop; + goto yyerrpop; yyn = -yyn; goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; + } + else if (yyn == 0) + goto yyerrpop; - if (yyn == YYFINAL) - YYACCEPT; + if (yyn == YYFINAL) + YYACCEPT; #if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting error token, "); + if (yydebug) + fprintf(stderr, "Shifting error token, "); #endif - *++yyvsp = yylval; + *++yyvsp = yylval; #ifdef YYLSP_NEEDED - *++yylsp = yylloc; + *++yylsp = yylloc; #endif - yystate = yyn; - goto yynewstate; + yystate = yyn; + goto yynewstate; } -#line 612 "cmdgram.y" +#line 617 "cmdgram.y" diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index 997519231..d3687a2cd 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -565,7 +565,7 @@ bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, con return true; } -void CodeBlock::compileExec(StringTableEntry fileName, const char *inString, ConsoleValue &returnValue, bool noCalls, S32 setFrame) +ConsoleValue CodeBlock::compileExec(StringTableEntry fileName, const char *inString, bool noCalls, S32 setFrame) { AssertFatal(Con::isMainThread(), "Compiling code on a secondary thread"); @@ -619,7 +619,7 @@ void CodeBlock::compileExec(StringTableEntry fileName, const char *inString, Con if (!gStatementList) { delete this; - return; + return std::move(ConsoleValue()); } resetTables(); @@ -653,7 +653,7 @@ void CodeBlock::compileExec(StringTableEntry fileName, const char *inString, Con if (lastIp + 1 != codeSize) Con::warnf(ConsoleLogEntry::General, "precompile size mismatch, precompile: %d compile: %d", codeSize, lastIp); - exec(0, fileName, NULL, 0, 0, noCalls, NULL, returnValue, setFrame); + return std::move(exec(0, fileName, NULL, 0, 0, noCalls, NULL, setFrame)); } //------------------------------------------------------------------------- diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 1d9ae968c..e0bfcee7e 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -420,7 +420,7 @@ void ExprEvalState::setStringVariable(const char *val) //----------------------------------------------------------------------------- U32 gExecCount = 0; -void CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNamespace, U32 argc, ConsoleValue* argv, bool noCalls, StringTableEntry packageName, ConsoleValue& returnValue, S32 setFrame) +ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNamespace, U32 argc, ConsoleValue* argv, bool noCalls, StringTableEntry packageName, S32 setFrame) { #ifdef TORQUE_DEBUG U32 stackStart = STR.mStartStackSize; @@ -432,6 +432,7 @@ void CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNamespace, U32 i; U32 iterDepth = 0; + ConsoleValue returnValue; incRefCount(); F64* curFloatTable; @@ -1738,9 +1739,8 @@ void CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNamespace, { if (nsEntry->mFunctionOffset) { - ConsoleValue ret; - nsEntry->mCode->exec(nsEntry->mFunctionOffset, fnName, nsEntry->mNamespace, callArgc, callArgv, false, nsEntry->mPackage, ret); - STR.setStringValue(ret.getString()); + const char* ret = nsEntry->mCode->exec(nsEntry->mFunctionOffset, fnName, nsEntry->mNamespace, callArgc, callArgv, false, nsEntry->mPackage).getString(); + STR.setStringValue(ret); } else // no body STR.setStringValue(""); @@ -2128,6 +2128,10 @@ execFinished: AssertFatal(!(STR.mStartStackSize > stackStart), "String stack not popped enough in script exec"); AssertFatal(!(STR.mStartStackSize < stackStart), "String stack popped too much in script exec"); #endif + + if (returnValue.getType() == ConsoleValueType::cvNone) + returnValue.setStringTableEntry(StringTable->EmptyString()); + return std::move(returnValue); } //------------------------------------------------------------ diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index 150b3f823..78b4ba05f 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -73,6 +73,11 @@ char* ConsoleValue::convertToBuffer() const return offset; } +const char* ConsoleValue::getConsoleData() const +{ + return Con::getData(type, ct->dataPtr, 0, ct->enumTable); +} + ConsoleDocFragment* ConsoleDocFragment::smFirst; ExprEvalState gEvalState; StmtNode *gStatementList; diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index cb49911c2..4d9c21296 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -158,25 +158,12 @@ class ConsoleValue char* convertToBuffer() const; - TORQUE_FORCEINLINE bool isStringType() const - { - return type == ConsoleValueType::cvString || type == ConsoleValueType::cvSTEntry; - } - - TORQUE_FORCEINLINE bool isNumberType() const - { - return type == ConsoleValueType::cvFloat || type == ConsoleValueType::cvInteger; - } - TORQUE_FORCEINLINE bool hasAllocatedData() const { - return type == ConsoleValueType::cvString || type >= ConsoleValueType::cvConsoleValueType; + return type == ConsoleValueType::cvString || isConsoleType(); } - TORQUE_FORCEINLINE const char* getConsoleData() const - { - return Con::getData(type, ct->dataPtr, 0, ct->enumTable); - } + const char* getConsoleData() const; TORQUE_FORCEINLINE void cleanupData() { @@ -192,7 +179,7 @@ public: type = ConsoleValueType::cvNone; } - ConsoleValue(ConsoleValue&& ref) + ConsoleValue(ConsoleValue&& ref) noexcept { cleanupData(); type = ref.type; @@ -209,7 +196,7 @@ public: f = ref.f; break; case cvSTEntry: - TORQUE_CASE_FALLTHROUGH + TORQUE_CASE_FALLTHROUGH; case cvString: s = ref.s; break; @@ -229,6 +216,12 @@ public: cleanupData(); } + TORQUE_FORCEINLINE void reset() + { + cleanupData(); + type = ConsoleValueType::cvNone; + } + TORQUE_FORCEINLINE F64 getFloat() const { AssertFatal(type == ConsoleValueType::cvNone, "Attempted to access ConsoleValue when it has no value!"); @@ -263,6 +256,11 @@ public: return getConsoleData(); } + TORQUE_FORCEINLINE operator const char* () const + { + return getString(); + } + TORQUE_FORCEINLINE bool getBool() const { AssertFatal(type == ConsoleValueType::cvNone, "Attempted to access ConsoleValue when it has no value!"); @@ -290,6 +288,11 @@ public: i = val; } + TORQUE_FORCEINLINE void setString(const char* val) + { + setString(val, dStrlen(val)); + } + TORQUE_FORCEINLINE void setString(const char* val, S32 len) { cleanupData(); @@ -315,11 +318,11 @@ public: s = const_cast(val); } - TORQUE_FORCEINLINE void setConsoleData(S32 consoleType, void* dataPtr, EnumTable* enumTable) + TORQUE_FORCEINLINE void setConsoleData(S32 consoleType, void* dataPtr, const EnumTable* enumTable) { cleanupData(); type = ConsoleValueType::cvSTEntry; - ct = new ConsoleValueConsoleType{ dataPtr, enumTable }; + ct = new ConsoleValueConsoleType{ dataPtr, const_cast(enumTable) }; } TORQUE_FORCEINLINE S32 getType() const @@ -327,6 +330,21 @@ public: return type; } + TORQUE_FORCEINLINE bool isStringType() const + { + return type == ConsoleValueType::cvString || type == ConsoleValueType::cvSTEntry; + } + + TORQUE_FORCEINLINE bool isNumberType() const + { + return type == ConsoleValueType::cvFloat || type == ConsoleValueType::cvInteger; + } + + TORQUE_FORCEINLINE bool isConsoleType() const + { + return type >= ConsoleValueType::cvConsoleValueType; + } + static void init(); static S32 getConstantBufferCount() { return (S32)ConversionBufferSize / StringSize; } }; diff --git a/Engine/source/console/consoleInternal.cpp b/Engine/source/console/consoleInternal.cpp index 4fd2aaa0b..d224f6154 100644 --- a/Engine/source/console/consoleInternal.cpp +++ b/Engine/source/console/consoleInternal.cpp @@ -480,8 +480,6 @@ Dictionary::Entry::Entry(StringTableEntry in_name) Dictionary::Entry::~Entry() { - value.cleanup(); - if (notify) delete notify; } @@ -560,20 +558,13 @@ Dictionary::Entry* Dictionary::addVariable(const char *name, } Entry *ent = add(StringTable->insert(name)); - - if (ent->value.type <= ConsoleValue::TypeInternalString && - ent->value.bufferLen > 0) - dFree(ent->value.sval); - - ent->value.type = type; - ent->value.dataPtr = dataPtr; ent->mUsage = usage; // Fetch enum table, if any. ConsoleBaseType* conType = ConsoleBaseType::getType(type); AssertFatal(conType, "Dictionary::addVariable - invalid console type"); - ent->value.enumTable = conType->getEnumTable(); + ent->value.setConsoleData(type, dataPtr, conType->getEnumTable()); return ent; } @@ -1303,9 +1294,11 @@ ConsoleValue Namespace::Entry::execute(S32 argc, ConsoleValue *argv, ExprEvalSta switch (mType) { case StringCallbackType: + { const char* str = cb.mStringCallbackFunc(state->thisObject, argc, argv); result.setString(str, dStrlen(str)); break; + } case IntCallbackType: result.setInt(cb.mIntCallbackFunc(state->thisObject, argc, argv)); break; diff --git a/Engine/source/console/consoleInternal.h b/Engine/source/console/consoleInternal.h index ac61f5331..cba74715a 100644 --- a/Engine/source/console/consoleInternal.h +++ b/Engine/source/console/consoleInternal.h @@ -274,8 +274,6 @@ public: typedef VectorPtr::iterator NamespaceEntryListIterator; - - class Dictionary { public: @@ -307,7 +305,6 @@ public: mUsage = NULL; mIsConstant = false; mNext = NULL; - value.init(); } Entry(StringTableEntry name); @@ -317,7 +314,7 @@ public: void reset() { name = NULL; - value.cleanup(); + value.reset(); if (notify) delete notify; } diff --git a/Engine/source/console/engineAPI.h b/Engine/source/console/engineAPI.h index 8fefd5fdc..aa6eb3ce2 100644 --- a/Engine/source/console/engineAPI.h +++ b/Engine/source/console/engineAPI.h @@ -1187,8 +1187,7 @@ public: if (Con::isMainThread()) { ConsoleStackFrameSaver sav; sav.save(); - CSTK.reserveValues(mArgc + sizeof...(ArgTs), mArgv); - mArgv[ 0 ].value->setStackStringValue(mCallbackName); + mArgv[ 0 ].setStringTableEntry(mCallbackName); Helper::marshallEach(mArgc, mArgv, args...); @@ -1199,7 +1198,7 @@ public: SimConsoleThreadExecCallback cb; SimConsoleThreadExecEvent *evt = new SimConsoleThreadExecEvent(mArgc + sizeof...(ArgTs), NULL, false, &cb); evt->populateArgs(mArgv); - mArgv[ 0 ].value->setStackStringValue(mCallbackName); + mArgv[ 0 ].setStringTableEntry(mCallbackName); Helper::marshallEach(mArgc, mArgv, args...); @@ -1233,7 +1232,6 @@ public: if (Con::isMainThread()) { ConsoleStackFrameSaver sav; sav.save(); - CSTK.reserveValues(mArgc+sizeof...(ArgTs), mArgv); mArgv[ 0 ].setString(simCB, dStrlen(simCB)); Helper::marshallEach(mArgc, mArgv, args...); diff --git a/Engine/source/console/engineDoc.cpp b/Engine/source/console/engineDoc.cpp index cbbc7249d..56563efe0 100644 --- a/Engine/source/console/engineDoc.cpp +++ b/Engine/source/console/engineDoc.cpp @@ -114,7 +114,7 @@ static void dumpVariable( Stream& stream, { // Skip variables defined in script. - if( entry->value.type < 0 ) + if( !entry->value.isConsoleType() ) return; // Skip internals... don't export them. @@ -149,7 +149,7 @@ static void dumpVariable( Stream& stream, // Skip variables for which we can't decipher their type. - ConsoleBaseType* type = ConsoleBaseType::getType( entry->value.type ); + ConsoleBaseType* type = ConsoleBaseType::getType( entry->value.getType() ); if( !type ) { Con::errorf( "Can't find type for variable '%s'", entry->name ); diff --git a/Engine/source/console/optimizer.cpp b/Engine/source/console/optimizer.cpp new file mode 100644 index 000000000..9bfbb09a5 --- /dev/null +++ b/Engine/source/console/optimizer.cpp @@ -0,0 +1,104 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2013 GarageGames, LLC +// Copyright (c) 2021 TGEMIT Authors & Contributors +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +#include "console/console.h" +#include "console/codeBlock.h" + +static bool isLiteralNumber(ExprNode* node) +{ + ExprNodeName name = node->getExprNodeNameEnum(); + return name == NameFloatNode || name == NameIntNode; +} + +static F64 getFloatValue(ExprNode* node) +{ + if (node->getExprNodeNameEnum() == NameFloatNode) + return static_cast(node)->value; + return (F64)static_cast(node)->value; +} + +static S32 getIntValue(ExprNode* node) +{ + if (node->getExprNodeNameEnum() == NameFloatNode) + return (S32)static_cast(node)->value; + return static_cast(node)->value; +} + +bool FloatBinaryExprNode::optimize() +{ + // Perform constant folding + if (isLiteralNumber(right) && isLiteralNumber(left)) + { + F64 rightValue = getFloatValue(right); + F64 leftValue = getFloatValue(left); + F64 result = 0.0; + + switch (op) + { + case '+': + result = leftValue + rightValue; + break; + case '-': + result = leftValue - rightValue; + break; + case '*': + result = leftValue * rightValue; + break; + case '/': + if (rightValue != 0.0) + result = leftValue / rightValue; + break; + } + + optimizedNode = FloatNode::alloc(dbgLineNumber, result); + return true; + } + + return false; +} + +bool IntBinaryExprNode::optimize() +{ + if (op == '%' && left->getExprNodeNameEnum() == NameVarNode && isLiteralNumber(right)) + { + // %a % intconst + S32 val = getIntValue(right); + switch (val) + { + case 2: + op = '&'; + optimizedNode = IntNode::alloc(dbgLineNumber, 1); + return true; + case 4: + op = '&'; + optimizedNode = IntNode::alloc(dbgLineNumber, 3); + return true; + case 8: + op = '&'; + optimizedNode = IntNode::alloc(dbgLineNumber, 7); + return true; + } + } + + return false; +} diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index 008ba9698..56a88cb8d 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -2962,7 +2962,7 @@ DefineEngineStringlyVariadicMethod( SimObject, call, const char*, 3, 0, "( strin "@param args Zero or more arguments for the method.\n" "@return The result of the method call." ) { - argv[1] = argv[2]; + argv[1].setString(argv[2], dStrlen(argv[2])); return Con::execute( object, argc - 1, argv + 1 ); } @@ -3065,9 +3065,9 @@ DefineEngineStringlyVariadicMethod( SimObject,schedule, S32, 4, 0, "( float time "@param args The arguments with which to call the method.\n" "@return The numeric ID of the created schedule. Can be used to cancel the call.\n" ) { - U32 timeDelta = U32(dAtof(argv[2])); - argv[2] = argv[3]; - argv[3] = argv[1]; + U32 timeDelta = U32(argv[2].getFloat()); + argv[2].setString(argv[3].getString()); + argv[3].setString(argv[1].getString()); SimConsoleEvent *evt = new SimConsoleEvent(argc - 2, argv + 2, true); S32 ret = Sim::postEvent(object, evt, Sim::getCurrentTime() + timeDelta); // #ifdef DEBUG diff --git a/Engine/source/console/test/consoleTest.cpp b/Engine/source/console/test/consoleTest.cpp index d1ced9ec9..a143d1835 100644 --- a/Engine/source/console/test/consoleTest.cpp +++ b/Engine/source/console/test/consoleTest.cpp @@ -1,4 +1,4 @@ -#ifdef 0 +#if 0 #ifdef TORQUE_TESTS_ENABLED #include "testing/unitTesting.h" diff --git a/Engine/source/gui/controls/guiGameListMenuCtrl.cpp b/Engine/source/gui/controls/guiGameListMenuCtrl.cpp index ece9535e5..276f4511d 100644 --- a/Engine/source/gui/controls/guiGameListMenuCtrl.cpp +++ b/Engine/source/gui/controls/guiGameListMenuCtrl.cpp @@ -361,10 +361,8 @@ void GuiGameListMenuCtrl::onRenderSliderOption(Row* row, Point2I currentOffset) // calculate text to be at the center between the arrows GFont* font = profile->mFont; - ConsoleValue val; - val.setFloatValue(row->mValue); - - const char* stringVal = val.getStringValue(); + char stringVal[32]; + dSprintf(stringVal, 32, "%f", row->mValue); S32 textWidth = font->getStrWidth(stringVal); S32 columnWidth = profile->mHitAreaLowerRight.x * xScale - profile->mRightPad - columnSplit; diff --git a/Engine/source/shaderGen/customShaderFeature.cpp b/Engine/source/shaderGen/customShaderFeature.cpp index c184cb128..25e2975b0 100644 --- a/Engine/source/shaderGen/customShaderFeature.cpp +++ b/Engine/source/shaderGen/customShaderFeature.cpp @@ -236,7 +236,7 @@ DefineEngineStringlyVariadicMethod(CustomShaderFeatureData, writeLine, void, 3, "@param args Zero or more arguments for the method.\n" "@return The result of the method call.") { - object->writeLine(argv[2], argc - 3, argv + 3); + object->writeLine(argv[2].getString(), argc - 3, argv + 3); } DefineEngineMethod(CustomShaderFeatureData, hasFeature, bool, (String name), (""), "") From f776e73b04c67271516aab4c0e543cd693af912c Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Fri, 2 Apr 2021 00:57:49 -0400 Subject: [PATCH 006/399] cleanup --- Engine/source/console/compiledEval.cpp | 7 +---- Engine/source/console/console.cpp | 12 ++++----- Engine/source/console/console.h | 32 +++++++++++++---------- Engine/source/console/consoleInternal.cpp | 13 ++++++++- Engine/source/console/consoleInternal.h | 5 +++- Engine/source/console/engineAPI.h | 8 +++--- Engine/source/console/simEvents.cpp | 6 ++--- Engine/source/console/simManager.cpp | 4 --- Engine/source/console/simObject.cpp | 2 +- Engine/source/console/stringStack.cpp | 2 +- Engine/source/console/stringStack.h | 13 --------- 11 files changed, 50 insertions(+), 54 deletions(-) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index e0bfcee7e..bffe06980 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -1076,7 +1076,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa STR.rewind(); returnValue.setString(retVal, STR.mLen); - //STR.setStringValue(returnValue); // Not nice but works. + STR.setStringValue(retVal); // Not nice but works. } goto execFinished; @@ -2070,9 +2070,6 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa } } execFinished: -#ifdef TORQUE_DEBUG - AssertFatal(returnValue.getType() == ConsoleValueType::cvNone, "returnValue was never set during script exec"); -#endif if (telDebuggerOn && setFrame < 0) TelDebugger->popStackFrame(); @@ -2129,8 +2126,6 @@ execFinished: AssertFatal(!(STR.mStartStackSize < stackStart), "String stack popped too much in script exec"); #endif - if (returnValue.getType() == ConsoleValueType::cvNone) - returnValue.setStringTableEntry(StringTable->EmptyString()); return std::move(returnValue); } diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index 78b4ba05f..a9dd4de40 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -1555,7 +1555,7 @@ ConsoleValue _internalExecute(S32 argc, ConsoleValue argv[]) if (result) { ConsoleValue ret; - ret.setString(methodRes, dStrlen(methodRes)); + ret.setString(methodRes); return std::move(ret); } @@ -1644,7 +1644,7 @@ static ConsoleValue _internalExecute(SimObject *object, S32 argc, ConsoleValue a if (result) { ConsoleValue val; - val.setString(methodRes, dStrlen(methodRes)); + val.setString(methodRes); return std::move(val); } @@ -1672,7 +1672,7 @@ static ConsoleValue _internalExecute(SimObject *object, S32 argc, ConsoleValue a gEvalState.thisObject = save; // Twiddle it back - argv[1].setString(oldIdent, dStrlen(oldIdent)); + argv[1].setString(oldIdent); return std::move(ret); } @@ -1934,8 +1934,8 @@ void postConsoleInput( RawData data ) // TODO(JTH): Mem leak // Schedule this to happen at the next time event. ConsoleValue* argv = new ConsoleValue[2]; - argv[0].setString("eval", 4); - argv[1].setString(reinterpret_cast(data.data), dStrlen(reinterpret_cast(data.data))); + argv[0].setString("eval"); + argv[1].setString(reinterpret_cast(data.data)); Sim::postCurrentEvent(Sim::getRootGroup(), new SimConsoleEvent(2, argv, false)); } @@ -2577,7 +2577,7 @@ StringArrayToConsoleValueWrapper::StringArrayToConsoleValueWrapper(int targc, co for (int i=0; i(val); } + TORQUE_FORCEINLINE void setEmptyString() + { + setStringTableEntry(StringTable->EmptyString()); + } + TORQUE_FORCEINLINE void setConsoleData(S32 consoleType, void* dataPtr, const EnumTable* enumTable) { cleanupData(); diff --git a/Engine/source/console/consoleInternal.cpp b/Engine/source/console/consoleInternal.cpp index d224f6154..0444369f2 100644 --- a/Engine/source/console/consoleInternal.cpp +++ b/Engine/source/console/consoleInternal.cpp @@ -633,6 +633,10 @@ void ExprEvalState::pushFrame(StringTableEntry frameName, Namespace *ns, S32 reg AssertFatal(!newFrame.getCount(), "ExprEvalState::pushFrame - Dictionary not empty!"); + ConsoleValue* consoleValArray = new ConsoleValue[registerCount]; + localStack.push_back(ConsoleValueFrame(consoleValArray, false)); + currentRegisterArray = &localStack.last(); + #ifdef DEBUG_SPEW validate(); #endif @@ -653,6 +657,13 @@ void ExprEvalState::popFrame() stack[mStackDepth]->reset(); currentVariable = NULL; + const ConsoleValueFrame& frame = localStack.last(); + localStack.pop_back(); + if (!frame.isReference) + delete[] frame.values; + + currentRegisterArray = localStack.size() ? &localStack.last() : NULL; + #ifdef DEBUG_SPEW validate(); #endif @@ -1296,7 +1307,7 @@ ConsoleValue Namespace::Entry::execute(S32 argc, ConsoleValue *argv, ExprEvalSta case StringCallbackType: { const char* str = cb.mStringCallbackFunc(state->thisObject, argc, argv); - result.setString(str, dStrlen(str)); + result.setString(str); break; } case IntCallbackType: diff --git a/Engine/source/console/consoleInternal.h b/Engine/source/console/consoleInternal.h index cba74715a..085a7a0e5 100644 --- a/Engine/source/console/consoleInternal.h +++ b/Engine/source/console/consoleInternal.h @@ -372,7 +372,7 @@ public: return; } - value.setString(newValue, dStrlen(newValue)); + value.setString(newValue); // Fire off the notification if we have one. if (notify) @@ -456,6 +456,9 @@ struct ConsoleValueFrame ConsoleValue* values; bool isReference; + ConsoleValueFrame() : values(NULL), isReference(false) + {} + ConsoleValueFrame(ConsoleValue* vals, bool isRef) { values = vals; diff --git a/Engine/source/console/engineAPI.h b/Engine/source/console/engineAPI.h index aa6eb3ce2..5cfa7cc09 100644 --- a/Engine/source/console/engineAPI.h +++ b/Engine/source/console/engineAPI.h @@ -171,11 +171,11 @@ inline void EngineMarshallData( F32 arg, S32& argc, ConsoleValue *argv ) } inline void EngineMarshallData( const char* arg, S32& argc, ConsoleValue *argv ) { - argv[ argc++ ].setString(arg, dStrlen(arg)); + argv[ argc++ ].setString(arg); } inline void EngineMarshallData( char* arg, S32& argc, ConsoleValue *argv ) { - argv[ argc++ ].setString(arg, dStrlen(arg)); + argv[ argc++ ].setString(arg); } template< typename T > @@ -1232,7 +1232,7 @@ public: if (Con::isMainThread()) { ConsoleStackFrameSaver sav; sav.save(); - mArgv[ 0 ].setString(simCB, dStrlen(simCB)); + mArgv[ 0 ].setString(simCB); Helper::marshallEach(mArgc, mArgv, args...); @@ -1243,7 +1243,7 @@ public: SimConsoleThreadExecCallback cb; SimConsoleThreadExecEvent *evt = new SimConsoleThreadExecEvent(mArgc+sizeof...(ArgTs), NULL, true, &cb); evt->populateArgs(mArgv); - mArgv[ 0 ].setString(simCB, dStrlen(simCB)); + mArgv[ 0 ].setString(simCB); Helper::marshallEach(mArgc, mArgv, args...); diff --git a/Engine/source/console/simEvents.cpp b/Engine/source/console/simEvents.cpp index 97eb74d40..e375438e9 100644 --- a/Engine/source/console/simEvents.cpp +++ b/Engine/source/console/simEvents.cpp @@ -38,7 +38,7 @@ SimConsoleEvent::SimConsoleEvent(S32 argc, ConsoleValue *argv, bool onObject) { if (argv) { - mArgv->setString(argv[i].getString(), dStrlen(argv[i].getString())); + mArgv->setString(argv[i].getString()); } } } @@ -92,7 +92,7 @@ void SimConsoleEvent::populateArgs(ConsoleValue *argv) { for (U32 i=0; irelease(); } diff --git a/Engine/source/console/simManager.cpp b/Engine/source/console/simManager.cpp index b874f752e..7aaf773e6 100644 --- a/Engine/source/console/simManager.cpp +++ b/Engine/source/console/simManager.cpp @@ -388,8 +388,6 @@ SimObject* findObject(const char* name) SimObject* findObject(const ConsoleValue &val) { - if (val.getType() == ConsoleValueType::cvNone) - return NULL; if (val.getType() == ConsoleValueType::cvInteger) return findObject((SimObjectId)val.getInt()); return findObject(val.getString()); @@ -397,8 +395,6 @@ SimObject* findObject(const ConsoleValue &val) SimObject* findObject(ConsoleValue* val) { - if (val->getType() == ConsoleValueType::cvNone) - return NULL; if (val->getType() == ConsoleValueType::cvInteger) return findObject((SimObjectId)val->getInt()); return findObject(val->getString()); diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index 56a88cb8d..17a4c1c73 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -2962,7 +2962,7 @@ DefineEngineStringlyVariadicMethod( SimObject, call, const char*, 3, 0, "( strin "@param args Zero or more arguments for the method.\n" "@return The result of the method call." ) { - argv[1].setString(argv[2], dStrlen(argv[2])); + argv[1].setString(argv[2]); return Con::execute( object, argc - 1, argv + 1 ); } diff --git a/Engine/source/console/stringStack.cpp b/Engine/source/console/stringStack.cpp index cfe2d83f5..78d98f183 100644 --- a/Engine/source/console/stringStack.cpp +++ b/Engine/source/console/stringStack.cpp @@ -82,7 +82,7 @@ void StringStack::setIntValue(U32 i) void StringStack::setFloatValue(F64 v) { validateBufferSize(mStart + 32); - dSprintf(mBuffer + mStart, 32, "%g", v); + dSprintf(mBuffer + mStart, 32, "%.9g", v); mLen = dStrlen(mBuffer + mStart); } diff --git a/Engine/source/console/stringStack.h b/Engine/source/console/stringStack.h index 1cb8a5bc0..1b5d5d84e 100644 --- a/Engine/source/console/stringStack.h +++ b/Engine/source/console/stringStack.h @@ -138,16 +138,6 @@ struct StringStack return mBuffer + mStartOffsets[mStartStackSize-1]; } - inline StringStackPtr getStringValuePtr() - { - return (getStringValue() - mBuffer); - } - - inline StringStackPtr getPreviousStringValuePtr() - { - return (getPreviousStringValue() - mBuffer); - } - /// Advance the start stack, placing a zero length string on the top. /// /// @note You should use StringStack::push, not this, if you want to @@ -184,9 +174,6 @@ struct StringStack void popFrame(); void clearFrames(); - - /// Get the arguments for a function call from the stack. - void getArgcArgv(StringTableEntry name, U32 *argc, const char ***in_argv, bool popStackFrame = false); }; extern StringStack STR; From 3e04196a5379c8e3cac26d1f87324ea7ec75c94e Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 3 Apr 2021 01:53:40 -0400 Subject: [PATCH 007/399] make tests pass. --- Engine/source/console/astAlloc.cpp | 2 +- Engine/source/console/compiledEval.cpp | 22 ++- Engine/source/console/console.h | 9 +- Engine/source/console/consoleInternal.cpp | 12 +- Engine/source/console/consoleInternal.h | 2 + Engine/source/console/engineAPI.h | 2 +- Engine/source/console/test/ScriptTest.cpp | 176 +++++++----------- .../source/core/strings/stringFunctions.cpp | 2 +- 8 files changed, 103 insertions(+), 124 deletions(-) diff --git a/Engine/source/console/astAlloc.cpp b/Engine/source/console/astAlloc.cpp index 58d5a0d7f..50d02bcaa 100644 --- a/Engine/source/console/astAlloc.cpp +++ b/Engine/source/console/astAlloc.cpp @@ -254,7 +254,7 @@ StrConstNode* StrConstNode::alloc(S32 lineNumber, char* str, bool tag, bool doc) ret->str = (char*)consoleAlloc(len + 1); ret->tag = tag; ret->doc = doc; - dStrcpy(ret->str, str, len); + dStrcpy(ret->str, str, len + 1); ret->str[len] = '\0'; return ret; diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index bffe06980..0375ab14e 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -512,6 +512,12 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa curStringTable = globalStrings; curStringTableLen = globalStringsMaxLen; + // If requested stack frame isn't available, request a new one + // (this prevents assert failures when creating local + // variables without a stack frame) + if (gEvalState.getStackDepth() <= setFrame) + setFrame = -1; + // Do we want this code to execute using a new stack frame? if (setFrame < 0) { @@ -519,13 +525,13 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa gCallStack.pushFrame(0); popFrame = true; } - else if (!gEvalState.stack.empty()) + else { // We want to copy a reference to an existing stack frame // on to the top of the stack. Any change that occurs to // the locals during this new frame will also occur in the // original frame. - S32 stackIndex = gEvalState.stack.size() - setFrame - 1; + S32 stackIndex = gEvalState.getTopOfStack() - setFrame - 1; gEvalState.pushFrameRef(stackIndex); popFrame = true; } @@ -1062,7 +1068,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // We're falling thru here on purpose. case OP_RETURN: - + { if (iterDepth > 0) { // Clear iterator state. @@ -1074,13 +1080,13 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa const char* retVal = STR.getStringValue(); STR.rewind(); - - returnValue.setString(retVal, STR.mLen); STR.setStringValue(retVal); // Not nice but works. } - goto execFinished; + returnValue.setString(STR.getStringValue(), STR.mLen); + goto execFinished; + } case OP_RETURN_FLT: if (iterDepth > 0) @@ -1739,8 +1745,8 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa { if (nsEntry->mFunctionOffset) { - const char* ret = nsEntry->mCode->exec(nsEntry->mFunctionOffset, fnName, nsEntry->mNamespace, callArgc, callArgv, false, nsEntry->mPackage).getString(); - STR.setStringValue(ret); + ConsoleValue returnFromFn = nsEntry->mCode->exec(nsEntry->mFunctionOffset, fnName, nsEntry->mNamespace, callArgc, callArgv, false, nsEntry->mPackage); + STR.setStringValue(returnFromFn.getString()); } else // no body STR.setStringValue(""); diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index dfdb90010..763adc564 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -203,6 +203,7 @@ public: break; } + ref.data = NULL; ref.setEmptyString(); } @@ -283,7 +284,7 @@ public: TORQUE_FORCEINLINE void setString(const char* val) { - setString(val, dStrlen(val) + 1); + setString(val, dStrlen(val)); } TORQUE_FORCEINLINE void setString(const char* val, S32 len) @@ -298,9 +299,9 @@ public: type = ConsoleValueType::cvString; - s = (char*)dMalloc(len + 1); - s[len] = 0x0; - dStrcpy(s, val, len); + s = (char*)dMalloc(static_cast(len) + 1); + s[len] = '\0'; + dStrcpy(s, val, static_cast(len) + 1); } TORQUE_FORCEINLINE void setBool(const bool val) diff --git a/Engine/source/console/consoleInternal.cpp b/Engine/source/console/consoleInternal.cpp index 0444369f2..336de99fa 100644 --- a/Engine/source/console/consoleInternal.cpp +++ b/Engine/source/console/consoleInternal.cpp @@ -637,6 +637,8 @@ void ExprEvalState::pushFrame(StringTableEntry frameName, Namespace *ns, S32 reg localStack.push_back(ConsoleValueFrame(consoleValArray, false)); currentRegisterArray = &localStack.last(); + AssertFatal(mStackDepth == localStack.size(), avar("Stack sizes do not match. mStackDepth = %d, localStack = %d", mStackDepth, localStack.size())); + #ifdef DEBUG_SPEW validate(); #endif @@ -664,6 +666,8 @@ void ExprEvalState::popFrame() currentRegisterArray = localStack.size() ? &localStack.last() : NULL; + AssertFatal(mStackDepth == localStack.size(), avar("Stack sizes do not match. mStackDepth = %d, localStack = %d", mStackDepth, localStack.size())); + #ifdef DEBUG_SPEW validate(); #endif @@ -671,7 +675,7 @@ void ExprEvalState::popFrame() void ExprEvalState::pushFrameRef(S32 stackIndex) { - AssertFatal(stackIndex >= 0 && stackIndex < stack.size(), "You must be asking for a valid frame!"); + AssertFatal(stackIndex >= 0 && stackIndex < mStackDepth, "You must be asking for a valid frame!"); #ifdef DEBUG_SPEW validate(); @@ -695,6 +699,12 @@ void ExprEvalState::pushFrameRef(S32 stackIndex) mStackDepth++; currentVariable = NULL; + ConsoleValue* values = localStack[stackIndex].values; + localStack.push_back(ConsoleValueFrame(values, true)); + currentRegisterArray = &localStack.last(); + + AssertFatal(mStackDepth == localStack.size(), avar("Stack sizes do not match. mStackDepth = %d, localStack = %d", mStackDepth, localStack.size())); + #ifdef DEBUG_SPEW validate(); #endif diff --git a/Engine/source/console/consoleInternal.h b/Engine/source/console/consoleInternal.h index 085a7a0e5..e1d2cd462 100644 --- a/Engine/source/console/consoleInternal.h +++ b/Engine/source/console/consoleInternal.h @@ -494,6 +494,8 @@ public: /// an interior pointer that will become invalid when the object changes address. Vector< Dictionary* > stack; + S32 getTopOfStack() { return (S32)mStackDepth; } + Vector< ConsoleValueFrame > localStack; ConsoleValueFrame* currentRegisterArray; // contains array at to top of localStack diff --git a/Engine/source/console/engineAPI.h b/Engine/source/console/engineAPI.h index 5cfa7cc09..a8540968a 100644 --- a/Engine/source/console/engineAPI.h +++ b/Engine/source/console/engineAPI.h @@ -151,7 +151,7 @@ template< typename T > inline void EngineMarshallData( const T& arg, S32& argc, ConsoleValue *argv ) { const char* str = castConsoleTypeToString(arg);; - argv[ argc++ ].setString(str, dStrlen(str)); + argv[ argc++ ].setString(str); } inline void EngineMarshallData( bool arg, S32& argc, ConsoleValue *argv ) { diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index 1b937c755..3bd6a1bb4 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -30,139 +30,99 @@ #include "math/mMath.h" #include "console/stringStack.h" -template -inline T Convert(ConsoleValue&); - -template<> -inline U32 Convert(ConsoleValue &val) +inline ConsoleValue RunScript(const char* str) { - return val.getInt(); -} - -template<> -inline S32 Convert(ConsoleValue &val) -{ - return val.getInt(); -} - -template<> -inline bool Convert(ConsoleValue &val) -{ - return val.getBool(); -} - -template<> -inline F32 Convert(ConsoleValue &val) -{ - return val.getFloat(); -} - -template<> -inline const char* Convert(ConsoleValue &val) -{ - return val.getString(); -} - -template<> -inline SimObject* Convert(ConsoleValue &val) -{ - return Sim::findObject(val); -} - -template -inline T RunScript(const char* str) -{ - return Convert(std::move(Con::evaluate(str, false, NULL))); + return std::move(Con::evaluate(str, false, NULL)); } TEST(Script, Basic_Arithmetic) { - S32 add = RunScript(R"( + ConsoleValue add = RunScript(R"( return 1.0 + 1; )"); - EXPECT_EQ(add, 2); + ASSERT_EQ(add.getInt(), 2); - S32 sub = RunScript(R"( + ConsoleValue sub = RunScript(R"( return 10 - 1.0; )"); - EXPECT_EQ(sub, 9); + ASSERT_EQ(sub.getInt(), 9); - S32 mult = RunScript(R"( + ConsoleValue mult = RunScript(R"( return 10 * 2.5; )"); - EXPECT_EQ(mult, 25); + ASSERT_EQ(mult.getInt(), 25); - S32 div = RunScript(R"( + ConsoleValue div = RunScript(R"( return 10.0 / 2; )"); - EXPECT_EQ(div, 5); + ASSERT_EQ(div.getInt(), 5); } TEST(Script, Complex_Arithmetic) { - S32 result = RunScript(R"( + ConsoleValue result = RunScript(R"( return 1 * 2 - (0.5 * 2); )"); - EXPECT_EQ(result, 1); + ASSERT_EQ(result.getInt(), 1); - S32 result2 = RunScript(R"( + ConsoleValue result2 = RunScript(R"( return 1 * 2 * 3 % 2; )"); - EXPECT_EQ(result2, 0); + ASSERT_EQ(result2.getInt(), 0); } TEST(Script, Basic_Concatination) { - const char* result1 = RunScript(R"( + ConsoleValue result1 = RunScript(R"( return "a" @ "b"; )"); - EXPECT_STREQ(result1, "ab"); + ASSERT_STREQ(result1.getString(), "ab"); - const char* result2 = RunScript(R"( + ConsoleValue result2 = RunScript(R"( return "a" SPC "b"; )"); - EXPECT_STREQ(result2, "a b"); + ASSERT_STREQ(result2.getString(), "a b"); - const char* result3 = RunScript(R"( + ConsoleValue result3 = RunScript(R"( return "a" TAB "b"; )"); - EXPECT_STREQ(result3, "a\tb"); + ASSERT_STREQ(result3.getString(), "a\tb"); - const char* result4 = RunScript(R"( + ConsoleValue result4 = RunScript(R"( return "a" NL "b"; )"); - EXPECT_STREQ(result4, "a\nb"); + ASSERT_STREQ(result4.getString(), "a\nb"); - const char* complex = RunScript(R"( + ConsoleValue complex = RunScript(R"( return "a" @ "b" @ "c" @ "d"; )"); - EXPECT_STREQ(complex, "abcd"); + ASSERT_STREQ(complex.getString(), "abcd"); } TEST(Script, Basic_Global_Variable_Tests) { - S32 value = RunScript(R"( + ConsoleValue value = RunScript(R"( $a = 1; return $a; )"); - EXPECT_EQ(value, 1); + ASSERT_EQ(value.getInt(), 1); } TEST(Script, Variable_Chaining_And_Usage) { - S32 value = RunScript(R"( + ConsoleValue value = RunScript(R"( function t() { %a = %b = 2; @@ -171,9 +131,9 @@ TEST(Script, Variable_Chaining_And_Usage) return t(); )"); - EXPECT_EQ(value, 2); + ASSERT_EQ(value.getInt(), 2); - S32 valueGlobal = RunScript(R"( + ConsoleValue valueGlobal = RunScript(R"( function t() { $a = %b = 2; @@ -182,9 +142,9 @@ TEST(Script, Variable_Chaining_And_Usage) return $a; )"); - EXPECT_EQ(valueGlobal, 2); + ASSERT_EQ(valueGlobal.getInt(), 2); - S32 value2 = RunScript(R"( + ConsoleValue value2 = RunScript(R"( function t(%a) { if ((%b = 2 * %a) != 5) @@ -195,26 +155,26 @@ TEST(Script, Variable_Chaining_And_Usage) return t(2); )"); - EXPECT_EQ(value2, 4); + ASSERT_EQ(value2.getInt(), 4); } TEST(Script, Basic_Function_Call_And_Local_Variable_Testing) { - S32 value = RunScript(R"( + ConsoleValue value = RunScript(R"( function t() { %a = 2; return %a; } return t(); )"); - EXPECT_EQ(value, 2); + ASSERT_EQ(value.getInt(), 2); - S32 value2 = RunScript(R"( + ConsoleValue value2 = RunScript(R"( function add(%a, %b) { return %a + %b; } return add(2, 4); )"); - EXPECT_EQ(value2, 6); + ASSERT_EQ(value2.getInt(), 6); - S32 value3 = RunScript(R"( + ConsoleValue value3 = RunScript(R"( function fib(%a) { if (%a == 0) return 0; @@ -225,48 +185,48 @@ TEST(Script, Basic_Function_Call_And_Local_Variable_Testing) return fib(15); )"); - EXPECT_EQ(value3, 610); + ASSERT_EQ(value3.getInt(), 610); - S32 staticCall = RunScript(R"( + ConsoleValue staticCall = RunScript(R"( function SimObject::bar(%a, %b) { return %a + %b; } return SimObject::bar(1, 2); )"); - EXPECT_EQ(staticCall, 3); + ASSERT_EQ(staticCall.getInt(), 3); } TEST(Script, Basic_Conditional_Statements) { - S32 value = RunScript(R"( + ConsoleValue value = RunScript(R"( $a = "hello"; if ($a $= "hello") return 1; return 2; )"); - EXPECT_EQ(value, 1); + ASSERT_EQ(value.getInt(), 1); - const char* ternaryValue = RunScript(R"( + ConsoleValue ternaryValue = RunScript(R"( return $a $= "hello" ? "World" : "No U"; )"); - EXPECT_STREQ(ternaryValue, "World"); + ASSERT_STREQ(ternaryValue.getString(), "World"); } TEST(Script, Basic_Loop_Statements) { - S32 whileValue = RunScript(R"( + ConsoleValue whileValue = RunScript(R"( $count = 0; while ($count < 5) $count++; return $count; )"); - EXPECT_EQ(whileValue, 5); + ASSERT_EQ(whileValue.getInt(), 5); - const char* forValue = RunScript(R"( + ConsoleValue forValue = RunScript(R"( function t(%times) { %result = ""; @@ -278,9 +238,9 @@ TEST(Script, Basic_Loop_Statements) return t(3); )"); - EXPECT_STREQ(forValue, "aaa"); + ASSERT_STREQ(forValue.getString(), "aaa"); - const char* forIfValue = RunScript(R"( + ConsoleValue forIfValue = RunScript(R"( function t() { %str = ""; for (%i = 0; %i < 5; %i++) { @@ -298,43 +258,43 @@ TEST(Script, Basic_Loop_Statements) return t(); )"); - EXPECT_STREQ(forIfValue, "0, 1, 2, 3, 4"); + ASSERT_STREQ(forIfValue.getString(), "0, 1, 2, 3, 4"); } TEST(Script, TorqueScript_Array_Testing) { - S32 value = RunScript(R"( + ConsoleValue value = RunScript(R"( function t(%idx) { %a[idx] = 2; return %a[idx]; } return t(5); )"); - EXPECT_EQ(value, 2); + ASSERT_EQ(value.getInt(), 2); - S32 value2 = RunScript(R"( + ConsoleValue value2 = RunScript(R"( function t(%idx) { %a[idx, 0] = 2; return %a[idx, 0]; } return t(5); )"); - EXPECT_EQ(value2, 2); + ASSERT_EQ(value2.getInt(), 2); } TEST(Script, Basic_SimObject) { - SimObject* object = RunScript(R"( + ConsoleValue object = RunScript(R"( return new SimObject(FudgeCollector) { fudge = "Chocolate"; }; )"); - EXPECT_NE(object, (SimObject*)NULL); + ASSERT_NE(Sim::findObject(object), (SimObject*)NULL); - const char* propertyValue = RunScript(R"( + ConsoleValue propertyValue = RunScript(R"( return FudgeCollector.fudge; )"); - EXPECT_STREQ(propertyValue, "Chocolate"); + ASSERT_STREQ(propertyValue.getString(), "Chocolate"); - const char* funcReturn = RunScript(R"( + ConsoleValue funcReturn = RunScript(R"( function SimObject::fooFunc(%this) { return "Bar"; @@ -343,9 +303,9 @@ TEST(Script, Basic_SimObject) return FudgeCollector.fooFunc(); )"); - EXPECT_STREQ(funcReturn, "Bar"); + ASSERT_STREQ(funcReturn.getString(), "Bar"); - const char* parentFn = RunScript(R"( + ConsoleValue parentFn = RunScript(R"( new SimObject(Hello); function SimObject::fooFunc2(%this) @@ -362,12 +322,12 @@ TEST(Script, Basic_SimObject) return Hello.fooFunc2(); )"); - EXPECT_STREQ(parentFn, "FooBar"); + ASSERT_STREQ(parentFn.getString(), "FooBar"); } TEST(Script, Basic_Package) { - S32 value = RunScript(R"( + ConsoleValue value = RunScript(R"( function a() { return 3; } package overrides { function a() { return 5; } @@ -375,21 +335,21 @@ TEST(Script, Basic_Package) return a(); )"); - EXPECT_EQ(value, 3); + ASSERT_EQ(value.getInt(), 3); - S32 overrideValue = RunScript(R"( + ConsoleValue overrideValue = RunScript(R"( activatePackage(overrides); return a(); )"); - EXPECT_EQ(overrideValue, 5); + ASSERT_EQ(overrideValue.getInt(), 5); - S32 deactivatedValue = RunScript(R"( + ConsoleValue deactivatedValue = RunScript(R"( deactivatePackage(overrides); return a(); )"); - EXPECT_EQ(deactivatedValue, 3); + ASSERT_EQ(deactivatedValue.getInt(), 3); } #endif diff --git a/Engine/source/core/strings/stringFunctions.cpp b/Engine/source/core/strings/stringFunctions.cpp index ed810ea74..893dc5815 100644 --- a/Engine/source/core/strings/stringFunctions.cpp +++ b/Engine/source/core/strings/stringFunctions.cpp @@ -428,7 +428,7 @@ S32 dStrlcpy(char *dst, const char *src, dsize_t dstSize) S32 copyLen = srcLen; //Check for buffer overflow and don't allow it. Warn on debug so we can fix it - AssertWarn(copyLen < dstSize, "Buffer too small in call to dStrlcpy!"); + AssertFatal(copyLen < dstSize, "Buffer too small in call to dStrlcpy!"); if (srcLen + 1 > dstSize) { copyLen = dstSize - 1; From 4e678292e114abf9c1c1d3f81af79af77332997f Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sun, 4 Apr 2021 00:50:37 -0400 Subject: [PATCH 008/399] fix foreach/foreach$ loops. --- Engine/source/console/astNodes.cpp | 11 ++- Engine/source/console/codeBlock.cpp | 46 +++++++++--- Engine/source/console/compiledEval.cpp | 55 +++++++++++--- Engine/source/console/test/ScriptTest.cpp | 88 +++++++++++++++++++++-- 4 files changed, 176 insertions(+), 24 deletions(-) diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index 28e6b4960..14f610bd2 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -413,11 +413,18 @@ U32 IterStmtNode::compileStmt(CodeStream& codeStream, U32 ip) codeStream.pushFixScope(true); + bool isGlobal = varName[0] == '$'; + TypeReq varType = isStringIter ? TypeReqString : TypeReqUInt; + const U32 startIp = ip; - containerExpr->compile(codeStream, startIp, TypeReqString); + containerExpr->compile(codeStream, startIp, TypeReqString); // todo: figure out better way to codegen this so we don't rely on STR codeStream.emit(isStringIter ? OP_ITER_BEGIN_STR : OP_ITER_BEGIN); - codeStream.emitSTE(varName); + codeStream.emit(isGlobal); + if (isGlobal) + codeStream.emitSTE(varName); + else + codeStream.emit(gFuncVars->assign(varName, varType)); const U32 finalFix = codeStream.emit(0); const U32 continueIp = codeStream.emit(OP_ITER); codeStream.emitFix(CodeStream::FIXTYPE_BREAK); diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index d3687a2cd..559e921c3 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -643,7 +643,8 @@ ConsoleValue CodeBlock::compileExec(StringTableEntry fileName, const char *inStr codeStream.emit(OP_RETURN); codeStream.emitCodeStream(&codeSize, &code, &lineBreakPairs); - //dumpInstructions(0, false); + if (Con::getBoolVariable("dump")) + dumpInstructions(0, false); consoleAllocReset(); @@ -1392,23 +1393,50 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) case OP_ITER_BEGIN: { - StringTableEntry varName = CodeToSTE(code, ip); - U32 failIp = code[ip + 2]; + bool isGlobal = code[ip]; + if (isGlobal) + { + StringTableEntry varName = CodeToSTE(code, ip + 1); + U32 failIp = code[ip + 3]; - Con::printf("%i: OP_ITER_BEGIN varName=%s failIp=%i", ip - 1, varName, failIp); + Con::printf("%i: OP_ITER_BEGIN varName=%s failIp=%i isGlobal=%s", ip - 1, varName, failIp, "true"); - ip += 3; + ip += 4; + } + else + { + S32 reg = code[ip + 1]; + U32 failIp = code[ip + 2]; + + Con::printf("%i: OP_ITER_BEGIN varRegister=%d failIp=%i isGlobal=%s", ip - 1, reg, failIp, "false"); + + ip += 3; + } break; } case OP_ITER_BEGIN_STR: { - StringTableEntry varName = CodeToSTE(code, ip); - U32 failIp = code[ip + 2]; + bool isGlobal = code[ip]; + if (isGlobal) + { + StringTableEntry varName = CodeToSTE(code, ip + 1); + U32 failIp = code[ip + 3]; - Con::printf("%i: OP_ITER_BEGIN varName=%s failIp=%i", ip - 1, varName, failIp); + Con::printf("%i: OP_ITER_BEGIN_STR varName=%s failIp=%i isGlobal=%s", ip - 1, varName, failIp, "true"); + + ip += 4; + } + else + { + S32 reg = code[ip + 1]; + U32 failIp = code[ip + 2]; + + Con::printf("%i: OP_ITER_BEGIN_STR varRegister=%d failIp=%i isGlobal=%s", ip - 1, reg, failIp, "false"); + + ip += 3; + } - ip += 3; break; } diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 0375ab14e..23245b135 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -66,8 +66,18 @@ struct IterStackRecord /// If true, this is a foreach$ loop; if not, it's a foreach loop. bool mIsStringIter; - /// The iterator variable. - Dictionary::Entry* mVariable; + /// True if the variable referenced is a global + bool mIsGlobalVariable; + + union + { + + /// The iterator variable if we are a global variable + Dictionary::Entry* mVariable; + + /// The register variable if we are a local variable + S32 mRegister; + } mVar; /// Information for an object iterator loop. struct ObjectPos @@ -1745,6 +1755,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa { if (nsEntry->mFunctionOffset) { + // TODO: not make this strings only for returns. ConsoleValue returnFromFn = nsEntry->mCode->exec(nsEntry->mFunctionOffset, fnName, nsEntry->mNamespace, callArgc, callArgv, false, nsEntry->mPackage); STR.setStringValue(returnFromFn.getString()); } @@ -1954,12 +1965,22 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_ITER_BEGIN: { - StringTableEntry varName = CodeToSTE(code, ip); - U32 failIp = code[ip + 2]; + bool isGlobal = code[ip]; + + U32 failIp = code[ip + isGlobal ? 3 : 2]; IterStackRecord& iter = iterStack[_ITER]; + iter.mIsGlobalVariable = isGlobal; - iter.mVariable = gEvalState.getCurrentFrame().add(varName); + if (isGlobal) + { + StringTableEntry varName = CodeToSTE(code, ip + 1); + iter.mVar.mVariable = gEvalState.globalVars.add(varName); + } + else + { + iter.mVar.mRegister = code[ip + 1]; + } if (iter.mIsStringIter) { @@ -1990,7 +2011,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa STR.push(); - ip += 3; + ip += isGlobal ? 4 : 3; break; } @@ -2026,11 +2047,21 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa { char savedChar = str[endIndex]; const_cast(str)[endIndex] = '\0'; // We are on the string stack so this is okay. - iter.mVariable->setStringValue(&str[startIndex]); + + if (iter.mIsGlobalVariable) + iter.mVar.mVariable->setStringValue(&str[startIndex]); + else + gEvalState.setLocalStringVariable(iter.mVar.mRegister, &str[startIndex], endIndex - startIndex); + const_cast(str)[endIndex] = savedChar; } else - iter.mVariable->setStringValue(""); + { + if (iter.mIsGlobalVariable) + iter.mVar.mVariable->setStringValue(""); + else + gEvalState.setLocalStringVariable(iter.mVar.mRegister, "", 0); + } // Skip separator. if (str[endIndex] != '\0') @@ -2049,7 +2080,13 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa continue; } - iter.mVariable->setIntValue(set->at(index)->getId()); + SimObjectId id = set->at(index)->getId(); + + if (iter.mIsGlobalVariable) + iter.mVar.mVariable->setIntValue(id); + else + gEvalState.setLocalIntVariable(iter.mVar.mRegister, id); + iter.mData.mObj.mIndex = index + 1; } diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index 3bd6a1bb4..ecf3ae3f9 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -241,9 +241,11 @@ TEST(Script, Basic_Loop_Statements) ASSERT_STREQ(forValue.getString(), "aaa"); ConsoleValue forIfValue = RunScript(R"( - function t() { + function t() + { %str = ""; - for (%i = 0; %i < 5; %i++) { + for (%i = 0; %i < 5; %i++) + { %loopValue = %i; @@ -261,6 +263,82 @@ TEST(Script, Basic_Loop_Statements) ASSERT_STREQ(forIfValue.getString(), "0, 1, 2, 3, 4"); } +TEST(Script, ForEachLoop) +{ + ConsoleValue forEach1 = RunScript(R"( + $theSimSet = new SimSet(); + $theSimSet.add(new SimObject()); + $theSimSet.add(new SimObject()); + + $counter = 0; + foreach ($obj in $theSimSet) + { + $counter++; + } + + $theSimSet.delete(); + + return $counter; + )"); + + ASSERT_EQ(forEach1.getInt(), 2); + + ConsoleValue forEach2 = RunScript(R"( + $counter = 0; + foreach$ ($word in "a b c d") + { + $counter++; + } + + return $counter; + )"); + + ASSERT_EQ(forEach2.getInt(), 4); + + ConsoleValue forEach3 = RunScript(R"( + function SimObject::addOne(%this) + { + return 1; + } + + function test() + { + %set = new SimSet(); + %set.add(new SimObject()); + %set.add(new SimObject()); + + %count = 0; + foreach (%obj in %set) + %count += %obj.addOne(); + + %set.delete(); + + return %count; + } + + return test(); + )"); + + ASSERT_EQ(forEach3.getInt(), 2); + + ConsoleValue forEach4 = RunScript(R"( + function test() + { + %string = "a b c d e"; + + %count = 0; + foreach$ (%word in %string) + %count++; + + return %count; + } + + return test(); + )"); + + ASSERT_EQ(forEach4.getInt(), 5); +} + TEST(Script, TorqueScript_Array_Testing) { ConsoleValue value = RunScript(R"( @@ -281,7 +359,8 @@ TEST(Script, TorqueScript_Array_Testing) TEST(Script, Basic_SimObject) { ConsoleValue object = RunScript(R"( - return new SimObject(FudgeCollector) { + return new SimObject(FudgeCollector) + { fudge = "Chocolate"; }; )"); @@ -329,7 +408,8 @@ TEST(Script, Basic_Package) { ConsoleValue value = RunScript(R"( function a() { return 3; } - package overrides { + package overrides + { function a() { return 5; } }; return a(); From 960db74733d51b7096b75cbdc3d6acc028682893 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 10 Apr 2021 15:52:53 -0400 Subject: [PATCH 009/399] small fix. --- Engine/source/console/compiledEval.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 23245b135..091a00e95 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -763,6 +763,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // Clean up... delete object; + currentNewObject = NULL; ip = failJump; break; } @@ -1011,7 +1012,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa if (currentNewObject) currentNewObject->onPostAdd(); - //Assert( objectCreationStackIndex >= 0 ); + AssertFatal( objectCreationStackIndex >= 0, "Object Stack is empty." ); // Restore the object info from the stack [7/9/2007 Black] currentNewObject = objectCreationStack[--objectCreationStackIndex].newObject; failJump = objectCreationStack[objectCreationStackIndex].failJump; From 93500b6ac45fe1666a3a9f79309249ebb6b39e5f Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Mon, 12 Apr 2021 21:26:26 -0400 Subject: [PATCH 010/399] more changes. --- Engine/source/console/console.cpp | 2 +- Engine/source/console/consoleInternal.cpp | 100 +++++++++++++++--- Engine/source/console/consoleInternal.h | 119 +++++++++++++++++----- Engine/source/console/engineDoc.cpp | 4 +- 4 files changed, 185 insertions(+), 40 deletions(-) diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index a9dd4de40..a544aad0e 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -1657,7 +1657,7 @@ static ConsoleValue _internalExecute(SimObject *object, S32 argc, ConsoleValue a if(ent == NULL) { - warnf(ConsoleLogEntry::Script, "%s: undefined for object '%s' - id %d", funcName, object->getName(), object->getId()); + //warnf(ConsoleLogEntry::Script, "%s: undefined for object '%s' - id %d", funcName, object->getName(), object->getId()); STR.clearFunctionOffset(); return std::move(ConsoleValue()); diff --git a/Engine/source/console/consoleInternal.cpp b/Engine/source/console/consoleInternal.cpp index 336de99fa..bb059f9d6 100644 --- a/Engine/source/console/consoleInternal.cpp +++ b/Engine/source/console/consoleInternal.cpp @@ -183,13 +183,13 @@ void Dictionary::exportVariables(const char *varString, const char *fileName, bo for (s = sortList.begin(); s != sortList.end(); s++) { - switch ((*s)->value.getType()) + switch ((*s)->type) { - case ConsoleValueType::cvInteger: - dSprintf(buffer, sizeof(buffer), "%s = %d;%s", (*s)->name, (*s)->value.getInt(), cat); + case Entry::TypeInternalInt: + dSprintf(buffer, sizeof(buffer), "%s = %d;%s", (*s)->name, (*s)->ival, cat); break; - case ConsoleValueType::cvFloat: - dSprintf(buffer, sizeof(buffer), "%s = %g;%s", (*s)->name, (*s)->value.getFloat(), cat); + case Entry::TypeInternalFloat: + dSprintf(buffer, sizeof(buffer), "%s = %g;%s", (*s)->name, (*s)->fval, cat); break; default: expandEscape(expandBuffer, (*s)->getStringValue()); @@ -243,11 +243,11 @@ void Dictionary::exportVariables(const char *varString, Vector *names, V if (values) { - switch ((*s)->value.getType()) + switch ((*s)->type) { case ConsoleValueType::cvInteger: case ConsoleValueType::cvFloat: - values->push_back(String((*s)->value.getString())); + values->push_back(String((*s)->getStringValue())); break; default: expandEscape(expandBuffer, (*s)->getStringValue()); @@ -473,17 +473,88 @@ Dictionary::Entry::Entry(StringTableEntry in_name) mUsage = NULL; mIsConstant = false; mNext = NULL; - // NOTE: This is data inside a nameless - // union, so we don't need to init the rest. - value.init(); + + ival = 0; + fval = 0; + sval = typeValueEmpty; + bufferLen = 0; } Dictionary::Entry::~Entry() { + reset(); +} + +void Dictionary::Entry::reset() +{ + name = NULL; + if (type <= TypeInternalString && sval != typeValueEmpty) + dFree(sval); if (notify) delete notify; } +void Dictionary::Entry::setStringValue(const char* value) +{ + if (mIsConstant) + { + Con::errorf("Cannot assign value to constant '%s'.", name); + return; + } + + if (type <= TypeInternalString) + { + // Let's not remove empty-string-valued global vars from the dict. + // If we remove them, then they won't be exported, and sometimes + // it could be necessary to export such a global. There are very + // few empty-string global vars so there's no performance-related + // need to remove them from the dict. + /* + if(!value[0] && name[0] == '$') + { + gEvalState.globalVars.remove(this); + return; + } + */ + + U32 stringLen = dStrlen(value); + + // If it's longer than 256 bytes, it's certainly not a number. + // + // (This decision may come back to haunt you. Shame on you if it + // does.) + if (stringLen < 256) + { + fval = dAtof(value); + ival = dAtoi(value); + } + else + { + fval = 0.f; + ival = 0; + } + + type = TypeInternalString; + + // may as well pad to the next cache line + U32 newLen = ((stringLen + 1) + 15) & ~15; + + if (sval == typeValueEmpty) + sval = (char*)dMalloc(newLen); + else if (newLen > bufferLen) + sval = (char*)dRealloc(sval, newLen); + + bufferLen = newLen; + dStrcpy(sval, value, newLen); + } + else + Con::setData(type, dataPtr, 0, 1, &value, enumTable); + + // Fire off the notification if we have one. + if (notify) + notify->trigger(); +} + const char *Dictionary::getVariable(StringTableEntry name, bool *entValid) { Entry *ent = lookup(name); @@ -558,13 +629,18 @@ Dictionary::Entry* Dictionary::addVariable(const char *name, } Entry *ent = add(StringTable->insert(name)); + + if (ent->type <= Entry::TypeInternalString && ent->sval != typeValueEmpty) + dFree(ent->sval); + ent->mUsage = usage; + ent->type = type; + ent->dataPtr = dataPtr; // Fetch enum table, if any. - ConsoleBaseType* conType = ConsoleBaseType::getType(type); AssertFatal(conType, "Dictionary::addVariable - invalid console type"); - ent->value.setConsoleData(type, dataPtr, conType->getEnumTable()); + ent->enumTable = conType->getEnumTable(); return ent; } diff --git a/Engine/source/console/consoleInternal.h b/Engine/source/console/consoleInternal.h index e1d2cd462..34f6e1a9b 100644 --- a/Engine/source/console/consoleInternal.h +++ b/Engine/source/console/consoleInternal.h @@ -280,9 +280,18 @@ public: struct Entry { + friend class Dictionary; + + enum + { + TypeInternalInt = -3, + TypeInternalFloat = -2, + TypeInternalString = -1, + }; + StringTableEntry name; - ConsoleValue value; Entry *nextEntry; + S32 type; typedef Signal NotifySignal; @@ -296,6 +305,41 @@ public: /// Whether this is a constant that cannot be assigned to. bool mIsConstant; + protected: + + // NOTE: This is protected to ensure no one outside + // of this structure is messing with it. + +#pragma warning( push ) +#pragma warning( disable : 4201 ) // warning C4201: nonstandard extension used : nameless struct/union + + // An variable is either a real dynamic type or + // its one exposed from C++ using a data pointer. + // + // We use this nameless union and struct setup + // to optimize the memory usage. + union + { + struct + { + char* sval; + U32 ival; // doubles as strlen when type is TypeInternalString + F32 fval; + U32 bufferLen; + }; + + struct + { + /// The real data pointer. + void* dataPtr; + + /// The enum lookup table for enumerated types. + const EnumTable* enumTable; + }; + }; + +#pragma warning( pop ) // C4201 + public: Entry() { @@ -312,26 +356,34 @@ public: Entry *mNext; - void reset() { - name = NULL; - value.reset(); - if (notify) - delete notify; - } + void reset(); inline U32 getIntValue() { - return value.getInt(); + if (type <= TypeInternalString) + return ival; + else + return dAtoi(Con::getData(type, dataPtr, 0, enumTable)); } inline F32 getFloatValue() { - return value.getFloat(); + if (type <= TypeInternalString) + return fval; + else + return dAtof(Con::getData(type, dataPtr, 0, enumTable)); } inline const char *getStringValue() { - return value.getString(); + if (type == TypeInternalString) + return sval; + if (type == TypeInternalFloat) + return Con::getData(TypeF32, &fval, 0); + else if (type == TypeInternalInt) + return Con::getData(TypeS32, &ival, 0); + else + return Con::getData(type, dataPtr, 0, enumTable); } void setIntValue(U32 val) @@ -342,7 +394,22 @@ public: return; } - value.setInt(val); + if (type <= TypeInternalString) + { + fval = (F32)val; + ival = val; + if (sval != typeValueEmpty) + { + dFree(sval); + sval = typeValueEmpty; + } + type = TypeInternalInt; + } + else + { + const char* dptr = Con::getData(TypeS32, &val, 0); + Con::setData(type, dataPtr, 0, 1, &dptr, enumTable); + } // Fire off the notification if we have one. if (notify) @@ -357,27 +424,29 @@ public: return; } - value.setFloat(val); - - // Fire off the notification if we have one. - if (notify) - notify->trigger(); - } - - void setStringValue(const char *newValue) - { - if (mIsConstant) + if (type <= TypeInternalString) { - Con::errorf("Cannot assign value to constant '%s'.", name); - return; + fval = val; + ival = static_cast(val); + if (sval != typeValueEmpty) + { + dFree(sval); + sval = typeValueEmpty; + } + type = TypeInternalFloat; + } + else + { + const char* dptr = Con::getData(TypeF32, &val, 0); + Con::setData(type, dataPtr, 0, 1, &dptr, enumTable); } - value.setString(newValue); - // Fire off the notification if we have one. if (notify) notify->trigger(); } + + void setStringValue(const char* value); }; struct HashTableData diff --git a/Engine/source/console/engineDoc.cpp b/Engine/source/console/engineDoc.cpp index 56563efe0..c471fe820 100644 --- a/Engine/source/console/engineDoc.cpp +++ b/Engine/source/console/engineDoc.cpp @@ -114,7 +114,7 @@ static void dumpVariable( Stream& stream, { // Skip variables defined in script. - if( !entry->value.isConsoleType() ) + if( entry->type <= Dictionary::Entry::TypeInternalString ) return; // Skip internals... don't export them. @@ -149,7 +149,7 @@ static void dumpVariable( Stream& stream, // Skip variables for which we can't decipher their type. - ConsoleBaseType* type = ConsoleBaseType::getType( entry->value.getType() ); + ConsoleBaseType* type = ConsoleBaseType::getType( entry->type ); if( !type ) { Con::errorf( "Can't find type for variable '%s'", entry->name ); From a2dea07d8b396648e58a3549c4d3a90fcdfe8017 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Mon, 12 Apr 2021 21:42:18 -0400 Subject: [PATCH 011/399] fixed internal types. --- Engine/source/console/consoleInternal.cpp | 1 + Engine/source/console/consoleInternal.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/Engine/source/console/consoleInternal.cpp b/Engine/source/console/consoleInternal.cpp index bb059f9d6..bd8e230ff 100644 --- a/Engine/source/console/consoleInternal.cpp +++ b/Engine/source/console/consoleInternal.cpp @@ -468,6 +468,7 @@ char *typeValueEmpty = ""; Dictionary::Entry::Entry(StringTableEntry in_name) { name = in_name; + type = TypeInternalString; notify = NULL; nextEntry = NULL; mUsage = NULL; diff --git a/Engine/source/console/consoleInternal.h b/Engine/source/console/consoleInternal.h index 34f6e1a9b..392bf0c3f 100644 --- a/Engine/source/console/consoleInternal.h +++ b/Engine/source/console/consoleInternal.h @@ -344,11 +344,17 @@ public: Entry() { name = NULL; + type = TypeInternalString; notify = NULL; nextEntry = NULL; mUsage = NULL; mIsConstant = false; mNext = NULL; + + ival = 0; + fval = 0; + sval = typeValueEmpty; + bufferLen = 0; } Entry(StringTableEntry name); From bc0f5bd3a39205a0de8803340dadb3c6b9c22fb5 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Fri, 16 Apr 2021 19:20:15 -0400 Subject: [PATCH 012/399] combine numeric stacks into one common stack. --- Engine/source/console/compiledEval.cpp | 241 ++++++++++++------------- Engine/source/console/stringStack.h | 6 +- 2 files changed, 119 insertions(+), 128 deletions(-) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 091a00e95..c1db544eb 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -109,14 +109,18 @@ ConsoleValueStack<4096> gCallStack; StringStack STR; -U32 _FLT = 0; ///< Stack pointer for floatStack. -U32 _UINT = 0; ///< Stack pointer for intStack. U32 _ITER = 0; ///< Stack pointer for iterStack. IterStackRecord iterStack[MaxStackSize]; -F64 floatStack[MaxStackSize]; -S64 intStack[MaxStackSize]; +union StackValue +{ + F64 f; + S64 i; +}; + +StackValue numStack[MaxStackSize]; +U32 _STK = 0; char curFieldArray[256]; char prevFieldArray[256]; @@ -945,7 +949,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa } // What group will we be added to, if any? - U32 groupAddId = (U32)intStack[_UINT]; + U32 groupAddId = (U32)numStack[_STK].i; SimGroup* grp = NULL; SimSet* set = NULL; @@ -990,9 +994,9 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // id, if one was given, otherwise getting pushed) S32 id = currentNewObject->getId(); if (placeAtRoot) - intStack[_UINT] = id; + numStack[_STK].i = id; else - intStack[++_UINT] = id; + numStack[++_STK].i = id; break; } @@ -1003,7 +1007,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // our group reference. bool placeAtRoot = code[ip++]; if (!placeAtRoot) - _UINT--; + _STK--; break; } @@ -1020,7 +1024,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa } case OP_JMPIFFNOT: - if (floatStack[_FLT--]) + if (numStack[_STK--].f) { ip++; break; @@ -1028,7 +1032,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa ip = code[ip]; break; case OP_JMPIFNOT: - if (intStack[_UINT--]) + if (numStack[_STK--].i) { ip++; break; @@ -1036,7 +1040,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa ip = code[ip]; break; case OP_JMPIFF: - if (!floatStack[_FLT--]) + if (!numStack[_STK--].f) { ip++; break; @@ -1044,7 +1048,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa ip = code[ip]; break; case OP_JMPIF: - if (!intStack[_UINT--]) + if (!numStack[_STK--].i) { ip++; break; @@ -1052,18 +1056,18 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa ip = code[ip]; break; case OP_JMPIFNOT_NP: - if (intStack[_UINT]) + if (numStack[_STK].i) { - _UINT--; + _STK--; ip++; break; } ip = code[ip]; break; case OP_JMPIF_NP: - if (!intStack[_UINT]) + if (!numStack[_STK].i) { - _UINT--; + _STK--; ip++; break; } @@ -1111,8 +1115,8 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa } - returnValue.setFloat(floatStack[_FLT]); - _FLT--; + returnValue.setFloat(numStack[_STK].f); + _STK--; goto execFinished; @@ -1128,124 +1132,116 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa } } - returnValue.setInt(intStack[_UINT]); - _UINT--; + returnValue.setInt(numStack[_STK].i); + _STK--; goto execFinished; case OP_CMPEQ: - intStack[_UINT + 1] = bool(floatStack[_FLT] == floatStack[_FLT - 1]); - _UINT++; - _FLT -= 2; + numStack[_STK - 1].i = bool(numStack[_STK].f == numStack[_STK - 1].f); + _STK--; break; case OP_CMPGR: - intStack[_UINT + 1] = bool(floatStack[_FLT] > floatStack[_FLT - 1]); - _UINT++; - _FLT -= 2; + numStack[_STK - 1].i = bool(numStack[_STK].f > numStack[_STK - 1].f); + _STK--; break; case OP_CMPGE: - intStack[_UINT + 1] = bool(floatStack[_FLT] >= floatStack[_FLT - 1]); - _UINT++; - _FLT -= 2; + numStack[_STK - 1].i = bool(numStack[_STK].f >= numStack[_STK - 1].f); + _STK--; break; case OP_CMPLT: - intStack[_UINT + 1] = bool(floatStack[_FLT] < floatStack[_FLT - 1]); - _UINT++; - _FLT -= 2; + numStack[_STK - 1].i = bool(numStack[_STK].f < numStack[_STK - 1].f); + _STK--; break; case OP_CMPLE: - intStack[_UINT + 1] = bool(floatStack[_FLT] <= floatStack[_FLT - 1]); - _UINT++; - _FLT -= 2; + numStack[_STK - 1].i = bool(numStack[_STK].f <= numStack[_STK - 1].f); + _STK--; break; case OP_CMPNE: - intStack[_UINT + 1] = bool(floatStack[_FLT] != floatStack[_FLT - 1]); - _UINT++; - _FLT -= 2; + numStack[_STK - 1].i = bool(numStack[_STK].f != numStack[_STK - 1].f); + _STK--; break; case OP_XOR: - intStack[_UINT - 1] = intStack[_UINT] ^ intStack[_UINT - 1]; - _UINT--; + numStack[_STK - 1].i = numStack[_STK].i ^ numStack[_STK - 1].i; + _STK--; break; case OP_MOD: - if (intStack[_UINT - 1] != 0) - intStack[_UINT - 1] = intStack[_UINT] % intStack[_UINT - 1]; + if (numStack[_STK - 1].i != 0) + numStack[_STK - 1].i = numStack[_STK].i % numStack[_STK - 1].i; else - intStack[_UINT - 1] = 0; - _UINT--; + numStack[_STK - 1].i = 0; + _STK--; break; case OP_BITAND: - intStack[_UINT - 1] = intStack[_UINT] & intStack[_UINT - 1]; - _UINT--; + numStack[_STK - 1].i = numStack[_STK].i & numStack[_STK - 1].i; + _STK--; break; case OP_BITOR: - intStack[_UINT - 1] = intStack[_UINT] | intStack[_UINT - 1]; - _UINT--; + numStack[_STK - 1].i = numStack[_STK].i | numStack[_STK - 1].i; + _STK--; break; case OP_NOT: - intStack[_UINT] = !intStack[_UINT]; + numStack[_STK].i = !numStack[_STK].i; break; case OP_NOTF: - intStack[_UINT + 1] = !floatStack[_FLT]; - _FLT--; - _UINT++; + numStack[_STK].i = !numStack[_STK].f; break; case OP_ONESCOMPLEMENT: - intStack[_UINT] = ~intStack[_UINT]; + numStack[_STK].i = ~numStack[_STK].i; break; case OP_SHR: - intStack[_UINT - 1] = intStack[_UINT] >> intStack[_UINT - 1]; - _UINT--; + numStack[_STK - 1].i = numStack[_STK].i >> numStack[_STK - 1].i; + _STK--; break; case OP_SHL: - intStack[_UINT - 1] = intStack[_UINT] << intStack[_UINT - 1]; - _UINT--; + numStack[_STK - 1].i = numStack[_STK].i << numStack[_STK - 1].i; + _STK--; break; case OP_AND: - intStack[_UINT - 1] = intStack[_UINT] && intStack[_UINT - 1]; - _UINT--; + numStack[_STK - 1].i = numStack[_STK].i && numStack[_STK - 1].i; + _STK--; break; case OP_OR: - intStack[_UINT - 1] = intStack[_UINT] || intStack[_UINT - 1]; - _UINT--; + numStack[_STK - 1].i = numStack[_STK].i || numStack[_STK - 1].i; + _STK--; break; case OP_ADD: - floatStack[_FLT - 1] = floatStack[_FLT] + floatStack[_FLT - 1]; - _FLT--; + numStack[_STK - 1].f = numStack[_STK].f + numStack[_STK - 1].f; + _STK--; break; case OP_SUB: - floatStack[_FLT - 1] = floatStack[_FLT] - floatStack[_FLT - 1]; - _FLT--; + numStack[_STK - 1].f = numStack[_STK].f - numStack[_STK - 1].f; + _STK--; break; case OP_MUL: - floatStack[_FLT - 1] = floatStack[_FLT] * floatStack[_FLT - 1]; - _FLT--; + numStack[_STK - 1].f = numStack[_STK].f * numStack[_STK - 1].f; + _STK--; break; case OP_DIV: - floatStack[_FLT - 1] = floatStack[_FLT] / floatStack[_FLT - 1]; - _FLT--; + numStack[_STK - 1].f = numStack[_STK].f / numStack[_STK - 1].f; + _STK--; break; case OP_NEG: - floatStack[_FLT] = -floatStack[_FLT]; + numStack[_STK].f = -numStack[_STK].f; break; case OP_INC: @@ -1320,13 +1316,13 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_LOADVAR_UINT: - intStack[_UINT + 1] = gEvalState.getIntVariable(); - _UINT++; + numStack[_STK + 1].i = gEvalState.getIntVariable(); + _STK++; break; case OP_LOADVAR_FLT: - floatStack[_FLT + 1] = gEvalState.getFloatVariable(); - _FLT++; + numStack[_STK + 1].f = gEvalState.getFloatVariable(); + _STK++; break; case OP_LOADVAR_STR: @@ -1335,11 +1331,11 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_SAVEVAR_UINT: - gEvalState.setIntVariable((S32)intStack[_UINT]); + gEvalState.setIntVariable(numStack[_STK].i); break; case OP_SAVEVAR_FLT: - gEvalState.setFloatVariable(floatStack[_FLT]); + gEvalState.setFloatVariable(numStack[_STK].f); break; case OP_SAVEVAR_STR: @@ -1348,14 +1344,14 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_LOAD_LOCAL_VAR_UINT: reg = code[ip++]; - intStack[_UINT + 1] = gEvalState.getLocalIntVariable(reg); - _UINT++; + numStack[_STK + 1].i = gEvalState.getLocalIntVariable(reg); + _STK++; break; case OP_LOAD_LOCAL_VAR_FLT: reg = code[ip++]; - floatStack[_FLT + 1] = gEvalState.getLocalFloatVariable(reg); - _FLT++; + numStack[_STK + 1].f = gEvalState.getLocalFloatVariable(reg); + _STK++; break; case OP_LOAD_LOCAL_VAR_STR: @@ -1366,12 +1362,12 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_SAVE_LOCAL_VAR_UINT: reg = code[ip++]; - gEvalState.setLocalIntVariable(reg, (S32)intStack[_UINT]); + gEvalState.setLocalIntVariable(reg, numStack[_STK].i); break; case OP_SAVE_LOCAL_VAR_FLT: reg = code[ip++]; - gEvalState.setLocalFloatVariable(reg, floatStack[_FLT]); + gEvalState.setLocalFloatVariable(reg, numStack[_STK].f); break; case OP_SAVE_LOCAL_VAR_STR: @@ -1408,13 +1404,13 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa StringTableEntry intName = StringTable->insert(STR.getStringValue()); bool recurse = code[ip - 1]; SimObject* obj = group->findObjectByInternalName(intName, recurse); - intStack[_UINT + 1] = obj ? obj->getId() : 0; - _UINT++; + numStack[_STK + 1].i = obj ? obj->getId() : 0; + _STK++; } else { Con::errorf(ConsoleLogEntry::Script, "%s: Attempt to use -> on non-group %s of class %s.", getFileLine(ip - 2), curObject->getName(), curObject->getClassName()); - intStack[_UINT] = 0; + numStack[_STK].i = 0; } } break; @@ -1444,7 +1440,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_LOADFIELD_UINT: if (curObject) - intStack[_UINT + 1] = U32(dAtoi(curObject->getDataField(curField, curFieldArray))); + numStack[_STK + 1].i = dAtol(curObject->getDataField(curField, curFieldArray)); else { // The field is not being retrieved from an object. Maybe it's @@ -1452,14 +1448,14 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa char buff[FieldBufferSizeNumeric]; memset(buff, 0, sizeof(buff)); getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff); - intStack[_UINT + 1] = dAtoi(buff); + numStack[_STK + 1].i = dAtol(buff); } - _UINT++; + _STK++; break; case OP_LOADFIELD_FLT: if (curObject) - floatStack[_FLT + 1] = dAtof(curObject->getDataField(curField, curFieldArray)); + numStack[_STK + 1].f = dAtod(curObject->getDataField(curField, curFieldArray)); else { // The field is not being retrieved from an object. Maybe it's @@ -1467,9 +1463,9 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa char buff[FieldBufferSizeNumeric]; memset(buff, 0, sizeof(buff)); getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff); - floatStack[_FLT + 1] = dAtof(buff); + numStack[_STK + 1].f = dAtod(buff); } - _FLT++; + _STK++; break; case OP_LOADFIELD_STR: @@ -1491,7 +1487,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_SAVEFIELD_UINT: - STR.setIntValue((U32)intStack[_UINT]); + STR.setIntValue(numStack[_STK].i); if (curObject) curObject->setDataField(curField, curFieldArray, STR.getStringValue()); else @@ -1504,7 +1500,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_SAVEFIELD_FLT: - STR.setFloatValue(floatStack[_FLT]); + STR.setFloatValue(numStack[_STK].f); if (curObject) curObject->setDataField(curField, curFieldArray, STR.getStringValue()); else @@ -1529,13 +1525,13 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_STR_TO_UINT: - intStack[_UINT + 1] = STR.getIntValue(); - _UINT++; + numStack[_STK + 1].i = STR.getIntValue(); + _STK++; break; case OP_STR_TO_FLT: - floatStack[_FLT + 1] = STR.getFloatValue(); - _FLT++; + numStack[_STK + 1].f = STR.getFloatValue(); + _STK++; break; case OP_STR_TO_NONE: @@ -1543,44 +1539,39 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_FLT_TO_UINT: - intStack[_UINT + 1] = (S64)floatStack[_FLT]; - _FLT--; - _UINT++; + numStack[_STK].i = (S64)numStack[_STK].f; break; case OP_FLT_TO_STR: - STR.setFloatValue(floatStack[_FLT]); - _FLT--; + STR.setFloatValue(numStack[_STK].f); + _STK--; break; case OP_FLT_TO_NONE: - _FLT--; + _STK--; break; case OP_UINT_TO_FLT: - floatStack[_FLT + 1] = (F64)intStack[_UINT]; - _UINT--; - _FLT++; + numStack[_STK].f = (F64)numStack[_STK].i; break; case OP_UINT_TO_STR: - STR.setIntValue((U32)intStack[_UINT]); - _UINT--; + STR.setIntValue(numStack[_STK].i); + _STK--; break; case OP_UINT_TO_NONE: - _UINT--; + _STK--; break; case OP_LOADIMMED_UINT: - intStack[_UINT + 1] = code[ip++]; - _UINT++; + numStack[_STK + 1].i = code[ip++]; + _STK++; break; case OP_LOADIMMED_FLT: - floatStack[_FLT + 1] = curFloatTable[code[ip]]; - ip++; - _FLT++; + numStack[_STK + 1].f = curFloatTable[code[ip++]]; + _STK++; break; case OP_TAG_TO_STR: code[ip - 1] = OP_LOADIMMED_STR; @@ -1791,18 +1782,18 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa } case Namespace::Entry::IntCallbackType: { - S32 result = nsEntry->cb.mIntCallbackFunc(gEvalState.thisObject, callArgc, callArgv); + S64 result = nsEntry->cb.mIntCallbackFunc(gEvalState.thisObject, callArgc, callArgv); gCallStack.popFrame(); if (code[ip] == OP_STR_TO_UINT) { ip++; - intStack[++_UINT] = result; + numStack[++_STK].i = result; break; } else if (code[ip] == OP_STR_TO_FLT) { ip++; - floatStack[++_FLT] = result; + numStack[++_STK].f = result; break; } else if (code[ip] == OP_STR_TO_NONE) @@ -1818,13 +1809,13 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa if (code[ip] == OP_STR_TO_UINT) { ip++; - intStack[++_UINT] = (S64)result; + numStack[++_STK].i = (S64)result; break; } else if (code[ip] == OP_STR_TO_FLT) { ip++; - floatStack[++_FLT] = result; + numStack[++_STK].f = result; break; } else if (code[ip] == OP_STR_TO_NONE) @@ -1849,13 +1840,13 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa if (code[ip] == OP_STR_TO_UINT) { ip++; - intStack[++_UINT] = result; + numStack[++_STK].i = result; break; } else if (code[ip] == OP_STR_TO_FLT) { ip++; - floatStack[++_FLT] = result; + numStack[++_STK].f = result; break; } else if (code[ip] == OP_STR_TO_NONE) @@ -1896,7 +1887,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_COMPARE_STR: - intStack[++_UINT] = STR.compare(); + numStack[++_STK].i = STR.compare(); break; case OP_PUSH: @@ -1904,11 +1895,11 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_PUSH_UINT: - gCallStack.pushInt((U32)intStack[_UINT--]); + gCallStack.pushInt((U32)numStack[_STK--].i); break; case OP_PUSH_FLT: - gCallStack.pushFloat(floatStack[_FLT--]); + gCallStack.pushFloat(numStack[_STK--].f); break; case OP_PUSH_FRAME: @@ -1917,7 +1908,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_ASSERT: { - if (!intStack[_UINT--]) + if (!numStack[_STK--].i) { const char* message = curStringTable + code[ip]; diff --git a/Engine/source/console/stringStack.h b/Engine/source/console/stringStack.h index 1b5d5d84e..6a5dd977f 100644 --- a/Engine/source/console/stringStack.h +++ b/Engine/source/console/stringStack.h @@ -114,15 +114,15 @@ struct StringStack } /// Get an integer representation of the top of the stack. - inline U32 getIntValue() + inline S64 getIntValue() { - return dAtoi(mBuffer + mStart); + return dAtol(mBuffer + mStart); } /// Get a float representation of the top of the stack. inline F64 getFloatValue() { - return dAtof(mBuffer + mStart); + return dAtod(mBuffer + mStart); } /// Get a string representation of the top of the stack. From bfc01094853aaaaae222e01b19db1c658d2ad0ad Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Fri, 16 Apr 2021 23:21:39 -0400 Subject: [PATCH 013/399] fixes and some minor bc adjustment. --- Engine/source/console/CMDscan.l | 1 + Engine/source/console/astNodes.cpp | 4 ++-- Engine/source/console/codeBlock.cpp | 10 ++-------- Engine/source/console/compiledEval.cpp | 6 +----- Engine/source/console/compiler.h | 3 +-- Engine/source/console/console.cpp | 2 +- Engine/source/console/console.h | 7 +++---- 7 files changed, 11 insertions(+), 22 deletions(-) diff --git a/Engine/source/console/CMDscan.l b/Engine/source/console/CMDscan.l index e9069fe15..ccf933bd7 100644 --- a/Engine/source/console/CMDscan.l +++ b/Engine/source/console/CMDscan.l @@ -213,6 +213,7 @@ HEXDIGIT [a-fA-F0-9] "true" { CMDlval.i = MakeToken< int >( 1, lineIndex ); return INTCONST; } "false" { CMDlval.i = MakeToken< int >( 0, lineIndex ); return INTCONST; } {VAR} { return(Sc_ScanVar()); } + {ID} { return Sc_ScanIdent(); } 0[xX]{HEXDIGIT}+ return(Sc_ScanHex()); {INTEGER} { CMDtext[CMDleng] = 0; CMDlval.i = MakeToken< int >( dAtoi(CMDtext), lineIndex ); return INTCONST; } diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index 14f610bd2..9fa5c1e11 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -165,7 +165,7 @@ static U32 conversionOp(TypeReq src, TypeReq dst) case TypeReqString: return OP_FLT_TO_STR; case TypeReqNone: - return OP_FLT_TO_NONE; + return OP_NUM_TO_NONE; default: break; } @@ -179,7 +179,7 @@ static U32 conversionOp(TypeReq src, TypeReq dst) case TypeReqString: return OP_UINT_TO_STR; case TypeReqNone: - return OP_UINT_TO_NONE; + return OP_NUM_TO_NONE; default: break; } diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index 559e921c3..47345aae1 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -1215,12 +1215,6 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) break; } - case OP_FLT_TO_NONE: - { - Con::printf("%i: OP_FLT_TO_NONE", ip - 1); - break; - } - case OP_UINT_TO_FLT: { Con::printf("%i: OP_UINT_TO_FLT", ip - 1); @@ -1233,9 +1227,9 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) break; } - case OP_UINT_TO_NONE: + case OP_NUM_TO_NONE: { - Con::printf("%i: OP_UINT_TO_NONE", ip - 1); + Con::printf("%i: OP_NUM_TO_NONE", ip - 1); break; } diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index c1db544eb..b39a29133 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -1547,10 +1547,6 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa _STK--; break; - case OP_FLT_TO_NONE: - _STK--; - break; - case OP_UINT_TO_FLT: numStack[_STK].f = (F64)numStack[_STK].i; break; @@ -1560,7 +1556,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa _STK--; break; - case OP_UINT_TO_NONE: + case OP_NUM_TO_NONE: _STK--; break; diff --git a/Engine/source/console/compiler.h b/Engine/source/console/compiler.h index c58fff3e6..f0633deab 100644 --- a/Engine/source/console/compiler.h +++ b/Engine/source/console/compiler.h @@ -137,10 +137,9 @@ namespace Compiler OP_STR_TO_NONE, // 60 OP_FLT_TO_UINT, OP_FLT_TO_STR, - OP_FLT_TO_NONE, OP_UINT_TO_FLT, OP_UINT_TO_STR, - OP_UINT_TO_NONE, + OP_NUM_TO_NONE, OP_LOADIMMED_UINT, OP_LOADIMMED_FLT, diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index a544aad0e..4f6971eb8 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -2595,7 +2595,7 @@ ConsoleValue _BaseEngineConsoleCallbackHelper::_exec() // Cannot invoke callback until object has been registered if (mThis->isProperlyAdded()) { - ConsoleValue returnValue = std::move(Con::_internalExecute( mThis, mArgc, mArgv, false )); + ConsoleValue returnValue = Con::_internalExecute( mThis, mArgc, mArgv, false ); mArgc = mInitialArgc; // reset return std::move(returnValue); } diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index 763adc564..d42c202a7 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -175,14 +175,14 @@ class ConsoleValue } public: - ConsoleValue() + explicit ConsoleValue() { - setEmptyString(); + type = ConsoleValueType::cvSTEntry; + s = const_cast(StringTable->EmptyString()); } ConsoleValue(ConsoleValue&& ref) noexcept { - cleanupData(); type = ref.type; switch (ref.type) @@ -217,7 +217,6 @@ public: TORQUE_FORCEINLINE void reset() { - cleanupData(); setEmptyString(); } From bb12638ea5cfccf28f19401253bdb2639c6b863c Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 17 Apr 2021 14:31:27 -0400 Subject: [PATCH 014/399] Added error checking for using a local variable in global scope, and added optimization to method object parameter. --- Engine/source/console/astNodes.cpp | 24 +++++++++++++++--------- Engine/source/console/compiledEval.cpp | 11 ++++++++++- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index 9fa5c1e11..4d58d91d4 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -101,6 +101,12 @@ private: FuncVars* gFuncVars = NULL; +inline FuncVars* getFuncVars() +{ + AssertISV(gFuncVars, "Attemping to use local variable in global scope."); + return gFuncVars; +} + //----------------------------------------------------------------------------- void StmtNode::addBreakLine(CodeStream& code) @@ -424,7 +430,7 @@ U32 IterStmtNode::compileStmt(CodeStream& codeStream, U32 ip) if (isGlobal) codeStream.emitSTE(varName); else - codeStream.emit(gFuncVars->assign(varName, varType)); + codeStream.emit(getFuncVars()->assign(varName, varType)); const U32 finalFix = codeStream.emit(0); const U32 continueIp = codeStream.emit(OP_ITER); codeStream.emitFix(CodeStream::FIXTYPE_BREAK); @@ -793,7 +799,7 @@ U32 VarNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) default: codeStream.emit(OP_LOAD_LOCAL_VAR_STR); } - codeStream.emit(gFuncVars->lookup(varName)); + codeStream.emit(getFuncVars()->lookup(varName)); } return codeStream.tell(); @@ -802,7 +808,7 @@ U32 VarNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) TypeReq VarNode::getPreferredType() { bool oldVariables = arrayIndex || varName[0] == '$'; - return oldVariables ? TypeReqNone : gFuncVars->lookupType(varName); + return oldVariables ? TypeReqNone : getFuncVars()->lookupType(varName); } //------------------------------------------------------------ @@ -1040,7 +1046,7 @@ U32 AssignExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) case TypeReqFloat: codeStream.emit(OP_SAVE_LOCAL_VAR_FLT); break; default: codeStream.emit(OP_SAVE_LOCAL_VAR_STR); } - codeStream.emit(gFuncVars->assign(varName, subType == TypeReqNone ? TypeReqString : subType)); + codeStream.emit(getFuncVars()->assign(varName, subType == TypeReqNone ? TypeReqString : subType)); } if (type != subType) @@ -1136,7 +1142,7 @@ U32 AssignOpExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) if (op == opPLUSPLUS && !oldVariables) { - const S32 varIdx = gFuncVars->assign(varName, TypeReqFloat); + const S32 varIdx = getFuncVars()->assign(varName, TypeReqFloat); codeStream.emit(OP_INC); codeStream.emit(varIdx); @@ -1169,7 +1175,7 @@ U32 AssignOpExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) else { const bool isFloat = subType == TypeReqFloat; - const S32 varIdx = gFuncVars->assign(varName, subType == TypeReqNone ? TypeReqString : subType); + const S32 varIdx = getFuncVars()->assign(varName, subType == TypeReqNone ? TypeReqString : subType); codeStream.emit(isFloat ? OP_LOAD_LOCAL_VAR_FLT : OP_LOAD_LOCAL_VAR_UINT); codeStream.emit(varIdx); @@ -1649,7 +1655,7 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream& codeStream, U32 ip) for (VarNode* walk = args; walk; walk = (VarNode*)((StmtNode*)walk)->getNext()) { precompileIdent(walk->varName); - gFuncVars->assign(walk->varName, TypeReqNone); + getFuncVars()->assign(walk->varName, TypeReqNone); argc++; } @@ -1673,7 +1679,7 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream& codeStream, U32 ip) for (VarNode* walk = args; walk; walk = (VarNode*)((StmtNode*)walk)->getNext()) { StringTableEntry name = walk->varName; - codeStream.emit(gFuncVars->lookup(name)); + codeStream.emit(getFuncVars()->lookup(name)); } CodeBlock::smInFunction = true; ip = compileBlock(stmts, codeStream, ip); @@ -1685,7 +1691,7 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream& codeStream, U32 ip) CodeBlock::smInFunction = false; codeStream.emit(OP_RETURN_VOID); - codeStream.patch(localNumVarsIP, gFuncVars->count()); + codeStream.patch(localNumVarsIP, getFuncVars()->count()); codeStream.patch(endIp, codeStream.tell()); setCurrentStringTable(&getGlobalStringTable()); diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index b39a29133..5a6785ed2 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -1682,7 +1682,16 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa if (simObjectLookupValue.getType() == ConsoleValueType::cvInteger) gEvalState.thisObject = Sim::findObject(static_cast(simObjectLookupValue.getInt())); else - gEvalState.thisObject = Sim::findObject(simObjectLookupValue.getString()); + { + SimObject *foundObject = Sim::findObject(simObjectLookupValue.getString()); + + // Optimization: If we're not an integer, let's make it so that the fast path exists + // on the first argument of the method call (speeds up future usage of %this, for example) + if (foundObject != NULL) + callArgv[1].setInt(static_cast(foundObject->getId())); + + gEvalState.thisObject = foundObject; + } if (gEvalState.thisObject == NULL) { From f056e181b743d695ceabef69e724d6b7034ad17d Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Tue, 20 Apr 2021 19:55:35 -0400 Subject: [PATCH 015/399] remove unused code. --- Engine/source/console/console.cpp | 2 -- Engine/source/console/stringStack.cpp | 28 --------------------------- Engine/source/console/stringStack.h | 4 ---- 3 files changed, 34 deletions(-) diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index 4f6971eb8..a7d2dafc6 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -2622,7 +2622,6 @@ ConsoleValue _BaseEngineConsoleCallbackHelper::_execLater(SimConsoleThreadExecEv void ConsoleStackFrameSaver::save() { gCallStack.pushFrame(0); - STR.pushFrame(); mSaved = true; } @@ -2631,6 +2630,5 @@ void ConsoleStackFrameSaver::restore() if (mSaved) { gCallStack.popFrame(); - STR.popFrame(); } } diff --git a/Engine/source/console/stringStack.cpp b/Engine/source/console/stringStack.cpp index 78d98f183..f1ee26702 100644 --- a/Engine/source/console/stringStack.cpp +++ b/Engine/source/console/stringStack.cpp @@ -39,7 +39,6 @@ StringStack::StringStack() mStart = 0; mLen = 0; mStartStackSize = 0; - mFunctionOffset = 0; validateBufferSize(8192); validateArgBufferSize(2048); dMemset(mBuffer, '\0', mBufferSize); @@ -180,30 +179,3 @@ U32 StringStack::compare() return ret; } - -void StringStack::pushFrame() -{ - //Con::printf("StringStack pushFrame [frame=%i, start=%i]", mNumFrames, mStartStackSize); - mFrameOffsets[mNumFrames++] = mStartStackSize; - mStartOffsets[mStartStackSize++] = mStart; - mStart += ReturnBufferSpace; - validateBufferSize(0); -} - -void StringStack::popFrame() -{ - //Con::printf("StringStack popFrame [frame=%i, start=%i]", mNumFrames, mStartStackSize); - mStartStackSize = mFrameOffsets[--mNumFrames]; - mStart = mStartOffsets[mStartStackSize]; - mLen = 0; -} - -void StringStack::clearFrames() -{ - //Con::printf("StringStack clearFrames"); - mNumFrames = 0; - mStart = 0; - mLen = 0; - mStartStackSize = 0; - mFunctionOffset = 0; -} diff --git a/Engine/source/console/stringStack.h b/Engine/source/console/stringStack.h index 6a5dd977f..1ebac1fc7 100644 --- a/Engine/source/console/stringStack.h +++ b/Engine/source/console/stringStack.h @@ -169,10 +169,6 @@ struct StringStack /// and returning true if they matched, false if they didn't. U32 compare(); - void pushFrame(); - - void popFrame(); - void clearFrames(); }; From 964fde8f091a254286797e1ed57a8218a160bfab Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Mon, 26 Apr 2021 22:52:58 -0400 Subject: [PATCH 016/399] Goodbye String Stack! --- Engine/source/console/astNodes.cpp | 185 +++------- Engine/source/console/codeBlock.cpp | 268 ++++++-------- Engine/source/console/compiledEval.cpp | 408 ++++++++++------------ Engine/source/console/compiler.h | 22 +- Engine/source/console/console.h | 27 +- Engine/source/console/consoleValueStack.h | 16 +- Engine/source/console/test/ScriptTest.cpp | 139 ++++++++ 7 files changed, 507 insertions(+), 558 deletions(-) diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index 4d58d91d4..1f8fea367 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -47,7 +47,9 @@ namespace Compiler U32 compileBlock(StmtNode* block, CodeStream& codeStream, U32 ip) { for (StmtNode* walk = block; walk; walk = walk->getNext()) + { ip = walk->compileStmt(codeStream, ip); + } return codeStream.tell(); } } @@ -146,55 +148,6 @@ void FunctionDeclStmtNode::setPackage(StringTableEntry packageName) // //------------------------------------------------------------ -static U32 conversionOp(TypeReq src, TypeReq dst) -{ - if (src == TypeReqString) - { - switch (dst) - { - case TypeReqUInt: - return OP_STR_TO_UINT; - case TypeReqFloat: - return OP_STR_TO_FLT; - case TypeReqNone: - return OP_STR_TO_NONE; - default: - break; - } - } - else if (src == TypeReqFloat) - { - switch (dst) - { - case TypeReqUInt: - return OP_FLT_TO_UINT; - case TypeReqString: - return OP_FLT_TO_STR; - case TypeReqNone: - return OP_NUM_TO_NONE; - default: - break; - } - } - else if (src == TypeReqUInt) - { - switch (dst) - { - case TypeReqFloat: - return OP_UINT_TO_FLT; - case TypeReqString: - return OP_UINT_TO_STR; - case TypeReqNone: - return OP_NUM_TO_NONE; - default: - break; - } - } - return OP_INVALID; -} - -//------------------------------------------------------------ - U32 BreakStmtNode::compileStmt(CodeStream& codeStream, U32 ip) { if (codeStream.inLoop()) @@ -517,8 +470,6 @@ U32 FloatBinaryExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) break; } codeStream.emit(operand); - if (type != TypeReqFloat) - codeStream.emit(conversionOp(TypeReqFloat, type)); return codeStream.tell(); } @@ -608,8 +559,6 @@ U32 IntBinaryExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) ip = left->compile(codeStream, ip, subType); codeStream.emit(operand); } - if (type != TypeReqUInt) - codeStream.emit(conversionOp(TypeReqUInt, type)); return codeStream.tell(); } @@ -629,13 +578,10 @@ U32 StreqExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) // optional conversion ip = left->compile(codeStream, ip, TypeReqString); - codeStream.emit(OP_ADVANCE_STR_NUL); ip = right->compile(codeStream, ip, TypeReqString); codeStream.emit(OP_COMPARE_STR); if (!eq) codeStream.emit(OP_NOT); - if (type != TypeReqUInt) - codeStream.emit(conversionOp(TypeReqUInt, type)); return codeStream.tell(); } @@ -649,19 +595,13 @@ TypeReq StreqExprNode::getPreferredType() U32 StrcatExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { ip = left->compile(codeStream, ip, TypeReqString); - if (!appendChar) - codeStream.emit(OP_ADVANCE_STR); - else + if (appendChar) { codeStream.emit(OP_ADVANCE_STR_APPENDCHAR); codeStream.emit(appendChar); } ip = right->compile(codeStream, ip, TypeReqString); codeStream.emit(OP_REWIND_STR); - if (type == TypeReqUInt) - codeStream.emit(OP_STR_TO_UINT); - else if (type == TypeReqFloat) - codeStream.emit(OP_STR_TO_FLT); return codeStream.tell(); } @@ -675,7 +615,8 @@ TypeReq StrcatExprNode::getPreferredType() U32 CommaCatExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { ip = left->compile(codeStream, ip, TypeReqString); - codeStream.emit(OP_ADVANCE_STR_COMMA); + codeStream.emit(OP_ADVANCE_STR_APPENDCHAR); + codeStream.emit('_'); ip = right->compile(codeStream, ip, TypeReqString); codeStream.emit(OP_REWIND_STR); @@ -684,10 +625,7 @@ U32 CommaCatExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) // But we're paranoid, so accept (but whine) if we get an oddity... if (type == TypeReqUInt || type == TypeReqFloat) Con::warnf(ConsoleLogEntry::General, "%s (%d): converting comma string to a number... probably wrong.", dbgFileName, dbgLineNumber); - if (type == TypeReqUInt) - codeStream.emit(OP_STR_TO_UINT); - else if (type == TypeReqFloat) - codeStream.emit(OP_STR_TO_FLT); + return codeStream.tell(); } @@ -710,8 +648,7 @@ U32 IntUnaryExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) codeStream.emit(integer ? OP_NOT : OP_NOTF); else if (op == '~') codeStream.emit(OP_ONESCOMPLEMENT); - if (type != TypeReqUInt) - codeStream.emit(conversionOp(TypeReqUInt, type)); + return codeStream.tell(); } @@ -726,8 +663,7 @@ U32 FloatUnaryExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { ip = expr->compile(codeStream, ip, TypeReqFloat); codeStream.emit(OP_NEG); - if (type != TypeReqFloat) - codeStream.emit(conversionOp(TypeReqFloat, type)); + return codeStream.tell(); } @@ -768,10 +704,11 @@ U32 VarNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) if (arrayIndex) { - codeStream.emit(OP_ADVANCE_STR); + //codeStream.emit(OP_ADVANCE_STR); ip = arrayIndex->compile(codeStream, ip, TypeReqString); codeStream.emit(OP_REWIND_STR); codeStream.emit(OP_SETCURVAR_ARRAY); + codeStream.emit(OP_POP_STK); } switch (type) { @@ -1013,18 +950,18 @@ U32 AssignExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { if (arrayIndex) { - if (subType == TypeReqString) - codeStream.emit(OP_ADVANCE_STR); + //if (subType == TypeReqString) + // codeStream.emit(OP_ADVANCE_STR); codeStream.emit(OP_LOADIMMED_IDENT); codeStream.emitSTE(varName); - codeStream.emit(OP_ADVANCE_STR); + //codeStream.emit(OP_ADVANCE_STR); ip = arrayIndex->compile(codeStream, ip, TypeReqString); codeStream.emit(OP_REWIND_STR); codeStream.emit(OP_SETCURVAR_ARRAY_CREATE); - if (subType == TypeReqString) - codeStream.emit(OP_TERMINATE_REWIND_STR); + if (type == TypeReqNone) + codeStream.emit(OP_POP_STK); } else { @@ -1049,11 +986,8 @@ U32 AssignExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) codeStream.emit(getFuncVars()->assign(varName, subType == TypeReqNone ? TypeReqString : subType)); } - if (type != subType) - { - U32 conOp = conversionOp(subType, type); - codeStream.emit(conOp); - } + if (type == TypeReqNone) + codeStream.emit(OP_POP_STK); return ip; } @@ -1068,11 +1002,14 @@ static void getAssignOpTypeOp(S32 op, TypeReq& type, U32& operand) { switch (op) { - case '+': case opPLUSPLUS: + TORQUE_CASE_FALLTHROUGH; + case '+': type = TypeReqFloat; operand = OP_ADD; break; + case opMINUSMINUS: + TORQUE_CASE_FALLTHROUGH; case '-': type = TypeReqFloat; operand = OP_SUB; @@ -1109,6 +1046,8 @@ static void getAssignOpTypeOp(S32 op, TypeReq& type, U32& operand) type = TypeReqUInt; operand = OP_SHR; break; + default: + AssertFatal(false, "Invalid opcode on operation expression"); } } @@ -1163,10 +1102,12 @@ U32 AssignOpExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) codeStream.emit(OP_LOADIMMED_IDENT); codeStream.emitSTE(varName); - codeStream.emit(OP_ADVANCE_STR); + //codeStream.emit(OP_ADVANCE_STR); ip = arrayIndex->compile(codeStream, ip, TypeReqString); codeStream.emit(OP_REWIND_STR); codeStream.emit(OP_SETCURVAR_ARRAY_CREATE); + if (type == TypeReqNone) + codeStream.emit(OP_POP_STK); } codeStream.emit((subType == TypeReqFloat) ? OP_LOADVAR_FLT : OP_LOADVAR_UINT); codeStream.emit(operand); @@ -1184,10 +1125,8 @@ U32 AssignOpExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) codeStream.emit(varIdx); } - if (subType != type) - { - codeStream.emit(conversionOp(subType, type)); - } + if (type == TypeReqNone) + codeStream.emit(OP_POP_STK); } return codeStream.tell(); } @@ -1259,18 +1198,7 @@ U32 FuncCallExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) walkType = TypeReqString; ip = walk->compile(codeStream, ip, walkType); - switch (walk->getPreferredType()) - { - case TypeReqFloat: - codeStream.emit(OP_PUSH_FLT); - break; - case TypeReqUInt: - codeStream.emit(OP_PUSH_UINT); - break; - default: - codeStream.emit(OP_PUSH); - break; - } + codeStream.emit(OP_PUSH); } codeStream.emit(OP_CALLFUNC); @@ -1278,8 +1206,9 @@ U32 FuncCallExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) codeStream.emitSTE(nameSpace); codeStream.emit(callType); - if (type != TypeReqString) - codeStream.emit(conversionOp(TypeReqString, type)); + if (type == TypeReqNone) + codeStream.emit(OP_POP_STK); + return codeStream.tell(); } @@ -1288,7 +1217,6 @@ TypeReq FuncCallExprNode::getPreferredType() return TypeReqString; } - //------------------------------------------------------------ U32 AssertCallExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) @@ -1322,15 +1250,7 @@ U32 SlotAccessNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) if (arrayExpr) { - // eval array - // OP_ADVANCE_STR - // evaluate object expression sub (OP_SETCURFIELD) - // OP_TERMINATE_REWIND_STR - // OP_SETCURFIELDARRAY - // total add of 4 + array precomp - ip = arrayExpr->compile(codeStream, ip, TypeReqString); - codeStream.emit(OP_ADVANCE_STR); } ip = objectExpr->compile(codeStream, ip, TypeReqString); codeStream.emit(OP_SETCUROBJECT); @@ -1341,8 +1261,8 @@ U32 SlotAccessNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) if (arrayExpr) { - codeStream.emit(OP_TERMINATE_REWIND_STR); codeStream.emit(OP_SETCURFIELD_ARRAY); + codeStream.emit(OP_POP_STK); } switch (type) @@ -1381,8 +1301,6 @@ U32 InternalSlotAccessNode::compile(CodeStream& codeStream, U32 ip, TypeReq type codeStream.emit(OP_SETCUROBJECT_INTERNAL); codeStream.emit(recurse); - if (type != TypeReqUInt) - codeStream.emit(conversionOp(TypeReqUInt, type)); return codeStream.tell(); } @@ -1426,11 +1344,9 @@ U32 SlotAssignNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) precompileIdent(slotName); ip = valueExpr->compile(codeStream, ip, TypeReqString); - codeStream.emit(OP_ADVANCE_STR); if (arrayExpr) { ip = arrayExpr->compile(codeStream, ip, TypeReqString); - codeStream.emit(OP_ADVANCE_STR); } if (objectExpr) { @@ -1444,11 +1360,10 @@ U32 SlotAssignNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) if (arrayExpr) { - codeStream.emit(OP_TERMINATE_REWIND_STR); codeStream.emit(OP_SETCURFIELD_ARRAY); + codeStream.emit(OP_POP_STK); } - codeStream.emit(OP_TERMINATE_REWIND_STR); codeStream.emit(OP_SAVEFIELD_STR); if (typeID != -1) @@ -1457,8 +1372,9 @@ U32 SlotAssignNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) codeStream.emit(typeID); } - if (type != TypeReqString) - codeStream.emit(conversionOp(TypeReqString, type)); + if (type == TypeReqNone) + codeStream.emit(OP_POP_STK); + return codeStream.tell(); } @@ -1501,7 +1417,6 @@ U32 SlotAssignOpNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) if (arrayExpr) { ip = arrayExpr->compile(codeStream, ip, TypeReqString); - codeStream.emit(OP_ADVANCE_STR); } ip = objectExpr->compile(codeStream, ip, TypeReqString); codeStream.emit(OP_SETCUROBJECT); @@ -1510,14 +1425,15 @@ U32 SlotAssignOpNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) if (arrayExpr) { - codeStream.emit(OP_TERMINATE_REWIND_STR); codeStream.emit(OP_SETCURFIELD_ARRAY); + if (subType == TypeReqNone) + codeStream.emit(OP_POP_STK); } codeStream.emit((subType == TypeReqFloat) ? OP_LOADFIELD_FLT : OP_LOADFIELD_UINT); codeStream.emit(operand); codeStream.emit((subType == TypeReqFloat) ? OP_SAVEFIELD_FLT : OP_SAVEFIELD_UINT); - if (subType != type) - codeStream.emit(conversionOp(subType, type)); + if (subType == TypeReqNone) + codeStream.emit(OP_POP_STK); return codeStream.tell(); } @@ -1572,18 +1488,7 @@ U32 ObjectDeclNode::compileSubObject(CodeStream& codeStream, U32 ip, bool root) TypeReq walkType = exprWalk->getPreferredType(); if (walkType == TypeReqNone) walkType = TypeReqString; ip = exprWalk->compile(codeStream, ip, walkType); - switch (exprWalk->getPreferredType()) - { - case TypeReqFloat: - codeStream.emit(OP_PUSH_FLT); - break; - case TypeReqUInt: - codeStream.emit(OP_PUSH_UINT); - break; - default: - codeStream.emit(OP_PUSH); - break; - } + codeStream.emit(OP_PUSH); } codeStream.emit(OP_CREATE_OBJECT); codeStream.emitSTE(parentObject); @@ -1621,8 +1526,10 @@ U32 ObjectDeclNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) codeStream.emit(OP_LOADIMMED_UINT); codeStream.emit(0); ip = compileSubObject(codeStream, ip, true); - if (type != TypeReqUInt) - codeStream.emit(conversionOp(TypeReqUInt, type)); + + if (type == TypeReqNone) + codeStream.emit(OP_POP_STK); + return codeStream.tell(); } diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index 47345aae1..9c1ddda17 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -520,7 +520,7 @@ bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, con lastIp = 0; } - codeStream.emit(OP_RETURN); + codeStream.emit(OP_RETURN_VOID); codeStream.emitCodeStream(&codeSize, &code, &lineBreakPairs); lineBreakPairCount = codeStream.getNumLineBreaks(); @@ -640,11 +640,11 @@ ConsoleValue CodeBlock::compileExec(StringTableEntry fileName, const char *inStr globalFloats = getGlobalFloatTable().build(); functionFloats = getFunctionFloatTable().build(); - codeStream.emit(OP_RETURN); + codeStream.emit(OP_RETURN_VOID); codeStream.emitCodeStream(&codeSize, &code, &lineBreakPairs); - if (Con::getBoolVariable("dump")) - dumpInstructions(0, false); + //if (Con::getBoolVariable("dump")) + //dumpInstructions(0, false); consoleAllocReset(); @@ -726,7 +726,7 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) U32 regCount = code[ip + 9]; endFuncIp = newIp; - Con::printf("%i: OP_FUNC_DECL name=%s nspace=%s package=%s hasbody=%i newip=%i argc=%i regCount=%i", + Con::printf("%i: OP_FUNC_DECL stk=+0 name=%s nspace=%s package=%s hasbody=%i newip=%i argc=%i regCount=%i", ip - 1, fnName, fnNamespace, fnPackage, hasBody, newIp, argc, regCount); // Skip args. @@ -745,7 +745,7 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) U32 lineNumber = code[ip + 5]; U32 failJump = code[ip + 6]; - Con::printf("%i: OP_CREATE_OBJECT objParent=%s isDataBlock=%i isInternal=%i isSingleton=%i lineNumber=%i failJump=%i", + Con::printf("%i: OP_CREATE_OBJECT stk=+0 objParent=%s isDataBlock=%i isInternal=%i isSingleton=%i lineNumber=%i failJump=%i", ip - 1, objParent, isDataBlock, isInternal, isSingleton, lineNumber, failJump); ip += 7; @@ -755,14 +755,16 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) case OP_ADD_OBJECT: { bool placeAtRoot = code[ip++]; - Con::printf("%i: OP_ADD_OBJECT placeAtRoot=%i", ip - 1, placeAtRoot); + const char* stk = placeAtRoot ? "+1" : "0"; + Con::printf("%i: OP_ADD_OBJECT stk=%s placeAtRoot=%i", ip - 1, stk, placeAtRoot); break; } case OP_END_OBJECT: { bool placeAtRoot = code[ip++]; - Con::printf("%i: OP_END_OBJECT placeAtRoot=%i", ip - 1, placeAtRoot); + const char* stk = placeAtRoot ? "-1" : "0"; + Con::printf("%i: OP_END_OBJECT stk=%s placeAtRoot=%i", ip - 1, stk, placeAtRoot); break; } @@ -774,56 +776,56 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) case OP_JMPIFFNOT: { - Con::printf("%i: OP_JMPIFFNOT ip=%i", ip - 1, code[ip]); + Con::printf("%i: OP_JMPIFFNOT stk=-1 ip=%i", ip - 1, code[ip]); ++ip; break; } case OP_JMPIFNOT: { - Con::printf("%i: OP_JMPIFNOT ip=%i", ip - 1, code[ip]); + Con::printf("%i: OP_JMPIFNOT stk=-1 ip=%i", ip - 1, code[ip]); ++ip; break; } case OP_JMPIFF: { - Con::printf("%i: OP_JMPIFF ip=%i", ip - 1, code[ip]); + Con::printf("%i: OP_JMPIFF stk=-1 ip=%i", ip - 1, code[ip]); ++ip; break; } case OP_JMPIF: { - Con::printf("%i: OP_JMPIF ip=%i", ip - 1, code[ip]); + Con::printf("%i: OP_JMPIF stk=-1 ip=%i", ip - 1, code[ip]); ++ip; break; } case OP_JMPIFNOT_NP: { - Con::printf("%i: OP_JMPIFNOT_NP ip=%i", ip - 1, code[ip]); + Con::printf("%i: OP_JMPIFNOT_NP stk=-1 or 0 ip=%i", ip - 1, code[ip]); ++ip; break; } case OP_JMPIF_NP: { - Con::printf("%i: OP_JMPIF_NP ip=%i", ip - 1, code[ip]); + Con::printf("%i: OP_JMPIF_NP stk=-1 or 0 ip=%i", ip - 1, code[ip]); ++ip; break; } case OP_JMP: { - Con::printf("%i: OP_JMP ip=%i", ip - 1, code[ip]); + Con::printf("%i: OP_JMP stk=0 ip=%i", ip - 1, code[ip]); ++ip; break; } - case OP_RETURN: + case OP_RETURN_VOID: { - Con::printf("%i: OP_RETURN", ip - 1); + Con::printf("%i: OP_RETURN_VOID stk=0", ip - 1); if (upToReturn) return; @@ -831,9 +833,9 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) break; } - case OP_RETURN_VOID: + case OP_RETURN: { - Con::printf("%i: OP_RETURNVOID", ip - 1); + Con::printf("%i: OP_RETURN stk=-1", ip - 1); if (upToReturn) return; @@ -843,7 +845,7 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) case OP_RETURN_UINT: { - Con::printf("%i: OP_RETURNUINT", ip - 1); + Con::printf("%i: OP_RETURNUINT stk=-1", ip - 1); if (upToReturn) return; @@ -853,7 +855,7 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) case OP_RETURN_FLT: { - Con::printf("%i: OP_RETURNFLT", ip - 1); + Con::printf("%i: OP_RETURNFLT stk=-1", ip - 1); if (upToReturn) return; @@ -863,139 +865,139 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) case OP_CMPEQ: { - Con::printf("%i: OP_CMPEQ", ip - 1); + Con::printf("%i: OP_CMPEQ stk=-1", ip - 1); break; } case OP_CMPGR: { - Con::printf("%i: OP_CMPGR", ip - 1); + Con::printf("%i: OP_CMPGR stk=-1", ip - 1); break; } case OP_CMPGE: { - Con::printf("%i: OP_CMPGE", ip - 1); + Con::printf("%i: OP_CMPGE stk=-1", ip - 1); break; } case OP_CMPLT: { - Con::printf("%i: OP_CMPLT", ip - 1); + Con::printf("%i: OP_CMPLT stk=-1", ip - 1); break; } case OP_CMPLE: { - Con::printf("%i: OP_CMPLE", ip - 1); + Con::printf("%i: OP_CMPLE stk=-1", ip - 1); break; } case OP_CMPNE: { - Con::printf("%i: OP_CMPNE", ip - 1); + Con::printf("%i: OP_CMPNE stk=-1", ip - 1); break; } case OP_XOR: { - Con::printf("%i: OP_XOR", ip - 1); + Con::printf("%i: OP_XOR stk=-1", ip - 1); break; } case OP_MOD: { - Con::printf("%i: OP_MOD", ip - 1); + Con::printf("%i: OP_MOD stk=-1", ip - 1); break; } case OP_BITAND: { - Con::printf("%i: OP_BITAND", ip - 1); + Con::printf("%i: OP_BITAND stk=-1", ip - 1); break; } case OP_BITOR: { - Con::printf("%i: OP_BITOR", ip - 1); + Con::printf("%i: OP_BITOR stk=-1", ip - 1); break; } case OP_NOT: { - Con::printf("%i: OP_NOT", ip - 1); + Con::printf("%i: OP_NOT stk=0", ip - 1); break; } case OP_NOTF: { - Con::printf("%i: OP_NOTF", ip - 1); + Con::printf("%i: OP_NOTF stk=0", ip - 1); break; } case OP_ONESCOMPLEMENT: { - Con::printf("%i: OP_ONESCOMPLEMENT", ip - 1); + Con::printf("%i: OP_ONESCOMPLEMENT stk=0", ip - 1); break; } case OP_SHR: { - Con::printf("%i: OP_SHR", ip - 1); + Con::printf("%i: OP_SHR stk=-1", ip - 1); break; } case OP_SHL: { - Con::printf("%i: OP_SHL", ip - 1); + Con::printf("%i: OP_SHL stk=-1", ip - 1); break; } case OP_AND: { - Con::printf("%i: OP_AND", ip - 1); + Con::printf("%i: OP_AND stk=-1", ip - 1); break; } case OP_OR: { - Con::printf("%i: OP_OR", ip - 1); + Con::printf("%i: OP_OR stk=-1", ip - 1); break; } case OP_ADD: { - Con::printf("%i: OP_ADD", ip - 1); + Con::printf("%i: OP_ADD stk=-1", ip - 1); break; } case OP_SUB: { - Con::printf("%i: OP_SUB", ip - 1); + Con::printf("%i: OP_SUB stk=-1", ip - 1); break; } case OP_MUL: { - Con::printf("%i: OP_MUL", ip - 1); + Con::printf("%i: OP_MUL stk=-1", ip - 1); break; } case OP_DIV: { - Con::printf("%i: OP_DIV", ip - 1); + Con::printf("%i: OP_DIV stk=-1", ip - 1); break; } case OP_NEG: { - Con::printf("%i: OP_NEG", ip - 1); + Con::printf("%i: OP_NEG stk=0", ip - 1); break; } case OP_INC: { - Con::printf("%i: OP_INC reg=%i", ip - 1, code[ip]); + Con::printf("%i: OP_INC stk=0 reg=%i", ip - 1, code[ip]); ++ip; break; } @@ -1004,7 +1006,7 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) { StringTableEntry var = CodeToSTE(code, ip); - Con::printf("%i: OP_SETCURVAR var=%s", ip - 1, var); + Con::printf("%i: OP_SETCURVAR stk=0 var=%s", ip - 1, var); ip += 2; break; } @@ -1013,116 +1015,116 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) { StringTableEntry var = CodeToSTE(code, ip); - Con::printf("%i: OP_SETCURVAR_CREATE var=%s", ip - 1, var); + Con::printf("%i: OP_SETCURVAR_CREATE stk=0 var=%s", ip - 1, var); ip += 2; break; } case OP_SETCURVAR_ARRAY: { - Con::printf("%i: OP_SETCURVAR_ARRAY", ip - 1); + Con::printf("%i: OP_SETCURVAR_ARRAY stk=0", ip - 1); break; } case OP_SETCURVAR_ARRAY_CREATE: { - Con::printf("%i: OP_SETCURVAR_ARRAY_CREATE", ip - 1); + Con::printf("%i: OP_SETCURVAR_ARRAY_CREATE stk=0", ip - 1); break; } case OP_LOADVAR_UINT: { - Con::printf("%i: OP_LOADVAR_UINT", ip - 1); + Con::printf("%i: OP_LOADVAR_UINT stk=+1", ip - 1); break; } case OP_LOADVAR_FLT: { - Con::printf("%i: OP_LOADVAR_FLT", ip - 1); + Con::printf("%i: OP_LOADVAR_FLT stk=+1", ip - 1); break; } case OP_LOADVAR_STR: { - Con::printf("%i: OP_LOADVAR_STR", ip - 1); + Con::printf("%i: OP_LOADVAR_STR stk=+1", ip - 1); break; } case OP_SAVEVAR_UINT: { - Con::printf("%i: OP_SAVEVAR_UINT", ip - 1); + Con::printf("%i: OP_SAVEVAR_UINT stk=0", ip - 1); break; } case OP_SAVEVAR_FLT: { - Con::printf("%i: OP_SAVEVAR_FLT", ip - 1); + Con::printf("%i: OP_SAVEVAR_FLT stk=0", ip - 1); break; } case OP_SAVEVAR_STR: { - Con::printf("%i: OP_SAVEVAR_STR", ip - 1); + Con::printf("%i: OP_SAVEVAR_STR stk=0", ip - 1); break; } case OP_LOAD_LOCAL_VAR_UINT: { - Con::printf("%i: OP_LOAD_LOCAL_VAR_UINT reg=%i", ip - 1, code[ip]); + Con::printf("%i: OP_LOAD_LOCAL_VAR_UINT stk=+1 reg=%i", ip - 1, code[ip]); ++ip; break; } case OP_LOAD_LOCAL_VAR_FLT: { - Con::printf("%i: OP_LOAD_LOCAL_VAR_FLT reg=%i", ip - 1, code[ip]); + Con::printf("%i: OP_LOAD_LOCAL_VAR_FLT stk=+1 reg=%i", ip - 1, code[ip]); ++ip; break; } case OP_LOAD_LOCAL_VAR_STR: { - Con::printf("%i: OP_LOAD_LOCAL_VAR_STR reg=%i", ip - 1, code[ip]); + Con::printf("%i: OP_LOAD_LOCAL_VAR_STR stk=+1 reg=%i", ip - 1, code[ip]); ++ip; break; } case OP_SAVE_LOCAL_VAR_UINT: { - Con::printf("%i: OP_SAVE_LOCAL_VAR_UINT reg=%i", ip - 1, code[ip]); + Con::printf("%i: OP_SAVE_LOCAL_VAR_UINT stk=0 reg=%i", ip - 1, code[ip]); ++ip; break; } case OP_SAVE_LOCAL_VAR_FLT: { - Con::printf("%i: OP_SAVE_LOCAL_VAR_FLT reg=%i", ip - 1, code[ip]); + Con::printf("%i: OP_SAVE_LOCAL_VAR_FLT stk=0 reg=%i", ip - 1, code[ip]); ++ip; break; } case OP_SAVE_LOCAL_VAR_STR: { - Con::printf("%i: OP_SAVE_LOCAL_VAR_STR reg=%i", ip - 1, code[ip]); + Con::printf("%i: OP_SAVE_LOCAL_VAR_STR stk=0 reg=%i", ip - 1, code[ip]); ++ip; break; } case OP_SETCUROBJECT: { - Con::printf("%i: OP_SETCUROBJECT", ip - 1); + Con::printf("%i: OP_SETCUROBJECT stk=-1", ip - 1); break; } case OP_SETCUROBJECT_NEW: { - Con::printf("%i: OP_SETCUROBJECT_NEW", ip - 1); + Con::printf("%i: OP_SETCUROBJECT_NEW stk=0", ip - 1); break; } case OP_SETCUROBJECT_INTERNAL: { - Con::printf("%i: OP_SETCUROBJECT_INTERNAL", ip - 1); + Con::printf("%i: OP_SETCUROBJECT_INTERNAL stk=0", ip - 1); ++ip; break; } @@ -1130,113 +1132,71 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) case OP_SETCURFIELD: { StringTableEntry curField = CodeToSTE(code, ip); - Con::printf("%i: OP_SETCURFIELD field=%s", ip - 1, curField); + Con::printf("%i: OP_SETCURFIELD stk=0 field=%s", ip - 1, curField); ip += 2; break; } case OP_SETCURFIELD_ARRAY: { - Con::printf("%i: OP_SETCURFIELD_ARRAY", ip - 1); + Con::printf("%i: OP_SETCURFIELD_ARRAY stk=0", ip - 1); break; } case OP_SETCURFIELD_TYPE: { U32 type = code[ip]; - Con::printf("%i: OP_SETCURFIELD_TYPE type=%i", ip - 1, type); + Con::printf("%i: OP_SETCURFIELD_TYPE stk=0 type=%i", ip - 1, type); ++ip; break; } case OP_LOADFIELD_UINT: { - Con::printf("%i: OP_LOADFIELD_UINT", ip - 1); + Con::printf("%i: OP_LOADFIELD_UINT stk=+1", ip - 1); break; } case OP_LOADFIELD_FLT: { - Con::printf("%i: OP_LOADFIELD_FLT", ip - 1); + Con::printf("%i: OP_LOADFIELD_FLT stk=+1", ip - 1); break; } case OP_LOADFIELD_STR: { - Con::printf("%i: OP_LOADFIELD_STR", ip - 1); + Con::printf("%i: OP_LOADFIELD_STR stk=+1", ip - 1); break; } case OP_SAVEFIELD_UINT: { - Con::printf("%i: OP_SAVEFIELD_UINT", ip - 1); + Con::printf("%i: OP_SAVEFIELD_UINT stk=0", ip - 1); break; } case OP_SAVEFIELD_FLT: { - Con::printf("%i: OP_SAVEFIELD_FLT", ip - 1); + Con::printf("%i: OP_SAVEFIELD_FLT stk=0", ip - 1); break; } case OP_SAVEFIELD_STR: { - Con::printf("%i: OP_SAVEFIELD_STR", ip - 1); + Con::printf("%i: OP_SAVEFIELD_STR stk=0", ip - 1); break; } - case OP_STR_TO_UINT: + case OP_POP_STK: { - Con::printf("%i: OP_STR_TO_UINT", ip - 1); - break; - } - - case OP_STR_TO_FLT: - { - Con::printf("%i: OP_STR_TO_FLT", ip - 1); - break; - } - - case OP_STR_TO_NONE: - { - Con::printf("%i: OP_STR_TO_NONE", ip - 1); - break; - } - - case OP_FLT_TO_UINT: - { - Con::printf("%i: OP_FLT_TO_UINT", ip - 1); - break; - } - - case OP_FLT_TO_STR: - { - Con::printf("%i: OP_FLT_TO_STR", ip - 1); - break; - } - - case OP_UINT_TO_FLT: - { - Con::printf("%i: OP_UINT_TO_FLT", ip - 1); - break; - } - - case OP_UINT_TO_STR: - { - Con::printf("%i: OP_UINT_TO_STR", ip - 1); - break; - } - - case OP_NUM_TO_NONE: - { - Con::printf("%i: OP_NUM_TO_NONE", ip - 1); + Con::printf("%i: OP_POP_STK stk=-1", ip - 1); break; } case OP_LOADIMMED_UINT: { U32 val = code[ip]; - Con::printf("%i: OP_LOADIMMED_UINT val=%i", ip - 1, val); + Con::printf("%i: OP_LOADIMMED_UINT stk=+1 val=%i", ip - 1, val); ++ip; break; } @@ -1244,7 +1204,7 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) case OP_LOADIMMED_FLT: { F64 val = (smInFunction ? functionFloats : globalFloats)[code[ip]]; - Con::printf("%i: OP_LOADIMMED_FLT val=%f", ip - 1, val); + Con::printf("%i: OP_LOADIMMED_FLT stk=+1 val=%f", ip - 1, val); ++ip; break; } @@ -1252,7 +1212,8 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) case OP_TAG_TO_STR: { const char* str = (smInFunction ? functionStrings : globalStrings) + code[ip]; - Con::printf("%i: OP_TAG_TO_STR str=%s", ip - 1, str); + Con::printf("%i: OP_TAG_TO_STR stk=0 str=%s", ip - 1, str); + Con::printf(" OP_LOADIMMED_STR stk=+1 (fallthrough)"); ++ip; break; } @@ -1260,7 +1221,7 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) case OP_LOADIMMED_STR: { const char* str = (smInFunction ? functionStrings : globalStrings) + code[ip]; - Con::printf("%i: OP_LOADIMMED_STR str=%s", ip - 1, str); + Con::printf("%i: OP_LOADIMMED_STR stk=+1 str=%s", ip - 1, str); ++ip; break; } @@ -1268,7 +1229,7 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) case OP_DOCBLOCK_STR: { const char* str = (smInFunction ? functionStrings : globalStrings) + code[ip]; - Con::printf("%i: OP_DOCBLOCK_STR str=%s", ip - 1, str); + Con::printf("%i: OP_DOCBLOCK_STR stk=0 str=%s", ip - 1, str); ++ip; break; } @@ -1276,7 +1237,7 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) case OP_LOADIMMED_IDENT: { StringTableEntry str = CodeToSTE(code, ip); - Con::printf("%i: OP_LOADIMMED_IDENT str=%s", ip - 1, str); + Con::printf("%i: OP_LOADIMMED_IDENT stk=+1 str=%s", ip - 1, str); ip += 2; break; } @@ -1296,77 +1257,48 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) case FuncCallExprNode::StaticCall: callTypeName = "StaticCall"; break; } - Con::printf("%i: OP_CALLFUNC name=%s nspace=%s callType=%s", ip - 1, fnName, fnNamespace, callTypeName); + Con::printf("%i: OP_CALLFUNC stk=+1 name=%s nspace=%s callType=%s", ip - 1, fnName, fnNamespace, callTypeName); ip += 5; break; } - case OP_ADVANCE_STR: - { - Con::printf("%i: OP_ADVANCE_STR", ip - 1); - break; - } - case OP_ADVANCE_STR_APPENDCHAR: { char ch = code[ip]; - Con::printf("%i: OP_ADVANCE_STR_APPENDCHAR char=%c", ip - 1, ch); + Con::printf("%i: OP_ADVANCE_STR_APPENDCHAR stk=0 char=%c", ip - 1, ch); ++ip; break; } - case OP_ADVANCE_STR_COMMA: - { - Con::printf("%i: OP_ADVANCE_STR_COMMA", ip - 1); - break; - } - - case OP_ADVANCE_STR_NUL: - { - Con::printf("%i: OP_ADVANCE_STR_NUL", ip - 1); - break; - } - case OP_REWIND_STR: { - Con::printf("%i: OP_REWIND_STR", ip - 1); + Con::printf("%i: OP_REWIND_STR stk=0", ip - 1); + Con::printf(" OP_TERMINATE_REWIND_STR stk=-1 (fallthrough)"); break; } case OP_TERMINATE_REWIND_STR: { - Con::printf("%i: OP_TERMINATE_REWIND_STR", ip - 1); + Con::printf("%i: OP_TERMINATE_REWIND_STR stk=-1", ip - 1); break; } case OP_COMPARE_STR: { - Con::printf("%i: OP_COMPARE_STR", ip - 1); + Con::printf("%i: OP_COMPARE_STR stk=-1", ip - 1); break; } case OP_PUSH: { - Con::printf("%i: OP_PUSH", ip - 1); - break; - } - - case OP_PUSH_UINT: - { - Con::printf("%i: OP_PUSH_UINT", ip - 1); - break; - } - - case OP_PUSH_FLT: - { - Con::printf("%i: OP_PUSH_FLT", ip - 1); + Con::printf("%i: OP_PUSH stk=-1", ip - 1); break; } case OP_PUSH_FRAME: { - Con::printf("%i: OP_PUSH_FRAME count=%i", ip - 1, code[ip]); + Con::printf("%i: OP_PUSH_FRAME stk=0 count=%i", ip - 1, code[ip]); ++ip; break; } @@ -1374,14 +1306,14 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) case OP_ASSERT: { const char* message = (smInFunction ? functionStrings : globalStrings) + code[ip]; - Con::printf("%i: OP_ASSERT message=%s", ip - 1, message); + Con::printf("%i: OP_ASSERT stk=-1 message=%s", ip - 1, message); ++ip; break; } case OP_BREAK: { - Con::printf("%i: OP_BREAK", ip - 1); + Con::printf("%i: OP_BREAK stk=0", ip - 1); break; } @@ -1393,7 +1325,7 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) StringTableEntry varName = CodeToSTE(code, ip + 1); U32 failIp = code[ip + 3]; - Con::printf("%i: OP_ITER_BEGIN varName=%s failIp=%i isGlobal=%s", ip - 1, varName, failIp, "true"); + Con::printf("%i: OP_ITER_BEGIN stk=0 varName=%s failIp=%i isGlobal=%s", ip - 1, varName, failIp, "true"); ip += 4; } @@ -1402,7 +1334,7 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) S32 reg = code[ip + 1]; U32 failIp = code[ip + 2]; - Con::printf("%i: OP_ITER_BEGIN varRegister=%d failIp=%i isGlobal=%s", ip - 1, reg, failIp, "false"); + Con::printf("%i: OP_ITER_BEGIN stk=0 varRegister=%d failIp=%i isGlobal=%s", ip - 1, reg, failIp, "false"); ip += 3; } @@ -1417,7 +1349,8 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) StringTableEntry varName = CodeToSTE(code, ip + 1); U32 failIp = code[ip + 3]; - Con::printf("%i: OP_ITER_BEGIN_STR varName=%s failIp=%i isGlobal=%s", ip - 1, varName, failIp, "true"); + Con::printf("%i: OP_ITER_BEGIN_STR stk=0 varName=%s failIp=%i isGlobal=%s", ip - 1, varName, failIp, "true"); + Con::printf(" OP_ITER_BEGIN stk=0 (fallthrough)"); ip += 4; } @@ -1426,7 +1359,8 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) S32 reg = code[ip + 1]; U32 failIp = code[ip + 2]; - Con::printf("%i: OP_ITER_BEGIN_STR varRegister=%d failIp=%i isGlobal=%s", ip - 1, reg, failIp, "false"); + Con::printf("%i: OP_ITER_BEGIN_STR stk=0 varRegister=%d failIp=%i isGlobal=%s", ip - 1, reg, failIp, "false"); + Con::printf(" OP_ITER_BEGIN stk=0 (fallthrough)"); ip += 3; } @@ -1438,7 +1372,7 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) { U32 breakIp = code[ip]; - Con::printf("%i: OP_ITER breakIp=%i", ip - 1, breakIp); + Con::printf("%i: OP_ITER stk=0 breakIp=%i", ip - 1, breakIp); ++ip; break; @@ -1446,7 +1380,7 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) case OP_ITER_END: { - Con::printf("%i: OP_ITER_END", ip - 1); + Con::printf("%i: OP_ITER_END stk=-1", ip - 1); break; } diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 5a6785ed2..228dc85f3 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -109,18 +109,11 @@ ConsoleValueStack<4096> gCallStack; StringStack STR; +IterStackRecord iterStack[MaxStackSize]; U32 _ITER = 0; ///< Stack pointer for iterStack. -IterStackRecord iterStack[MaxStackSize]; - -union StackValue -{ - F64 f; - S64 i; -}; - -StackValue numStack[MaxStackSize]; -U32 _STK = 0; +ConsoleValue stack[MaxStackSize]; +S32 _STK = 0; char curFieldArray[256]; char prevFieldArray[256]; @@ -166,7 +159,7 @@ static void getFieldComponent(SimObject* object, StringTableEntry field, const c // Otherwise, grab from the string stack. The value coming in will always // be a string because that is how multicomponent variables are handled. else - prevVal = STR.getStringValue(); + prevVal = stack[_STK].getString(); // Make sure we got a value. if (prevVal && *prevVal) @@ -214,7 +207,7 @@ static void setFieldComponent(SimObject* object, StringTableEntry field, const c { // Copy the current string value char strValue[1024]; - dStrncpy(strValue, STR.getStringValue(), 1024); + dStrncpy(strValue, stack[_STK].getString(), 1024); char val[1024] = ""; const char* prevVal = NULL; @@ -437,7 +430,7 @@ U32 gExecCount = 0; ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNamespace, U32 argc, ConsoleValue* argv, bool noCalls, StringTableEntry packageName, S32 setFrame) { #ifdef TORQUE_DEBUG - U32 stackStart = STR.mStartStackSize; + U32 stackStart = _STK; gExecCount++; #endif @@ -452,7 +445,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa F64* curFloatTable; char* curStringTable; S32 curStringTableLen = 0; //clint to ensure we dont overwrite it - STR.clearFunctionOffset(); + StringTableEntry thisFunctionName = NULL; bool popFrame = false; if (argv) @@ -949,7 +942,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa } // What group will we be added to, if any? - U32 groupAddId = (U32)numStack[_STK].i; + U32 groupAddId = (U32)stack[_STK].getInt(); SimGroup* grp = NULL; SimSet* set = NULL; @@ -994,9 +987,9 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // id, if one was given, otherwise getting pushed) S32 id = currentNewObject->getId(); if (placeAtRoot) - numStack[_STK].i = id; + stack[_STK].setInt(id); else - numStack[++_STK].i = id; + stack[++_STK].setInt(id); break; } @@ -1024,7 +1017,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa } case OP_JMPIFFNOT: - if (numStack[_STK--].f) + if (stack[_STK--].getFloat()) { ip++; break; @@ -1032,7 +1025,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa ip = code[ip]; break; case OP_JMPIFNOT: - if (numStack[_STK--].i) + if (stack[_STK--].getInt()) { ip++; break; @@ -1040,7 +1033,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa ip = code[ip]; break; case OP_JMPIFF: - if (!numStack[_STK--].f) + if (!stack[_STK--].getFloat()) { ip++; break; @@ -1048,7 +1041,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa ip = code[ip]; break; case OP_JMPIF: - if (!numStack[_STK--].i) + if (!stack[_STK--].getFloat()) { ip++; break; @@ -1056,7 +1049,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa ip = code[ip]; break; case OP_JMPIFNOT_NP: - if (numStack[_STK].i) + if (stack[_STK].getInt()) { _STK--; ip++; @@ -1065,7 +1058,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa ip = code[ip]; break; case OP_JMPIF_NP: - if (!numStack[_STK].i) + if (!stack[_STK].getInt()) { _STK--; ip++; @@ -1077,10 +1070,24 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa ip = code[ip]; break; - // This fixes a bug when not explicitly returning a value. case OP_RETURN_VOID: - STR.setStringValue(""); - // We're falling thru here on purpose. + { + if (iterDepth > 0) + { + // Clear iterator state. + while (iterDepth > 0) + { + iterStack[--_ITER].mIsStringIter = false; + --iterDepth; + } + + _STK--; // this is a pop from foreach() + } + + returnValue.setEmptyString(); + + goto execFinished; + } case OP_RETURN: { @@ -1093,12 +1100,16 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa --iterDepth; } - const char* retVal = STR.getStringValue(); - STR.rewind(); - STR.setStringValue(retVal); // Not nice but works. + + const char* retVal = stack[_STK].getString(); + _STK--; + _STK--; + stack[_STK + 1].setString(retVal); + _STK++; // Not nice but works. } - returnValue.setString(STR.getStringValue(), STR.mLen); + returnValue.setString(stack[_STK].getString()); + _STK--; goto execFinished; } @@ -1115,7 +1126,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa } - returnValue.setFloat(numStack[_STK].f); + returnValue.setFloat(stack[_STK].getFloat()); _STK--; goto execFinished; @@ -1132,116 +1143,118 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa } } - returnValue.setInt(numStack[_STK].i); + returnValue.setInt(stack[_STK].getInt()); _STK--; goto execFinished; case OP_CMPEQ: - numStack[_STK - 1].i = bool(numStack[_STK].f == numStack[_STK - 1].f); + stack[_STK - 1].setInt(stack[_STK].getFloat() == stack[_STK - 1].getFloat()); _STK--; break; case OP_CMPGR: - numStack[_STK - 1].i = bool(numStack[_STK].f > numStack[_STK - 1].f); + stack[_STK - 1].setInt(stack[_STK].getFloat() > stack[_STK - 1].getFloat()); _STK--; break; case OP_CMPGE: - numStack[_STK - 1].i = bool(numStack[_STK].f >= numStack[_STK - 1].f); + stack[_STK - 1].setInt(stack[_STK].getFloat() >= stack[_STK - 1].getFloat()); _STK--; break; case OP_CMPLT: - numStack[_STK - 1].i = bool(numStack[_STK].f < numStack[_STK - 1].f); + stack[_STK - 1].setInt(stack[_STK].getFloat() < stack[_STK - 1].getFloat()); _STK--; break; case OP_CMPLE: - numStack[_STK - 1].i = bool(numStack[_STK].f <= numStack[_STK - 1].f); + stack[_STK - 1].setInt(stack[_STK].getFloat() <= stack[_STK - 1].getFloat()); _STK--; break; case OP_CMPNE: - numStack[_STK - 1].i = bool(numStack[_STK].f != numStack[_STK - 1].f); + stack[_STK - 1].setInt(stack[_STK].getFloat() != stack[_STK - 1].getFloat()); _STK--; break; case OP_XOR: - numStack[_STK - 1].i = numStack[_STK].i ^ numStack[_STK - 1].i; + stack[_STK - 1].setInt(stack[_STK].getInt() ^ stack[_STK - 1].getInt()); _STK--; break; case OP_MOD: - if (numStack[_STK - 1].i != 0) - numStack[_STK - 1].i = numStack[_STK].i % numStack[_STK - 1].i; + if (stack[_STK - 1].getInt() != 0) + stack[_STK - 1].setInt(stack[_STK].getInt() % stack[_STK - 1].getInt()); else - numStack[_STK - 1].i = 0; + stack[_STK - 1].setInt(0); _STK--; break; case OP_BITAND: - numStack[_STK - 1].i = numStack[_STK].i & numStack[_STK - 1].i; + stack[_STK - 1].setInt(stack[_STK].getInt() & stack[_STK - 1].getInt()); _STK--; break; case OP_BITOR: - numStack[_STK - 1].i = numStack[_STK].i | numStack[_STK - 1].i; + stack[_STK - 1].setInt(stack[_STK].getInt() | stack[_STK - 1].getInt()); _STK--; break; case OP_NOT: - numStack[_STK].i = !numStack[_STK].i; + stack[_STK].setInt(!stack[_STK].getInt()); break; case OP_NOTF: - numStack[_STK].i = !numStack[_STK].f; + stack[_STK].setInt(!stack[_STK].getFloat()); break; case OP_ONESCOMPLEMENT: - numStack[_STK].i = ~numStack[_STK].i; + stack[_STK].setInt(~stack[_STK].getInt()); break; case OP_SHR: - numStack[_STK - 1].i = numStack[_STK].i >> numStack[_STK - 1].i; + stack[_STK - 1].setInt(stack[_STK].getInt() >> stack[_STK - 1].getInt()); _STK--; break; case OP_SHL: - numStack[_STK - 1].i = numStack[_STK].i << numStack[_STK - 1].i; + stack[_STK - 1].setInt(stack[_STK].getInt() << stack[_STK - 1].getInt()); _STK--; break; case OP_AND: - numStack[_STK - 1].i = numStack[_STK].i && numStack[_STK - 1].i; + stack[_STK - 1].setInt(stack[_STK].getInt() && stack[_STK - 1].getInt()); _STK--; break; case OP_OR: - numStack[_STK - 1].i = numStack[_STK].i || numStack[_STK - 1].i; + stack[_STK - 1].setInt(stack[_STK].getInt() || stack[_STK - 1].getInt()); _STK--; break; case OP_ADD: - numStack[_STK - 1].f = numStack[_STK].f + numStack[_STK - 1].f; + stack[_STK - 1].setFloat(stack[_STK].getFloat() + stack[_STK - 1].getFloat()); _STK--; break; case OP_SUB: - numStack[_STK - 1].f = numStack[_STK].f - numStack[_STK - 1].f; + stack[_STK - 1].setFloat(stack[_STK].getFloat() - stack[_STK - 1].getFloat()); _STK--; break; case OP_MUL: - numStack[_STK - 1].f = numStack[_STK].f * numStack[_STK - 1].f; + stack[_STK - 1].setFloat(stack[_STK].getFloat() * stack[_STK - 1].getFloat()); _STK--; break; + case OP_DIV: - numStack[_STK - 1].f = numStack[_STK].f / numStack[_STK - 1].f; + stack[_STK - 1].setFloat(stack[_STK].getFloat() / stack[_STK - 1].getFloat()); _STK--; break; + case OP_NEG: - numStack[_STK].f = -numStack[_STK].f; + stack[_STK].setFloat(-stack[_STK].getFloat()); break; case OP_INC: @@ -1286,7 +1299,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_SETCURVAR_ARRAY: - var = STR.getSTValue(); + var = StringTable->insert(stack[_STK].getString()); // See OP_SETCURVAR prevField = NULL; @@ -1301,7 +1314,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_SETCURVAR_ARRAY_CREATE: - var = STR.getSTValue(); + var = StringTable->insert(stack[_STK].getString()); // See OP_SETCURVAR prevField = NULL; @@ -1316,69 +1329,72 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_LOADVAR_UINT: - numStack[_STK + 1].i = gEvalState.getIntVariable(); + stack[_STK + 1].setInt(gEvalState.getIntVariable()); _STK++; break; case OP_LOADVAR_FLT: - numStack[_STK + 1].f = gEvalState.getFloatVariable(); + stack[_STK + 1].setFloat(gEvalState.getFloatVariable()); _STK++; break; case OP_LOADVAR_STR: - val = gEvalState.getStringVariable(); - STR.setStringValue(val); + stack[_STK + 1].setString(gEvalState.getStringVariable()); + _STK++; break; case OP_SAVEVAR_UINT: - gEvalState.setIntVariable(numStack[_STK].i); + gEvalState.setIntVariable(stack[_STK].getInt()); break; case OP_SAVEVAR_FLT: - gEvalState.setFloatVariable(numStack[_STK].f); + gEvalState.setFloatVariable(stack[_STK].getFloat()); break; case OP_SAVEVAR_STR: - gEvalState.setStringVariable(STR.getStringValue()); + gEvalState.setStringVariable(stack[_STK].getString()); break; case OP_LOAD_LOCAL_VAR_UINT: reg = code[ip++]; - numStack[_STK + 1].i = gEvalState.getLocalIntVariable(reg); + stack[_STK + 1].setInt(gEvalState.getLocalIntVariable(reg)); _STK++; break; case OP_LOAD_LOCAL_VAR_FLT: reg = code[ip++]; - numStack[_STK + 1].f = gEvalState.getLocalFloatVariable(reg); + stack[_STK + 1].setFloat(gEvalState.getLocalFloatVariable(reg)); _STK++; break; case OP_LOAD_LOCAL_VAR_STR: reg = code[ip++]; val = gEvalState.getLocalStringVariable(reg); - STR.setStringValue(val); + stack[_STK + 1].setString(val); + _STK++; break; case OP_SAVE_LOCAL_VAR_UINT: reg = code[ip++]; - gEvalState.setLocalIntVariable(reg, numStack[_STK].i); + gEvalState.setLocalIntVariable(reg, stack[_STK].getInt()); break; case OP_SAVE_LOCAL_VAR_FLT: reg = code[ip++]; - gEvalState.setLocalFloatVariable(reg, numStack[_STK].f); + gEvalState.setLocalFloatVariable(reg, stack[_STK].getFloat()); break; case OP_SAVE_LOCAL_VAR_STR: reg = code[ip++]; - gEvalState.setLocalStringVariable(reg, STR.getStringValue(), (S32)STR.mLen); + val = stack[_STK].getString(); + gEvalState.setLocalStringVariable(reg, val, (S32)dStrlen(val)); break; case OP_SETCUROBJECT: // Save the previous object for parsing vector fields. prevObject = curObject; - val = STR.getStringValue(); + val = stack[_STK].getString(); + _STK--; // Sim::findObject will sometimes find valid objects from // multi-component strings. This makes sure that doesn't @@ -1401,16 +1417,15 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa SimGroup* group = dynamic_cast(curObject); if (group) { - StringTableEntry intName = StringTable->insert(STR.getStringValue()); + StringTableEntry intName = StringTable->insert(stack[_STK].getString()); bool recurse = code[ip - 1]; SimObject* obj = group->findObjectByInternalName(intName, recurse); - numStack[_STK + 1].i = obj ? obj->getId() : 0; - _STK++; + stack[_STK].setInt(obj ? obj->getId() : 0); } else { Con::errorf(ConsoleLogEntry::Script, "%s: Attempt to use -> on non-group %s of class %s.", getFileLine(ip - 2), curObject->getName(), curObject->getClassName()); - numStack[_STK].i = 0; + stack[_STK].setInt(0); } } break; @@ -1429,7 +1444,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_SETCURFIELD_ARRAY: - dStrcpy(curFieldArray, STR.getStringValue(), 256); + dStrcpy(curFieldArray, stack[_STK].getString(), 256); break; case OP_SETCURFIELD_TYPE: @@ -1440,7 +1455,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_LOADFIELD_UINT: if (curObject) - numStack[_STK + 1].i = dAtol(curObject->getDataField(curField, curFieldArray)); + stack[_STK + 1].setInt(dAtol(curObject->getDataField(curField, curFieldArray))); else { // The field is not being retrieved from an object. Maybe it's @@ -1448,14 +1463,14 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa char buff[FieldBufferSizeNumeric]; memset(buff, 0, sizeof(buff)); getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff); - numStack[_STK + 1].i = dAtol(buff); + stack[_STK + 1].setInt(dAtol(buff)); } _STK++; break; case OP_LOADFIELD_FLT: if (curObject) - numStack[_STK + 1].f = dAtod(curObject->getDataField(curField, curFieldArray)); + stack[_STK + 1].setFloat(dAtod(curObject->getDataField(curField, curFieldArray))); else { // The field is not being retrieved from an object. Maybe it's @@ -1463,7 +1478,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa char buff[FieldBufferSizeNumeric]; memset(buff, 0, sizeof(buff)); getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff); - numStack[_STK + 1].f = dAtod(buff); + stack[_STK + 1].setFloat(dAtod(buff)); } _STK++; break; @@ -1472,7 +1487,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa if (curObject) { val = curObject->getDataField(curField, curFieldArray); - STR.setStringValue(val); + stack[_STK + 1].setString(val); } else { @@ -1481,15 +1496,14 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa char buff[FieldBufferSizeString]; memset(buff, 0, sizeof(buff)); getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff); - STR.setStringValue(buff); + stack[_STK + 1].setString(buff); } - + _STK++; break; case OP_SAVEFIELD_UINT: - STR.setIntValue(numStack[_STK].i); if (curObject) - curObject->setDataField(curField, curFieldArray, STR.getStringValue()); + curObject->setDataField(curField, curFieldArray, stack[_STK].getString()); else { // The field is not being set on an object. Maybe it's @@ -1500,9 +1514,8 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_SAVEFIELD_FLT: - STR.setFloatValue(numStack[_STK].f); if (curObject) - curObject->setDataField(curField, curFieldArray, STR.getStringValue()); + curObject->setDataField(curField, curFieldArray, stack[_STK].getString()); else { // The field is not being set on an object. Maybe it's @@ -1514,7 +1527,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_SAVEFIELD_STR: if (curObject) - curObject->setDataField(curField, curFieldArray, STR.getStringValue()); + curObject->setDataField(curField, curFieldArray, stack[_STK].getString()); else { // The field is not being set on an object. Maybe it's @@ -1524,51 +1537,20 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa } break; - case OP_STR_TO_UINT: - numStack[_STK + 1].i = STR.getIntValue(); - _STK++; - break; - - case OP_STR_TO_FLT: - numStack[_STK + 1].f = STR.getFloatValue(); - _STK++; - break; - - case OP_STR_TO_NONE: - // This exists simply to deal with certain typecast situations. - break; - - case OP_FLT_TO_UINT: - numStack[_STK].i = (S64)numStack[_STK].f; - break; - - case OP_FLT_TO_STR: - STR.setFloatValue(numStack[_STK].f); - _STK--; - break; - - case OP_UINT_TO_FLT: - numStack[_STK].f = (F64)numStack[_STK].i; - break; - - case OP_UINT_TO_STR: - STR.setIntValue(numStack[_STK].i); - _STK--; - break; - - case OP_NUM_TO_NONE: + case OP_POP_STK: _STK--; break; case OP_LOADIMMED_UINT: - numStack[_STK + 1].i = code[ip++]; + stack[_STK + 1].setInt(code[ip++]); _STK++; break; case OP_LOADIMMED_FLT: - numStack[_STK + 1].f = curFloatTable[code[ip++]]; + stack[_STK + 1].setFloat(curFloatTable[code[ip++]]); _STK++; break; + case OP_TAG_TO_STR: code[ip - 1] = OP_LOADIMMED_STR; // it's possible the string has already been converted @@ -1578,8 +1560,11 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa dSprintf(curStringTable + code[ip] + 1, 7, "%d", id); *(curStringTable + code[ip]) = StringTagPrefixByte; } + TORQUE_CASE_FALLTHROUGH; + case OP_LOADIMMED_STR: - STR.setStringValue(curStringTable + code[ip++]); + stack[_STK + 1].setString(curStringTable + code[ip++]); + _STK ++; break; case OP_DOCBLOCK_STR: @@ -1614,7 +1599,8 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_LOADIMMED_IDENT: - STR.setStringValue(CodeToSTE(code, ip)); + stack[_STK + 1].setString(CodeToSTE(code, ip)); + _STK++; ip += 2; break; @@ -1652,8 +1638,10 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa Con::warnf(ConsoleLogEntry::General, "%s: Unable to find function %s", getFileLine(ip - 4), fnName); - //STR.popFrame(); + gCallStack.popFrame(); + stack[_STK + 1].setEmptyString(); + _STK++; break; } } @@ -1668,8 +1656,10 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa "%s: Unable to find function %s%s%s", getFileLine(ip - 4), fnNamespace ? fnNamespace : "", fnNamespace ? "::" : "", fnName); - //STR.popFrame(); + gCallStack.popFrame(); + stack[_STK + 1].setEmptyString(); + _STK++; break; } } @@ -1702,9 +1692,10 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa simObjectLookupValue.getString(), fnName ); - //STR.popFrame(); + gCallStack.popFrame(); - STR.setStringValue(""); + stack[_STK + 1].setEmptyString(); + _STK++; break; } @@ -1744,8 +1735,8 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa } } gCallStack.popFrame(); - STR.setStringValue(""); - STR.setStringValue(""); + stack[_STK + 1].setEmptyString(); + _STK++; break; } if (nsEntry->mType == Namespace::Entry::ConsoleFunctionType) @@ -1754,10 +1745,11 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa { // TODO: not make this strings only for returns. ConsoleValue returnFromFn = nsEntry->mCode->exec(nsEntry->mFunctionOffset, fnName, nsEntry->mNamespace, callArgc, callArgv, false, nsEntry->mPackage); - STR.setStringValue(returnFromFn.getString()); + stack[_STK + 1] = std::move(returnFromFn); } else // no body - STR.setStringValue(""); + stack[_STK + 1].setEmptyString(); + _STK++; gCallStack.popFrame(); } @@ -1769,7 +1761,8 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa Con::warnf(ConsoleLogEntry::Script, "%s: %s::%s - wrong number of arguments.", getFileLine(ip - 4), nsName, fnName); Con::warnf(ConsoleLogEntry::Script, "%s: usage: %s", getFileLine(ip - 4), nsEntry->mUsage); gCallStack.popFrame(); - STR.setStringValue(""); + stack[_STK + 1].setEmptyString(); + _STK++; } else { @@ -1777,87 +1770,73 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa { case Namespace::Entry::StringCallbackType: { - const char* ret = nsEntry->cb.mStringCallbackFunc(gEvalState.thisObject, callArgc, callArgv); + const char* result = nsEntry->cb.mStringCallbackFunc(gEvalState.thisObject, callArgc, callArgv); gCallStack.popFrame(); - if (ret != STR.getStringValue()) - STR.setStringValue(ret); - else - STR.setLen(dStrlen(ret)); + stack[_STK + 1].setString(result); + _STK++; break; } case Namespace::Entry::IntCallbackType: { S64 result = nsEntry->cb.mIntCallbackFunc(gEvalState.thisObject, callArgc, callArgv); gCallStack.popFrame(); - if (code[ip] == OP_STR_TO_UINT) + + if (code[ip] == OP_POP_STK) { ip++; - numStack[++_STK].i = result; break; } - else if (code[ip] == OP_STR_TO_FLT) - { - ip++; - numStack[++_STK].f = result; - break; - } - else if (code[ip] == OP_STR_TO_NONE) - ip++; - else - STR.setIntValue(result); + + stack[_STK + 1].setInt(result); + _STK++; break; } case Namespace::Entry::FloatCallbackType: { F64 result = nsEntry->cb.mFloatCallbackFunc(gEvalState.thisObject, callArgc, callArgv); gCallStack.popFrame(); - if (code[ip] == OP_STR_TO_UINT) + + if (code[ip] == OP_POP_STK) { ip++; - numStack[++_STK].i = (S64)result; break; } - else if (code[ip] == OP_STR_TO_FLT) - { - ip++; - numStack[++_STK].f = result; - break; - } - else if (code[ip] == OP_STR_TO_NONE) - ip++; - else - STR.setFloatValue(result); + + stack[_STK + 1].setInt(result); + _STK++; break; } case Namespace::Entry::VoidCallbackType: { nsEntry->cb.mVoidCallbackFunc(gEvalState.thisObject, callArgc, callArgv); - if (code[ip] != OP_STR_TO_NONE) - Con::warnf(ConsoleLogEntry::General, "%s: Call to %s in %s uses result of void function call.", getFileLine(ip - 4), fnName, functionName); gCallStack.popFrame(); - STR.setStringValue(""); + + if (code[ip] == OP_POP_STK) + { + ip++; + break; + } + + Con::warnf(ConsoleLogEntry::General, "%s: Call to %s in %s uses result of void function call.", getFileLine(ip - 4), fnName, functionName); + stack[_STK + 1].setEmptyString(); + _STK++; + break; } case Namespace::Entry::BoolCallbackType: { bool result = nsEntry->cb.mBoolCallbackFunc(gEvalState.thisObject, callArgc, callArgv); gCallStack.popFrame(); - if (code[ip] == OP_STR_TO_UINT) + + if (code[ip] == OP_POP_STK) { ip++; - numStack[++_STK].i = result; break; } - else if (code[ip] == OP_STR_TO_FLT) - { - ip++; - numStack[++_STK].f = result; - break; - } - else if (code[ip] == OP_STR_TO_NONE) - ip++; - else - STR.setIntValue(result); + + stack[_STK + 1].setBool(result); + _STK++; + break; } } @@ -1868,43 +1847,45 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa gEvalState.thisObject = saveObject; break; } - case OP_ADVANCE_STR: - STR.advance(); - break; + case OP_ADVANCE_STR_APPENDCHAR: - STR.advanceChar(code[ip++]); - break; + { + // TODO: Create a better way to handle string concatination without + // heap allocating every time. - case OP_ADVANCE_STR_COMMA: - STR.advanceChar('_'); - break; + val = stack[_STK].getString(); + dsize_t len = dStrlen(val) + 2; + + char buff[2]; + buff[0] = (char)code[ip++]; + buff[1] = '\0'; + + char* concat = new char[len]; + dMemset(concat, 0, len); + dStrcat(concat, val, len); + dStrcat(concat, buff, len); + + stack[_STK].setString(concat); + + delete[] concat; - case OP_ADVANCE_STR_NUL: - STR.advanceChar(0); break; + } case OP_REWIND_STR: - STR.rewind(); - break; - + TORQUE_CASE_FALLTHROUGH; case OP_TERMINATE_REWIND_STR: - STR.rewindTerminate(); + stack[_STK - 1].setString((String(stack[_STK - 1] + String(stack[_STK])))); + _STK--; break; case OP_COMPARE_STR: - numStack[++_STK].i = STR.compare(); + stack[_STK - 1].setBool(!dStricmp(stack[_STK].getString(), stack[_STK - 1].getString())); + _STK--; break; case OP_PUSH: - gCallStack.pushString(STR.getStringValue(), STR.mLen); - break; - - case OP_PUSH_UINT: - gCallStack.pushInt((U32)numStack[_STK--].i); - break; - - case OP_PUSH_FLT: - gCallStack.pushFloat(numStack[_STK--].f); + gCallStack.push(std::move(stack[_STK--])); break; case OP_PUSH_FRAME: @@ -1913,7 +1894,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_ASSERT: { - if (!numStack[_STK--].i) + if (!stack[_STK--].getBool()) { const char* message = curStringTable + code[ip]; @@ -1957,7 +1938,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_ITER_BEGIN_STR: { iterStack[_ITER].mIsStringIter = true; - /* fallthrough */ + TORQUE_CASE_FALLTHROUGH; } case OP_ITER_BEGIN: @@ -1981,7 +1962,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa if (iter.mIsStringIter) { - iter.mData.mStr.mString = STR.getStringValue(); + iter.mData.mStr.mString = stack[_STK].getString(); iter.mData.mStr.mIndex = 0; } else @@ -1989,9 +1970,9 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // Look up the object. SimSet* set; - if (!Sim::findObject(STR.getStringValue(), set)) + if (!Sim::findObject(stack[_STK].getString(), set)) { - Con::errorf(ConsoleLogEntry::General, "No SimSet object '%s'", STR.getStringValue()); + Con::errorf(ConsoleLogEntry::General, "No SimSet object '%s'", stack[_STK].getString()); Con::errorf(ConsoleLogEntry::General, "Did you mean to use 'foreach$' instead of 'foreach'?"); ip = failIp; continue; @@ -2006,8 +1987,6 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa _ITER++; iterDepth++; - STR.push(); - ip += isGlobal ? 4 : 3; break; } @@ -2096,16 +2075,17 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa --_ITER; --iterDepth; - STR.rewind(); + _STK--; iterStack[_ITER].mIsStringIter = false; break; } case OP_INVALID: - + TORQUE_CASE_FALLTHROUGH; default: // error! + AssertISV(false, "Invalid OPCode Processed!"); goto execFinished; } } @@ -2162,8 +2142,8 @@ execFinished: decRefCount(); #ifdef TORQUE_DEBUG - AssertFatal(!(STR.mStartStackSize > stackStart), "String stack not popped enough in script exec"); - AssertFatal(!(STR.mStartStackSize < stackStart), "String stack popped too much in script exec"); + AssertFatal(!(_STK > stackStart), "String stack not popped enough in script exec"); + AssertFatal(!(_STK < stackStart), "String stack popped too much in script exec"); #endif return std::move(returnValue); diff --git a/Engine/source/console/compiler.h b/Engine/source/console/compiler.h index f0633deab..128088827 100644 --- a/Engine/source/console/compiler.h +++ b/Engine/source/console/compiler.h @@ -69,6 +69,7 @@ namespace Compiler OP_RETURN_FLT, OP_RETURN_UINT, + OP_CMPEQ, OP_CMPGR, OP_CMPGE, @@ -132,14 +133,7 @@ namespace Compiler OP_SAVEFIELD_FLT, OP_SAVEFIELD_STR, - OP_STR_TO_UINT, - OP_STR_TO_FLT, - OP_STR_TO_NONE, // 60 - OP_FLT_TO_UINT, - OP_FLT_TO_STR, - OP_UINT_TO_FLT, - OP_UINT_TO_STR, - OP_NUM_TO_NONE, + OP_POP_STK, OP_LOADIMMED_UINT, OP_LOADIMMED_FLT, @@ -150,18 +144,14 @@ namespace Compiler OP_CALLFUNC, - OP_ADVANCE_STR, OP_ADVANCE_STR_APPENDCHAR, - OP_ADVANCE_STR_COMMA, - OP_ADVANCE_STR_NUL, OP_REWIND_STR, - OP_TERMINATE_REWIND_STR, // 80 + OP_TERMINATE_REWIND_STR, + OP_COMPARE_STR, - OP_PUSH, // String - OP_PUSH_UINT, // Integer - OP_PUSH_FLT, // Float - OP_PUSH_FRAME, // Frame + OP_PUSH, + OP_PUSH_FRAME, OP_ASSERT, OP_BREAK, diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index d42c202a7..b36a7c233 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -174,14 +174,7 @@ class ConsoleValue } } -public: - explicit ConsoleValue() - { - type = ConsoleValueType::cvSTEntry; - s = const_cast(StringTable->EmptyString()); - } - - ConsoleValue(ConsoleValue&& ref) noexcept + TORQUE_FORCEINLINE void _move(ConsoleValue&& ref) noexcept { type = ref.type; @@ -207,6 +200,24 @@ public: ref.setEmptyString(); } +public: + ConsoleValue() + { + type = ConsoleValueType::cvSTEntry; + s = const_cast(StringTable->EmptyString()); + } + + ConsoleValue(ConsoleValue&& ref) noexcept + { + _move(std::move(ref)); + } + + TORQUE_FORCEINLINE ConsoleValue& operator=(ConsoleValue&& ref) noexcept + { + _move(std::move(ref)); + return *this; + } + ConsoleValue(const ConsoleValue&) = delete; ConsoleValue& operator=(const ConsoleValue&) = delete; diff --git a/Engine/source/console/consoleValueStack.h b/Engine/source/console/consoleValueStack.h index b88804dd5..8b44a652c 100644 --- a/Engine/source/console/consoleValueStack.h +++ b/Engine/source/console/consoleValueStack.h @@ -89,22 +89,10 @@ public: stack.pop_back(); } - TORQUE_FORCEINLINE void pushInt(S64 value) + TORQUE_FORCEINLINE void push(ConsoleValue&& val) { Frame& frame = stack.last(); - frame.values[frame.internalCounter++].setInt(value); - } - - TORQUE_FORCEINLINE void pushFloat(F64 value) - { - Frame& frame = stack.last(); - frame.values[frame.internalCounter++].setFloat(value); - } - - TORQUE_FORCEINLINE void pushString(const char* value, S32 len) - { - Frame& frame = stack.last(); - frame.values[frame.internalCounter++].setString(value, len); + frame.values[frame.internalCounter++] = std::move(val); } TORQUE_FORCEINLINE void argvc(StringTableEntry fn, S32& argc, ConsoleValue** argv) diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index ecf3ae3f9..ecc974d2f 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -60,6 +60,60 @@ TEST(Script, Basic_Arithmetic) )"); ASSERT_EQ(div.getInt(), 5); + + ConsoleValue mod = RunScript(R"( + return 4 % 5; + )"); + + ASSERT_EQ(mod.getInt(), 4); + + ConsoleValue add2 = RunScript(R"( + $a = 0; + $a += 2; + return $a; + )"); + + ASSERT_EQ(add2.getInt(), 2); + + ConsoleValue sub2 = RunScript(R"( + $a = 0; + $a -= 2; + return $a; + )"); + + ASSERT_EQ(sub2.getInt(), -2); + + ConsoleValue mult2 = RunScript(R"( + $a = 2; + $a *= 3; + return $a; + )"); + + ASSERT_EQ(mult2.getInt(), 6); + + ConsoleValue div2 = RunScript(R"( + $a = 10; + $a /= 2; + return $a; + )"); + + ASSERT_EQ(div2.getInt(), 5); + + ConsoleValue pp = RunScript(R"( + $a = 0; + $a++; + return $a; + )"); + + ASSERT_EQ(pp.getInt(), 1); + + ConsoleValue mm = RunScript(R"( + $a = 2; + $a--; + return $a; + )"); + + ASSERT_EQ(mm.getInt(), 1); } TEST(Script, Complex_Arithmetic) @@ -240,6 +294,20 @@ TEST(Script, Basic_Loop_Statements) ASSERT_STREQ(forValue.getString(), "aaa"); + ConsoleValue forReverseLoop = RunScript(R"( + function t(%times) + { + %result = ""; + for (%i = %times - 1; %i >= 0; %i--) + %result = %result @ "b"; + return %result; + } + + return t(3); + )"); + + ASSERT_STREQ(forReverseLoop.getString(), "bbb"); + ConsoleValue forIfValue = RunScript(R"( function t() { @@ -402,6 +470,77 @@ TEST(Script, Basic_SimObject) )"); ASSERT_STREQ(parentFn.getString(), "FooBar"); + + ConsoleValue grp = RunScript(R"( + new SimGroup(FudgeCollectorGroup) + { + theName = "fudge"; + + new SimObject(ChocolateFudge) + { + type = "Chocolate"; + }; + new SimObject(PeanutButterFudge) + { + type = "Peanut Butter"; + + field["a"] = "Yes"; + }; + }; + + return FudgeCollectorGroup.getId(); + )"); + + SimGroup* simGroup = dynamic_cast(Sim::findObject(grp)); + ASSERT_NE(simGroup, (SimGroup*)NULL); + ASSERT_EQ(simGroup->size(), 2); + + simGroup->deleteObject(); + + ConsoleValue fieldTest = RunScript(R"( + function a() + { + %obj = new SimObject(); + %obj.field = "A"; + %obj.val[%obj.field] = "B"; + + %value = %obj.val["A"]; + %obj.delete(); + return %value; + } + return a(); + )"); + + ASSERT_STREQ(fieldTest.getString(), "B"); +} + +TEST(Script, Internal_Name) +{ + ConsoleValue value = RunScript(R"( + function SimObject::_internalCall(%this) + { + return 5; + } + + function a() + { + %grp = new SimGroup(); + %obj = new SimObject() + { + internalName = "Yay"; + }; + %grp.add(%obj); + + %val = %grp->Yay._internalCall(); + + %grp.delete(); + + return %val; + } + return a(); + )"); + + ASSERT_EQ(value.getInt(), 5); } TEST(Script, Basic_Package) From dcd01e1231044b6098c73dd391ea376c782c19fc Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Fri, 30 Apr 2021 00:24:03 -0400 Subject: [PATCH 017/399] move parameters instead of copying. --- Engine/source/console/compiledEval.cpp | 18 +----------------- Engine/source/console/consoleInternal.h | 5 +++++ 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 228dc85f3..4063aa3eb 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -490,23 +490,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa { S32 reg = code[ip + (2 + 6 + 1 + 1) + i]; ConsoleValue& value = argv[i + 1]; - switch (value.getType()) - { - case ConsoleValueType::cvString: - gEvalState.setLocalStringVariable(reg, value.getString(), dStrlen(value.getString())); - break; - case ConsoleValueType::cvInteger: - gEvalState.setLocalIntVariable(reg, value.getInt()); - break; - case ConsoleValueType::cvFloat: - gEvalState.setLocalFloatVariable(reg, value.getFloat()); - break; - case ConsoleValueType::cvSTEntry: - gEvalState.setLocalStringTableEntryVariable(reg, value.getString()); - break; - default: - AssertFatal(false, avar("Invalid local variable type. Type was: %i", value.getType())); - } + gEvalState.moveConsoleValue(reg, std::move(value)); } ip = ip + fnArgc + (2 + 6 + 1 + 1); curFloatTable = functionFloats; diff --git a/Engine/source/console/consoleInternal.h b/Engine/source/console/consoleInternal.h index 392bf0c3f..f947057e5 100644 --- a/Engine/source/console/consoleInternal.h +++ b/Engine/source/console/consoleInternal.h @@ -622,6 +622,11 @@ public: currentRegisterArray->values[reg].setStringTableEntry(val); } + TORQUE_FORCEINLINE void moveConsoleValue(S32 reg, ConsoleValue val) + { + currentRegisterArray->values[reg] = std::move(val); + } + void pushFrame(StringTableEntry frameName, Namespace *ns, S32 regCount); void popFrame(); From 55b0ecb4878e80a3cacc89437ba6c531a95ede02 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Fri, 30 Apr 2021 01:20:01 -0400 Subject: [PATCH 018/399] optimizations --- Engine/source/console/compiledEval.cpp | 43 ++++++++++++++++---------- Engine/source/console/console.cpp | 16 ++-------- Engine/source/console/console.h | 12 ++++--- 3 files changed, 38 insertions(+), 33 deletions(-) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 4063aa3eb..4f1a197d9 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -57,6 +57,7 @@ enum EvalConstants MaxStackSize = 1024, FieldBufferSizeString = 2048, FieldBufferSizeNumeric = 128, + ConcatBufferInitialSize = 8192, MethodOnComponent = -2 }; @@ -118,6 +119,23 @@ S32 _STK = 0; char curFieldArray[256]; char prevFieldArray[256]; +const char* tsconcat(const char* strA, const char* strB, S32& outputLen) +{ + S32 lenA = dStrlen(strA); + S32 lenB = dStrlen(strB); + + S32 len = lenA + lenB + 1; + + char* concatBuffer = (char*)dMalloc(len); + + concatBuffer[len - 1] = '\0'; + memcpy(concatBuffer, strA, lenA); + memcpy(concatBuffer + lenA, strB, lenB); + + outputLen = lenA + lenB; + return concatBuffer; +} + namespace Con { // Current script file name and root, these are registered as @@ -1727,7 +1745,6 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa { if (nsEntry->mFunctionOffset) { - // TODO: not make this strings only for returns. ConsoleValue returnFromFn = nsEntry->mCode->exec(nsEntry->mFunctionOffset, fnName, nsEntry->mNamespace, callArgc, callArgv, false, nsEntry->mPackage); stack[_STK + 1] = std::move(returnFromFn); } @@ -1834,34 +1851,28 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_ADVANCE_STR_APPENDCHAR: { - // TODO: Create a better way to handle string concatination without - // heap allocating every time. - - val = stack[_STK].getString(); - dsize_t len = dStrlen(val) + 2; - char buff[2]; buff[0] = (char)code[ip++]; buff[1] = '\0'; - char* concat = new char[len]; - dMemset(concat, 0, len); - dStrcat(concat, val, len); - dStrcat(concat, buff, len); - - stack[_STK].setString(concat); - - delete[] concat; + S32 len; + const char* concat = tsconcat(stack[_STK].getString(), buff, len); + stack[_STK].setStringRef(concat, len); break; } case OP_REWIND_STR: TORQUE_CASE_FALLTHROUGH; case OP_TERMINATE_REWIND_STR: - stack[_STK - 1].setString((String(stack[_STK - 1] + String(stack[_STK])))); + { + S32 len; + const char* concat = tsconcat(stack[_STK - 1].getString(), stack[_STK].getString(), len); + + stack[_STK - 1].setStringRef(concat, len); _STK--; break; + } case OP_COMPARE_STR: stack[_STK - 1].setBool(!dStricmp(stack[_STK].getString(), stack[_STK - 1].getString())); diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index a7d2dafc6..f75285f2f 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -46,31 +46,21 @@ extern StringStack STR; extern ConsoleValueStack<4096> gCallStack; -S32 ConsoleValue::sBufferOffset = 0; char ConsoleValue::sConversionBuffer[ConversionBufferSize]; void ConsoleValue::init() { - sBufferOffset = 0; dMemset(sConversionBuffer, '\0', ConversionBufferSize); } char* ConsoleValue::convertToBuffer() const { - sBufferOffset += StringSize; - if (sBufferOffset > ConversionBufferSize) - { - dMemset(sConversionBuffer, '\0', ConversionBufferSize); - sBufferOffset = 0; - } - - char* offset = sConversionBuffer + sBufferOffset; if (type == ConsoleValueType::cvFloat) - dSprintf(offset, StringSize, "%.9g", f); + dSprintf(sConversionBuffer, ConversionBufferSize, "%.9g", f); else - dSprintf(offset, StringSize, "%lld", i); + dSprintf(sConversionBuffer, ConversionBufferSize, "%lld", i); - return offset; + return sConversionBuffer; } const char* ConsoleValue::getConsoleData() const diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index b36a7c233..f7d077ae0 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -149,12 +149,10 @@ class ConsoleValue enum Constants { - ConversionBufferSize = 1024, - StringSize = 16 + ConversionBufferSize = 32 }; static char sConversionBuffer[ConversionBufferSize]; - static S32 sBufferOffset; char* convertToBuffer() const; @@ -314,6 +312,13 @@ public: dStrcpy(s, val, static_cast(len) + 1); } + TORQUE_FORCEINLINE void setStringRef(const char* ref, S32 len) + { + cleanupData(); + type = ConsoleValueType::cvString; + s = const_cast(ref); + } + TORQUE_FORCEINLINE void setBool(const bool val) { cleanupData(); @@ -361,7 +366,6 @@ public: } static void init(); - static S32 getConstantBufferCount() { return (S32)ConversionBufferSize / StringSize; } }; // Transparently converts ConsoleValue[] to const char** From ab4c0f036109c478bd4b04d204c7e3df24baa613 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 1 May 2021 02:07:54 -0400 Subject: [PATCH 019/399] Add fast math optimization --- Engine/source/console/compiledEval.cpp | 234 ++++++++++++++++++++----- Engine/source/console/console.h | 22 +++ Engine/source/platform/types.visualc.h | 1 + 3 files changed, 216 insertions(+), 41 deletions(-) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 4f1a197d9..018a82b21 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -444,6 +444,172 @@ void ExprEvalState::setStringVariable(const char *val) //----------------------------------------------------------------------------- +enum class FloatOperation +{ + Add, + Sub, + Mul, + Div, + + LT, + LE, + GR, + GE, + EQ, + NE +}; + +template +TORQUE_FORCEINLINE void doFloatMathOperation() +{ + ConsoleValue& a = stack[_STK]; + ConsoleValue& b = stack[_STK - 1]; + + S32 fastIf = (a.getType() == ConsoleValueType::cvFloat) & (b.getType() == ConsoleValueType::cvFloat); + if (fastIf) + { + // Arithmetic + if constexpr (Op == FloatOperation::Add) + stack[_STK - 1].setFastFloat(a.getFastFloat() + b.getFastFloat()); + if constexpr (Op == FloatOperation::Sub) + stack[_STK - 1].setFastFloat(a.getFastFloat() - b.getFastFloat()); + if constexpr (Op == FloatOperation::Mul) + stack[_STK - 1].setFastFloat(a.getFastFloat() * b.getFastFloat()); + if constexpr (Op == FloatOperation::Div) + stack[_STK - 1].setFastFloat(a.getFastFloat() / b.getFastFloat()); + + // Logical + if constexpr (Op == FloatOperation::LT) + stack[_STK - 1].setFastInt(a.getFastFloat() < b.getFastFloat()); + if constexpr (Op == FloatOperation::LE) + stack[_STK - 1].setFastInt(a.getFastFloat() <= b.getFastFloat()); + if constexpr (Op == FloatOperation::GR) + stack[_STK - 1].setFastInt(a.getFastFloat() > b.getFastFloat()); + if constexpr (Op == FloatOperation::GE) + stack[_STK - 1].setFastInt(a.getFastFloat() >= b.getFastFloat()); + if constexpr (Op == FloatOperation::EQ) + stack[_STK - 1].setFastInt(a.getFastFloat() == b.getFastFloat()); + if constexpr (Op == FloatOperation::NE) + stack[_STK - 1].setFastInt(a.getFastFloat() != b.getFastFloat()); + + _STK--; + } + else + { + doSlowMathOp(); + } +} + +template +TORQUE_NOINLINE void doSlowMathOp() +{ + ConsoleValue& a = stack[_STK]; + ConsoleValue& b = stack[_STK - 1]; + + // Arithmetic + if constexpr (Op == FloatOperation::Add) + stack[_STK - 1].setFloat(a.getFloat() + b.getFloat()); + else if constexpr (Op == FloatOperation::Sub) + stack[_STK - 1].setFloat(a.getFloat() - b.getFloat()); + else if constexpr (Op == FloatOperation::Mul) + stack[_STK - 1].setFloat(a.getFloat() * b.getFloat()); + else if constexpr (Op == FloatOperation::Div) + stack[_STK - 1].setFloat(a.getFloat() / b.getFloat()); + + // Logical + if constexpr (Op == FloatOperation::LT) + stack[_STK - 1].setFastInt(a.getFloat() < b.getFloat()); + if constexpr (Op == FloatOperation::LE) + stack[_STK - 1].setFastInt(a.getFloat() <= b.getFloat()); + if constexpr (Op == FloatOperation::GR) + stack[_STK - 1].setFastInt(a.getFloat() > b.getFloat()); + if constexpr (Op == FloatOperation::GE) + stack[_STK - 1].setFastInt(a.getFloat() >= b.getFloat()); + if constexpr (Op == FloatOperation::EQ) + stack[_STK - 1].setFastInt(a.getFloat() == b.getFloat()); + if constexpr (Op == FloatOperation::NE) + stack[_STK - 1].setFastInt(a.getFloat() != b.getFloat()); + + _STK--; +} + +//----------------------------------------------------------------------------- + +enum class IntegerOperation +{ + BitAnd, + BitOr, + Xor, + LShift, + RShift, + + LogicalAnd, + LogicalOr +}; + +template +TORQUE_FORCEINLINE void doIntOperation() +{ + ConsoleValue& a = stack[_STK]; + ConsoleValue& b = stack[_STK - 1]; + + if (a.isNumberType() && b.isNumberType()) + { + // Bitwise Op + if constexpr (Op == IntegerOperation::BitAnd) + stack[_STK - 1].setFastInt(a.getFastInt() & b.getFastInt()); + if constexpr (Op == IntegerOperation::BitOr) + stack[_STK - 1].setFastInt(a.getFastInt() | b.getFastInt()); + if constexpr (Op == IntegerOperation::Xor) + stack[_STK - 1].setFastInt(a.getFastInt() ^ b.getFastInt()); + if constexpr (Op == IntegerOperation::LShift) + stack[_STK - 1].setFastInt(a.getFastInt() << b.getFastInt()); + if constexpr (Op == IntegerOperation::RShift) + stack[_STK - 1].setFastInt(a.getFastInt() >> b.getFastInt()); + + // Logical Op + if constexpr (Op == IntegerOperation::LogicalAnd) + stack[_STK - 1].setFastInt(a.getFastInt() && b.getFastInt()); + if constexpr (Op == IntegerOperation::LogicalOr) + stack[_STK - 1].setFastInt(a.getFastInt() || b.getFastInt()); + + _STK--; + } + else + { + doSlowIntegerOp(); + } +} + +template +TORQUE_NOINLINE void doSlowIntegerOp() +{ + ConsoleValue& a = stack[_STK]; + ConsoleValue& b = stack[_STK - 1]; + + // Bitwise Op + if constexpr (Op == IntegerOperation::BitAnd) + stack[_STK - 1].setInt(a.getInt() & b.getInt()); + if constexpr (Op == IntegerOperation::BitOr) + stack[_STK - 1].setInt(a.getInt() | b.getInt()); + if constexpr (Op == IntegerOperation::Xor) + stack[_STK - 1].setInt(a.getInt() ^ b.getInt()); + if constexpr (Op == IntegerOperation::LShift) + stack[_STK - 1].setInt(a.getInt() << b.getInt()); + if constexpr (Op == IntegerOperation::RShift) + stack[_STK - 1].setInt(a.getInt() >> b.getInt()); + + // Logical Op + if constexpr (Op == IntegerOperation::LogicalAnd) + stack[_STK - 1].setInt(a.getInt() && b.getInt()); + if constexpr (Op == IntegerOperation::LogicalOr) + stack[_STK - 1].setInt(a.getInt() || b.getInt()); + + _STK--; +} + +//----------------------------------------------------------------------------- + U32 gExecCount = 0; ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNamespace, U32 argc, ConsoleValue* argv, bool noCalls, StringTableEntry packageName, S32 setFrame) { @@ -1151,56 +1317,39 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa goto execFinished; case OP_CMPEQ: - stack[_STK - 1].setInt(stack[_STK].getFloat() == stack[_STK - 1].getFloat()); - _STK--; + doFloatMathOperation(); break; case OP_CMPGR: - stack[_STK - 1].setInt(stack[_STK].getFloat() > stack[_STK - 1].getFloat()); - _STK--; + doFloatMathOperation(); break; case OP_CMPGE: - stack[_STK - 1].setInt(stack[_STK].getFloat() >= stack[_STK - 1].getFloat()); - _STK--; + doFloatMathOperation(); break; case OP_CMPLT: - stack[_STK - 1].setInt(stack[_STK].getFloat() < stack[_STK - 1].getFloat()); - _STK--; + doFloatMathOperation(); break; case OP_CMPLE: - stack[_STK - 1].setInt(stack[_STK].getFloat() <= stack[_STK - 1].getFloat()); - _STK--; + doFloatMathOperation(); break; case OP_CMPNE: - stack[_STK - 1].setInt(stack[_STK].getFloat() != stack[_STK - 1].getFloat()); - _STK--; + doFloatMathOperation(); break; case OP_XOR: - stack[_STK - 1].setInt(stack[_STK].getInt() ^ stack[_STK - 1].getInt()); - _STK--; - break; - - case OP_MOD: - if (stack[_STK - 1].getInt() != 0) - stack[_STK - 1].setInt(stack[_STK].getInt() % stack[_STK - 1].getInt()); - else - stack[_STK - 1].setInt(0); - _STK--; + doIntOperation(); break; case OP_BITAND: - stack[_STK - 1].setInt(stack[_STK].getInt() & stack[_STK - 1].getInt()); - _STK--; + doIntOperation(); break; case OP_BITOR: - stack[_STK - 1].setInt(stack[_STK].getInt() | stack[_STK - 1].getInt()); - _STK--; + doIntOperation(); break; case OP_NOT: @@ -1216,44 +1365,47 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_SHR: - stack[_STK - 1].setInt(stack[_STK].getInt() >> stack[_STK - 1].getInt()); - _STK--; + doIntOperation(); break; case OP_SHL: - stack[_STK - 1].setInt(stack[_STK].getInt() << stack[_STK - 1].getInt()); - _STK--; + doIntOperation(); break; case OP_AND: - stack[_STK - 1].setInt(stack[_STK].getInt() && stack[_STK - 1].getInt()); - _STK--; + doIntOperation(); break; case OP_OR: - stack[_STK - 1].setInt(stack[_STK].getInt() || stack[_STK - 1].getInt()); - _STK--; + doIntOperation(); break; case OP_ADD: - stack[_STK - 1].setFloat(stack[_STK].getFloat() + stack[_STK - 1].getFloat()); - _STK--; + doFloatMathOperation(); break; case OP_SUB: - stack[_STK - 1].setFloat(stack[_STK].getFloat() - stack[_STK - 1].getFloat()); - _STK--; + doFloatMathOperation(); break; case OP_MUL: - stack[_STK - 1].setFloat(stack[_STK].getFloat() * stack[_STK - 1].getFloat()); - _STK--; + doFloatMathOperation(); break; case OP_DIV: - stack[_STK - 1].setFloat(stack[_STK].getFloat() / stack[_STK - 1].getFloat()); + doFloatMathOperation(); + break; + + case OP_MOD: + { + S64 divisor = stack[_STK - 1].getInt(); + if (divisor != 0) + stack[_STK - 1].setInt(stack[_STK].getInt() % divisor); + else + stack[_STK - 1].setInt(0); _STK--; break; + } case OP_NEG: stack[_STK].setFloat(-stack[_STK].getFloat()); diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index f7d077ae0..db9af8a23 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -365,6 +365,28 @@ public: return type >= ConsoleValueType::cvConsoleValueType; } + TORQUE_FORCEINLINE void setFastFloat(F64 flt) + { + type = ConsoleValueType::cvFloat; + f = flt; + } + + TORQUE_FORCEINLINE F64 getFastFloat() const + { + return f; + } + + TORQUE_FORCEINLINE void setFastInt(S64 flt) + { + type = ConsoleValueType::cvInteger; + i = flt; + } + + TORQUE_FORCEINLINE S64 getFastInt() const + { + return i; + } + static void init(); }; diff --git a/Engine/source/platform/types.visualc.h b/Engine/source/platform/types.visualc.h index 89fd38d4b..4ccc6ce42 100644 --- a/Engine/source/platform/types.visualc.h +++ b/Engine/source/platform/types.visualc.h @@ -105,6 +105,7 @@ typedef unsigned _int64 U64; #pragma warning(disable: 4291) #define TORQUE_FORCEINLINE __forceinline +#define TORQUE_NOINLINE __declspec(noinline) #if __cplusplus >= 201703L #define TORQUE_CASE_FALLTHROUGH [[fallthrough]]; From db047275f1b107942b7013ad53c7b2e24101d25b Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 1 May 2021 02:55:24 -0400 Subject: [PATCH 020/399] add fast int to object lookup. --- Engine/source/console/compiledEval.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 018a82b21..b02f2f8fd 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -1824,7 +1824,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // Optimization: If we're an integer, we can lookup the value by SimObjectId const ConsoleValue& simObjectLookupValue = callArgv[1]; if (simObjectLookupValue.getType() == ConsoleValueType::cvInteger) - gEvalState.thisObject = Sim::findObject(static_cast(simObjectLookupValue.getInt())); + gEvalState.thisObject = Sim::findObject(static_cast(simObjectLookupValue.getFastInt())); else { SimObject *foundObject = Sim::findObject(simObjectLookupValue.getString()); From 6f7fdca87d10e9a5b6dcebcd2ce597a4377d7dc2 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Tue, 4 May 2021 21:18:15 -0400 Subject: [PATCH 021/399] lotsa fixes. --- Engine/source/T3D/gameBase/gameConnection.cpp | 31 ++++++----------- Engine/source/console/console.h | 2 +- Engine/source/console/simEvents.cpp | 2 +- .../scripts/server/levelInfo.tscript | 1 + .../scripts/server/levelLoad.tscript | 3 ++ .../game/core/console/guis/console.gui | 2 +- .../game/core/console/scripts/console.tscript | 2 +- .../core/postFX/scripts/postFxManager.tscript | 2 +- .../scripts/gameObjectManagement.tscript | 4 +-- .../utility/scripts/helperFunctions.tscript | 4 ++- .../core/utility/scripts/parseArgs.tscript | 34 +++++++++---------- .../game/core/utility/scripts/scene.tscript | 3 -- .../data/ExampleModule/GUIs/ExampleGUI.gui | 2 +- Templates/BaseGame/game/data/defaults.tscript | 2 +- .../game/data/gameUI/GUIs/playGui.gui | 2 +- .../game/data/ui/guis/IODropdownDlg.ed.gui | 2 +- .../game/data/ui/guis/RecordingsDlg.gui | 2 +- .../game/data/ui/guis/chooseLevelDlg.gui | 2 +- .../game/data/ui/guis/guiMusicPlayer.gui | 2 +- .../game/data/ui/guis/joinServerMenu.gui | 2 +- .../BaseGame/game/data/ui/guis/loadingGui.gui | 2 +- .../BaseGame/game/data/ui/guis/mainMenu.gui | 2 +- .../game/data/ui/guis/messageBoxDlg.gui | 2 +- .../game/data/ui/guis/netGraphGui.gui | 2 +- .../BaseGame/game/data/ui/guis/optionsDlg.gui | 2 +- .../game/data/ui/guis/optionsMenu.gui | 2 +- .../game/data/ui/guis/optionsMenu.tscript | 17 +++------- .../BaseGame/game/data/ui/guis/pauseMenu.gui | 2 +- .../BaseGame/game/data/ui/guis/profiler.gui | 2 +- .../game/data/ui/guis/profiler.tscript | 2 +- .../game/data/ui/guis/remapConfirmDlg.gui | 2 +- .../BaseGame/game/data/ui/guis/remapDlg.gui | 2 +- .../BaseGame/game/data/ui/guis/startupGui.gui | 2 +- Templates/BaseGame/game/main.tscript.in | 5 ++- .../MainEditor/guis/MainEditorWindow.gui | 2 +- .../VPathEditor/GUI/VPathEditorToolbar.gui | 2 +- .../tools/VerveEditor/GUI/VerveEditor.gui | 2 +- .../GUI/VerveEditorGroupBuilder.gui | 2 +- .../GUI/VerveEditorImportPathNodes.gui | 2 +- .../GUI/VerveEditorPreferences.gui | 2 +- .../guis/AssetImportConfigEditor.gui | 2 +- .../assetBrowser/guis/GameObjectCreator.gui | 2 +- .../assetBrowser/guis/addModuleWindow.gui | 2 +- .../assetBrowser/guis/addPackageWindow.gui | 2 +- .../tools/assetBrowser/guis/assetBrowser.gui | 2 +- .../tools/assetBrowser/guis/assetImport.gui | 2 +- .../assetBrowser/guis/assetImportLog.gui | 2 +- .../tools/assetBrowser/guis/assetNameEdit.gui | 2 +- .../guis/assetPreviewButtonsTemplate.gui | 2 +- .../guis/createNewCollectionSet.gui | 2 +- .../tools/assetBrowser/guis/editAsset.gui | 2 +- .../tools/assetBrowser/guis/editModule.gui | 2 +- .../assetBrowser/guis/looseFileAudit.gui | 2 +- .../game/tools/assetBrowser/guis/newAsset.gui | 2 +- .../assetBrowser/guis/newComponentAsset.gui | 2 +- .../tools/assetBrowser/guis/newFolder.gui | 2 +- .../tools/assetBrowser/guis/selectModule.gui | 2 +- .../tools/assetBrowser/guis/selectPackage.gui | 2 +- .../tools/assetBrowser/guis/selectPath.gui | 2 +- .../templateFiles/guiFile.gui.template | 2 +- .../componentEditor/gui/TypeMaskFieldGui.gui | 2 +- .../gui/superToolTipDlg.ed.gui | 2 +- .../tools/convexEditor/convexEditorGui.gui | 2 +- .../convexEditorSettingsTab.ed.gui | 2 +- .../convexEditor/convexEditorToolbar.ed.gui | 2 +- .../DatablockEditorCreatePrompt.ed.gui | 2 +- .../DatablockEditorInspectorWindow.ed.gui | 2 +- .../DatablockEditorTreeWindow.ed.gui | 2 +- .../debugger/gui/breakConditionDlg.ed.gui | 2 +- .../game/tools/debugger/gui/connectDlg.ed.gui | 2 +- .../game/tools/debugger/gui/debugger.ed.gui | 2 +- .../tools/debugger/gui/editWatchDlg.ed.gui | 2 +- .../game/tools/debugger/gui/findDlg.ed.gui | 2 +- .../game/tools/debugger/gui/watchDlg.ed.gui | 2 +- .../game/tools/decalEditor/decalEditorGui.gui | 2 +- .../forestEditor/forestEditToolbar.ed.gui | 2 +- .../tools/forestEditor/forestEditorGui.gui | 2 +- .../game/tools/gui/EditorLoadingGui.gui | 2 +- .../tools/gui/EditorSettingsWindow.ed.gui | 2 +- .../game/tools/gui/GuiEaseEditDlg.ed.gui | 2 +- .../game/tools/gui/assimpImport.ed.gui | 2 +- .../game/tools/gui/colladaImport.ed.gui | 6 ++-- .../game/tools/gui/colorPicker.ed.gui | 2 +- .../BaseGame/game/tools/gui/cubemapEditor.gui | 2 +- .../game/tools/gui/fileDialogBase.ed.tscript | 3 +- .../game/tools/gui/guiObjectInspector.ed.gui | 2 +- .../tools/gui/guiObjectInspector.ed.tscript | 6 ++-- .../game/tools/gui/materialSelector.ed.gui | 4 ++- .../gui/messageBoxes/IODropdownDlg.ed.gui | 2 +- .../gui/messageBoxes/messageBoxOK.ed.gui | 2 +- .../gui/messageBoxes/messageBoxOKBuy.ed.gui | 2 +- .../messageBoxes/messageBoxOKCancel.ed.gui | 2 +- .../messageBoxOKCancelDetailsDlg.ed.gui | 2 +- .../gui/messageBoxes/messageBoxYesNo.ed.gui | 2 +- .../messageBoxes/messageBoxYesNoCancel.ed.gui | 2 +- .../gui/messageBoxes/messagePopup.ed.gui | 2 +- .../BaseGame/game/tools/gui/postFxEditor.gui | 2 +- .../BaseGame/game/tools/gui/profilerGraph.gui | 2 +- .../tools/gui/renderTargetVisualizer.ed.gui | 2 +- .../game/tools/gui/saveChangesMBDlg.ed.gui | 2 +- .../game/tools/gui/scriptEditorDlg.ed.gui | 2 +- .../BaseGame/game/tools/gui/simViewDlg.ed.gui | 2 +- .../guiEditor/gui/EditorChooseGUI.ed.gui | 2 +- .../game/tools/guiEditor/gui/guiEditor.ed.gui | 2 +- .../gui/guiEditorNewGuiDialog.ed.gui | 2 +- .../guiEditor/gui/guiEditorPrefsDlg.ed.gui | 2 +- .../guiEditor/gui/guiEditorSelectDlg.ed.gui | 2 +- .../scripts/EditorChooseGUI.ed.tscript | 4 +-- .../scripts/guiEditorCanvas.ed.tscript | 16 ++++----- Templates/BaseGame/game/tools/main.tscript | 2 +- .../materialEditor/gui/MaterialToolbar.ed.gui | 2 +- .../gui/guiMaterialPreviewWindow.ed.gui | 2 +- .../gui/guiMaterialPropertiesWindow.ed.gui | 2 +- .../gui/materialInstancesView.ed.gui | 2 +- .../meshRoadEditor/meshRoadEditorGui.gui | 2 +- .../meshRoadEditorSettingsTab.gui | 2 +- .../meshRoadEditor/meshRoadEditorToolbar.gui | 2 +- .../missionAreaEditorGui.ed.gui | 2 +- .../tools/navEditor/CreateNewNavMeshDlg.gui | 2 +- .../tools/navEditor/NavEditorConsoleDlg.gui | 2 +- .../game/tools/navEditor/NavEditorGui.gui | 2 +- .../tools/navEditor/NavEditorSettingsTab.gui | 2 +- .../game/tools/navEditor/NavEditorToolbar.gui | 2 +- .../particleEditor/ParticleEditor.ed.gui | 2 +- .../game/tools/riverEditor/RiverEditorGui.gui | 2 +- .../riverEditor/RiverEditorSettingsTab.gui | 2 +- .../tools/riverEditor/RiverEditorToolbar.gui | 2 +- .../game/tools/roadEditor/RoadEditorGui.gui | 2 +- .../roadEditor/RoadEditorSettingsTab.gui | 2 +- .../tools/roadEditor/RoadEditorToolbar.gui | 2 +- .../gui/ShapeEditorSettingsTab.gui | 2 +- .../shapeEditor/gui/ShapeEditorToolbar.ed.gui | 2 +- .../gui/shapeEdAdvancedWindow.ed.gui | 2 +- .../shapeEditor/gui/shapeEdAnimWindow.ed.gui | 2 +- .../gui/shapeEdPreviewWindow.ed.gui | 2 +- .../shapeEditor/gui/shapeEdPropWindow.ed.gui | 2 +- .../gui/shapeEdSelectWindow.ed.gui | 2 +- .../worldEditor/gui/AddFMODProjectDlg.ed.gui | 2 +- .../gui/AxisGizmoSettingsTab.ed.gui | 2 +- .../worldEditor/gui/CameraSettingsTab.ed.gui | 2 +- .../gui/EditorChooseLevelGui.ed.gui | 4 +-- .../tools/worldEditor/gui/EditorGui.ed.gui | 2 +- .../gui/EditorSettingsWindow.ed.gui | 2 +- .../worldEditor/gui/GeneralSettingsTab.ed.gui | 2 +- .../gui/GenericPromptDialog.ed.gui | 2 +- .../gui/ManageBookmarksWindow.ed.gui | 2 +- .../gui/ManageSFXParametersWindow.ed.gui | 2 +- .../gui/ObjectEditorSettingsTab.ed.gui | 2 +- .../gui/ObjectSnapOptionsWindow.ed.gui | 4 +-- .../gui/ProceduralTerrainPainterGui.gui | 2 +- .../gui/SelectObjectsWindow.ed.gui | 2 +- .../gui/TerrainBrushSoftnessCurveDlg.ed.gui | 2 +- .../worldEditor/gui/TerrainEditToolbar.ed.gui | 2 +- .../gui/TerrainEditorSettingsTab.ed.gui | 2 +- .../gui/TerrainPainterToolbar.ed.gui | 2 +- .../gui/TerrainPainterWindow.ed.gui | 2 +- .../worldEditor/gui/TimeAdjustGui.ed.gui | 2 +- .../worldEditor/gui/ToolsPaletteWindow.ed.gui | 2 +- .../tools/worldEditor/gui/ToolsToolbar.ed.gui | 2 +- .../gui/TransformSelectionWindow.ed.gui | 2 +- .../gui/VisibilityLayerWindow.ed.gui | 2 +- .../gui/WorldEditorInspectorWindow.ed.gui | 2 +- .../worldEditor/gui/WorldEditorToolbar.ed.gui | 2 +- .../gui/WorldEditorTreeWindow.ed.gui | 2 +- .../gui/guiCreateNewTerrainGui.gui | 2 +- .../worldEditor/gui/guiTerrainExportGui.gui | 2 +- .../worldEditor/gui/guiTerrainImportGui.gui | 2 +- .../gui/guiTerrainMaterialDlg.ed.gui | 2 +- .../gui/guiTerrainTextureSettingsDlg.ed.gui | 2 +- .../gui/guiWorldEditorMissionInspector.ed.gui | 2 +- .../worldEditor/gui/objectBuilderGui.ed.gui | 2 +- .../tools/worldEditor/gui/probeBakeDlg.gui | 2 +- .../game/tools/worldEditor/gui/shadowViz.gui | 2 +- .../worldEditor/scripts/EditorGui.ed.tscript | 6 ++-- .../Modules/Verve/gui/VerveCinematic.gui | 2 +- .../inputTest/scripts/gui/inputMonitor.gui | 2 +- .../scripts/gui/joystickSettings.gui | 2 +- Templates/Modules/vr/guis/oculusVROverlay.gui | 2 +- 178 files changed, 230 insertions(+), 245 deletions(-) diff --git a/Engine/source/T3D/gameBase/gameConnection.cpp b/Engine/source/T3D/gameBase/gameConnection.cpp index e4a4c9f5e..3c58c62b9 100644 --- a/Engine/source/T3D/gameBase/gameConnection.cpp +++ b/Engine/source/T3D/gameBase/gameConnection.cpp @@ -374,7 +374,7 @@ void GameConnection::onConnectionEstablished(bool isInitiator) const char *argv[MaxConnectArgs + 2]; argv[0] = "onConnect"; - argv[1] = NULL; // Filled in later + argv[1] = getIdString(); for(U32 i = 0; i < mConnectArgc; i++) argv[i + 2] = mConnectArgv[i]; // NOTE: Need to fallback to Con::execute() as IMPLEMENT_CALLBACK does not @@ -494,33 +494,23 @@ bool GameConnection::readConnectRequest(BitStream *stream, const char **errorStr *errorString = "CR_INVALID_ARGS"; return false; } + + char buffer[256]; + Net::addressToString(getNetAddress(), buffer); + ConsoleValue connectArgv[MaxConnectArgs + 3]; - ConsoleValue connectArgvValue[MaxConnectArgs + 3]; - - // TODO(JTH): Fix pls. - AssertISV(false, "TODO: FIX CONSOLE VALUE"); - return false; - - /* - for(U32 i = 0; i < mConnectArgc+3; i++) - { - - connectArgv[i].value = &connectArgvValue[i]; - connectArgvValue[i].init(); - } for(U32 i = 0; i < mConnectArgc; i++) { char argString[256]; stream->readString(argString); mConnectArgv[i] = dStrdup(argString); - connectArgv[i + 3] = mConnectArgv[i]; + connectArgv[i + 3].setString(argString); } - connectArgvValue[0].setStackStringValue("onConnectRequest"); - connectArgvValue[1].setIntValue(0); - char buffer[256]; - Net::addressToString(getNetAddress(), buffer); - connectArgvValue[2].setStackStringValue(buffer); + + connectArgv[0].setStringTableEntry("onConnectRequest"); + connectArgv[1].setInt(0); + connectArgv[2].setString(buffer); // NOTE: Cannot convert over to IMPLEMENT_CALLBACK as it has variable args. const char *ret = Con::execute(this, mConnectArgc + 3, connectArgv); @@ -530,7 +520,6 @@ bool GameConnection::readConnectRequest(BitStream *stream, const char **errorStr return false; } return true; - */ } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index db9af8a23..4a9f3be9d 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -292,7 +292,7 @@ public: TORQUE_FORCEINLINE void setString(const char* val) { - setString(val, dStrlen(val)); + setString(val, val != NULL ? dStrlen(val) : 0); } TORQUE_FORCEINLINE void setString(const char* val, S32 len) diff --git a/Engine/source/console/simEvents.cpp b/Engine/source/console/simEvents.cpp index e375438e9..6c943f054 100644 --- a/Engine/source/console/simEvents.cpp +++ b/Engine/source/console/simEvents.cpp @@ -38,7 +38,7 @@ SimConsoleEvent::SimConsoleEvent(S32 argc, ConsoleValue *argv, bool onObject) { if (argv) { - mArgv->setString(argv[i].getString()); + mArgv[i].setString(argv[i].getString()); } } } diff --git a/Templates/BaseGame/game/core/clientServer/scripts/server/levelInfo.tscript b/Templates/BaseGame/game/core/clientServer/scripts/server/levelInfo.tscript index 269362638..dbfa7237d 100644 --- a/Templates/BaseGame/game/core/clientServer/scripts/server/levelInfo.tscript +++ b/Templates/BaseGame/game/core/clientServer/scripts/server/levelInfo.tscript @@ -143,6 +143,7 @@ function parseMissionGroupForIds( %className, %childGroup ) if(!isObject(%currentGroup)) return ""; + %classIds = ""; for(%i = 0; %i < (%currentGroup).getCount(); %i++) { if( (%currentGroup).getObject(%i).getClassName() $= %className ) diff --git a/Templates/BaseGame/game/core/clientServer/scripts/server/levelLoad.tscript b/Templates/BaseGame/game/core/clientServer/scripts/server/levelLoad.tscript index 64e2aa268..9bb2457ac 100644 --- a/Templates/BaseGame/game/core/clientServer/scripts/server/levelLoad.tscript +++ b/Templates/BaseGame/game/core/clientServer/scripts/server/levelLoad.tscript @@ -193,6 +193,9 @@ function resetMission() clearServerPaths(); + // TODO: Is this right? + %client = ClientGroup.getObject(0); + // Inform the game code we're resetting. %hasGameMode = callGamemodeFunction("onMissionReset", %client); } \ No newline at end of file diff --git a/Templates/BaseGame/game/core/console/guis/console.gui b/Templates/BaseGame/game/core/console/guis/console.gui index 1d6153ce2..3c5c217a6 100644 --- a/Templates/BaseGame/game/core/console/guis/console.gui +++ b/Templates/BaseGame/game/core/console/guis/console.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ConsoleDlg) { +$guiContent = new GuiControl(ConsoleDlg) { position = "0 0"; extent = "1024 768"; minExtent = "8 8"; diff --git a/Templates/BaseGame/game/core/console/scripts/console.tscript b/Templates/BaseGame/game/core/console/scripts/console.tscript index 201bcfb92..9a024050d 100644 --- a/Templates/BaseGame/game/core/console/scripts/console.tscript +++ b/Templates/BaseGame/game/core/console/scripts/console.tscript @@ -62,7 +62,7 @@ function ConsoleEntry::eval() && !startsWith(%text, "for(") && !startsWith(%text, "switch(") && !startsWith(%text, "switch$(")) - eval("%result = " @ %text); + %result = eval("return" SPC %text); else eval(%text); $Con::warnVoidAssignment = %oldWarnVoidAssignment; diff --git a/Templates/BaseGame/game/core/postFX/scripts/postFxManager.tscript b/Templates/BaseGame/game/core/postFX/scripts/postFxManager.tscript index cf0080923..055411423 100644 --- a/Templates/BaseGame/game/core/postFX/scripts/postFxManager.tscript +++ b/Templates/BaseGame/game/core/postFX/scripts/postFxManager.tscript @@ -59,7 +59,7 @@ function PostFXManager::loadPresetFile() { //Show the dialog and set the flag getLoadFilename($PostFXManager::fileFilter, "PostFXManager::loadPresetHandler"); - $PostFXManager::currentPreset = $Tools::FileDialogs::LastFilePath(); + $PostFXManager::currentPreset = $Tools::FileDialogs::LastFilePath; } function PostFXManager::loadPresetHandler( %filename ) diff --git a/Templates/BaseGame/game/core/utility/scripts/gameObjectManagement.tscript b/Templates/BaseGame/game/core/utility/scripts/gameObjectManagement.tscript index f496111eb..44ec46555 100644 --- a/Templates/BaseGame/game/core/utility/scripts/gameObjectManagement.tscript +++ b/Templates/BaseGame/game/core/utility/scripts/gameObjectManagement.tscript @@ -15,7 +15,7 @@ function findGameObject(%name) //%assetName = AssetDatabase.getAssetName(%assetId); - if(%assetId $= %name) + if(%assetId $= %name) { %gameObjectAsset = AssetDatabase.acquireAsset(%assetId); @@ -47,7 +47,7 @@ function spawnGameObject(%name, %addToScene) %go.setHidden(false); %go.setScopeAlways(); - if(%addToMissionGroup == true) //save instance when saving level + if(%addToScene == true) //save instance when saving level getScene(0).add(%go); else // clear instance on level exit MissionCleanup.add(%go); diff --git a/Templates/BaseGame/game/core/utility/scripts/helperFunctions.tscript b/Templates/BaseGame/game/core/utility/scripts/helperFunctions.tscript index 29d2f5df6..ee7378bf8 100644 --- a/Templates/BaseGame/game/core/utility/scripts/helperFunctions.tscript +++ b/Templates/BaseGame/game/core/utility/scripts/helperFunctions.tscript @@ -524,7 +524,9 @@ function loadDir(%dir) function loadDirs(%dirPath) { - %dirPath = nextToken(%dirPath, token, ";"); + %dirPath = nextToken(%dirPath, "$token", ";"); + %token = $token; + if (%dirPath !$= "") loadDirs(%dirPath); diff --git a/Templates/BaseGame/game/core/utility/scripts/parseArgs.tscript b/Templates/BaseGame/game/core/utility/scripts/parseArgs.tscript index 51975d635..d5a098c90 100644 --- a/Templates/BaseGame/game/core/utility/scripts/parseArgs.tscript +++ b/Templates/BaseGame/game/core/utility/scripts/parseArgs.tscript @@ -67,28 +67,28 @@ function parseArgs() $isDedicated = true; $Server::Dedicated = true; enableWinConsole(true); - $argUsed[%i]++; + $argUsed[$i]++; //-------------------- case "-mission": - $argUsed[%i]++; + $argUsed[$i]++; if ($hasNextArg) { $missionArg = $nextArg; - $argUsed[%i+1]++; - %i++; + $argUsed[$i+1]++; + $i++; } else error("Error: Missing Command Line argument. Usage: -mission "); //-------------------- case "-connect": - $argUsed[%i]++; + $argUsed[$i]++; if ($hasNextArg) { $JoinGameAddress = $nextArg; - $argUsed[%i+1]++; - %i++; + $argUsed[$i+1]++; + $i++; } else error("Error: Missing Command Line argument. Usage: -connect "); @@ -271,9 +271,9 @@ function parseArgs() { $levelToLoad = $nextArg @ " "; - for(%i = $i + 2; %i < $Game::argc; %i++) + for(%j = $i + 2; %j < $Game::argc; %j++) { - $arg = $Game::argv[%i]; + $arg = $Game::argv[%j]; %hasExt = strpos($arg, ".mis"); if(%hasExt == -1) @@ -329,30 +329,30 @@ function parseArgs() case "-fullscreen": $cliFullscreen = true; - $argUsed[%i]++; + $argUsed[$i]++; case "-windowed": $cliFullscreen = false; - $argUsed[%i]++; + $argUsed[$i]++; case "-openGL": $pref::Video::displayDevice = "OpenGL"; - $argUsed[%i]++; + $argUsed[$i]++; case "-directX": $pref::Video::displayDevice = "D3D"; - $argUsed[%i]++; + $argUsed[$i]++; case "-autoVideo": $pref::Video::displayDevice = ""; - $argUsed[%i]++; + $argUsed[$i]++; case "-prefs": - $argUsed[%i]++; + $argUsed[$i]++; if ($hasNextArg) { exec($nextArg, true, true); - $argUsed[%i+1]++; - %i++; + $argUsed[$i+1]++; + $i++; } else error("Error: Missing Command Line argument. Usage: -prefs "); diff --git a/Templates/BaseGame/game/core/utility/scripts/scene.tscript b/Templates/BaseGame/game/core/utility/scripts/scene.tscript index 795d541f3..4062c4749 100644 --- a/Templates/BaseGame/game/core/utility/scripts/scene.tscript +++ b/Templates/BaseGame/game/core/utility/scripts/scene.tscript @@ -1,8 +1,5 @@ function callGamemodeFunction(%gameModeFuncName, %arg0, %arg1, %arg2, %arg3, %arg4, %arg5, %arg6) { - if(%data !$= "") - %data = "\""@%data@"\""; - %activeSceneCount = getSceneCount(); %hasGameMode = 0; diff --git a/Templates/BaseGame/game/data/ExampleModule/GUIs/ExampleGUI.gui b/Templates/BaseGame/game/data/ExampleModule/GUIs/ExampleGUI.gui index 48bf13f92..396b5b291 100644 --- a/Templates/BaseGame/game/data/ExampleModule/GUIs/ExampleGUI.gui +++ b/Templates/BaseGame/game/data/ExampleModule/GUIs/ExampleGUI.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ExampleGUI) +$guiContent = new GuiControl(ExampleGUI) { position = "0 0"; extent = "100 100"; diff --git a/Templates/BaseGame/game/data/defaults.tscript b/Templates/BaseGame/game/data/defaults.tscript index eaea83a8d..c4512418e 100644 --- a/Templates/BaseGame/game/data/defaults.tscript +++ b/Templates/BaseGame/game/data/defaults.tscript @@ -25,7 +25,7 @@ $sceneLighting::cacheSize = 20000; $sceneLighting::purgeMethod = "lastCreated"; $sceneLighting::cacheLighting = 1; -$pref::Video::displayDevice = "D3D11"; +$pref::Video::displayDevice = ($platform $= "windows") ? "D3D11" : "OpenGL"; $pref::Video::disableVerticalSync = 1; $pref::Video::defaultFenceCount = 0; $pref::Video::screenShotSession = 0; diff --git a/Templates/BaseGame/game/data/gameUI/GUIs/playGui.gui b/Templates/BaseGame/game/data/gameUI/GUIs/playGui.gui index e9522b42f..4783b51a7 100644 --- a/Templates/BaseGame/game/data/gameUI/GUIs/playGui.gui +++ b/Templates/BaseGame/game/data/gameUI/GUIs/playGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GameTSCtrl(PlayGui) { +$guiContent = new GameTSCtrl(PlayGui) { cameraZRot = "0"; forceFOV = "0"; reflectPriority = "1"; diff --git a/Templates/BaseGame/game/data/ui/guis/IODropdownDlg.ed.gui b/Templates/BaseGame/game/data/ui/guis/IODropdownDlg.ed.gui index 5fa0093da..6a98fe6d7 100644 --- a/Templates/BaseGame/game/data/ui/guis/IODropdownDlg.ed.gui +++ b/Templates/BaseGame/game/data/ui/guis/IODropdownDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(IODropdownDlg) { +$guiContent = new GuiControl(IODropdownDlg) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; diff --git a/Templates/BaseGame/game/data/ui/guis/RecordingsDlg.gui b/Templates/BaseGame/game/data/ui/guis/RecordingsDlg.gui index 0e863fff5..c13008f11 100644 --- a/Templates/BaseGame/game/data/ui/guis/RecordingsDlg.gui +++ b/Templates/BaseGame/game/data/ui/guis/RecordingsDlg.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(recordingsDlg) { +$guiContent = new GuiControl(recordingsDlg) { position = "0 0"; extent = "1024 768"; minExtent = "8 8"; diff --git a/Templates/BaseGame/game/data/ui/guis/chooseLevelDlg.gui b/Templates/BaseGame/game/data/ui/guis/chooseLevelDlg.gui index 9b4771717..8d92639fb 100644 --- a/Templates/BaseGame/game/data/ui/guis/chooseLevelDlg.gui +++ b/Templates/BaseGame/game/data/ui/guis/chooseLevelDlg.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ChooseLevelDlg) { +$guiContent = new GuiControl(ChooseLevelDlg) { position = "0 0"; extent = "1024 768"; minExtent = "8 8"; diff --git a/Templates/BaseGame/game/data/ui/guis/guiMusicPlayer.gui b/Templates/BaseGame/game/data/ui/guis/guiMusicPlayer.gui index 291f3a356..cfd2c3e96 100644 --- a/Templates/BaseGame/game/data/ui/guis/guiMusicPlayer.gui +++ b/Templates/BaseGame/game/data/ui/guis/guiMusicPlayer.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(GuiMusicPlayer) { +$guiContent = new GuiControl(GuiMusicPlayer) { isContainer = "1"; Profile = "GuiWindowProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/data/ui/guis/joinServerMenu.gui b/Templates/BaseGame/game/data/ui/guis/joinServerMenu.gui index a45d5d3ce..d84a381b2 100644 --- a/Templates/BaseGame/game/data/ui/guis/joinServerMenu.gui +++ b/Templates/BaseGame/game/data/ui/guis/joinServerMenu.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(JoinServerMenu) { +$guiContent = new GuiControl(JoinServerMenu) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/data/ui/guis/loadingGui.gui b/Templates/BaseGame/game/data/ui/guis/loadingGui.gui index b0af3e66e..d525e5931 100644 --- a/Templates/BaseGame/game/data/ui/guis/loadingGui.gui +++ b/Templates/BaseGame/game/data/ui/guis/loadingGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiChunkedBitmapCtrl(LoadingGui) { +$guiContent = new GuiChunkedBitmapCtrl(LoadingGui) { bitmap = "data/ui/images/background-dark.png"; useVariable = "0"; tile = "0"; diff --git a/Templates/BaseGame/game/data/ui/guis/mainMenu.gui b/Templates/BaseGame/game/data/ui/guis/mainMenu.gui index 9f4b8ec3b..d7f7fc3a3 100644 --- a/Templates/BaseGame/game/data/ui/guis/mainMenu.gui +++ b/Templates/BaseGame/game/data/ui/guis/mainMenu.gui @@ -1,7 +1,7 @@ exec( "tools/gui/profiles.ed.tscript" ); //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiChunkedBitmapCtrl(MainMenuGui) { +$guiContent = new GuiChunkedBitmapCtrl(MainMenuGui) { bitmap = "data/ui/images/background-dark.png"; useVariable = "0"; tile = "0"; diff --git a/Templates/BaseGame/game/data/ui/guis/messageBoxDlg.gui b/Templates/BaseGame/game/data/ui/guis/messageBoxDlg.gui index 8dd356d97..a78ae98d5 100644 --- a/Templates/BaseGame/game/data/ui/guis/messageBoxDlg.gui +++ b/Templates/BaseGame/game/data/ui/guis/messageBoxDlg.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(MessageBoxDlg) { +$guiContent = new GuiControl(MessageBoxDlg) { position = "0 0"; extent = "1024 768"; minExtent = "8 8"; diff --git a/Templates/BaseGame/game/data/ui/guis/netGraphGui.gui b/Templates/BaseGame/game/data/ui/guis/netGraphGui.gui index b034a447e..be8ba1233 100644 --- a/Templates/BaseGame/game/data/ui/guis/netGraphGui.gui +++ b/Templates/BaseGame/game/data/ui/guis/netGraphGui.gui @@ -73,7 +73,7 @@ new GuiControlProfile (NetGraphPacketLossProfile) }; //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(NetGraphGui) { +$guiContent = new GuiControl(NetGraphGui) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/data/ui/guis/optionsDlg.gui b/Templates/BaseGame/game/data/ui/guis/optionsDlg.gui index 3c78ac116..b2758c32c 100644 --- a/Templates/BaseGame/game/data/ui/guis/optionsDlg.gui +++ b/Templates/BaseGame/game/data/ui/guis/optionsDlg.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(OptionsDlg) { +$guiContent = new GuiControl(OptionsDlg) { position = "0 0"; extent = "1024 768"; minExtent = "8 8"; diff --git a/Templates/BaseGame/game/data/ui/guis/optionsMenu.gui b/Templates/BaseGame/game/data/ui/guis/optionsMenu.gui index 5d357e9fd..9b76cb979 100644 --- a/Templates/BaseGame/game/data/ui/guis/optionsMenu.gui +++ b/Templates/BaseGame/game/data/ui/guis/optionsMenu.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(OptionsMenu) { +$guiContent = new GuiControl(OptionsMenu) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/data/ui/guis/optionsMenu.tscript b/Templates/BaseGame/game/data/ui/guis/optionsMenu.tscript index eba6e173b..d22d847c3 100644 --- a/Templates/BaseGame/game/data/ui/guis/optionsMenu.tscript +++ b/Templates/BaseGame/game/data/ui/guis/optionsMenu.tscript @@ -276,11 +276,8 @@ function OptionsMenu::applyDisplaySettings(%this) // Change the device. if ( %newDevice !$= $pref::Video::displayDevice ) { - if ( %testNeedApply ) - return true; - $pref::Video::displayDevice = %newDevice; - if( %newAdapter !$= getDisplayDeviceInformation() ) + if( %newDevice !$= getDisplayDeviceInformation() ) MessageBoxOK( "Change requires restart", "Please restart the game for a display device change to take effect." ); $changingDisplayDevice = %newDevice; @@ -368,10 +365,7 @@ function OptionsMenu::applyGraphicsSettings(%this) // Check the anisotropic filtering. %level = OptionsMenuSettingsList.getCurrentOption(10); if ( %level != $pref::Video::defaultAnisotropy ) - { - if ( %testNeedApply ) - return true; - + { $pref::Video::defaultAnisotropy = %level; } @@ -418,9 +412,6 @@ function updateDisplaySettings() if ( %newMode !$= $pref::Video::mode || %newDeviceID != $pref::Video::deviceId || %newVsync != $pref::Video::disableVerticalSync || %newDeviceMode != $pref::Video::deviceMode) { - if ( %testNeedApply ) - return true; - //****Edge Case Hack // If we're in fullscreen mode and switching to a different monitor at the // same resolution and maintaining fullscreen, GFX...WindowTarget::resetMode() @@ -433,7 +424,7 @@ function updateDisplaySettings() $pref::Video::deviceId = %newDeviceID; $pref::Video::deviceMode = $Video::ModeBorderless; %tmpModeStr = Canvas.getMonitorMode(%newDeviceID, 0); - Canvas.setVideoMode(%tmpModeStr.x, %tmpModeStr.y, false, 32, getWord(%tmpModeStr, $WORD::REFRESH), %aa); + Canvas.setVideoMode(%tmpModeStr.x, %tmpModeStr.y, false, 32, getWord(%tmpModeStr, $WORD::REFRESH), %newFSAA); } $pref::Video::mode = %newMode; @@ -459,6 +450,8 @@ function OptionsMenu::populateAudioSettingsList(%this) %buffer = sfxGetAvailableDevices(); %count = getRecordCount( %buffer ); %audioDriverList = ""; + %audioProviderList = ""; + %audioDeviceList = ""; $currentAudioProvider = $currentAudioProvider $= "" ? $pref::SFX::provider : $currentAudioProvider; diff --git a/Templates/BaseGame/game/data/ui/guis/pauseMenu.gui b/Templates/BaseGame/game/data/ui/guis/pauseMenu.gui index 987493ba9..80d6eb74d 100644 --- a/Templates/BaseGame/game/data/ui/guis/pauseMenu.gui +++ b/Templates/BaseGame/game/data/ui/guis/pauseMenu.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(PauseMenu) { +$guiContent = new GuiControl(PauseMenu) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/data/ui/guis/profiler.gui b/Templates/BaseGame/game/data/ui/guis/profiler.gui index 46628c6df..c6d97a26f 100644 --- a/Templates/BaseGame/game/data/ui/guis/profiler.gui +++ b/Templates/BaseGame/game/data/ui/guis/profiler.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ProfilerGui) { +$guiContent = new GuiControl(ProfilerGui) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/data/ui/guis/profiler.tscript b/Templates/BaseGame/game/data/ui/guis/profiler.tscript index bc73338bf..402f7b1f1 100644 --- a/Templates/BaseGame/game/data/ui/guis/profiler.tscript +++ b/Templates/BaseGame/game/data/ui/guis/profiler.tscript @@ -101,7 +101,7 @@ function showMetics(%var) GlobalActionMap.bind(keyboard, "ctrl F2", showMetics); -%guiContent = new GuiControl(FrameOverlayGui) { +$guiContent = new GuiControl(FrameOverlayGui) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; diff --git a/Templates/BaseGame/game/data/ui/guis/remapConfirmDlg.gui b/Templates/BaseGame/game/data/ui/guis/remapConfirmDlg.gui index 6e32fd1ec..97f5a55c9 100644 --- a/Templates/BaseGame/game/data/ui/guis/remapConfirmDlg.gui +++ b/Templates/BaseGame/game/data/ui/guis/remapConfirmDlg.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(RemapConfirmDlg) { +$guiContent = new GuiControl(RemapConfirmDlg) { position = "0 0"; extent = "1024 768"; minExtent = "8 8"; diff --git a/Templates/BaseGame/game/data/ui/guis/remapDlg.gui b/Templates/BaseGame/game/data/ui/guis/remapDlg.gui index 71832d81c..900ae8e95 100644 --- a/Templates/BaseGame/game/data/ui/guis/remapDlg.gui +++ b/Templates/BaseGame/game/data/ui/guis/remapDlg.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(RemapDlg) { +$guiContent = new GuiControl(RemapDlg) { position = "0 0"; extent = "1024 768"; minExtent = "8 8"; diff --git a/Templates/BaseGame/game/data/ui/guis/startupGui.gui b/Templates/BaseGame/game/data/ui/guis/startupGui.gui index ad7afcf63..fd42c23bd 100644 --- a/Templates/BaseGame/game/data/ui/guis/startupGui.gui +++ b/Templates/BaseGame/game/data/ui/guis/startupGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiFadeinBitmapCtrl(StartupGui) { +$guiContent = new GuiFadeinBitmapCtrl(StartupGui) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/main.tscript.in b/Templates/BaseGame/game/main.tscript.in index f2cae0249..5d5569e7d 100644 --- a/Templates/BaseGame/game/main.tscript.in +++ b/Templates/BaseGame/game/main.tscript.in @@ -37,9 +37,8 @@ else //If nothing else set a main menu, try to do so now if(!isObject(Canvas.getContent())) { - %mainMenuGUI = ProjectSettings.value("UI/mainMenuName"); - if (isObject( %mainMenuGUI )) - Canvas.setContent( %mainMenuGUI ); + if (isObject( ProjectSettings.value("UI/mainMenuName") )) + Canvas.setContent( ProjectSettings.value("UI/mainMenuName") ); } } diff --git a/Templates/BaseGame/game/tools/MainEditor/guis/MainEditorWindow.gui b/Templates/BaseGame/game/tools/MainEditor/guis/MainEditorWindow.gui index 42c5eca6e..6d40a9164 100644 --- a/Templates/BaseGame/game/tools/MainEditor/guis/MainEditorWindow.gui +++ b/Templates/BaseGame/game/tools/MainEditor/guis/MainEditorWindow.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiContainer(NewEditorGui) { +$guiContent = new GuiContainer(NewEditorGui) { margin = "0 0 0 0"; padding = "0 0 0 0"; anchorTop = "1"; diff --git a/Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditorToolbar.gui b/Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditorToolbar.gui index 76fa8aff7..57651df52 100644 --- a/Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditorToolbar.gui +++ b/Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditorToolbar.gui @@ -3,7 +3,7 @@ // Copyright (C) - Violent Tulip //----------------------------------------------------------------------------- -%guiContent = new GuiControl(VPathEditorToolbar) +$guiContent = new GuiControl(VPathEditorToolbar) { canSaveDynamicFields = "0"; internalName = "VPathEditorToolbar"; diff --git a/Templates/BaseGame/game/tools/VerveEditor/GUI/VerveEditor.gui b/Templates/BaseGame/game/tools/VerveEditor/GUI/VerveEditor.gui index 091288fe0..bb6f76885 100644 --- a/Templates/BaseGame/game/tools/VerveEditor/GUI/VerveEditor.gui +++ b/Templates/BaseGame/game/tools/VerveEditor/GUI/VerveEditor.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(VerveEditorGui) { +$guiContent = new GuiControl(VerveEditorGui) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/VerveEditor/GUI/VerveEditorGroupBuilder.gui b/Templates/BaseGame/game/tools/VerveEditor/GUI/VerveEditorGroupBuilder.gui index 7b041f7f6..19076f551 100644 --- a/Templates/BaseGame/game/tools/VerveEditor/GUI/VerveEditorGroupBuilder.gui +++ b/Templates/BaseGame/game/tools/VerveEditor/GUI/VerveEditorGroupBuilder.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(VerveEditorGroupBuilderGUI) { +$guiContent = new GuiControl(VerveEditorGroupBuilderGUI) { isContainer = "1"; Profile = "GuiDefaultProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/VerveEditor/GUI/VerveEditorImportPathNodes.gui b/Templates/BaseGame/game/tools/VerveEditor/GUI/VerveEditorImportPathNodes.gui index 6ec7b430c..9309ee64f 100644 --- a/Templates/BaseGame/game/tools/VerveEditor/GUI/VerveEditorImportPathNodes.gui +++ b/Templates/BaseGame/game/tools/VerveEditor/GUI/VerveEditorImportPathNodes.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(VerveEditorImportPathNodesGUI) { +$guiContent = new GuiControl(VerveEditorImportPathNodesGUI) { isContainer = "1"; Profile = "GuiDefaultProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/VerveEditor/GUI/VerveEditorPreferences.gui b/Templates/BaseGame/game/tools/VerveEditor/GUI/VerveEditorPreferences.gui index 31579a5fb..417f15908 100644 --- a/Templates/BaseGame/game/tools/VerveEditor/GUI/VerveEditorPreferences.gui +++ b/Templates/BaseGame/game/tools/VerveEditor/GUI/VerveEditorPreferences.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(VerveEditorPreferenceGui) { +$guiContent = new GuiControl(VerveEditorPreferenceGui) { canSaveDynamicFields = "0"; isContainer = "1"; Profile = "GuiDefaultProfile"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/AssetImportConfigEditor.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/AssetImportConfigEditor.gui index 4bffe1234..d7844261c 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/AssetImportConfigEditor.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/AssetImportConfigEditor.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AssetImportConfigEditor) { +$guiContent = new GuiControl(AssetImportConfigEditor) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/GameObjectCreator.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/GameObjectCreator.gui index 6ade66e95..4b1894812 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/GameObjectCreator.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/GameObjectCreator.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(GameObjectCreator) { +$guiContent = new GuiControl(GameObjectCreator) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/addModuleWindow.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/addModuleWindow.gui index e8f35a13a..d6f2acc1f 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/addModuleWindow.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/addModuleWindow.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AssetBrowser_AddModule) { +$guiContent = new GuiControl(AssetBrowser_AddModule) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/addPackageWindow.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/addPackageWindow.gui index 48a48f5be..1bf51e529 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/addPackageWindow.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/addPackageWindow.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AssetBrowser_AddPackage) { +$guiContent = new GuiControl(AssetBrowser_AddPackage) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui index 40d772206..8a831a68d 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AssetBrowser) { +$guiContent = new GuiControl(AssetBrowser) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui index 1e4913025..5e8ab8dec 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AssetImportCtrl) { +$guiContent = new GuiControl(AssetImportCtrl) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetImportLog.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetImportLog.gui index 14935f2b1..81aca8284 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/assetImportLog.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetImportLog.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AssetBrowserImportLog) { +$guiContent = new GuiControl(AssetBrowserImportLog) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetNameEdit.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetNameEdit.gui index e99e12118..4e6ddfe69 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/assetNameEdit.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetNameEdit.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AssetBrowser_assetNameEdit) { +$guiContent = new GuiControl(AssetBrowser_assetNameEdit) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui index 2ee3b1cdc..803f71ba5 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AssetPreviewButtonsTemplate) { +$guiContent = new GuiControl(AssetPreviewButtonsTemplate) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/createNewCollectionSet.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/createNewCollectionSet.gui index faa48bd6e..9317d8bec 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/createNewCollectionSet.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/createNewCollectionSet.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(CreateNewCollectionSetCtrl) { +$guiContent = new GuiControl(CreateNewCollectionSetCtrl) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui index 180b4b5d7..9ac2e2ef2 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AssetBrowser_editAsset) { +$guiContent = new GuiControl(AssetBrowser_editAsset) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/editModule.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/editModule.gui index 18927399f..c2a59f6ef 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/editModule.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/editModule.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AssetBrowser_editModule) { +$guiContent = new GuiControl(AssetBrowser_editModule) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/looseFileAudit.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/looseFileAudit.gui index b4d6d1cce..2bc3d46ee 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/looseFileAudit.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/looseFileAudit.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(LooseFileAudit) { +$guiContent = new GuiControl(LooseFileAudit) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/newAsset.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/newAsset.gui index e7efb40d4..38d7b2449 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/newAsset.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/newAsset.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AssetBrowser_newAsset) { +$guiContent = new GuiControl(AssetBrowser_newAsset) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/newComponentAsset.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/newComponentAsset.gui index 37e6fc4a1..9fc756fd1 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/newComponentAsset.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/newComponentAsset.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AssetBrowser_newComponentAsset) { +$guiContent = new GuiControl(AssetBrowser_newComponentAsset) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/newFolder.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/newFolder.gui index ff1509cb4..7030b5e40 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/newFolder.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/newFolder.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AssetBrowser_newFolder) { +$guiContent = new GuiControl(AssetBrowser_newFolder) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/selectModule.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/selectModule.gui index ed907fbd9..9795c8a74 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/selectModule.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/selectModule.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AssetBrowser_SelectModule) { +$guiContent = new GuiControl(AssetBrowser_SelectModule) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/selectPackage.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/selectPackage.gui index c31dbf53e..a74dbf594 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/selectPackage.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/selectPackage.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AssetBrowser_SelectPackage) { +$guiContent = new GuiControl(AssetBrowser_SelectPackage) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/selectPath.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/selectPath.gui index 21949c518..5bdb39b21 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/selectPath.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/selectPath.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(SelectAssetPath) { +$guiContent = new GuiControl(SelectAssetPath) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/guiFile.gui.template b/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/guiFile.gui.template index 63dc722d2..5224885a7 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/guiFile.gui.template +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/guiFile.gui.template @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(@@) +$guiContent = new GuiControl(@@) { position = "0 0"; extent = "100 100"; diff --git a/Templates/BaseGame/game/tools/componentEditor/gui/TypeMaskFieldGui.gui b/Templates/BaseGame/game/tools/componentEditor/gui/TypeMaskFieldGui.gui index a18277419..a5ce9d51b 100644 --- a/Templates/BaseGame/game/tools/componentEditor/gui/TypeMaskFieldGui.gui +++ b/Templates/BaseGame/game/tools/componentEditor/gui/TypeMaskFieldGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(TypeMaskFieldGui) { +$guiContent = new GuiControl(TypeMaskFieldGui) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/componentEditor/gui/superToolTipDlg.ed.gui b/Templates/BaseGame/game/tools/componentEditor/gui/superToolTipDlg.ed.gui index ef506941a..a0a79e60b 100644 --- a/Templates/BaseGame/game/tools/componentEditor/gui/superToolTipDlg.ed.gui +++ b/Templates/BaseGame/game/tools/componentEditor/gui/superToolTipDlg.ed.gui @@ -1,4 +1,4 @@ -%guiContent = new GuiControl(SuperTooltipDlg) { +$guiContent = new GuiControl(SuperTooltipDlg) { canSaveDynamicFields = "0"; Profile = "GuiTransparentProfileModeless"; class = "SuperTooltip"; diff --git a/Templates/BaseGame/game/tools/convexEditor/convexEditorGui.gui b/Templates/BaseGame/game/tools/convexEditor/convexEditorGui.gui index f28b3b5b4..07ecfc7be 100644 --- a/Templates/BaseGame/game/tools/convexEditor/convexEditorGui.gui +++ b/Templates/BaseGame/game/tools/convexEditor/convexEditorGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiConvexEditorCtrl(ConvexEditorGui) { +$guiContent = new GuiConvexEditorCtrl(ConvexEditorGui) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/convexEditor/convexEditorSettingsTab.ed.gui b/Templates/BaseGame/game/tools/convexEditor/convexEditorSettingsTab.ed.gui index 3cd3a1ebd..b77d68f85 100644 --- a/Templates/BaseGame/game/tools/convexEditor/convexEditorSettingsTab.ed.gui +++ b/Templates/BaseGame/game/tools/convexEditor/convexEditorSettingsTab.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ConvexEditorSettingsTab,EditorGuiGroup) { +$guiContent = new GuiControl(ConvexEditorSettingsTab,EditorGuiGroup) { isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/convexEditor/convexEditorToolbar.ed.gui b/Templates/BaseGame/game/tools/convexEditor/convexEditorToolbar.ed.gui index 2e737c942..aad716277 100644 --- a/Templates/BaseGame/game/tools/convexEditor/convexEditorToolbar.ed.gui +++ b/Templates/BaseGame/game/tools/convexEditor/convexEditorToolbar.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(convexEditorToolbar, EditorGuiGroup) { +$guiContent = new GuiControl(convexEditorToolbar, EditorGuiGroup) { canSaveDynamicFields = "0"; internalName = ""; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorCreatePrompt.ed.gui b/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorCreatePrompt.ed.gui index e8c3b5adb..5f1783390 100644 --- a/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorCreatePrompt.ed.gui +++ b/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorCreatePrompt.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) { +$guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorInspectorWindow.ed.gui b/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorInspectorWindow.ed.gui index 5a68c4df2..2fce2fb25 100644 --- a/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorInspectorWindow.ed.gui +++ b/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorInspectorWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl() { +$guiContent = new GuiControl() { isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorTreeWindow.ed.gui b/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorTreeWindow.ed.gui index d07a4158d..67d71544d 100644 --- a/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorTreeWindow.ed.gui +++ b/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorTreeWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl() { +$guiContent = new GuiControl() { isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/debugger/gui/breakConditionDlg.ed.gui b/Templates/BaseGame/game/tools/debugger/gui/breakConditionDlg.ed.gui index d6355e58f..9a5c53881 100644 --- a/Templates/BaseGame/game/tools/debugger/gui/breakConditionDlg.ed.gui +++ b/Templates/BaseGame/game/tools/debugger/gui/breakConditionDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(DebuggerBreakConditionDlg, EditorGuiGroup) { +$guiContent = new GuiControl(DebuggerBreakConditionDlg, EditorGuiGroup) { profile = "ToolsGuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; diff --git a/Templates/BaseGame/game/tools/debugger/gui/connectDlg.ed.gui b/Templates/BaseGame/game/tools/debugger/gui/connectDlg.ed.gui index 927312fed..5d72d44ee 100644 --- a/Templates/BaseGame/game/tools/debugger/gui/connectDlg.ed.gui +++ b/Templates/BaseGame/game/tools/debugger/gui/connectDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(DebuggerConnectDlg, EditorGuiGroup) { +$guiContent = new GuiControl(DebuggerConnectDlg, EditorGuiGroup) { profile = "ToolsGuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; diff --git a/Templates/BaseGame/game/tools/debugger/gui/debugger.ed.gui b/Templates/BaseGame/game/tools/debugger/gui/debugger.ed.gui index 616a8f0fb..6efe6786c 100644 --- a/Templates/BaseGame/game/tools/debugger/gui/debugger.ed.gui +++ b/Templates/BaseGame/game/tools/debugger/gui/debugger.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(DebuggerGui, EditorGuiGroup) { +$guiContent = new GuiControl(DebuggerGui, EditorGuiGroup) { profile = "ToolsGuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; diff --git a/Templates/BaseGame/game/tools/debugger/gui/editWatchDlg.ed.gui b/Templates/BaseGame/game/tools/debugger/gui/editWatchDlg.ed.gui index d1d5ebe4e..e53a8c7c8 100644 --- a/Templates/BaseGame/game/tools/debugger/gui/editWatchDlg.ed.gui +++ b/Templates/BaseGame/game/tools/debugger/gui/editWatchDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(DebuggerEditWatchDlg, EditorGuiGroup) { +$guiContent = new GuiControl(DebuggerEditWatchDlg, EditorGuiGroup) { profile = "ToolsGuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; diff --git a/Templates/BaseGame/game/tools/debugger/gui/findDlg.ed.gui b/Templates/BaseGame/game/tools/debugger/gui/findDlg.ed.gui index 5a74273d5..a16b9784b 100644 --- a/Templates/BaseGame/game/tools/debugger/gui/findDlg.ed.gui +++ b/Templates/BaseGame/game/tools/debugger/gui/findDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(DebuggerFindDlg, EditorGuiGroup) { +$guiContent = new GuiControl(DebuggerFindDlg, EditorGuiGroup) { profile = "ToolsGuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; diff --git a/Templates/BaseGame/game/tools/debugger/gui/watchDlg.ed.gui b/Templates/BaseGame/game/tools/debugger/gui/watchDlg.ed.gui index 898563807..2bd913b85 100644 --- a/Templates/BaseGame/game/tools/debugger/gui/watchDlg.ed.gui +++ b/Templates/BaseGame/game/tools/debugger/gui/watchDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(DebuggerWatchDlg, EditorGuiGroup) { +$guiContent = new GuiControl(DebuggerWatchDlg, EditorGuiGroup) { profile = "ToolsGuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; diff --git a/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.gui b/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.gui index 919291d2c..816bb0cc2 100644 --- a/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.gui +++ b/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiDecalEditorCtrl(DecalEditorGui) { +$guiContent = new GuiDecalEditorCtrl(DecalEditorGui) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/forestEditor/forestEditToolbar.ed.gui b/Templates/BaseGame/game/tools/forestEditor/forestEditToolbar.ed.gui index 782383121..5b6911a9b 100644 --- a/Templates/BaseGame/game/tools/forestEditor/forestEditToolbar.ed.gui +++ b/Templates/BaseGame/game/tools/forestEditor/forestEditToolbar.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ForestEditToolbar,EditorGuiGroup) { +$guiContent = new GuiControl(ForestEditToolbar,EditorGuiGroup) { isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/forestEditor/forestEditorGui.gui b/Templates/BaseGame/game/tools/forestEditor/forestEditorGui.gui index e46a09f3d..a663c9d0b 100644 --- a/Templates/BaseGame/game/tools/forestEditor/forestEditorGui.gui +++ b/Templates/BaseGame/game/tools/forestEditor/forestEditorGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new ForestEditorCtrl(ForestEditorGui,EditorGuiGroup) { +$guiContent = new ForestEditorCtrl(ForestEditorGui,EditorGuiGroup) { renderMissionArea = "0"; missionAreaFillColor = "255 0 0 20"; missionAreaFrameColor = "255 0 0 128"; diff --git a/Templates/BaseGame/game/tools/gui/EditorLoadingGui.gui b/Templates/BaseGame/game/tools/gui/EditorLoadingGui.gui index 5d7152e44..e5950b677 100644 --- a/Templates/BaseGame/game/tools/gui/EditorLoadingGui.gui +++ b/Templates/BaseGame/game/tools/gui/EditorLoadingGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(EditorLoadingGui,EditorGuiGroup) { +$guiContent = new GuiControl(EditorLoadingGui,EditorGuiGroup) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/gui/EditorSettingsWindow.ed.gui b/Templates/BaseGame/game/tools/gui/EditorSettingsWindow.ed.gui index 3d5d939ad..93010d0e1 100644 --- a/Templates/BaseGame/game/tools/gui/EditorSettingsWindow.ed.gui +++ b/Templates/BaseGame/game/tools/gui/EditorSettingsWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(EditorSettingsWindow,EditorGuiGroup) { +$guiContent = new GuiControl(EditorSettingsWindow,EditorGuiGroup) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/gui/GuiEaseEditDlg.ed.gui b/Templates/BaseGame/game/tools/gui/GuiEaseEditDlg.ed.gui index 4c76d8388..abe4422e1 100644 --- a/Templates/BaseGame/game/tools/gui/GuiEaseEditDlg.ed.gui +++ b/Templates/BaseGame/game/tools/gui/GuiEaseEditDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(GuiEaseEditDlg,EditorGuiGroup) { +$guiContent = new GuiControl(GuiEaseEditDlg,EditorGuiGroup) { isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/gui/assimpImport.ed.gui b/Templates/BaseGame/game/tools/gui/assimpImport.ed.gui index a9ba1f768..dcee11033 100644 --- a/Templates/BaseGame/game/tools/gui/assimpImport.ed.gui +++ b/Templates/BaseGame/game/tools/gui/assimpImport.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AssimpImportDlg,EditorGuiGroup) { +$guiContent = new GuiControl(AssimpImportDlg,EditorGuiGroup) { isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "width"; diff --git a/Templates/BaseGame/game/tools/gui/colladaImport.ed.gui b/Templates/BaseGame/game/tools/gui/colladaImport.ed.gui index d098bffe6..4eb34b486 100644 --- a/Templates/BaseGame/game/tools/gui/colladaImport.ed.gui +++ b/Templates/BaseGame/game/tools/gui/colladaImport.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ColladaImportDlg,EditorGuiGroup) { +$guiContent = new GuiControl(ColladaImportDlg,EditorGuiGroup) { isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "width"; @@ -1754,8 +1754,8 @@ function convertColladaModels(%pattern) function showImportDialog(%shapePath, %cmd) { - %this.path = %shapePath; - %this.cmd = %cmd; + ColladaImportDlg.path = %shapePath; + ColladaImportDlg.cmd = %cmd; if ( fileExt(%shapePath) $= ".dts" || fileExt(%shapePath) $= ".dsq" || fileExt(%shapePath) $= ".dae" || fileExt(%shapePath) $= ".kmz" ) diff --git a/Templates/BaseGame/game/tools/gui/colorPicker.ed.gui b/Templates/BaseGame/game/tools/gui/colorPicker.ed.gui index 0d4f7a975..f390cf95e 100644 --- a/Templates/BaseGame/game/tools/gui/colorPicker.ed.gui +++ b/Templates/BaseGame/game/tools/gui/colorPicker.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiColorPickerCtrl(ColorPickerDlg,EditorGuiGroup) { +$guiContent = new GuiColorPickerCtrl(ColorPickerDlg,EditorGuiGroup) { displayMode = "Dropper"; // this makes the background visible actionOnMove = "1"; position = "0 0"; diff --git a/Templates/BaseGame/game/tools/gui/cubemapEditor.gui b/Templates/BaseGame/game/tools/gui/cubemapEditor.gui index 26ae7877d..d273e13e9 100644 --- a/Templates/BaseGame/game/tools/gui/cubemapEditor.gui +++ b/Templates/BaseGame/game/tools/gui/cubemapEditor.gui @@ -1,4 +1,4 @@ -%guiContent = new GuiControl(CubemapEditor) { +$guiContent = new GuiControl(CubemapEditor) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/gui/fileDialogBase.ed.tscript b/Templates/BaseGame/game/tools/gui/fileDialogBase.ed.tscript index 9d40e0434..7d36db457 100644 --- a/Templates/BaseGame/game/tools/gui/fileDialogBase.ed.tscript +++ b/Templates/BaseGame/game/tools/gui/fileDialogBase.ed.tscript @@ -255,8 +255,7 @@ function FileDialogOkButton::onClick( %this ) // Callback eval( %this.parent.SuccessCallback @ "(\"" @ %fullPath @"\");" ); - - %parent.SuccessCallback = 0; + %this.parent.SuccessCallback = 0; //error("Ok"); diff --git a/Templates/BaseGame/game/tools/gui/guiObjectInspector.ed.gui b/Templates/BaseGame/game/tools/gui/guiObjectInspector.ed.gui index 596e8e216..653fedee3 100644 --- a/Templates/BaseGame/game/tools/gui/guiObjectInspector.ed.gui +++ b/Templates/BaseGame/game/tools/gui/guiObjectInspector.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiWindowCollapseCtrl() { +$guiContent = new GuiWindowCollapseCtrl() { collapseGroup = "-1"; collapseGroupNum = "-1"; resizeWidth = "1"; diff --git a/Templates/BaseGame/game/tools/gui/guiObjectInspector.ed.tscript b/Templates/BaseGame/game/tools/gui/guiObjectInspector.ed.tscript index 33b65f6bd..28b2d0d68 100644 --- a/Templates/BaseGame/game/tools/gui/guiObjectInspector.ed.tscript +++ b/Templates/BaseGame/game/tools/gui/guiObjectInspector.ed.tscript @@ -37,7 +37,7 @@ function inspectObject( %object ) // Create a new object inspector window. exec( "./guiObjectInspector.ed.gui" ); - if( !isObject( %guiContent) ) + if( !isObject( $guiContent) ) { error( "InspectObject: failed to create GUI from 'guiObjectInspector.ed.gui'" ); return; @@ -45,9 +45,9 @@ function inspectObject( %object ) // Initialize the inspector. - %guiContent.init( %object ); + $guiContent.init( %object ); - Canvas.getContent().add( %guiContent ); + Canvas.getContent().add( $guiContent ); } //============================================================================================= diff --git a/Templates/BaseGame/game/tools/gui/materialSelector.ed.gui b/Templates/BaseGame/game/tools/gui/materialSelector.ed.gui index b3ad85549..a7c36de34 100644 --- a/Templates/BaseGame/game/tools/gui/materialSelector.ed.gui +++ b/Templates/BaseGame/game/tools/gui/materialSelector.ed.gui @@ -778,6 +778,8 @@ function MaterialSelector::buildStaticFilters( %this ) // if you want to add any more containers to staticFilterObjects, here's // where to do it + %filterArray = MaterialSelector-->filterArray; + %staticFilterContainer = new GuiControl (){ new GuiContainer(){ profile = "ToolsGuiDefaultProfile"; @@ -1366,7 +1368,7 @@ function MaterialSelector::loadMaterialFilters( %this ) // create category and update current material if there is one function MaterialSelector::createFilter( %this, %filter ) { - if( %filter $= %existingFilters ) + if( %filter $= "" ) { toolsMessageBoxOK( "Error", "Can not create blank filter."); return; diff --git a/Templates/BaseGame/game/tools/gui/messageBoxes/IODropdownDlg.ed.gui b/Templates/BaseGame/game/tools/gui/messageBoxes/IODropdownDlg.ed.gui index a65acf0b0..e62771773 100644 --- a/Templates/BaseGame/game/tools/gui/messageBoxes/IODropdownDlg.ed.gui +++ b/Templates/BaseGame/game/tools/gui/messageBoxes/IODropdownDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(IODropdownDlg) { +$guiContent = new GuiControl(IODropdownDlg) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; diff --git a/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxOK.ed.gui b/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxOK.ed.gui index f1f2beb76..9ec300d92 100644 --- a/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxOK.ed.gui +++ b/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxOK.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(toolsMessageBoxOKDlg) { +$guiContent = new GuiControl(toolsMessageBoxOKDlg) { profile = "GuiOverlayProfile"; horizSizing = "width"; vertSizing = "height"; diff --git a/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxOKBuy.ed.gui b/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxOKBuy.ed.gui index 176f47a1e..befe7e2fe 100644 --- a/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxOKBuy.ed.gui +++ b/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxOKBuy.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(toolsMessageBoxOKBuyDlg) { +$guiContent = new GuiControl(toolsMessageBoxOKBuyDlg) { profile = "ToolsGuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; diff --git a/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxOKCancel.ed.gui b/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxOKCancel.ed.gui index 2fc84fa07..9fb96b373 100644 --- a/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxOKCancel.ed.gui +++ b/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxOKCancel.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(toolsMessageBoxOKCancelDlg) { +$guiContent = new GuiControl(toolsMessageBoxOKCancelDlg) { profile = "GuiOverlayProfile"; horizSizing = "width"; vertSizing = "height"; diff --git a/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxOKCancelDetailsDlg.ed.gui b/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxOKCancelDetailsDlg.ed.gui index 83d810b4a..0e38c2e4f 100644 --- a/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxOKCancelDetailsDlg.ed.gui +++ b/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxOKCancelDetailsDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(toolsMessageBoxOKCancelDetailsDlg) { +$guiContent = new GuiControl(toolsMessageBoxOKCancelDetailsDlg) { canSaveDynamicFields = "0"; Profile = "GuiOverlayProfile"; HorizSizing = "width"; diff --git a/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxYesNo.ed.gui b/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxYesNo.ed.gui index 83cc0f1b5..d9d5b45bd 100644 --- a/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxYesNo.ed.gui +++ b/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxYesNo.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(toolsMessageBoxYesNoDlg) { +$guiContent = new GuiControl(toolsMessageBoxYesNoDlg) { profile = "GuiOverlayProfile"; horizSizing = "width"; vertSizing = "height"; diff --git a/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxYesNoCancel.ed.gui b/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxYesNoCancel.ed.gui index 9a707cdca..89e63cb87 100644 --- a/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxYesNoCancel.ed.gui +++ b/Templates/BaseGame/game/tools/gui/messageBoxes/messageBoxYesNoCancel.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(toolsMessageBoxYesNoCancelDlg) { +$guiContent = new GuiControl(toolsMessageBoxYesNoCancelDlg) { canSaveDynamicFields = "0"; Profile = "GuiOverlayProfile"; HorizSizing = "width"; diff --git a/Templates/BaseGame/game/tools/gui/messageBoxes/messagePopup.ed.gui b/Templates/BaseGame/game/tools/gui/messageBoxes/messagePopup.ed.gui index 317bbc7d1..475bb928a 100644 --- a/Templates/BaseGame/game/tools/gui/messageBoxes/messagePopup.ed.gui +++ b/Templates/BaseGame/game/tools/gui/messageBoxes/messagePopup.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(MessagePopupDlg) { +$guiContent = new GuiControl(MessagePopupDlg) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; diff --git a/Templates/BaseGame/game/tools/gui/postFxEditor.gui b/Templates/BaseGame/game/tools/gui/postFxEditor.gui index 4827435da..7d53b9869 100644 --- a/Templates/BaseGame/game/tools/gui/postFxEditor.gui +++ b/Templates/BaseGame/game/tools/gui/postFxEditor.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(postFXEditor) { +$guiContent = new GuiControl(postFXEditor) { position = "0 0"; extent = "1920 1200"; minExtent = "8 8"; diff --git a/Templates/BaseGame/game/tools/gui/profilerGraph.gui b/Templates/BaseGame/game/tools/gui/profilerGraph.gui index 8e2e2b68f..0a2fc44ab 100644 --- a/Templates/BaseGame/game/tools/gui/profilerGraph.gui +++ b/Templates/BaseGame/game/tools/gui/profilerGraph.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ProfilerGraphGui) { +$guiContent = new GuiControl(ProfilerGraphGui) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/gui/renderTargetVisualizer.ed.gui b/Templates/BaseGame/game/tools/gui/renderTargetVisualizer.ed.gui index f0f829253..79007fda4 100644 --- a/Templates/BaseGame/game/tools/gui/renderTargetVisualizer.ed.gui +++ b/Templates/BaseGame/game/tools/gui/renderTargetVisualizer.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(RenderTargetVisualizer) { +$guiContent = new GuiControl(RenderTargetVisualizer) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/gui/saveChangesMBDlg.ed.gui b/Templates/BaseGame/game/tools/gui/saveChangesMBDlg.ed.gui index b6bd3641d..3c7e26fd3 100644 --- a/Templates/BaseGame/game/tools/gui/saveChangesMBDlg.ed.gui +++ b/Templates/BaseGame/game/tools/gui/saveChangesMBDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(toolsMessageBoxSaveChangesDlg, EditorGuiGroup) { +$guiContent = new GuiControl(toolsMessageBoxSaveChangesDlg, EditorGuiGroup) { canSaveDynamicFields = "0"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "width"; diff --git a/Templates/BaseGame/game/tools/gui/scriptEditorDlg.ed.gui b/Templates/BaseGame/game/tools/gui/scriptEditorDlg.ed.gui index 2eca2d3ba..119e812ea 100644 --- a/Templates/BaseGame/game/tools/gui/scriptEditorDlg.ed.gui +++ b/Templates/BaseGame/game/tools/gui/scriptEditorDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ScriptEditorDlg,EditorGuiGroup) { +$guiContent = new GuiControl(ScriptEditorDlg,EditorGuiGroup) { isContainer = "1"; Profile = "ToolsGuiDefaultNonModalProfile"; HorizSizing = "width"; diff --git a/Templates/BaseGame/game/tools/gui/simViewDlg.ed.gui b/Templates/BaseGame/game/tools/gui/simViewDlg.ed.gui index 14bc25b57..2ec6b5a71 100644 --- a/Templates/BaseGame/game/tools/gui/simViewDlg.ed.gui +++ b/Templates/BaseGame/game/tools/gui/simViewDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(simViewDlg, EditorGuiGroup) { +$guiContent = new GuiControl(simViewDlg, EditorGuiGroup) { canSaveDynamicFields = "0"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/guiEditor/gui/EditorChooseGUI.ed.gui b/Templates/BaseGame/game/tools/guiEditor/gui/EditorChooseGUI.ed.gui index 02d9e04b3..0187020e5 100644 --- a/Templates/BaseGame/game/tools/guiEditor/gui/EditorChooseGUI.ed.gui +++ b/Templates/BaseGame/game/tools/guiEditor/gui/EditorChooseGUI.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiChunkedBitmapCtrl(EditorChooseGUI, EditorGuiGroup) { +$guiContent = new GuiChunkedBitmapCtrl(EditorChooseGUI, EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/guiEditor/gui/guiEditor.ed.gui b/Templates/BaseGame/game/tools/guiEditor/gui/guiEditor.ed.gui index 9426a7fdd..3c24eb885 100644 --- a/Templates/BaseGame/game/tools/guiEditor/gui/guiEditor.ed.gui +++ b/Templates/BaseGame/game/tools/guiEditor/gui/guiEditor.ed.gui @@ -3,7 +3,7 @@ // Copyright (C) GarageGames.com, Inc. //--------------------------------------------------------------------------------------------- -%guiContent = new GuiControl(GuiEditorGui, EditorGuiGroup) { +$guiContent = new GuiControl(GuiEditorGui, EditorGuiGroup) { canSaveDynamicFields = "0"; isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; diff --git a/Templates/BaseGame/game/tools/guiEditor/gui/guiEditorNewGuiDialog.ed.gui b/Templates/BaseGame/game/tools/guiEditor/gui/guiEditorNewGuiDialog.ed.gui index 98252410a..1e224911d 100644 --- a/Templates/BaseGame/game/tools/guiEditor/gui/guiEditorNewGuiDialog.ed.gui +++ b/Templates/BaseGame/game/tools/guiEditor/gui/guiEditorNewGuiDialog.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(GuiEditorNewGuiDialog,EditorGuiGroup) { +$guiContent = new GuiControl(GuiEditorNewGuiDialog,EditorGuiGroup) { isContainer = "1"; profile = "ToolsGuiOverlayProfile"; horizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/guiEditor/gui/guiEditorPrefsDlg.ed.gui b/Templates/BaseGame/game/tools/guiEditor/gui/guiEditorPrefsDlg.ed.gui index 6f901d1a8..5ddf53f6d 100644 --- a/Templates/BaseGame/game/tools/guiEditor/gui/guiEditorPrefsDlg.ed.gui +++ b/Templates/BaseGame/game/tools/guiEditor/gui/guiEditorPrefsDlg.ed.gui @@ -1,4 +1,4 @@ -%guiContent = new GuiControl(GuiEditorPrefsDlg, EditorGuiGroup) { +$guiContent = new GuiControl(GuiEditorPrefsDlg, EditorGuiGroup) { canSaveDynamicFields = "0"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/guiEditor/gui/guiEditorSelectDlg.ed.gui b/Templates/BaseGame/game/tools/guiEditor/gui/guiEditorSelectDlg.ed.gui index 1794a238d..148b77554 100644 --- a/Templates/BaseGame/game/tools/guiEditor/gui/guiEditorSelectDlg.ed.gui +++ b/Templates/BaseGame/game/tools/guiEditor/gui/guiEditorSelectDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(GuiEditorSelectDlgContainer,EditorGuiGroup) { +$guiContent = new GuiControl(GuiEditorSelectDlgContainer,EditorGuiGroup) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/guiEditor/scripts/EditorChooseGUI.ed.tscript b/Templates/BaseGame/game/tools/guiEditor/scripts/EditorChooseGUI.ed.tscript index 698d38bbf..00ec3e024 100644 --- a/Templates/BaseGame/game/tools/guiEditor/scripts/EditorChooseGUI.ed.tscript +++ b/Templates/BaseGame/game/tools/guiEditor/scripts/EditorChooseGUI.ed.tscript @@ -49,7 +49,7 @@ function GE_OpenGUIFile() // The level file should have contained a scenegraph, which should now be in the instant // group. And, it should be the only thing in the group. - if( !isObject( %guiContent ) ) + if( !isObject( $guiContent ) ) { toolsMessageBox( getEngineName(), "You have loaded a Gui file that was created before this version. It has been loaded but you must open it manually from the content list dropdown", @@ -58,7 +58,7 @@ function GE_OpenGUIFile() return 0; } - GuiEditContent( %guiContent ); + GuiEditContent( $guiContent ); } function GE_GUIList::onURL(%this, %url) diff --git a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorCanvas.ed.tscript b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorCanvas.ed.tscript index 450920e6f..1fbe50c12 100644 --- a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorCanvas.ed.tscript +++ b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorCanvas.ed.tscript @@ -281,7 +281,7 @@ function GuiEditCanvas::load( %this, %filename ) // The GUI file should have contained a GUIControl which should now be in the instant // group. And, it should be the only thing in the group. - if( !isObject( %guiContent ) ) + if( !isObject( $guiContent ) ) { toolsMessageBox( getEngineName(), "You have loaded a Gui file that was created before this version. It has been loaded but you must open it manually from the content list dropdown", @@ -289,7 +289,7 @@ function GuiEditCanvas::load( %this, %filename ) return 0; } - GuiEditor.openForEditing( %guiContent ); + GuiEditor.openForEditing( $guiContent ); GuiEditorStatusBar.print( "Loaded '" @ %filename @ "'" ); } @@ -449,7 +449,7 @@ function GuiEditCanvas::save( %this, %selectedOnly, %noPrompt ) %fo.writeLine( %beforeNewFileLines[ %i ] ); %fo.writeLine("//--- OBJECT WRITE BEGIN ---"); - %fo.writeObject(%currentObject, "%guiContent = "); + %fo.writeObject(%currentObject, "$guiContent = "); %fo.writeLine("//--- OBJECT WRITE END ---"); // Write out captured TorqueScript below Gui object @@ -488,19 +488,19 @@ function GuiEditCanvas::append( %this ) // Find guiContent. - if( !isObject( %guiContent ) ) + if( !isObject( $guiContent ) ) { toolsMessageBox( "Error loading GUI file", "The GUI content controls could not be found. This function can only be used with files saved by the GUI editor.", "Ok", "Error" ); return; } if( !GuiEditorContent.getCount() ) - GuiEditor.openForEditing( %guiContent ); + GuiEditor.openForEditing( $guiContent ); else { - GuiEditor.getCurrentAddSet().add( %guiContent ); - GuiEditor.readGuides( %guiContent ); - GuiEditor.onAddNewCtrl( %guiContent ); + GuiEditor.getCurrentAddSet().add( $guiContent ); + GuiEditor.readGuides( $guiContent ); + GuiEditor.onAddNewCtrl( $guiContent ); GuiEditor.onHierarchyChanged(); } diff --git a/Templates/BaseGame/game/tools/main.tscript b/Templates/BaseGame/game/tools/main.tscript index 36c7844c4..e2cfad1b2 100644 --- a/Templates/BaseGame/game/tools/main.tscript +++ b/Templates/BaseGame/game/tools/main.tscript @@ -252,7 +252,7 @@ function EditorCreateFakeGameSession(%fileName) $Game::MissionGroup = "MissionGroup"; - exec(%file); + exec(%fileName); } function fastLoadWorldEdit(%val) diff --git a/Templates/BaseGame/game/tools/materialEditor/gui/MaterialToolbar.ed.gui b/Templates/BaseGame/game/tools/materialEditor/gui/MaterialToolbar.ed.gui index efc140578..64bf201d7 100644 --- a/Templates/BaseGame/game/tools/materialEditor/gui/MaterialToolbar.ed.gui +++ b/Templates/BaseGame/game/tools/materialEditor/gui/MaterialToolbar.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(MaterialEditorToolbar) { +$guiContent = new GuiControl(MaterialEditorToolbar) { canSaveDynamicFields = "0"; internalName = "ShapeEditorToolbar"; Enabled = "1"; diff --git a/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPreviewWindow.ed.gui b/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPreviewWindow.ed.gui index 8b6dedb44..e7606081e 100644 --- a/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPreviewWindow.ed.gui +++ b/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPreviewWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl() { +$guiContent = new GuiControl() { canSaveDynamicFields = "0"; internalName = "MatEdPreviewWindowContainer"; Enabled = "1"; diff --git a/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui b/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui index 8882e1728..93a1f190f 100644 --- a/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui +++ b/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { +$guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { canSaveDynamicFields = "0"; internalName = "MatEdPropertiesWindowContainer"; Enabled = "1"; diff --git a/Templates/BaseGame/game/tools/materialEditor/gui/materialInstancesView.ed.gui b/Templates/BaseGame/game/tools/materialEditor/gui/materialInstancesView.ed.gui index ce5c683de..9e34544b5 100644 --- a/Templates/BaseGame/game/tools/materialEditor/gui/materialInstancesView.ed.gui +++ b/Templates/BaseGame/game/tools/materialEditor/gui/materialInstancesView.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(MaterialInstanceViewCtrl) { +$guiContent = new GuiControl(MaterialInstanceViewCtrl) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditorGui.gui b/Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditorGui.gui index 14bc92d2a..6d50e7fbc 100644 --- a/Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditorGui.gui +++ b/Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditorGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiMeshRoadEditorCtrl(MeshRoadEditorGui,EditorGuiGroup) { +$guiContent = new GuiMeshRoadEditorCtrl(MeshRoadEditorGui,EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditorSettingsTab.gui b/Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditorSettingsTab.gui index 81485d307..9b01c4c33 100644 --- a/Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditorSettingsTab.gui +++ b/Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditorSettingsTab.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(MeshRoadEditorSettingsTab,EditorGuiGroup) { +$guiContent = new GuiControl(MeshRoadEditorSettingsTab,EditorGuiGroup) { isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditorToolbar.gui b/Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditorToolbar.gui index 14444b62d..5266570ae 100644 --- a/Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditorToolbar.gui +++ b/Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditorToolbar.gui @@ -1,4 +1,4 @@ -%guiContent = new GuiControl(MeshRoadEditorToolbar,EditorGuiGroup) { +$guiContent = new GuiControl(MeshRoadEditorToolbar,EditorGuiGroup) { canSaveDynamicFields = "0"; internalName = "MeshRoadEditorToolbar"; Enabled = "1"; diff --git a/Templates/BaseGame/game/tools/missionAreaEditor/missionAreaEditorGui.ed.gui b/Templates/BaseGame/game/tools/missionAreaEditor/missionAreaEditorGui.ed.gui index 03e8fdfe5..754ec57f6 100644 --- a/Templates/BaseGame/game/tools/missionAreaEditor/missionAreaEditorGui.ed.gui +++ b/Templates/BaseGame/game/tools/missionAreaEditor/missionAreaEditorGui.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiMissionAreaEditorCtrl(MissionAreaEditorGui, EditorGuiGroup) { +$guiContent = new GuiMissionAreaEditorCtrl(MissionAreaEditorGui, EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/navEditor/CreateNewNavMeshDlg.gui b/Templates/BaseGame/game/tools/navEditor/CreateNewNavMeshDlg.gui index 906990409..412eacaa3 100644 --- a/Templates/BaseGame/game/tools/navEditor/CreateNewNavMeshDlg.gui +++ b/Templates/BaseGame/game/tools/navEditor/CreateNewNavMeshDlg.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(CreateNewNavMeshDlg) { +$guiContent = new GuiControl(CreateNewNavMeshDlg) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/navEditor/NavEditorConsoleDlg.gui b/Templates/BaseGame/game/tools/navEditor/NavEditorConsoleDlg.gui index 19c063d7a..4fbdfc100 100644 --- a/Templates/BaseGame/game/tools/navEditor/NavEditorConsoleDlg.gui +++ b/Templates/BaseGame/game/tools/navEditor/NavEditorConsoleDlg.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiWindowCtrl(NavEditorConsoleDlg) { +$guiContent = new GuiWindowCtrl(NavEditorConsoleDlg) { text = "Nav Console"; resizeWidth = "1"; resizeHeight = "1"; diff --git a/Templates/BaseGame/game/tools/navEditor/NavEditorGui.gui b/Templates/BaseGame/game/tools/navEditor/NavEditorGui.gui index e00dbf991..f415a43fa 100644 --- a/Templates/BaseGame/game/tools/navEditor/NavEditorGui.gui +++ b/Templates/BaseGame/game/tools/navEditor/NavEditorGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiNavEditorCtrl(NavEditorGui, EditorGuiGroup) { +$guiContent = new GuiNavEditorCtrl(NavEditorGui, EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/navEditor/NavEditorSettingsTab.gui b/Templates/BaseGame/game/tools/navEditor/NavEditorSettingsTab.gui index 1cbe2a81e..9aafcd0b9 100644 --- a/Templates/BaseGame/game/tools/navEditor/NavEditorSettingsTab.gui +++ b/Templates/BaseGame/game/tools/navEditor/NavEditorSettingsTab.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiTabPageCtrl(ENavEditorSettingsPage) { +$guiContent = new GuiTabPageCtrl(ENavEditorSettingsPage) { fitBook = "1"; text = "Navigation Editor"; maxLength = "1024"; diff --git a/Templates/BaseGame/game/tools/navEditor/NavEditorToolbar.gui b/Templates/BaseGame/game/tools/navEditor/NavEditorToolbar.gui index b38fd953a..cdee55fb9 100644 --- a/Templates/BaseGame/game/tools/navEditor/NavEditorToolbar.gui +++ b/Templates/BaseGame/game/tools/navEditor/NavEditorToolbar.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(NavEditorToolbar,EditorGuiGroup) { +$guiContent = new GuiControl(NavEditorToolbar,EditorGuiGroup) { position = "306 0"; extent = "800 32"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/particleEditor/ParticleEditor.ed.gui b/Templates/BaseGame/game/tools/particleEditor/ParticleEditor.ed.gui index e24bc379a..9cd6f594c 100644 --- a/Templates/BaseGame/game/tools/particleEditor/ParticleEditor.ed.gui +++ b/Templates/BaseGame/game/tools/particleEditor/ParticleEditor.ed.gui @@ -20,7 +20,7 @@ $PE_guielement_pos_colorpicker = "158 0"; $PE_guielement_ext_colorpicker = "18 18"; //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiWindowCollapseCtrl(PE_Window) { +$guiContent = new GuiWindowCollapseCtrl(PE_Window) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/riverEditor/RiverEditorGui.gui b/Templates/BaseGame/game/tools/riverEditor/RiverEditorGui.gui index 1a6831489..7645b8855 100644 --- a/Templates/BaseGame/game/tools/riverEditor/RiverEditorGui.gui +++ b/Templates/BaseGame/game/tools/riverEditor/RiverEditorGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiRiverEditorCtrl(RiverEditorGui, EditorGuiGroup) { +$guiContent = new GuiRiverEditorCtrl(RiverEditorGui, EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/riverEditor/RiverEditorSettingsTab.gui b/Templates/BaseGame/game/tools/riverEditor/RiverEditorSettingsTab.gui index 553e2d7c6..c1c6d37ed 100644 --- a/Templates/BaseGame/game/tools/riverEditor/RiverEditorSettingsTab.gui +++ b/Templates/BaseGame/game/tools/riverEditor/RiverEditorSettingsTab.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(RiverEditorSettingsTab,EditorGuiGroup) { +$guiContent = new GuiControl(RiverEditorSettingsTab,EditorGuiGroup) { isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/riverEditor/RiverEditorToolbar.gui b/Templates/BaseGame/game/tools/riverEditor/RiverEditorToolbar.gui index 141e577d1..f938acfdf 100644 --- a/Templates/BaseGame/game/tools/riverEditor/RiverEditorToolbar.gui +++ b/Templates/BaseGame/game/tools/riverEditor/RiverEditorToolbar.gui @@ -1,4 +1,4 @@ -%guiContent = new GuiControl(RiverEditorToolbar, EditorGuiGroup) { +$guiContent = new GuiControl(RiverEditorToolbar, EditorGuiGroup) { canSaveDynamicFields = "0"; internalName = "MeshRoadEditorToolbar"; Enabled = "1"; diff --git a/Templates/BaseGame/game/tools/roadEditor/RoadEditorGui.gui b/Templates/BaseGame/game/tools/roadEditor/RoadEditorGui.gui index 7f9eba0f6..93767d251 100644 --- a/Templates/BaseGame/game/tools/roadEditor/RoadEditorGui.gui +++ b/Templates/BaseGame/game/tools/roadEditor/RoadEditorGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiRoadEditorCtrl(RoadEditorGui) { +$guiContent = new GuiRoadEditorCtrl(RoadEditorGui) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/roadEditor/RoadEditorSettingsTab.gui b/Templates/BaseGame/game/tools/roadEditor/RoadEditorSettingsTab.gui index b37485cda..b2d2ae39a 100644 --- a/Templates/BaseGame/game/tools/roadEditor/RoadEditorSettingsTab.gui +++ b/Templates/BaseGame/game/tools/roadEditor/RoadEditorSettingsTab.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(RoadEditorSettingsTab,EditorGuiGroup) { +$guiContent = new GuiControl(RoadEditorSettingsTab,EditorGuiGroup) { isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/roadEditor/RoadEditorToolbar.gui b/Templates/BaseGame/game/tools/roadEditor/RoadEditorToolbar.gui index bfa2e0513..dbe3fdc8e 100644 --- a/Templates/BaseGame/game/tools/roadEditor/RoadEditorToolbar.gui +++ b/Templates/BaseGame/game/tools/roadEditor/RoadEditorToolbar.gui @@ -1,4 +1,4 @@ -%guiContent = new GuiControl(RoadEditorToolbar) { +$guiContent = new GuiControl(RoadEditorToolbar) { canSaveDynamicFields = "0"; internalName = "RoadEditorToolbar"; Enabled = "1"; diff --git a/Templates/BaseGame/game/tools/shapeEditor/gui/ShapeEditorSettingsTab.gui b/Templates/BaseGame/game/tools/shapeEditor/gui/ShapeEditorSettingsTab.gui index 1a455e9a6..e19052bc2 100644 --- a/Templates/BaseGame/game/tools/shapeEditor/gui/ShapeEditorSettingsTab.gui +++ b/Templates/BaseGame/game/tools/shapeEditor/gui/ShapeEditorSettingsTab.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ShapeEditorSettingsTab,EditorGuiGroup) { +$guiContent = new GuiControl(ShapeEditorSettingsTab,EditorGuiGroup) { isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/shapeEditor/gui/ShapeEditorToolbar.ed.gui b/Templates/BaseGame/game/tools/shapeEditor/gui/ShapeEditorToolbar.ed.gui index ccaaf03fb..cdb2c080c 100644 --- a/Templates/BaseGame/game/tools/shapeEditor/gui/ShapeEditorToolbar.ed.gui +++ b/Templates/BaseGame/game/tools/shapeEditor/gui/ShapeEditorToolbar.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ShapeEditorToolbar, EditorGuiGroup) { +$guiContent = new GuiControl(ShapeEditorToolbar, EditorGuiGroup) { canSaveDynamicFields = "0"; internalName = ""; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdAdvancedWindow.ed.gui b/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdAdvancedWindow.ed.gui index 405ce3ebc..ea2197bd3 100644 --- a/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdAdvancedWindow.ed.gui +++ b/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdAdvancedWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiWindowCollapseCtrl(ShapeEdAdvancedWindow, EditorGuiGroup) { +$guiContent = new GuiWindowCollapseCtrl(ShapeEdAdvancedWindow, EditorGuiGroup) { text = "Advanced Properties"; resizeWidth = "0"; resizeHeight = "0"; diff --git a/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdAnimWindow.ed.gui b/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdAnimWindow.ed.gui index 8785db315..a379cc533 100644 --- a/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdAnimWindow.ed.gui +++ b/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdAnimWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiWindowCtrl(ShapeEdAnimWindow) { +$guiContent = new GuiWindowCtrl(ShapeEdAnimWindow) { canSaveDynamicFields = "0"; isContainer = "1"; Profile = "ToolsGuiToolbarWindowProfile"; diff --git a/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdPreviewWindow.ed.gui b/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdPreviewWindow.ed.gui index 81b815d5c..65035d565 100644 --- a/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdPreviewWindow.ed.gui +++ b/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdPreviewWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl() { +$guiContent = new GuiControl() { canSaveDynamicFields = "0"; isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; diff --git a/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdPropWindow.ed.gui b/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdPropWindow.ed.gui index 52d581366..32e4da230 100644 --- a/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdPropWindow.ed.gui +++ b/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdPropWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiWindowCollapseCtrl(ShapeEdPropWindow) { +$guiContent = new GuiWindowCollapseCtrl(ShapeEdPropWindow) { canSaveDynamicFields = "0"; isContainer = "1"; Profile = "ToolsGuiWindowProfile"; diff --git a/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdSelectWindow.ed.gui b/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdSelectWindow.ed.gui index eb7a3225a..7b2fe0875 100644 --- a/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdSelectWindow.ed.gui +++ b/Templates/BaseGame/game/tools/shapeEditor/gui/shapeEdSelectWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl() { +$guiContent = new GuiControl() { canSaveDynamicFields = "0"; isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/AddFMODProjectDlg.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/AddFMODProjectDlg.ed.gui index 56c892fa9..b7bc1d86b 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/AddFMODProjectDlg.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/AddFMODProjectDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AddFMODProjectDlg,EditorGuiGroup) { +$guiContent = new GuiControl(AddFMODProjectDlg,EditorGuiGroup) { isContainer = "1"; Profile = "ToolsGuiOverlayProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/AxisGizmoSettingsTab.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/AxisGizmoSettingsTab.ed.gui index e5eba667e..08165a2ba 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/AxisGizmoSettingsTab.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/AxisGizmoSettingsTab.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AxisGizmoSettingsTab,EditorGuiGroup) { +$guiContent = new GuiControl(AxisGizmoSettingsTab,EditorGuiGroup) { isContainer = "1"; profile = "ToolsGuiDefaultProfile"; horizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/CameraSettingsTab.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/CameraSettingsTab.ed.gui index b267b25a6..969109a3b 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/CameraSettingsTab.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/CameraSettingsTab.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(CameraSettingsTab,EditorGuiGroup) { +$guiContent = new GuiControl(CameraSettingsTab,EditorGuiGroup) { isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/EditorChooseLevelGui.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/EditorChooseLevelGui.ed.gui index a384f59e7..a3eecd66b 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/EditorChooseLevelGui.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/EditorChooseLevelGui.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiContainer(EditorChooseLevelGui, EditorGuiGroup) { +$guiContent = new GuiContainer(EditorChooseLevelGui, EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; @@ -34,7 +34,7 @@ }; }; -%guiContent = new GuiContainer(EditorChooseLevelContainer, EditorGuiGroup) { +$guiContent = new GuiContainer(EditorChooseLevelContainer, EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui index c2330f6de..2223182c7 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiContainer(EditorGui,EditorGuiGroup) { +$guiContent = new GuiContainer(EditorGui,EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/EditorSettingsWindow.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/EditorSettingsWindow.ed.gui index 7662ecf00..97c607324 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/EditorSettingsWindow.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/EditorSettingsWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(EditorSettingsWindow,EditorGuiGroup) { +$guiContent = new GuiControl(EditorSettingsWindow,EditorGuiGroup) { isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/GeneralSettingsTab.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/GeneralSettingsTab.ed.gui index a49ab4064..933e42e8b 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/GeneralSettingsTab.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/GeneralSettingsTab.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(GeneralSettingsTab,EditorGuiGroup) { +$guiContent = new GuiControl(GeneralSettingsTab,EditorGuiGroup) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/GenericPromptDialog.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/GenericPromptDialog.ed.gui index ade528157..8ab2debf3 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/GenericPromptDialog.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/GenericPromptDialog.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(GenericPromptDialog) { +$guiContent = new GuiControl(GenericPromptDialog) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ManageBookmarksWindow.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ManageBookmarksWindow.ed.gui index c5f4ff469..d8cd38297 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ManageBookmarksWindow.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ManageBookmarksWindow.ed.gui @@ -1,4 +1,4 @@ -%guiContent = new GuiControl(ManageBookmarksContainer, EditorGuiGroup) { +$guiContent = new GuiControl(ManageBookmarksContainer, EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ManageSFXParametersWindow.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ManageSFXParametersWindow.ed.gui index 29c55dc74..d24407c8b 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ManageSFXParametersWindow.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ManageSFXParametersWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ManageSFXParametersContainer,EditorGuiGroup) { +$guiContent = new GuiControl(ManageSFXParametersContainer,EditorGuiGroup) { isContainer = "1"; Profile = "ToolsGuiModelessDialogProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ObjectEditorSettingsTab.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ObjectEditorSettingsTab.ed.gui index b8928eb7d..97382bb99 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ObjectEditorSettingsTab.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ObjectEditorSettingsTab.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ObjectEditorSettingsTab,EditorGuiGroup) { +$guiContent = new GuiControl(ObjectEditorSettingsTab,EditorGuiGroup) { isContainer = "1"; profile = "ToolsGuiDefaultProfile"; horizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ObjectSnapOptionsWindow.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ObjectSnapOptionsWindow.ed.gui index 9805d31dd..ec5165c1d 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ObjectSnapOptionsWindow.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ObjectSnapOptionsWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ObjectSnapOptionsContainer, EditorGuiGroup) { +$guiContent = new GuiControl(ObjectSnapOptionsContainer, EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; @@ -843,7 +843,7 @@ password = "0"; tabComplete = "0"; sinkAllKeyEvents = "0"; - passwordMask = "•"; + passwordMask = "�"; text = "2.0"; maxLength = "6"; margin = "0 0 0 0"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ProceduralTerrainPainterGui.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ProceduralTerrainPainterGui.gui index 452c23bf6..690d653fa 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ProceduralTerrainPainterGui.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ProceduralTerrainPainterGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ProceduralTerrainPainterGui) { +$guiContent = new GuiControl(ProceduralTerrainPainterGui) { canSaveDynamicFields = "0"; isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/SelectObjectsWindow.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/SelectObjectsWindow.ed.gui index 3e95e91d4..c7955d868 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/SelectObjectsWindow.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/SelectObjectsWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ESelectObjectsWindowContainer,EditorGuiGroup) { +$guiContent = new GuiControl(ESelectObjectsWindowContainer,EditorGuiGroup) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/TerrainBrushSoftnessCurveDlg.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/TerrainBrushSoftnessCurveDlg.ed.gui index 6fb188adf..f58b8fb6c 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/TerrainBrushSoftnessCurveDlg.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/TerrainBrushSoftnessCurveDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(TerrainBrushSoftnessCurveDlg, EditorGuiGroup) { +$guiContent = new GuiControl(TerrainBrushSoftnessCurveDlg, EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/TerrainEditToolbar.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/TerrainEditToolbar.ed.gui index cc9d6983b..2cf1d3ce5 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/TerrainEditToolbar.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/TerrainEditToolbar.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(EWTerrainEditToolbar,EditorGuiGroup) { +$guiContent = new GuiControl(EWTerrainEditToolbar,EditorGuiGroup) { canSaveDynamicFields = "0"; internalName = "TerrainEditToolbar"; Enabled = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/TerrainEditorSettingsTab.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/TerrainEditorSettingsTab.ed.gui index 8f219ec67..87cc92ff7 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/TerrainEditorSettingsTab.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/TerrainEditorSettingsTab.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(TerrainEditorSettingsTab,EditorGuiGroup) { +$guiContent = new GuiControl(TerrainEditorSettingsTab,EditorGuiGroup) { isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/TerrainPainterToolbar.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/TerrainPainterToolbar.ed.gui index ca4126330..5e25e475c 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/TerrainPainterToolbar.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/TerrainPainterToolbar.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(EWTerrainPainterToolbar,EditorGuiGroup) { +$guiContent = new GuiControl(EWTerrainPainterToolbar,EditorGuiGroup) { canSaveDynamicFields = "0"; internalName = "TerrainPainterToolbar"; Enabled = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/TerrainPainterWindow.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/TerrainPainterWindow.ed.gui index a08c05841..cb7f299d7 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/TerrainPainterWindow.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/TerrainPainterWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(TerrainPainterContainer,EditorGuiGroup) { +$guiContent = new GuiControl(TerrainPainterContainer,EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/TimeAdjustGui.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/TimeAdjustGui.ed.gui index 4b7b8a26e..96f64c447 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/TimeAdjustGui.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/TimeAdjustGui.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(TimeAdjustGui, EditorGuiGroup) { +$guiContent = new GuiControl(TimeAdjustGui, EditorGuiGroup) { isContainer = "1"; Profile = "ToolsGuiModelessDialogProfile"; HorizSizing = "right"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteWindow.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteWindow.ed.gui index b6b9c5507..491f7ad1b 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteWindow.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl() { +$guiContent = new GuiControl() { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsToolbar.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsToolbar.ed.gui index 1f15e5310..614db16e0 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsToolbar.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsToolbar.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiContainer(EWToolsToolbar) { +$guiContent = new GuiContainer(EWToolsToolbar) { canSaveDynamicFields = "0"; Enabled = "0"; internalName = "ToolsToolbar"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/TransformSelectionWindow.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/TransformSelectionWindow.ed.gui index 26324ea74..1d368b39b 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/TransformSelectionWindow.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/TransformSelectionWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(TransformSelectionContainer, EditorGuiGroup) { +$guiContent = new GuiControl(TransformSelectionContainer, EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/VisibilityLayerWindow.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/VisibilityLayerWindow.ed.gui index 6e65a2749..cff92d9ab 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/VisibilityLayerWindow.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/VisibilityLayerWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(VisibilityLayerContainer, EditorGuiGroup) { +$guiContent = new GuiControl(VisibilityLayerContainer, EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorInspectorWindow.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorInspectorWindow.ed.gui index 9abe8f9e3..bdfff71fb 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorInspectorWindow.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorInspectorWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl() { +$guiContent = new GuiControl() { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorToolbar.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorToolbar.ed.gui index f736e8555..aeb37db79 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorToolbar.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorToolbar.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(EWorldEditorToolbar, EditorGuiGroup) { +$guiContent = new GuiControl(EWorldEditorToolbar, EditorGuiGroup) { canSaveDynamicFields = "0"; internalName = "WorldEditorToolbar"; Enabled = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorTreeWindow.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorTreeWindow.ed.gui index 297336551..c74135219 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorTreeWindow.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorTreeWindow.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl() { +$guiContent = new GuiControl() { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/guiCreateNewTerrainGui.gui b/Templates/BaseGame/game/tools/worldEditor/gui/guiCreateNewTerrainGui.gui index 943e85185..41c9ed965 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/guiCreateNewTerrainGui.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/guiCreateNewTerrainGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(CreateNewTerrainGui, EditorGuiGroup) { +$guiContent = new GuiControl(CreateNewTerrainGui, EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainExportGui.gui b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainExportGui.gui index 411e74676..fd62d885a 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainExportGui.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainExportGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(TerrainExportGui, EditorGuiGroup) { +$guiContent = new GuiControl(TerrainExportGui, EditorGuiGroup) { canSaveDynamicFields = "0"; Profile = "ToolsGuiOverlayProfile"; Enabled = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainImportGui.gui b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainImportGui.gui index c013cba61..9055f4fdc 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainImportGui.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainImportGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(TerrainImportGui, EditorGuiGroup) { +$guiContent = new GuiControl(TerrainImportGui, EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui index 0d4339eae..57c9677e6 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(TerrainMaterialDlg,EditorGuiGroup) { +$guiContent = new GuiControl(TerrainMaterialDlg,EditorGuiGroup) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainTextureSettingsDlg.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainTextureSettingsDlg.ed.gui index 47c3549a2..f63f53614 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainTextureSettingsDlg.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainTextureSettingsDlg.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(TerrainTextureSettingsDlg, EditorGuiGroup) { +$guiContent = new GuiControl(TerrainTextureSettingsDlg, EditorGuiGroup) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/guiWorldEditorMissionInspector.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/guiWorldEditorMissionInspector.ed.gui index ab7bfe2f5..166db3024 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/guiWorldEditorMissionInspector.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/guiWorldEditorMissionInspector.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(WorldEditorMissionInspector,EditorGuiGroup) { +$guiContent = new GuiControl(WorldEditorMissionInspector,EditorGuiGroup) { canSaveDynamicFields = "0"; isContainer = "1"; Profile = "ToolsGuiDefaultProfile"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui index b486ca467..da4b05df3 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ObjectBuilderGui, EditorGuiGroup) { +$guiContent = new GuiControl(ObjectBuilderGui, EditorGuiGroup) { profile = "ToolsGuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/probeBakeDlg.gui b/Templates/BaseGame/game/tools/worldEditor/gui/probeBakeDlg.gui index ae952c9b8..cf4f2ad4b 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/probeBakeDlg.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/probeBakeDlg.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ProbeBakeDlg) { +$guiContent = new GuiControl(ProbeBakeDlg) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/shadowViz.gui b/Templates/BaseGame/game/tools/worldEditor/gui/shadowViz.gui index e130850bd..997d05417 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/shadowViz.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/shadowViz.gui @@ -4,7 +4,7 @@ //--------------------------------------------------------------------------------------------- //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(AL_ShadowVizOverlayCtrl) { +$guiContent = new GuiControl(AL_ShadowVizOverlayCtrl) { canSaveDynamicFields = "0"; isContainer = "1"; Profile = "GuiModelessDialogProfile"; diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript index ee4e7bfb2..1f5dc01f3 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript @@ -113,9 +113,9 @@ function EditorGui::init(%this) { // Load Terrain Painter GUI exec("~/worldEditor/gui/TerrainPainterWindow.ed.gui"); - if( isObject( %guiContent ) ){ - %this.add( %guiContent->TerrainPainter ); - %this.add( %guiContent->TerrainPainterPreview ); + if( isObject( $guiContent ) ){ + %this.add( $guiContent->TerrainPainter ); + %this.add( $guiContent->TerrainPainterPreview ); } exec("~/worldEditor/gui/guiTerrainMaterialDlg.ed.gui"); diff --git a/Templates/Modules/Verve/gui/VerveCinematic.gui b/Templates/Modules/Verve/gui/VerveCinematic.gui index f71a3171c..d12463244 100644 --- a/Templates/Modules/Verve/gui/VerveCinematic.gui +++ b/Templates/Modules/Verve/gui/VerveCinematic.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GameTSCtrl(VerveCinematicGui) { +$guiContent = new GameTSCtrl(VerveCinematicGui) { canSaveDynamicFields = "1"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/Modules/inputTest/scripts/gui/inputMonitor.gui b/Templates/Modules/inputTest/scripts/gui/inputMonitor.gui index e1549f06f..67708cf2e 100644 --- a/Templates/Modules/inputTest/scripts/gui/inputMonitor.gui +++ b/Templates/Modules/inputTest/scripts/gui/inputMonitor.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(InputMonitorDlg) { +$guiContent = new GuiControl(InputMonitorDlg) { position = "0 0"; extent = "1024 768"; minExtent = "8 8"; diff --git a/Templates/Modules/inputTest/scripts/gui/joystickSettings.gui b/Templates/Modules/inputTest/scripts/gui/joystickSettings.gui index d9b4d19a9..ca30235d4 100644 --- a/Templates/Modules/inputTest/scripts/gui/joystickSettings.gui +++ b/Templates/Modules/inputTest/scripts/gui/joystickSettings.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(JoystickSettingsDlg) { +$guiContent = new GuiControl(JoystickSettingsDlg) { position = "0 0"; extent = "1024 768"; minExtent = "8 8"; diff --git a/Templates/Modules/vr/guis/oculusVROverlay.gui b/Templates/Modules/vr/guis/oculusVROverlay.gui index 62a9f719c..d05852cbd 100644 --- a/Templates/Modules/vr/guis/oculusVROverlay.gui +++ b/Templates/Modules/vr/guis/oculusVROverlay.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = singleton GuiControl(OculusVROverlay) { +$guiContent = singleton GuiControl(OculusVROverlay) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; From b2bbd771f6ff751209ee753406692621f0a31641 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Tue, 4 May 2021 22:49:19 -0400 Subject: [PATCH 022/399] more torquescript template fixes. --- .../VPathEditor/GUI/VPathEditorPalette.gui | 2 +- .../Controller/VControllerProperties.tscript | 1 + .../Scripts/Groups/VDirectorGroup.tscript | 2 +- .../Scripts/Groups/VSceneObjectGroup.tscript | 2 +- .../Scripts/Groups/VSpawnSphereGroup.tscript | 2 +- .../assetBrowser/scripts/assetBrowser.tscript | 18 ++++++++++++ .../assetBrowser/scripts/assetImport.tscript | 3 ++ .../scripts/assetImportConfig.tscript | 2 ++ .../scripts/assetTypes/component.tscript | 2 +- .../scripts/assetTypes/cpp.tscript | 2 ++ .../scripts/assetTypes/level.tscript | 2 +- .../scripts/assetTypes/script.tscript | 3 +- .../scripts/assetTypes/stateMachine.tscript | 3 ++ .../scripts/directoryHandling.tscript | 2 +- .../assetBrowser/scripts/editAsset.tscript | 8 ++++-- .../interface/materialFieldType.tscript | 17 +++++++---- .../interface/stateMachineField.tscript | 2 +- .../interface/typeMaskFieldType.tscript | 4 +-- .../scripts/componentEditor.ed.tscript | 3 ++ .../convexEditor/convexEditorSidebarGui.gui | 2 +- .../datablockEditorUndo.tscript | 6 ++-- .../debugger/scripts/debugger.ed.tscript | 2 +- .../game/tools/decalEditor/decalEditorGui.gui | 8 ------ .../game/tools/forestEditor/brushes.tscript | 2 +- .../tools/gui/editorSettingsWindow.ed.tscript | 5 ++-- .../gui/fieldTypes/assetDependencies.tscript | 2 +- .../tools/gui/fieldTypes/buttonField.tscript | 2 +- .../tools/gui/fieldTypes/listField.tscript | 6 ++-- .../game/tools/gui/fieldTypes/range.tscript | 2 +- .../scripts/guiEditorProfiles.ed.tscript | 2 ++ .../scripts/guiEditorUndo.ed.tscript | 4 +++ .../gui/guiMaterialPropertiesWindow.ed.gui | 15 ---------- .../scripts/materialEditor.ed.tscript | 3 +- .../meshRoadEditor/meshRoadEditorGui.tscript | 2 +- .../particleEditor/ParticleEditor.ed.gui | 28 +++---------------- .../tools/roadEditor/roadEditorGui.tscript | 2 +- .../scripts/shapeEditor.ed.tscript | 4 ++- .../ConvexEditorPalette.ed.gui | 2 +- .../DecalEditorPalette.ed.gui | 2 +- .../ForestEditorPalette.ed.gui | 2 +- .../MeshRoadEditorPalette.ed.gui | 2 +- .../NavEditorPalette.ed.gui | 2 +- .../RiverEditorPalette.ed.gui | 2 +- .../RoadEditorPalette.ed.gui | 2 +- .../ShapeEditorPalette.ed.gui | 2 +- .../TerrainEditPalette.ed.gui | 2 +- .../TerrainPainterPalette.ed.gui | 2 +- .../WorldEditorPalette.ed.gui | 2 +- .../gui/ToolsPaletteGroups/init.tscript | 6 ++++ .../worldEditor/gui/guiTerrainExportGui.gui | 3 ++ .../worldEditor/gui/guiTerrainImportGui.gui | 5 ++++ .../worldEditor/scripts/EditorGui.ed.tscript | 2 +- .../ManageSFXParametersWindow.ed.tscript | 5 ++-- .../scripts/menuHandlers.ed.tscript | 1 + 54 files changed, 122 insertions(+), 99 deletions(-) diff --git a/Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditorPalette.gui b/Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditorPalette.gui index 94f8102dc..051bad2c5 100644 --- a/Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditorPalette.gui +++ b/Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditorPalette.gui @@ -3,7 +3,7 @@ // Copyright (C) - Violent Tulip //----------------------------------------------------------------------------- -%paletteId = new GuiControl(VPathEditorPalette) { +$paletteId = new GuiControl(VPathEditorPalette) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/VerveEditor/Scripts/Controller/VControllerProperties.tscript b/Templates/BaseGame/game/tools/VerveEditor/Scripts/Controller/VControllerProperties.tscript index b3bd39d5c..3fd8b8046 100644 --- a/Templates/BaseGame/game/tools/VerveEditor/Scripts/Controller/VControllerProperties.tscript +++ b/Templates/BaseGame/game/tools/VerveEditor/Scripts/Controller/VControllerProperties.tscript @@ -59,6 +59,7 @@ function VControllerPropertyList::InspectObject( %this, %object ) } %dataFieldCount = %object.getDataFieldCount(); + %dataFieldList = ""; for ( %i = 0; %i < %dataFieldCount; %i++ ) { // Add To List. diff --git a/Templates/BaseGame/game/tools/VerveEditor/Scripts/Groups/VDirectorGroup.tscript b/Templates/BaseGame/game/tools/VerveEditor/Scripts/Groups/VDirectorGroup.tscript index 9360f22d0..c47103b8f 100644 --- a/Templates/BaseGame/game/tools/VerveEditor/Scripts/Groups/VDirectorGroup.tscript +++ b/Templates/BaseGame/game/tools/VerveEditor/Scripts/Groups/VDirectorGroup.tscript @@ -22,7 +22,7 @@ function VDirectorGroup::PopulateBuildStack( %this, %stack ) function VDirectorGroup::ResolveBuildStack( %this, %stack ) { - Parent::ResolveBuildStack( %this, %stack, %groupObject ); + Parent::ResolveBuildStack( %this, %stack ); // Find the Track Toggle. %directorTrackCheckBox = %stack.findObjectByInternalName( "DirectorTrackToggle", true ); diff --git a/Templates/BaseGame/game/tools/VerveEditor/Scripts/Groups/VSceneObjectGroup.tscript b/Templates/BaseGame/game/tools/VerveEditor/Scripts/Groups/VSceneObjectGroup.tscript index 7483ea209..209c329fc 100644 --- a/Templates/BaseGame/game/tools/VerveEditor/Scripts/Groups/VSceneObjectGroup.tscript +++ b/Templates/BaseGame/game/tools/VerveEditor/Scripts/Groups/VSceneObjectGroup.tscript @@ -62,7 +62,7 @@ function VSceneObjectGroup::PopulateBuildStack( %this, %stack ) function VSceneObjectGroup::ResolveBuildStack( %this, %stack ) { - Parent::ResolveBuildStack( %this, %stack, %groupObject ); + Parent::ResolveBuildStack( %this, %stack ); // Fetch the Controller. %controller = %this.getRoot(); diff --git a/Templates/BaseGame/game/tools/VerveEditor/Scripts/Groups/VSpawnSphereGroup.tscript b/Templates/BaseGame/game/tools/VerveEditor/Scripts/Groups/VSpawnSphereGroup.tscript index cd2913ad9..de8280d60 100644 --- a/Templates/BaseGame/game/tools/VerveEditor/Scripts/Groups/VSpawnSphereGroup.tscript +++ b/Templates/BaseGame/game/tools/VerveEditor/Scripts/Groups/VSpawnSphereGroup.tscript @@ -31,7 +31,7 @@ function VSceneObjectGroup::PopulateBuildStack( %this, %stack ) function VSceneObjectGroup::ResolveBuildStack( %this, %stack ) { - VGroup::ResolveBuildStack( %this, %stack, %groupObject ); + VGroup::ResolveBuildStack( %this, %stack ); // Fetch the Controller. %controller = %this.getRoot(); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript index 3831adf2e..8596d4b0f 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript @@ -242,6 +242,8 @@ function AssetBrowser::selectAsset( %this, %asset ) //eval("materialEd_previewMaterial." @ %propertyField @ " = " @ %value @ ";"); if( AssetBrowser.returnType $= "name" ) { + // TODO! + %name = ""; eval( "" @ AssetBrowser.selectCallback @ "(" @ %name @ ");"); } else @@ -663,6 +665,7 @@ function AssetBrowser::loadDirectories( %this ) //Remove any modules that have no assets if we have that filter on if(%this.onlyShowModulesWithAssets) { + %modulesList = ModuleDatabase.findModules(); for(%i=0; %i < getWordCount(%modulesList); %i++) { %moduleName = getWord(%modulesList, %i).ModuleId; @@ -905,6 +908,8 @@ function AssetBrowser::addCreatorClass(%this, %class, %name, %buildfunc) if ( %name $= "" ) %name = %class; + // TODO + %group = ""; if ( %this.currentCreatorGroup !$= "" && %group $= "" ) %group = %this.currentCreatorGroup; @@ -1048,6 +1053,13 @@ function AssetBrowser::toggleTagFilterPopup(%this) //now, add the asset's category %assetType = AssetDatabase.getAssetCategory(%assetId); + // TODO? + %text = ""; + %var = ""; + %cmd = ""; + %textLength = strlen(%text); + // end todo + %checkBox = new GuiCheckBoxCtrl() { canSaveDynamicFields = "0"; @@ -1108,6 +1120,9 @@ function AssetBrowser::reImportAsset(%this) //if(%assetType $= "ImageAsset") // %filters = ""; + //TODO + %currentFile = ""; + %dlg = new OpenFileDialog() { Filters = "(All Files (*.*)|*.*|"; @@ -1412,10 +1427,13 @@ function AssetBrowser::doRebuildAssetArray(%this) AssetBrowser-->assetList.deleteAllObjects(); AssetPreviewArray.empty(); + // uhh?? I just added global schenanagins here to make this work + %assetArray = $AssetBrowser::AssetArray; if(isObject(%assetArray)) %assetArray.delete(); %assetArray = new ArrayObject(); + $AssetBrowser::AssetArray = %assetArray; //First, Query for our assets %assetQuery = new AssetQuery(); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.tscript index 152a4c78c..50ab94c6b 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.tscript @@ -277,6 +277,9 @@ function AssetBrowser::onDropFolder(%this, %filePath) //First, we wanna scan to see if we have modules to contend with. If we do, we'll just plunk them in wholesale //and not process their contents. + // TODO + %fileExt = ""; + //If not modules, it's likely an art pack or other mixed files, so we'll import them as normal if( (%fileExt $= ".png") || (%fileExt $= ".jpg") || (%fileExt $= ".bmp") || (%fileExt $= ".dds") ) %this.importAssetListArray.add("ImageAsset", %filePath); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.tscript index 97bd9b8db..6b52e7199 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.tscript @@ -142,6 +142,7 @@ function ImportAssetOptionsWindow::editImportSettings(%this, %assetItem) %filePath = %assetItem.filePath; %assetName = %assetItem.assetName; %assetConfigObj = %assetItem.importConfig; + %optionsObj = %assetItem.optionsObj; // TODO IS THIS RIGHT ImportOptionsList.startGroup("Asset"); ImportOptionsList.addField("AssetName", "Asset Name", "string", "", "NewAsset", "", %assetItem); @@ -405,6 +406,7 @@ function ImportAssetConfigEditorWindow::editConfig(%this) function ImportAssetConfigEditorWindow::deleteConfig(%this) { + %configList = ImportAssetConfigSettingsList; for(%i=0; %i < %configList.count(); %i++) { diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/component.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/component.tscript index 8d0b6eaee..c34eef551 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/component.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/component.tscript @@ -110,7 +110,7 @@ function AssetBrowser::renameComponentAsset(%this, %assetDef, %newAssetId, %orig %line = %file.readLine(); %line = trim( %line ); - %editedFileContents = %editedFileContents @ strreplace(%line, %originalAssetName, %newName) @ "\n"; + %editedFileContents = %editedFileContents @ strreplace(%line, %originalName, %newName) @ "\n"; } %file.close(); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cpp.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cpp.tscript index 4ae71361b..9d00caa05 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cpp.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cpp.tscript @@ -37,6 +37,8 @@ function AssetBrowser::createCpp(%this) TamlWrite(%asset, %tamlpath);*/ + %tamlpath = %assetPath @ %assetName @ ".asset.taml"; + %moduleDef = ModuleDatabase.findModule(%moduleName, 1); AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.tscript index d57f1594c..9a8f05783 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.tscript @@ -137,7 +137,7 @@ function AssetBrowser::buildLevelAssetPreview(%this, %assetDef, %previewData) %previewData.assetPath = %assetDef.getLevelPath(); %previewData.doubleClickCommand = "schedule( 1, 0, \"EditorOpenMission\", "@%assetDef@");"; - %levelPreviewImage = %assetDesc.PreviewImage; + %levelPreviewImage = %assetDef.PreviewImage; if(isFile(%levelPreviewImage)) %previewData.previewImage = %levelPreviewImage; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.tscript index c7a226d49..0ddd29944 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.tscript @@ -49,8 +49,7 @@ function AssetBrowser::importScriptAsset(%this, %assetId) function AssetBrowser::onScriptAssetEditorDropped(%this, %assetDef, %position) { - if(!isObject(%dropTarget)) - return; + } //Renames the asset diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/stateMachine.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/stateMachine.tscript index d55b926df..1e444bcf1 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/stateMachine.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/stateMachine.tscript @@ -86,6 +86,9 @@ function AssetBrowser::editStateMachineAsset(%this, %assetDef) function AssetBrowser::duplicateStateMachineAsset(%this, %assetDef) { + // TODO: + %targetModule = ""; + //Check if we have a target module, if not we need to select one if(%targetModule $= "") { diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.tscript index f40904ea8..10c75951f 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.tscript @@ -325,7 +325,7 @@ function directoryHandler::copyFolder(%this, %fromFolder, %toFolder) if(!%success) error("copyProjectFolder() - failed to copy file: " @ %file); - %file = findNextFileMultiExpr( %fullPath @ "/*.*" ); + %file = findNextFileMultiExpr( %fromFolder @ "/*.*" ); } //do sub directories diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript index 82385f25f..09117e16a 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript @@ -143,6 +143,10 @@ function AssetBrowser::performRenameAsset(%this, %originalAssetName, %newName) //Update the selection to immediately jump to the new asset AssetBrowser-->filterTree.clearSelection(); %ModuleItem = AssetBrowser-->filterTree.findItemByName(%moduleName); + + // TODO is this correct? + %assetType = %ModuleItem.getClassName(); + %assetTypeId = AssetBrowser-->filterTree.findChildItemByName(%ModuleItem, %assetType); AssetBrowser-->filterTree.selectItem(%assetTypeId); @@ -236,9 +240,9 @@ function moveAssetFile(%assetDef, %destinationPath) %assetPath = makeFullPath(AssetDatabase.getAssetFilePath(%assetDef.getAssetId())); %assetFilename = fileName(%assetPath); - %newAssetPath = %destination @ "/" @ %assetFilename; + %newAssetPath = %destinationPath @ "/" @ %assetFilename; - %copiedSuccess = pathCopy(%assetPath, %destination @ "/" @ %assetFilename); + %copiedSuccess = pathCopy(%assetPath, %destinationPath @ "/" @ %assetFilename); if(!%copiedSuccess) return ""; diff --git a/Templates/BaseGame/game/tools/componentEditor/interface/materialFieldType.tscript b/Templates/BaseGame/game/tools/componentEditor/interface/materialFieldType.tscript index aff83f5de..d2139d399 100644 --- a/Templates/BaseGame/game/tools/componentEditor/interface/materialFieldType.tscript +++ b/Templates/BaseGame/game/tools/componentEditor/interface/materialFieldType.tscript @@ -9,6 +9,13 @@ function GuiInspectorGroup::buildMaterialField(%this, %fieldName, %fieldLabel, % if(%currentMaterial $= "" || %currentMaterial == 0) %currentMaterial = %fieldDefaultVal; + // TODO? + %matName = ""; + %component = ""; + %material = ""; + %accessor = ""; + %precision = ""; + %container = new GuiControl() { canSaveDynamicFields = "0"; Profile = "EditorContainerProfile"; @@ -20,7 +27,7 @@ function GuiInspectorGroup::buildMaterialField(%this, %fieldName, %fieldLabel, % canSave = "0"; Visible = "1"; hovertime = "100"; - tooltip = %tooltip; + tooltip = "";// %tooltip; tooltipProfile = "EditorToolTipProfile"; }; @@ -35,7 +42,7 @@ function GuiInspectorGroup::buildMaterialField(%this, %fieldName, %fieldLabel, % canSave = "0"; Visible = "1"; hovertime = "100"; - tooltip = %tooltip; + tooltip = ""; //%tooltip; tooltipProfile = "EditorToolTipProfile"; text = %fieldName; maxLength = "1024"; @@ -57,7 +64,7 @@ function GuiInspectorGroup::buildMaterialField(%this, %fieldName, %fieldLabel, % text = %currentMaterial; }; }; - + %previewButton = new GuiBitmapButtonCtrl(){ internalName = %matName; HorizSizing = "right"; @@ -121,7 +128,7 @@ function GuiInspectorGroup::buildMaterialField(%this, %fieldName, %fieldLabel, % canSave = "0"; Visible = "1"; hovertime = "100"; - tooltip = %tooltip; + tooltip = ""; //%tooltip; tooltipProfile = "EditorToolTipProfile"; text = "Mapped to:" SPC %material.mapTo; maxLength = "1024"; @@ -140,7 +147,7 @@ function GuiInspectorGroup::buildMaterialField(%this, %fieldName, %fieldLabel, % canSave = "0"; Visible = "1"; hovertime = "100"; - tooltip = %tooltip; + tooltip = "";// %tooltip; tooltipProfile = "EditorToolTipProfile"; maxLength = "1024"; historySize = "0"; diff --git a/Templates/BaseGame/game/tools/componentEditor/interface/stateMachineField.tscript b/Templates/BaseGame/game/tools/componentEditor/interface/stateMachineField.tscript index 796c2486b..80c5723ed 100644 --- a/Templates/BaseGame/game/tools/componentEditor/interface/stateMachineField.tscript +++ b/Templates/BaseGame/game/tools/componentEditor/interface/stateMachineField.tscript @@ -201,7 +201,7 @@ function stateMachineFieldList::onSelect(%this) %index = %this.getParent().fieldID; %oldValue = %this.behavior.stateMachine.getValue(%index); - %this.behavior.stateMachine.setValue(%fieldType SPC %oldValue.y); + %this.behavior.stateMachine.setValue(%this.fieldType SPC %oldValue.y); %this.getParent().add(%fieldCtrl); } diff --git a/Templates/BaseGame/game/tools/componentEditor/interface/typeMaskFieldType.tscript b/Templates/BaseGame/game/tools/componentEditor/interface/typeMaskFieldType.tscript index 83cb55a6f..3b7710ad7 100644 --- a/Templates/BaseGame/game/tools/componentEditor/interface/typeMaskFieldType.tscript +++ b/Templates/BaseGame/game/tools/componentEditor/interface/typeMaskFieldType.tscript @@ -13,7 +13,7 @@ function GuiInspectorComponentGroup::buildTypeMaskField(%this, %component, %fiel canSave = "0"; Visible = "1"; hovertime = "100"; - tooltip = %tooltip; + tooltip = "";//%tooltip; tooltipProfile = "EditorToolTipProfile"; }; @@ -28,7 +28,7 @@ function GuiInspectorComponentGroup::buildTypeMaskField(%this, %component, %fiel canSave = "0"; Visible = "1"; hovertime = "100"; - tooltip = %tooltip; + tooltip = "";//%tooltip; tooltipProfile = "EditorToolTipProfile"; text = %fieldName; maxLength = "1024"; diff --git a/Templates/BaseGame/game/tools/componentEditor/scripts/componentEditor.ed.tscript b/Templates/BaseGame/game/tools/componentEditor/scripts/componentEditor.ed.tscript index c136bb4bf..b9b7d2850 100644 --- a/Templates/BaseGame/game/tools/componentEditor/scripts/componentEditor.ed.tscript +++ b/Templates/BaseGame/game/tools/componentEditor/scripts/componentEditor.ed.tscript @@ -159,6 +159,9 @@ function QuickEditComponentList::onHotTrackItem( %this, %itemID ) { %name = getField(%componentObj.getComponentField(%i), 0); + // TODO: + %description = ""; + SuperTooltipDlg.addParam(%name, %description @ "\n"); } %position = %this.getGlobalPosition(); diff --git a/Templates/BaseGame/game/tools/convexEditor/convexEditorSidebarGui.gui b/Templates/BaseGame/game/tools/convexEditor/convexEditorSidebarGui.gui index 8fbc97464..99d9b1852 100644 --- a/Templates/BaseGame/game/tools/convexEditor/convexEditorSidebarGui.gui +++ b/Templates/BaseGame/game/tools/convexEditor/convexEditorSidebarGui.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContnt = new GuiControl(ConvexEditorOptions) +$guiContnt = new GuiControl(ConvexEditorOptions) { position = "0 0"; extent = "800 600"; diff --git a/Templates/BaseGame/game/tools/datablockEditor/datablockEditorUndo.tscript b/Templates/BaseGame/game/tools/datablockEditor/datablockEditorUndo.tscript index f9a8d30b4..d3630c9e8 100644 --- a/Templates/BaseGame/game/tools/datablockEditor/datablockEditorUndo.tscript +++ b/Templates/BaseGame/game/tools/datablockEditor/datablockEditorUndo.tscript @@ -79,7 +79,7 @@ function ActionCreateDatablock::redo( %this ) %this.editor.selectDatablock( %db ); %this.editor.flagInspectorAsDirty( true ); - UnlistedDatablocks.remove( %id ); + UnlistedDatablocks.remove( %db ); } //--------------------------------------------------------------------------------------------- @@ -99,7 +99,7 @@ function ActionCreateDatablock::undo( %this ) %this.dbName = %db.name; %db.name = ""; - UnlistedDatablocks.add( %this.db ); + UnlistedDatablocks.add( %db ); } //============================================================================================= @@ -155,5 +155,5 @@ function ActionDeleteDatablock::undo( %this ) // Remove from unlisted. - UnlistedDatablocks.remove( %id ); + UnlistedDatablocks.remove( %db ); } diff --git a/Templates/BaseGame/game/tools/debugger/scripts/debugger.ed.tscript b/Templates/BaseGame/game/tools/debugger/scripts/debugger.ed.tscript index 408de29eb..0c17b8ccb 100644 --- a/Templates/BaseGame/game/tools/debugger/scripts/debugger.ed.tscript +++ b/Templates/BaseGame/game/tools/debugger/scripts/debugger.ed.tscript @@ -430,7 +430,7 @@ function DbgRemoveBreakPoint(%file, %line) function DbgDeleteSelectedBreak() { %selectedBreak = DebuggerBreakPoints.getSelectedId(); - %rowNum = DebuggerBreakPoints.getRowNumById(%selectedWatch); + %rowNum = DebuggerBreakPoints.getRowNumById(%selectedBreak); if (%rowNum >= 0) { %breakText = DebuggerBreakPoints.getRowText(%rowNum); %breakLine = getField(%breakText, 0); diff --git a/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.gui b/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.gui index 816bb0cc2..46291615a 100644 --- a/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.gui +++ b/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.gui @@ -472,8 +472,6 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) { Margin = "0 0 0 -3"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -552,8 +550,6 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) { Margin = "0 0 0 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -716,8 +712,6 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) { Margin = "0 0 0 -3"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -796,8 +790,6 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) { Margin = "0 0 0 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiInspector(DecalInspector) { StackingType = "Vertical"; diff --git a/Templates/BaseGame/game/tools/forestEditor/brushes.tscript b/Templates/BaseGame/game/tools/forestEditor/brushes.tscript index 2146c2e34..8b2735ccf 100644 --- a/Templates/BaseGame/game/tools/forestEditor/brushes.tscript +++ b/Templates/BaseGame/game/tools/forestEditor/brushes.tscript @@ -20,6 +20,6 @@ // IN THE SOFTWARE. //----------------------------------------------------------------------------- -%forestBrushesGroup = new SimGroup( ForestBrushGroup ) +$forestBrushesGroup = new SimGroup( ForestBrushGroup ) { }; \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript index 55842264c..a1604b005 100644 --- a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript +++ b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript @@ -233,7 +233,7 @@ function GuiInspectorVariableGroup::buildOptionsSettingField(%this, %fieldName, canSave = "1"; Visible = "1"; tooltipprofile = "ToolsGuiToolTipProfile"; - tooltip = %tooltip; + tooltip = "";//%tooltip; text = %fieldDefaultVal; hovertime = "1000"; ownerObject = %ownerObj; @@ -492,7 +492,8 @@ function ESettingsWindow::getAssetManagementSettings(%this) function ESettingsWindow::getAssetEditingSettings(%this) { ImportAssetWindow::reloadImportOptionConfigs(); - + %formattedConfigList = ""; + for(%i=0; %i < ImportAssetWindow.importConfigsList.Count(); %i++) { %configName = ImportAssetWindow.importConfigsList.getKey(%i); diff --git a/Templates/BaseGame/game/tools/gui/fieldTypes/assetDependencies.tscript b/Templates/BaseGame/game/tools/gui/fieldTypes/assetDependencies.tscript index 3aaf4f73a..b0f8e5a45 100644 --- a/Templates/BaseGame/game/tools/gui/fieldTypes/assetDependencies.tscript +++ b/Templates/BaseGame/game/tools/gui/fieldTypes/assetDependencies.tscript @@ -34,7 +34,7 @@ function GuiInspectorVariableGroup::buildAssetDependenciesField(%this, %fieldNam canSave = "1"; Visible = "1"; tooltipprofile = "ToolsGuiToolTipProfile"; - tooltip = %tooltip; + tooltip = "";// %tooltip; text = %fieldDefaultVal; hovertime = "1000"; ownerObject = %ownerObj; diff --git a/Templates/BaseGame/game/tools/gui/fieldTypes/buttonField.tscript b/Templates/BaseGame/game/tools/gui/fieldTypes/buttonField.tscript index c0a2392a2..e2f680d05 100644 --- a/Templates/BaseGame/game/tools/gui/fieldTypes/buttonField.tscript +++ b/Templates/BaseGame/game/tools/gui/fieldTypes/buttonField.tscript @@ -33,7 +33,7 @@ function GuiInspectorVariableGroup::buildButtonField(%this, %fieldName, %fieldLa canSave = "1"; Visible = "1"; tooltipprofile = "ToolsGuiToolTipProfile"; - tooltip = %tooltip; + tooltip = "";// %tooltip; text = %fieldName; hovertime = "1000"; command = %fieldDataVals; diff --git a/Templates/BaseGame/game/tools/gui/fieldTypes/listField.tscript b/Templates/BaseGame/game/tools/gui/fieldTypes/listField.tscript index d636641af..c26f3638d 100644 --- a/Templates/BaseGame/game/tools/gui/fieldTypes/listField.tscript +++ b/Templates/BaseGame/game/tools/gui/fieldTypes/listField.tscript @@ -22,7 +22,7 @@ function GuiInspectorVariableGroup::buildListField(%this, %fieldName, %fieldLabe canSave = "0"; Visible = "1"; hovertime = "100"; - tooltip = %tooltip; + tooltip = ""; ///%tooltip; tooltipProfile = "EditorToolTipProfile"; }; @@ -37,7 +37,7 @@ function GuiInspectorVariableGroup::buildListField(%this, %fieldName, %fieldLabe canSave = "0"; Visible = "1"; hovertime = "100"; - tooltip = %tooltip; + tooltip = ""; //%tooltip; tooltipProfile = "EditorToolTipProfile"; text = %fieldLabel; maxLength = "1024"; @@ -66,7 +66,7 @@ function GuiInspectorVariableGroup::buildListField(%this, %fieldName, %fieldLabe canSave = "1"; Visible = "1"; tooltipprofile = "ToolsGuiToolTipProfile"; - tooltip = %tooltip; + tooltip = ""; //%tooltip; text = %fieldDefaultVal; hovertime = "1000"; ownerObject = %ownerObj; diff --git a/Templates/BaseGame/game/tools/gui/fieldTypes/range.tscript b/Templates/BaseGame/game/tools/gui/fieldTypes/range.tscript index 35e55bfe7..efa78ca46 100644 --- a/Templates/BaseGame/game/tools/gui/fieldTypes/range.tscript +++ b/Templates/BaseGame/game/tools/gui/fieldTypes/range.tscript @@ -76,7 +76,7 @@ function GuiInspectorVariableGroup::buildRangeField(%this, %fieldName, %fieldLab Visible = "1"; Command = "$thisControl.onDragComplete();"; tooltipprofile = "GuiToolTipProfile"; - tooltip = %tooltip; + tooltip = ""; //%tooltip; hovertime = "1000"; canSaveDynamicFields = "0"; ownerObject = %ownerObj; diff --git a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorProfiles.ed.tscript b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorProfiles.ed.tscript index 433f103ae..e2a16756d 100644 --- a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorProfiles.ed.tscript +++ b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorProfiles.ed.tscript @@ -69,6 +69,8 @@ function GuiEditor::createNewProfile( %this, %name, %copySource ) function GuiEditor::getProfileCategory( %this, %profile ) { + // TODO + %name = ""; if( %this.isDefaultProfile( %name ) ) return "Default"; else if( %profile.category !$= "" ) diff --git a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorUndo.ed.tscript b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorUndo.ed.tscript index fad91557e..f28a26109 100644 --- a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorUndo.ed.tscript +++ b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorUndo.ed.tscript @@ -364,6 +364,10 @@ function GenericUndoAction::learn(%this, %object) %oldFieldNames = %this.fieldNames[%object]; %numNewFields = getWordCount(%newFieldNames); %numOldFields = getWordCount(%oldFieldNames); + + %newNullFields = ""; + %oldNullFields = ""; + // compare the old field list to the new field list. // if a field is on the old list that isn't on the new list, // add it to the newNullFields list. diff --git a/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui b/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui index 93a1f190f..068ca15ee 100644 --- a/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui +++ b/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui @@ -233,8 +233,6 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { Margin = "4 4 4 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -543,9 +541,6 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { Margin = "4 4 4 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -1923,8 +1918,6 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { Margin = "4 4 4 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -2623,8 +2616,6 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { Margin = "-1 0 0 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -3100,8 +3091,6 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { Margin = "-1 0 0 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -3373,8 +3362,6 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { Margin = "-1 0 0 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -4191,8 +4178,6 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { Margin = "4 4 4 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; diff --git a/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript b/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript index bcb2b2c29..84b345299 100644 --- a/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript +++ b/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript @@ -1496,7 +1496,8 @@ function MaterialEditorGui::updateAnimationFlags(%this) { MaterialEditorGui.setMaterialDirty(); %single = true; - + %flags = ""; + if(MaterialEditorPropertiesWindow-->RotationAnimation.getValue() == true) { if(%single == true) diff --git a/Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditorGui.tscript b/Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditorGui.tscript index 3fcfd528f..0c8533875 100644 --- a/Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditorGui.tscript +++ b/Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditorGui.tscript @@ -136,7 +136,7 @@ function MeshRoadEditorGui::editNodeDetails( %this ) function MeshRoadEditorGui::onBrowseClicked( %this ) { - //%filename = RETextureFileCtrl.getText(); + %filename = RETextureFileCtrl.getText(); %dlg = new OpenFileDialog() { diff --git a/Templates/BaseGame/game/tools/particleEditor/ParticleEditor.ed.gui b/Templates/BaseGame/game/tools/particleEditor/ParticleEditor.ed.gui index 9cd6f594c..6b7ab94a5 100644 --- a/Templates/BaseGame/game/tools/particleEditor/ParticleEditor.ed.gui +++ b/Templates/BaseGame/game/tools/particleEditor/ParticleEditor.ed.gui @@ -271,8 +271,6 @@ $guiContent = new GuiWindowCollapseCtrl(PE_Window) { Margin = "4 4 4 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -584,8 +582,6 @@ $guiContent = new GuiWindowCollapseCtrl(PE_Window) { Margin = "4 4 4 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -826,9 +822,7 @@ $guiContent = new GuiWindowCollapseCtrl(PE_Window) { Margin = "4 4 4 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; - + new GuiStackControl() { StackingType = "Vertical"; HorizStacking = "Left to Right"; @@ -1272,8 +1266,6 @@ $guiContent = new GuiWindowCollapseCtrl(PE_Window) { Margin = "4 4 4 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -1359,7 +1351,7 @@ $guiContent = new GuiWindowCollapseCtrl(PE_Window) { MinExtent = "8 2"; canSave = "1"; Visible = "1"; - Command = "%particleId = PEE_EmitterParticle2-->PopUpMenu.findText( \"None\" ); PEE_EmitterParticle2-->PopUpMenu.setSelected( %particleId );PE_EmitterEditor.updateParticlesFields();"; + Command = "$_particleId = PEE_EmitterParticle2-->PopUpMenu.findText( \"None\" ); PEE_EmitterParticle2-->PopUpMenu.setSelected( $_particleId );PE_EmitterEditor.updateParticlesFields();"; hovertime = "1000"; tooltip = "Clear Particle 2 from Emitter"; text = ""; @@ -1407,7 +1399,7 @@ $guiContent = new GuiWindowCollapseCtrl(PE_Window) { MinExtent = "8 2"; canSave = "1"; Visible = "1"; - Command = "%particleId = PEE_EmitterParticle3-->PopUpMenu.findText( \"None\" ); PEE_EmitterParticle3-->PopUpMenu.setSelected( %particleId );PE_EmitterEditor.updateParticlesFields();"; + Command = "$_particleId = PEE_EmitterParticle3-->PopUpMenu.findText( \"None\" ); PEE_EmitterParticle3-->PopUpMenu.setSelected( $_particleId );PE_EmitterEditor.updateParticlesFields();"; hovertime = "1000"; tooltip = "Clear Particle 3 from Emitter"; text = ""; @@ -1455,7 +1447,7 @@ $guiContent = new GuiWindowCollapseCtrl(PE_Window) { MinExtent = "8 2"; canSave = "1"; Visible = "1"; - Command = "%particleId = PEE_EmitterParticle4-->PopUpMenu.findText( \"None\" ); PEE_EmitterParticle4-->PopUpMenu.setSelected( %particleId );PE_EmitterEditor.updateParticlesFields();"; + Command = "$_particleId = PEE_EmitterParticle4-->PopUpMenu.findText( \"None\" ); PEE_EmitterParticle4-->PopUpMenu.setSelected( $_particleId );PE_EmitterEditor.updateParticlesFields();"; hovertime = "1000"; tooltip = "Clear Particle 4 from Emitter"; text = ""; @@ -1479,8 +1471,6 @@ $guiContent = new GuiWindowCollapseCtrl(PE_Window) { Margin = "4 4 4 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -1933,8 +1923,6 @@ $guiContent = new GuiWindowCollapseCtrl(PE_Window) { Margin = "4 4 4 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -2233,8 +2221,6 @@ $guiContent = new GuiWindowCollapseCtrl(PE_Window) { Margin = "4 4 4 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -2518,8 +2504,6 @@ $guiContent = new GuiWindowCollapseCtrl(PE_Window) { Margin = "4 4 4 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -2720,8 +2704,6 @@ $guiContent = new GuiWindowCollapseCtrl(PE_Window) { Margin = "4 4 4 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; @@ -2865,8 +2847,6 @@ $guiContent = new GuiWindowCollapseCtrl(PE_Window) { Margin = "4 4 4 0"; DragSizable = false; container = true; - parentRollout = %this.rollout; - object = %behavior; new GuiStackControl() { StackingType = "Vertical"; diff --git a/Templates/BaseGame/game/tools/roadEditor/roadEditorGui.tscript b/Templates/BaseGame/game/tools/roadEditor/roadEditorGui.tscript index acaad89b8..115da9d5c 100644 --- a/Templates/BaseGame/game/tools/roadEditor/roadEditorGui.tscript +++ b/Templates/BaseGame/game/tools/roadEditor/roadEditorGui.tscript @@ -138,7 +138,7 @@ function RoadEditorGui::editNodeDetails( %this ) function RoadEditorGui::onBrowseClicked( %this ) { - //%filename = RETextureFileCtrl.getText(); + %filename = RETextureFileCtrl.getText(); %dlg = new OpenFileDialog() { diff --git a/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.tscript b/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.tscript index 6959226c0..9067b5bcd 100644 --- a/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.tscript +++ b/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.tscript @@ -1439,6 +1439,8 @@ function ShapeEdPropWindow::update_onSequenceBlendChanged( %this, %seqName, %ble %proxyName = ShapeEditor.getProxyName( %seqName ); if ( ShapeEditor.shape.getSequenceIndex( %proxyName ) != -1 ) { + //TODO + %oldBlend = false; if ( %blend && %oldBlend ) ShapeEditor.shape.setSequenceBlend( %proxyName, false, %oldBlendSeq, %oldBlendFrame ); ShapeEditor.shape.setSequenceBlend( %proxyName, %blend, %blendSeq, %blendFrame ); @@ -2217,7 +2219,7 @@ function ShapeEdTriggerList::updateItem( %this, %oldFrame, %oldState, %frame, %s if ( %frame != %oldFrame ) { %pos = ShapeEdAnimWindow.getTimelineBitmapPos( ShapeEdAnimWindow-->seqIn.getText() + %frame, 2 ); - eval( "%ctrl = ShapeEdAnimWindow-->trigger" @ %updatedId @ ";" ); + %ctrl = eval( "return ShapeEdAnimWindow-->trigger" @ %updatedId @ ";" ); %ctrl.position = %pos SPC "0"; } } diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/ConvexEditorPalette.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/ConvexEditorPalette.ed.gui index e32cdfb4a..9453ae0e9 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/ConvexEditorPalette.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/ConvexEditorPalette.ed.gui @@ -1,4 +1,4 @@ -%paletteId = new GuiControl(ConvexEditorPalette, EditorGuiGroup) { +$paletteId = new GuiControl(ConvexEditorPalette, EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/DecalEditorPalette.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/DecalEditorPalette.ed.gui index 1e4053c8e..863eb1e68 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/DecalEditorPalette.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/DecalEditorPalette.ed.gui @@ -1,4 +1,4 @@ -%paletteId = new GuiControl(DecalEditorPalette,EditorGuiGroup) { +$paletteId = new GuiControl(DecalEditorPalette,EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/ForestEditorPalette.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/ForestEditorPalette.ed.gui index a1cc96ef5..4e5976fb3 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/ForestEditorPalette.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/ForestEditorPalette.ed.gui @@ -1,4 +1,4 @@ -%paletteId = new GuiControl(ForestEditorPalette,EditorGuiGroup) { +$paletteId = new GuiControl(ForestEditorPalette,EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/MeshRoadEditorPalette.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/MeshRoadEditorPalette.ed.gui index b005ac958..63a1e7acb 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/MeshRoadEditorPalette.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/MeshRoadEditorPalette.ed.gui @@ -1,4 +1,4 @@ -%paletteId = new GuiControl(MeshRoadEditorPalette,EditorGuiGroup) { +$paletteId = new GuiControl(MeshRoadEditorPalette,EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/NavEditorPalette.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/NavEditorPalette.ed.gui index a18e3f4ba..c275e30f1 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/NavEditorPalette.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/NavEditorPalette.ed.gui @@ -1,4 +1,4 @@ -%paletteId = new GuiControl(NavEditorPalette,EditorGuiGroup) { +$paletteId = new GuiControl(NavEditorPalette,EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/RiverEditorPalette.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/RiverEditorPalette.ed.gui index 5fea48b1b..1b86bc1bd 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/RiverEditorPalette.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/RiverEditorPalette.ed.gui @@ -1,4 +1,4 @@ -%paletteId = new GuiControl(RiverEditorPalette,EditorGuiGroup) { +$paletteId = new GuiControl(RiverEditorPalette,EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/RoadEditorPalette.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/RoadEditorPalette.ed.gui index 712ea774f..787f93050 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/RoadEditorPalette.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/RoadEditorPalette.ed.gui @@ -1,4 +1,4 @@ -%paletteId = new GuiControl(RoadEditorPalette,EditorGuiGroup) { +$paletteId = new GuiControl(RoadEditorPalette,EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/ShapeEditorPalette.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/ShapeEditorPalette.ed.gui index e8dfaf0e9..6c93bfa63 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/ShapeEditorPalette.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/ShapeEditorPalette.ed.gui @@ -1,4 +1,4 @@ -%paletteId = new GuiControl(ShapeEditorPalette,EditorGuiGroup) { +$paletteId = new GuiControl(ShapeEditorPalette,EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/TerrainEditPalette.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/TerrainEditPalette.ed.gui index 0ab8f2b1e..1b9e241a4 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/TerrainEditPalette.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/TerrainEditPalette.ed.gui @@ -1,4 +1,4 @@ -%paletteId = new GuiControl(TerrainEditorPalette,EditorGuiGroup) { +$paletteId = new GuiControl(TerrainEditorPalette,EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/TerrainPainterPalette.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/TerrainPainterPalette.ed.gui index 091f7a1c0..9e48b7fd2 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/TerrainPainterPalette.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/TerrainPainterPalette.ed.gui @@ -1,4 +1,4 @@ -%paletteId = new GuiControl(TerrainPainterPalette,EditorGuiGroup) { +$paletteId = new GuiControl(TerrainPainterPalette,EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/WorldEditorPalette.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/WorldEditorPalette.ed.gui index 421b52fe4..9c0b9ef6a 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/WorldEditorPalette.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/WorldEditorPalette.ed.gui @@ -1,4 +1,4 @@ -%paletteId = new GuiControl(WorldEditorInspectorPalette, EditorGuiGroup) { +$paletteId = new GuiControl(WorldEditorInspectorPalette, EditorGuiGroup) { canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/init.tscript b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/init.tscript index 637739745..86bc5b551 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/init.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/init.tscript @@ -30,6 +30,9 @@ function EWToolsPaletteWindow::loadToolsPalettes() exec( %file ); %paletteGroup = 0; + // TODO + %paletteId = 0; + %i = %paletteId.getCount(); for( ; %i != 0; %i--) { @@ -49,6 +52,9 @@ function EWToolsPaletteWindow::loadToolsPalettes() exec( %file ); %paletteGroup = 0; + // TODO + %paletteId = 0; + %i = %paletteId.getCount(); for( ; %i != 0; %i--) { diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainExportGui.gui b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainExportGui.gui index fd62d885a..0953e8620 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainExportGui.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainExportGui.gui @@ -288,6 +288,9 @@ function TerrainExportGui::selectFolder( %this ) function TerrainExportGui::doOpenDialog( %this, %filter, %callback ) { + // TODO + %currentFile = ""; + %dlg = new OpenFolderDialog() { Title = "Select Export Folder"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainImportGui.gui b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainImportGui.gui index 9055f4fdc..d1bfe1ded 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainImportGui.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainImportGui.gui @@ -508,6 +508,8 @@ function TerrainImportGui::acceptSettings( %this ) AssetBrowser.newAssetSettings.opacityList = %this-->OpacityLayerTextList; + %opacityList = %this-->OpacityLayerTextList; + for( %i = 0; %i < %opacityList.rowCount(); %i++ ) { %itemText = %opacityList.getRowTextById( %i ); @@ -535,6 +537,9 @@ function TerrainImportGui::cancel( %this ) function TerrainImportGui::doOpenDialog( %this, %filter, %callback ) { + // TODO + %currentFile = ""; + %dlg = new OpenFileDialog() { Filters = %filter; diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript index 1f5dc01f3..e1f73155c 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript @@ -399,7 +399,7 @@ function EditorGui::addToToolsToolbar( %this, %pluginName, %internalName, %bitma Visible = "1"; Command = "EditorGui.setEditor(" @ %pluginName @ ");"; tooltipprofile = "ToolsGuiToolTipProfile"; - ToolTip = %tooltip; + ToolTip = "";// %tooltip; hovertime = "750"; bitmap = %bitmap; buttonType = "RadioButton"; diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/ManageSFXParametersWindow.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/ManageSFXParametersWindow.ed.tscript index f788c7edb..e005c4c3e 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/ManageSFXParametersWindow.ed.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/ManageSFXParametersWindow.ed.tscript @@ -137,8 +137,7 @@ function EManageSFXParameters::onVisible( %this, %value ) if( %value ) { // Schedule an update. - - %this.schedule( %SFX_PARAMETERS_UPDATE_INTERVAL, "update" ); + %this.schedule( $SFX_PARAMETERS_UPDATE_INTERVAL, "update" ); } } @@ -770,7 +769,7 @@ function EManageSFXParameters::addParameter( %this, %parameter ) // Set the fields to reflect the parameter's current settings. - %ctrl-->valueField.setValue( %paramter.value ); + %ctrl-->valueField.setValue( %parameter.value ); %ctrl-->rangeMinField.setText( %parameter.range.x ); %ctrl-->rangeMaxField.setText( %parameter.range.y ); %ctrl-->defaultField.setValue( %parameter.defaultValue ); diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript index 3fb4b1652..8a874e613 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript @@ -871,6 +871,7 @@ function EditorToolsMenu::onSelectItem(%this, %id) { %toolName = getField( %this.item[%id], 2 ); + %paletteName = ""; EditorGui.setEditor(%toolName, %paletteName ); %this.checkRadioItem(0, %this.getItemCount(), %id); From 8fc0db21c14c76d36ded517278126460230d7bdc Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Fri, 18 Jun 2021 18:52:41 -0400 Subject: [PATCH 023/399] Small fixes for the script interpreter. --- Engine/source/console/compiledEval.cpp | 14 +++++++------- Engine/source/console/simManager.cpp | 4 ++-- Engine/source/console/test/ScriptTest.cpp | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index b02f2f8fd..061484659 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -518,17 +518,17 @@ TORQUE_NOINLINE void doSlowMathOp() // Logical if constexpr (Op == FloatOperation::LT) - stack[_STK - 1].setFastInt(a.getFloat() < b.getFloat()); + stack[_STK - 1].setInt(a.getFloat() < b.getFloat()); if constexpr (Op == FloatOperation::LE) - stack[_STK - 1].setFastInt(a.getFloat() <= b.getFloat()); + stack[_STK - 1].setInt(a.getFloat() <= b.getFloat()); if constexpr (Op == FloatOperation::GR) - stack[_STK - 1].setFastInt(a.getFloat() > b.getFloat()); + stack[_STK - 1].setInt(a.getFloat() > b.getFloat()); if constexpr (Op == FloatOperation::GE) - stack[_STK - 1].setFastInt(a.getFloat() >= b.getFloat()); + stack[_STK - 1].setInt(a.getFloat() >= b.getFloat()); if constexpr (Op == FloatOperation::EQ) - stack[_STK - 1].setFastInt(a.getFloat() == b.getFloat()); + stack[_STK - 1].setInt(a.getFloat() == b.getFloat()); if constexpr (Op == FloatOperation::NE) - stack[_STK - 1].setFastInt(a.getFloat() != b.getFloat()); + stack[_STK - 1].setInt(a.getFloat() != b.getFloat()); _STK--; } @@ -1276,7 +1276,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa _STK++; // Not nice but works. } - returnValue.setString(stack[_STK].getString()); + returnValue = std::move(stack[_STK]); _STK--; goto execFinished; diff --git a/Engine/source/console/simManager.cpp b/Engine/source/console/simManager.cpp index 7aaf773e6..c8fb60c7f 100644 --- a/Engine/source/console/simManager.cpp +++ b/Engine/source/console/simManager.cpp @@ -389,14 +389,14 @@ SimObject* findObject(const char* name) SimObject* findObject(const ConsoleValue &val) { if (val.getType() == ConsoleValueType::cvInteger) - return findObject((SimObjectId)val.getInt()); + return findObject((SimObjectId)val.getFastInt()); return findObject(val.getString()); } SimObject* findObject(ConsoleValue* val) { if (val->getType() == ConsoleValueType::cvInteger) - return findObject((SimObjectId)val->getInt()); + return findObject((SimObjectId)val->getFastInt()); return findObject(val->getString()); } diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index ecc974d2f..ccde5439f 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -410,14 +410,14 @@ TEST(Script, ForEachLoop) TEST(Script, TorqueScript_Array_Testing) { ConsoleValue value = RunScript(R"( - function t(%idx) { %a[idx] = 2; return %a[idx]; } + function t(%idx) { %a[%idx] = 2; return %a[%idx]; } return t(5); )"); ASSERT_EQ(value.getInt(), 2); ConsoleValue value2 = RunScript(R"( - function t(%idx) { %a[idx, 0] = 2; return %a[idx, 0]; } + function t(%idx) { %a[%idx, 0] = 2; return %a[%idx, 0]; } return t(5); )"); From 085af8e7625a27fea668e557b2705ed083debeda Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 19 Jun 2021 12:28:32 -0400 Subject: [PATCH 024/399] fix %obj.field op assign. --- Engine/source/console/astNodes.cpp | 2 +- Engine/source/console/test/ScriptTest.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index 1f8fea367..99a9ddad1 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -1432,7 +1432,7 @@ U32 SlotAssignOpNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) codeStream.emit((subType == TypeReqFloat) ? OP_LOADFIELD_FLT : OP_LOADFIELD_UINT); codeStream.emit(operand); codeStream.emit((subType == TypeReqFloat) ? OP_SAVEFIELD_FLT : OP_SAVEFIELD_UINT); - if (subType == TypeReqNone) + if (type == TypeReqNone) codeStream.emit(OP_POP_STK); return codeStream.tell(); } diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index ccde5439f..58441c3d2 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -512,6 +512,22 @@ TEST(Script, Basic_SimObject) )"); ASSERT_STREQ(fieldTest.getString(), "B"); + + ConsoleValue fieldOpTest = RunScript(R"( + function a() + { + %obj = new SimObject(); + %obj.field = 1; + %obj.field += 2; + + %value = %obj.field; + %obj.delete(); + return %value; + } + return a(); + )"); + + ASSERT_EQ(fieldOpTest.getInt(), 3); } TEST(Script, Internal_Name) From 464cb7ae299d05d5fe2ed02af342d91f25b49de9 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 19 Jun 2021 13:48:32 -0400 Subject: [PATCH 025/399] Better error messages when compiling script. --- Engine/source/console/astNodes.cpp | 35 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index 99a9ddad1..65cafe70d 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -66,12 +66,12 @@ class FuncVars }; public: - S32 assign(StringTableEntry var, TypeReq currentType, bool isConstant = false) + S32 assign(StringTableEntry var, TypeReq currentType, S32 lineNumber, bool isConstant = false) { std::unordered_map::iterator found = vars.find(var); if (found != vars.end()) { - AssertISV(!found->second.isConstant, avar("Reassigning variable %s when it is a constant", var)); + AssertISV(!found->second.isConstant, avar("Reassigning variable %s when it is a constant. File: %s Line : %d", var, CodeBlock::smCurrentParser->getCurrentFile(), lineNumber)); return found->second.reg; } @@ -80,17 +80,18 @@ public: return id; } - S32 lookup(StringTableEntry var) + S32 lookup(StringTableEntry var, S32 lineNumber) { std::unordered_map::iterator found = vars.find(var); - AssertISV(found != vars.end(), avar("Variable %s referenced before used when compiling script.", var)); + AssertISV(found != vars.end(), avar("Variable %s referenced before used when compiling script. File: %s Line: %d", var, CodeBlock::smCurrentParser->getCurrentFile(), lineNumber)); return found->second.reg; } - TypeReq lookupType(StringTableEntry var) + TypeReq lookupType(StringTableEntry var, S32 lineNumber) { std::unordered_map::iterator found = vars.find(var); - AssertISV(found != vars.end(), avar("Variable %s referenced before used when compiling script.", var)); + + AssertISV(found != vars.end(), avar("Variable %s referenced before used when compiling script. File: %s Line: %d", var, CodeBlock::smCurrentParser->getCurrentFile(), lineNumber)); return found->second.currentType; } @@ -103,9 +104,9 @@ private: FuncVars* gFuncVars = NULL; -inline FuncVars* getFuncVars() +inline FuncVars* getFuncVars(S32 lineNumber) { - AssertISV(gFuncVars, "Attemping to use local variable in global scope."); + AssertISV(gFuncVars, avar("Attemping to use local variable in global scope. File: %s Line: %d", CodeBlock::smCurrentParser->getCurrentFile(), lineNumber)); return gFuncVars; } @@ -383,7 +384,7 @@ U32 IterStmtNode::compileStmt(CodeStream& codeStream, U32 ip) if (isGlobal) codeStream.emitSTE(varName); else - codeStream.emit(getFuncVars()->assign(varName, varType)); + codeStream.emit(getFuncVars(dbgLineNumber)->assign(varName, varType, dbgLineNumber)); const U32 finalFix = codeStream.emit(0); const U32 continueIp = codeStream.emit(OP_ITER); codeStream.emitFix(CodeStream::FIXTYPE_BREAK); @@ -736,7 +737,7 @@ U32 VarNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) default: codeStream.emit(OP_LOAD_LOCAL_VAR_STR); } - codeStream.emit(getFuncVars()->lookup(varName)); + codeStream.emit(getFuncVars(dbgLineNumber)->lookup(varName, dbgLineNumber)); } return codeStream.tell(); @@ -745,7 +746,7 @@ U32 VarNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) TypeReq VarNode::getPreferredType() { bool oldVariables = arrayIndex || varName[0] == '$'; - return oldVariables ? TypeReqNone : getFuncVars()->lookupType(varName); + return oldVariables ? TypeReqNone : getFuncVars(dbgLineNumber)->lookupType(varName, dbgLineNumber); } //------------------------------------------------------------ @@ -983,7 +984,7 @@ U32 AssignExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) case TypeReqFloat: codeStream.emit(OP_SAVE_LOCAL_VAR_FLT); break; default: codeStream.emit(OP_SAVE_LOCAL_VAR_STR); } - codeStream.emit(getFuncVars()->assign(varName, subType == TypeReqNone ? TypeReqString : subType)); + codeStream.emit(getFuncVars(dbgLineNumber)->assign(varName, subType == TypeReqNone ? TypeReqString : subType, dbgLineNumber)); } if (type == TypeReqNone) @@ -1081,7 +1082,7 @@ U32 AssignOpExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) if (op == opPLUSPLUS && !oldVariables) { - const S32 varIdx = getFuncVars()->assign(varName, TypeReqFloat); + const S32 varIdx = getFuncVars(dbgLineNumber)->assign(varName, TypeReqFloat, dbgLineNumber); codeStream.emit(OP_INC); codeStream.emit(varIdx); @@ -1116,7 +1117,7 @@ U32 AssignOpExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) else { const bool isFloat = subType == TypeReqFloat; - const S32 varIdx = getFuncVars()->assign(varName, subType == TypeReqNone ? TypeReqString : subType); + const S32 varIdx = getFuncVars(dbgLineNumber)->assign(varName, subType == TypeReqNone ? TypeReqString : subType, dbgLineNumber); codeStream.emit(isFloat ? OP_LOAD_LOCAL_VAR_FLT : OP_LOAD_LOCAL_VAR_UINT); codeStream.emit(varIdx); @@ -1562,7 +1563,7 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream& codeStream, U32 ip) for (VarNode* walk = args; walk; walk = (VarNode*)((StmtNode*)walk)->getNext()) { precompileIdent(walk->varName); - getFuncVars()->assign(walk->varName, TypeReqNone); + getFuncVars(dbgLineNumber)->assign(walk->varName, TypeReqNone, dbgLineNumber); argc++; } @@ -1586,7 +1587,7 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream& codeStream, U32 ip) for (VarNode* walk = args; walk; walk = (VarNode*)((StmtNode*)walk)->getNext()) { StringTableEntry name = walk->varName; - codeStream.emit(getFuncVars()->lookup(name)); + codeStream.emit(getFuncVars(dbgLineNumber)->lookup(name, dbgLineNumber)); } CodeBlock::smInFunction = true; ip = compileBlock(stmts, codeStream, ip); @@ -1598,7 +1599,7 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream& codeStream, U32 ip) CodeBlock::smInFunction = false; codeStream.emit(OP_RETURN_VOID); - codeStream.patch(localNumVarsIP, getFuncVars()->count()); + codeStream.patch(localNumVarsIP, getFuncVars(dbgLineNumber)->count()); codeStream.patch(endIp, codeStream.tell()); setCurrentStringTable(&getGlobalStringTable()); From 6ad287650440aeb3c78929a8d09a80035f33b3fe Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Fri, 9 Jul 2021 21:05:55 -0400 Subject: [PATCH 026/399] * BugFix: Correct 3 missing defines in the GCC types include file. * BugFix: Move several compiledEval declarations around to resolve ordering issues. * BugFix: Experimentally remove the reference on an engineAPI template function to allow parameter types to match. --- Engine/source/console/compiledEval.cpp | 120 ++++++++++++------------- Engine/source/console/engineAPI.h | 2 +- Engine/source/platform/types.gcc.h | 3 + 3 files changed, 64 insertions(+), 61 deletions(-) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 061484659..10d201874 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -459,6 +459,39 @@ enum class FloatOperation NE }; +template +TORQUE_NOINLINE void doSlowMathOp() +{ + ConsoleValue& a = stack[_STK]; + ConsoleValue& b = stack[_STK - 1]; + + // Arithmetic + if constexpr (Op == FloatOperation::Add) + stack[_STK - 1].setFloat(a.getFloat() + b.getFloat()); + else if constexpr (Op == FloatOperation::Sub) + stack[_STK - 1].setFloat(a.getFloat() - b.getFloat()); + else if constexpr (Op == FloatOperation::Mul) + stack[_STK - 1].setFloat(a.getFloat() * b.getFloat()); + else if constexpr (Op == FloatOperation::Div) + stack[_STK - 1].setFloat(a.getFloat() / b.getFloat()); + + // Logical + if constexpr (Op == FloatOperation::LT) + stack[_STK - 1].setInt(a.getFloat() < b.getFloat()); + if constexpr (Op == FloatOperation::LE) + stack[_STK - 1].setInt(a.getFloat() <= b.getFloat()); + if constexpr (Op == FloatOperation::GR) + stack[_STK - 1].setInt(a.getFloat() > b.getFloat()); + if constexpr (Op == FloatOperation::GE) + stack[_STK - 1].setInt(a.getFloat() >= b.getFloat()); + if constexpr (Op == FloatOperation::EQ) + stack[_STK - 1].setInt(a.getFloat() == b.getFloat()); + if constexpr (Op == FloatOperation::NE) + stack[_STK - 1].setInt(a.getFloat() != b.getFloat()); + + _STK--; +} + template TORQUE_FORCEINLINE void doFloatMathOperation() { @@ -500,39 +533,6 @@ TORQUE_FORCEINLINE void doFloatMathOperation() } } -template -TORQUE_NOINLINE void doSlowMathOp() -{ - ConsoleValue& a = stack[_STK]; - ConsoleValue& b = stack[_STK - 1]; - - // Arithmetic - if constexpr (Op == FloatOperation::Add) - stack[_STK - 1].setFloat(a.getFloat() + b.getFloat()); - else if constexpr (Op == FloatOperation::Sub) - stack[_STK - 1].setFloat(a.getFloat() - b.getFloat()); - else if constexpr (Op == FloatOperation::Mul) - stack[_STK - 1].setFloat(a.getFloat() * b.getFloat()); - else if constexpr (Op == FloatOperation::Div) - stack[_STK - 1].setFloat(a.getFloat() / b.getFloat()); - - // Logical - if constexpr (Op == FloatOperation::LT) - stack[_STK - 1].setInt(a.getFloat() < b.getFloat()); - if constexpr (Op == FloatOperation::LE) - stack[_STK - 1].setInt(a.getFloat() <= b.getFloat()); - if constexpr (Op == FloatOperation::GR) - stack[_STK - 1].setInt(a.getFloat() > b.getFloat()); - if constexpr (Op == FloatOperation::GE) - stack[_STK - 1].setInt(a.getFloat() >= b.getFloat()); - if constexpr (Op == FloatOperation::EQ) - stack[_STK - 1].setInt(a.getFloat() == b.getFloat()); - if constexpr (Op == FloatOperation::NE) - stack[_STK - 1].setInt(a.getFloat() != b.getFloat()); - - _STK--; -} - //----------------------------------------------------------------------------- enum class IntegerOperation @@ -547,6 +547,33 @@ enum class IntegerOperation LogicalOr }; +template +TORQUE_NOINLINE void doSlowIntegerOp() +{ + ConsoleValue& a = stack[_STK]; + ConsoleValue& b = stack[_STK - 1]; + + // Bitwise Op + if constexpr (Op == IntegerOperation::BitAnd) + stack[_STK - 1].setInt(a.getInt() & b.getInt()); + if constexpr (Op == IntegerOperation::BitOr) + stack[_STK - 1].setInt(a.getInt() | b.getInt()); + if constexpr (Op == IntegerOperation::Xor) + stack[_STK - 1].setInt(a.getInt() ^ b.getInt()); + if constexpr (Op == IntegerOperation::LShift) + stack[_STK - 1].setInt(a.getInt() << b.getInt()); + if constexpr (Op == IntegerOperation::RShift) + stack[_STK - 1].setInt(a.getInt() >> b.getInt()); + + // Logical Op + if constexpr (Op == IntegerOperation::LogicalAnd) + stack[_STK - 1].setInt(a.getInt() && b.getInt()); + if constexpr (Op == IntegerOperation::LogicalOr) + stack[_STK - 1].setInt(a.getInt() || b.getInt()); + + _STK--; +} + template TORQUE_FORCEINLINE void doIntOperation() { @@ -581,33 +608,6 @@ TORQUE_FORCEINLINE void doIntOperation() } } -template -TORQUE_NOINLINE void doSlowIntegerOp() -{ - ConsoleValue& a = stack[_STK]; - ConsoleValue& b = stack[_STK - 1]; - - // Bitwise Op - if constexpr (Op == IntegerOperation::BitAnd) - stack[_STK - 1].setInt(a.getInt() & b.getInt()); - if constexpr (Op == IntegerOperation::BitOr) - stack[_STK - 1].setInt(a.getInt() | b.getInt()); - if constexpr (Op == IntegerOperation::Xor) - stack[_STK - 1].setInt(a.getInt() ^ b.getInt()); - if constexpr (Op == IntegerOperation::LShift) - stack[_STK - 1].setInt(a.getInt() << b.getInt()); - if constexpr (Op == IntegerOperation::RShift) - stack[_STK - 1].setInt(a.getInt() >> b.getInt()); - - // Logical Op - if constexpr (Op == IntegerOperation::LogicalAnd) - stack[_STK - 1].setInt(a.getInt() && b.getInt()); - if constexpr (Op == IntegerOperation::LogicalOr) - stack[_STK - 1].setInt(a.getInt() || b.getInt()); - - _STK--; -} - //----------------------------------------------------------------------------- U32 gExecCount = 0; diff --git a/Engine/source/console/engineAPI.h b/Engine/source/console/engineAPI.h index a8540968a..0a6af3dcd 100644 --- a/Engine/source/console/engineAPI.h +++ b/Engine/source/console/engineAPI.h @@ -292,7 +292,7 @@ struct EngineUnmarshallData< void > template<> struct EngineUnmarshallData< ConsoleValue > { - ConsoleValue operator()( ConsoleValue &ref ) const + ConsoleValue operator()( ConsoleValue ref ) const { return std::move(ref); } diff --git a/Engine/source/platform/types.gcc.h b/Engine/source/platform/types.gcc.h index 53538dd8d..4e65b23dc 100644 --- a/Engine/source/platform/types.gcc.h +++ b/Engine/source/platform/types.gcc.h @@ -43,6 +43,9 @@ typedef unsigned long U64; // Compiler Version #define TORQUE_COMPILER_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +#define TORQUE_FORCEINLINE __attribute__((always_inline)) +#define TORQUE_CASE_FALLTHROUGH __attribute__((fallthrough)) +#define TORQUE_NOINLINE __attribute__ ((noinline)) //-------------------------------------- // Identify the compiler string From a449fadde2e025507fe29bb576738f7c74a3b198 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 14 Aug 2021 01:37:01 -0400 Subject: [PATCH 027/399] hacks to make thedebugger work again. --- Engine/source/console/astNodes.cpp | 15 ++++++++- Engine/source/console/codeBlock.cpp | 2 ++ Engine/source/console/codeBlock.h | 21 +++++++++++- Engine/source/console/compiledEval.cpp | 8 ++--- Engine/source/console/compiler.cpp | 41 ++++++++++++++++++++++++ Engine/source/console/compiler.h | 3 ++ Engine/source/console/consoleInternal.h | 5 +++ Engine/source/console/telnetDebugger.cpp | 37 +++++++++++++++++++-- 8 files changed, 123 insertions(+), 9 deletions(-) diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index 65cafe70d..104671b1f 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -62,6 +62,7 @@ class FuncVars { S32 reg; TypeReq currentType; + StringTableEntry name; bool isConstant; }; @@ -76,7 +77,9 @@ public: } S32 id = counter++; - vars[var] = { id, currentType, isConstant }; + vars[var] = { id, currentType, var, isConstant }; + variableNameMap[id] = var; + return id; } @@ -97,6 +100,8 @@ public: inline S32 count() { return counter; } + std::unordered_map variableNameMap; + private: std::unordered_map vars; S32 counter = 0; @@ -1604,6 +1609,14 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream& codeStream, U32 ip) setCurrentStringTable(&getGlobalStringTable()); setCurrentFloatTable(&getGlobalFloatTable()); + + // map local variables to registers for this function. + CompilerLocalVariableToRegisterMappingTable* tbl = &getFunctionVariableMappingTable(); + for (const auto& pair : gFuncVars->variableNameMap) + { + tbl->add(fnName, pair.second, pair.first); + } + gFuncVars = NULL; return ip; diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index e7c3d4adb..b58156c4a 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -640,6 +640,8 @@ ConsoleValue CodeBlock::compileExec(StringTableEntry fileName, const char *inStr globalFloats = getGlobalFloatTable().build(); functionFloats = getFunctionFloatTable().build(); + variableRegisterTable = getFunctionVariableMappingTable().copy(); + codeStream.emit(OP_RETURN_VOID); codeStream.emitCodeStream(&codeSize, &code, &lineBreakPairs); diff --git a/Engine/source/console/codeBlock.h b/Engine/source/console/codeBlock.h index 1daa26bac..be6e48a46 100644 --- a/Engine/source/console/codeBlock.h +++ b/Engine/source/console/codeBlock.h @@ -23,6 +23,24 @@ #ifndef _CODEBLOCK_H_ #define _CODEBLOCK_H_ +#include + +struct CompilerLocalVariableToRegisterMappingTable +{ + // First key: function name + struct RemappingTable + { + std::unordered_map table; + }; + + std::unordered_map localVarToRegister; + + void add(StringTableEntry functionName, StringTableEntry varName, S32 reg); + S32 lookup(StringTableEntry functionName, StringTableEntry varName); + CompilerLocalVariableToRegisterMappingTable copy(); + void reset(); +}; + #include "console/compiler.h" #include "console/consoleParser.h" @@ -34,7 +52,6 @@ class ConsoleValue; /// This class represents a block of code, usually mapped directly to a file. class CodeBlock { - friend class CodeInterpreter; private: static CodeBlock* smCodeBlockList; static CodeBlock* smCurrentCodeBlock; @@ -77,6 +94,8 @@ public: U32 codeSize; U32 *code; + CompilerLocalVariableToRegisterMappingTable variableRegisterTable; + U32 refCount; U32 lineBreakPairCount; U32 *lineBreakPairs; diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 10d201874..b80530162 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -1773,8 +1773,8 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa //if this is called from inside a function, append the ip and codeptr if (!gEvalState.stack.empty()) { - gEvalState.stack.last()->code = this; - gEvalState.stack.last()->ip = ip - 1; + gEvalState.getCurrentFrame().code = this; + gEvalState.getCurrentFrame().ip = ip - 1; } ip += 5; @@ -2070,8 +2070,8 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa { //append the ip and codeptr before managing the breakpoint! AssertFatal(!gEvalState.stack.empty(), "Empty eval stack on break!"); - gEvalState.stack.last()->code = this; - gEvalState.stack.last()->ip = ip - 1; + gEvalState.getCurrentFrame().code = this; + gEvalState.getCurrentFrame().ip = ip - 1; U32 breakLine; findBreakLine(ip - 1, breakLine, instruction); diff --git a/Engine/source/console/compiler.cpp b/Engine/source/console/compiler.cpp index 8b1e15a8f..969770d54 100644 --- a/Engine/source/console/compiler.cpp +++ b/Engine/source/console/compiler.cpp @@ -60,6 +60,7 @@ namespace Compiler CompilerFloatTable *gCurrentFloatTable, gGlobalFloatTable, gFunctionFloatTable; DataChunker gConsoleAllocator; CompilerIdentTable gIdentTable; + CompilerLocalVariableToRegisterMappingTable gFunctionVariableMappingTable; //------------------------------------------------------------ @@ -92,6 +93,8 @@ namespace Compiler CompilerStringTable &getGlobalStringTable() { return gGlobalStringTable; } CompilerStringTable &getFunctionStringTable() { return gFunctionStringTable; } + CompilerLocalVariableToRegisterMappingTable& getFunctionVariableMappingTable() { return gFunctionVariableMappingTable; } + void setCurrentStringTable(CompilerStringTable* cst) { gCurrentStringTable = cst; } CompilerFloatTable *getCurrentFloatTable() { return gCurrentFloatTable; } @@ -117,6 +120,7 @@ namespace Compiler getFunctionFloatTable().reset(); getFunctionStringTable().reset(); getIdentTable().reset(); + getFunctionVariableMappingTable().reset(); } void *consoleAlloc(U32 size) { return gConsoleAllocator.alloc(size); } @@ -208,6 +212,43 @@ void CompilerStringTable::write(Stream &st) //------------------------------------------------------------ +void CompilerLocalVariableToRegisterMappingTable::add(StringTableEntry functionName, StringTableEntry varName, S32 reg) +{ + localVarToRegister[functionName].table[varName] = reg; +} + +S32 CompilerLocalVariableToRegisterMappingTable::lookup(StringTableEntry functionName, StringTableEntry varName) +{ + auto functionPosition = localVarToRegister.find(functionName); + if (functionPosition != localVarToRegister.end()) + { + const auto& table = localVarToRegister[functionName].table; + auto varPosition = table.find(varName); + if (varPosition != table.end()) + { + return varPosition->second; + } + } + + Con::errorf("Unable to find local variable %s in function name %s", varName, functionName); + return -1; +} + +CompilerLocalVariableToRegisterMappingTable CompilerLocalVariableToRegisterMappingTable::copy() +{ + // Trivilly copyable as its all plain old data and using STL containers... (We want a deep copy though!) + CompilerLocalVariableToRegisterMappingTable table; + table.localVarToRegister = localVarToRegister; + return std::move(table); +} + +void CompilerLocalVariableToRegisterMappingTable::reset() +{ + localVarToRegister.clear(); +} + +//------------------------------------------------------------ + U32 CompilerFloatTable::add(F64 value) { Entry **walk; diff --git a/Engine/source/console/compiler.h b/Engine/source/console/compiler.h index 4e6676d4c..117576a61 100644 --- a/Engine/source/console/compiler.h +++ b/Engine/source/console/compiler.h @@ -44,6 +44,8 @@ class DataChunker; #include "core/util/tVector.h" #endif +//------------------------------------------------------------ + namespace Compiler { /// The opcodes for the TorqueScript VM. @@ -252,6 +254,7 @@ namespace Compiler CompilerStringTable *getCurrentStringTable(); CompilerStringTable &getGlobalStringTable(); CompilerStringTable &getFunctionStringTable(); + CompilerLocalVariableToRegisterMappingTable& getFunctionVariableMappingTable(); void setCurrentStringTable(CompilerStringTable* cst); diff --git a/Engine/source/console/consoleInternal.h b/Engine/source/console/consoleInternal.h index f947057e5..6b7cc2294 100644 --- a/Engine/source/console/consoleInternal.h +++ b/Engine/source/console/consoleInternal.h @@ -644,6 +644,11 @@ public: return *(stack[mStackDepth - 1]); } + Dictionary& getFrameAt(S32 depth) + { + return *(stack[depth]); + } + /// @} /// Run integrity checks for debugging. diff --git a/Engine/source/console/telnetDebugger.cpp b/Engine/source/console/telnetDebugger.cpp index 719ed7d32..306611b0a 100644 --- a/Engine/source/console/telnetDebugger.cpp +++ b/Engine/source/console/telnetDebugger.cpp @@ -864,6 +864,37 @@ void TelnetDebugger::evaluateExpression(const char *tag, S32 frame, const char * if ( frame < 0 ) frame = 0; + // Local variables use their own memory management and can't be queried by just executing + // TorqueScript, we have to go digging into the interpreter. + S32 evalBufferLen = dStrlen(evalBuffer); + bool isEvaluatingLocalVariable = evalBufferLen > 0 && evalBuffer[0] == '%'; + if (isEvaluatingLocalVariable) + { + const char* format = "EVALOUT %s %s\r\n"; + + Dictionary &stackFrame = gEvalState.getFrameAt(frame); + StringTableEntry functionName = stackFrame.scopeName; + S32 registerId = stackFrame.code->variableRegisterTable.lookup(functionName, StringTable->insert(evalBuffer)); + + if (registerId == -1) + { + // ERROR, can't read the variable! + send("EVALOUT \"\" \"\""); + return; + } + + const char* varResult = gEvalState.getLocalStringVariable(registerId); + + S32 len = dStrlen(format) + dStrlen(tag) + dStrlen(varResult); + char* buffer = new char[len]; + dSprintf(buffer, len, format, tag, varResult[0] ? varResult : "\"\""); + + send(buffer); + delete[] buffer; + + return; + } + // Build a buffer just big enough for this eval. const char* format = "return %s;"; dsize_t len = dStrlen( format ) + dStrlen( evalBuffer ); @@ -872,14 +903,14 @@ void TelnetDebugger::evaluateExpression(const char *tag, S32 frame, const char * // Execute the eval. CodeBlock *newCodeBlock = new CodeBlock(); - const char* result = newCodeBlock->compileExec( NULL, buffer, false, frame ); + ConsoleValue result = newCodeBlock->compileExec( NULL, buffer, false, frame ); delete [] buffer; // Create a new buffer that fits the result. format = "EVALOUT %s %s\r\n"; - len = dStrlen( format ) + dStrlen( tag ) + dStrlen( result ); + len = dStrlen( format ) + dStrlen( tag ) + dStrlen( result.getString() ); buffer = new char[ len ]; - dSprintf( buffer, len, format, tag, result[0] ? result : "\"\"" ); + dSprintf( buffer, len, format, tag, result.getString()[0] ? result.getString() : "\"\"" ); send( buffer ); delete [] buffer; From 6ec40e86dab7aef353f928d1f4f749f4193b9192 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Mon, 16 Aug 2021 22:02:24 -0400 Subject: [PATCH 028/399] Fix bugs with certain properties (and .x .y .z accessors) and add tests. --- Engine/source/console/astNodes.cpp | 42 +++++--------- Engine/source/console/codeBlock.cpp | 2 +- Engine/source/console/compiledEval.cpp | 68 +++++++++++++++++------ Engine/source/console/test/ScriptTest.cpp | 61 ++++++++++++++++++++ 4 files changed, 125 insertions(+), 48 deletions(-) diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index 104671b1f..c95a45cae 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -1262,9 +1262,10 @@ U32 SlotAccessNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) codeStream.emit(OP_SETCUROBJECT); codeStream.emit(OP_SETCURFIELD); - codeStream.emitSTE(slotName); + codeStream.emit(OP_POP_STK); + if (arrayExpr) { codeStream.emit(OP_SETCURFIELD_ARRAY); @@ -1307,6 +1308,8 @@ U32 InternalSlotAccessNode::compile(CodeStream& codeStream, U32 ip, TypeReq type codeStream.emit(OP_SETCUROBJECT_INTERNAL); codeStream.emit(recurse); + codeStream.emit(OP_POP_STK); + return codeStream.tell(); } @@ -1319,34 +1322,6 @@ TypeReq InternalSlotAccessNode::getPreferredType() U32 SlotAssignNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { - // first eval the expression TypeReqString - - // if it's an array: - - // if OP_ADVANCE_STR 1 - // eval array - - // OP_ADVANCE_STR 1 - // evaluate object expr - // OP_SETCUROBJECT 1 - // OP_SETCURFIELD 1 - // fieldName 1 - // OP_TERMINATE_REWIND_STR 1 - - // OP_SETCURFIELDARRAY 1 - // OP_TERMINATE_REWIND_STR 1 - - // else - // OP_ADVANCE_STR - // evaluate object expr - // OP_SETCUROBJECT - // OP_SETCURFIELD - // fieldName - // OP_TERMINATE_REWIND_STR - - // OP_SAVEFIELD - // convert to return type if necessary. - precompileIdent(slotName); ip = valueExpr->compile(codeStream, ip, TypeReqString); @@ -1364,6 +1339,13 @@ U32 SlotAssignNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) codeStream.emit(OP_SETCURFIELD); codeStream.emitSTE(slotName); + if (objectExpr) + { + // Don't pop unless we are assigning a field to an object + // (For initializer fields, we don't wanna pop) + codeStream.emit(OP_POP_STK); + } + if (arrayExpr) { codeStream.emit(OP_SETCURFIELD_ARRAY); @@ -1429,6 +1411,8 @@ U32 SlotAssignOpNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) codeStream.emit(OP_SETCURFIELD); codeStream.emitSTE(slotName); + codeStream.emit(OP_POP_STK); + if (arrayExpr) { codeStream.emit(OP_SETCURFIELD_ARRAY); diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index b58156c4a..8d0cde4d5 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -1114,7 +1114,7 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) case OP_SETCUROBJECT: { - Con::printf("%i: OP_SETCUROBJECT stk=-1", ip - 1); + Con::printf("%i: OP_SETCUROBJECT stk=0", ip - 1); break; } diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index b80530162..f3c432fcb 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -166,18 +166,17 @@ namespace Con // Gets a component of an object's field value or a variable and returns it // in val. -static void getFieldComponent(SimObject* object, StringTableEntry field, const char* array, StringTableEntry subField, char val[]) +static void getFieldComponent(SimObject* object, StringTableEntry field, const char* array, StringTableEntry subField, char val[], S32 currentLocalRegister) { const char* prevVal = NULL; // Grab value from object. if (object && field) prevVal = object->getDataField(field, array); - - // Otherwise, grab from the string stack. The value coming in will always - // be a string because that is how multicomponent variables are handled. - else - prevVal = stack[_STK].getString(); + else if (currentLocalRegister != -1) + prevVal = gEvalState.getLocalStringVariable(currentLocalRegister); + else if (gEvalState.currentVariable) + prevVal = gEvalState.getStringVariable(); // Make sure we got a value. if (prevVal && *prevVal) @@ -198,15 +197,22 @@ static void getFieldComponent(SimObject* object, StringTableEntry field, const c StringTable->insert("a") }; + static const StringTableEntry uvw[] = + { + StringTable->insert("u"), + StringTable->insert("v"), + StringTable->insert("w") + }; + // Translate xyzw and rgba into the indexed component // of the variable or field. - if (subField == xyzw[0] || subField == rgba[0]) + if (subField == xyzw[0] || subField == rgba[0] || subField == uvw[0]) dStrcpy(val, StringUnit::getUnit(prevVal, 0, " \t\n"), 128); - else if (subField == xyzw[1] || subField == rgba[1]) + else if (subField == xyzw[1] || subField == rgba[1] || subField == uvw[1]) dStrcpy(val, StringUnit::getUnit(prevVal, 1, " \t\n"), 128); - else if (subField == xyzw[2] || subField == rgba[2]) + else if (subField == xyzw[2] || subField == rgba[2] || subField == uvw[2]) dStrcpy(val, StringUnit::getUnit(prevVal, 2, " \t\n"), 128); else if (subField == xyzw[3] || subField == rgba[3]) @@ -221,7 +227,7 @@ static void getFieldComponent(SimObject* object, StringTableEntry field, const c // Sets a component of an object's field value based on the sub field. 'x' will // set the first field, 'y' the second, and 'z' the third. -static void setFieldComponent(SimObject* object, StringTableEntry field, const char* array, StringTableEntry subField) +static void setFieldComponent(SimObject* object, StringTableEntry field, const char* array, StringTableEntry subField, S32 currentLocalRegister) { // Copy the current string value char strValue[1024]; @@ -233,7 +239,8 @@ static void setFieldComponent(SimObject* object, StringTableEntry field, const c // Set the value on an object field. if (object && field) prevVal = object->getDataField(field, array); - + else if (currentLocalRegister != -1) + prevVal = gEvalState.getLocalStringVariable(currentLocalRegister); // Set the value on a variable. else if (gEvalState.currentVariable) prevVal = gEvalState.getStringVariable(); @@ -277,6 +284,8 @@ static void setFieldComponent(SimObject* object, StringTableEntry field, const c // Update the field or variable. if (object && field) object->setDataField(field, 0, val); + else if (currentLocalRegister != -1) + gEvalState.setLocalStringVariable(currentLocalRegister, val, dStrlen(val)); else if (gEvalState.currentVariable) gEvalState.setStringVariable(val); } @@ -758,6 +767,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa } const char* val; S32 reg; + S32 currentRegister = -1; // The frame temp is used by the variable accessor ops (OP_SAVEFIELD_* and // OP_LOADFIELD_*) to store temporary values for the fields. @@ -1427,6 +1437,10 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa prevObject = NULL; curObject = NULL; + // Used for local variable caching of what is active...when we + // set a global, we aren't active + currentRegister = -1; + gEvalState.setCurVarName(var); // In order to let docblocks work properly with variables, we have @@ -1445,6 +1459,10 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa prevObject = NULL; curObject = NULL; + // Used for local variable caching of what is active...when we + // set a global, we aren't active + currentRegister = -1; + gEvalState.setCurVarNameCreate(var); // See OP_SETCURVAR for why we do this. @@ -1460,6 +1478,10 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa prevObject = NULL; curObject = NULL; + // Used for local variable caching of what is active...when we + // set a global, we aren't active + currentRegister = -1; + gEvalState.setCurVarName(var); // See OP_SETCURVAR for why we do this. @@ -1475,6 +1497,10 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa prevObject = NULL; curObject = NULL; + // Used for local variable caching of what is active...when we + // set a global, we aren't active + currentRegister = -1; + gEvalState.setCurVarNameCreate(var); // See OP_SETCURVAR for why we do this. @@ -1483,16 +1509,19 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_LOADVAR_UINT: + currentRegister = -1; stack[_STK + 1].setInt(gEvalState.getIntVariable()); _STK++; break; case OP_LOADVAR_FLT: + currentRegister = -1; stack[_STK + 1].setFloat(gEvalState.getFloatVariable()); _STK++; break; case OP_LOADVAR_STR: + currentRegister = -1; stack[_STK + 1].setString(gEvalState.getStringVariable()); _STK++; break; @@ -1511,18 +1540,21 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_LOAD_LOCAL_VAR_UINT: reg = code[ip++]; + currentRegister = reg; stack[_STK + 1].setInt(gEvalState.getLocalIntVariable(reg)); _STK++; break; case OP_LOAD_LOCAL_VAR_FLT: reg = code[ip++]; + currentRegister = reg; stack[_STK + 1].setFloat(gEvalState.getLocalFloatVariable(reg)); _STK++; break; case OP_LOAD_LOCAL_VAR_STR: reg = code[ip++]; + currentRegister = reg; val = gEvalState.getLocalStringVariable(reg); stack[_STK + 1].setString(val); _STK++; @@ -1548,7 +1580,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // Save the previous object for parsing vector fields. prevObject = curObject; val = stack[_STK].getString(); - _STK--; + //_STK--; // Sim::findObject will sometimes find valid objects from // multi-component strings. This makes sure that doesn't @@ -1616,7 +1648,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // a special accessor? char buff[FieldBufferSizeNumeric]; memset(buff, 0, sizeof(buff)); - getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff); + getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff, currentRegister); stack[_STK + 1].setInt(dAtol(buff)); } _STK++; @@ -1631,7 +1663,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // a special accessor? char buff[FieldBufferSizeNumeric]; memset(buff, 0, sizeof(buff)); - getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff); + getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff, currentRegister); stack[_STK + 1].setFloat(dAtod(buff)); } _STK++; @@ -1649,7 +1681,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // a special accessor? char buff[FieldBufferSizeString]; memset(buff, 0, sizeof(buff)); - getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff); + getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff, currentRegister); stack[_STK + 1].setString(buff); } _STK++; @@ -1662,7 +1694,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa { // The field is not being set on an object. Maybe it's // a special accessor? - setFieldComponent( prevObject, prevField, prevFieldArray, curField ); + setFieldComponent( prevObject, prevField, prevFieldArray, curField, currentRegister ); prevObject = NULL; } break; @@ -1674,7 +1706,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa { // The field is not being set on an object. Maybe it's // a special accessor? - setFieldComponent( prevObject, prevField, prevFieldArray, curField ); + setFieldComponent( prevObject, prevField, prevFieldArray, curField, currentRegister ); prevObject = NULL; } break; @@ -1686,7 +1718,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa { // The field is not being set on an object. Maybe it's // a special accessor? - setFieldComponent( prevObject, prevField, prevFieldArray, curField ); + setFieldComponent( prevObject, prevField, prevFieldArray, curField, currentRegister ); prevObject = NULL; } break; diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index 58441c3d2..28d291528 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -471,6 +471,17 @@ TEST(Script, Basic_SimObject) ASSERT_STREQ(parentFn.getString(), "FooBar"); + ConsoleValue simpleFieldTest = RunScript(R"( + function a() + { + FudgeCollector.field = "A"; + return FudgeCollector.field; + } + return a(); + )"); + + ASSERT_STREQ(simpleFieldTest.getString(), "A"); + ConsoleValue grp = RunScript(R"( new SimGroup(FudgeCollectorGroup) { @@ -587,4 +598,54 @@ TEST(Script, Basic_Package) ASSERT_EQ(deactivatedValue.getInt(), 3); } +TEST(Script, Sugar_Syntax) +{ + ConsoleValue value = RunScript(R"( + function a() + { + %vector = "1 2 3"; + return %vector.y; + } + return a(); + )"); + + ASSERT_EQ(value.getInt(), 2); + + ConsoleValue setValue = RunScript(R"( + function a() + { + %vector = "1 2 3"; + %vector.y = 4; + return %vector.y; + } + return a(); + )"); + + ASSERT_EQ(setValue.getInt(), 4); + + ConsoleValue valueArray = RunScript(R"( + function a() + { + %vector[0] = "1 2 3"; + return %vector[0].y; + } + return a(); + )"); + + ASSERT_EQ(valueArray.getInt(), 2); + + ConsoleValue valueSetArray = RunScript(R"( + function a() + { + %vector[0] = "1 2 3"; + %vector[0].z = 5; + return %vector[0].z; + } + return a(); + )"); + + ASSERT_EQ(valueSetArray.getInt(), 5); +} + + #endif From 838395840dc377c5b74c9c6c1fc4c8538d0c72be Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Tue, 17 Aug 2021 20:04:45 -0400 Subject: [PATCH 029/399] script fixes from latest merge and more tests --- Engine/source/console/test/ScriptTest.cpp | 53 +++++++++++++++++++ .../projectImporter/guis/projectImporter.gui | 2 +- .../scripts/projectImporter.tscript | 7 +-- 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index 28d291528..6a8d2ae12 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -647,5 +647,58 @@ TEST(Script, Sugar_Syntax) ASSERT_EQ(valueSetArray.getInt(), 5); } +TEST(Script, InnerObjectTests) +{ + ConsoleValue theObject = RunScript(R"( + function a() + { + %obj = new SimObject(TheOuterObject) + { + innerObject = new SimObject(TheInnerObject) + { + testField = 123; + position = "1 2 3"; + }; + }; + return %obj; + } + return a(); + )"); + + SimObject* outerObject = Sim::findObject("TheOuterObject"); + ASSERT_NE(outerObject, (SimObject*)NULL); + if (outerObject) + { + ASSERT_EQ(theObject.getInt(), Sim::findObject("TheOuterObject")->getId()); + } + ASSERT_NE(Sim::findObject("TheInnerObject"), (SimObject*)NULL); + + ConsoleValue positionValue = RunScript(R"( + function TheOuterObject::getInnerPosition(%this) + { + return %this.innerObject.position; + } + + function a() + { + %position = TheOuterObject.getInnerPosition(); + return %position.y; + } + return a(); + )"); + + ASSERT_EQ(positionValue.getInt(), 2); + + ConsoleValue nestedFuncCall = RunScript(R"( + function TheInnerObject::test(%this) + { + return %this.testField; + } + + return TheOuterObject.innerObject.test(); + )"); + + ASSERT_EQ(nestedFuncCall.getInt(), 123); +} #endif diff --git a/Templates/BaseGame/game/tools/projectImporter/guis/projectImporter.gui b/Templates/BaseGame/game/tools/projectImporter/guis/projectImporter.gui index b308feed3..480e71704 100644 --- a/Templates/BaseGame/game/tools/projectImporter/guis/projectImporter.gui +++ b/Templates/BaseGame/game/tools/projectImporter/guis/projectImporter.gui @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(ProjectImportCtrl) { +$guiContent = new GuiControl(ProjectImportCtrl) { position = "0 0"; extent = "1024 768"; minExtent = "8 2"; diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript index 05a0847f4..d73f414b2 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript @@ -70,7 +70,7 @@ function ProjectImportWindow::selectOGFolder(%this) %dlg = new OpenFolderDialog() { Title = "Select Export Folder"; - Filters = %filter; + Filters = ""; DefaultFile = "data/"; ChangePath = false; MustExist = true; @@ -588,7 +588,7 @@ function processLegacyShapeConstructorField(%line) if(%foundAssets != 0) { %assetId = $ProjectImporter::assetQuery.getAsset(0); - echo("Legacy Project Importer - processing of legacy shape constructor addSequence line's value: " @ %value @ " has found a matching AssetId: " @ %assetId); + echo("Legacy Project Importer - processing of legacy shape constructor addSequence line's value: " @ %animSourcePath @ " has found a matching AssetId: " @ %assetId); } if(%assetId !$= "" && AssetDatabase.isDeclaredAsset(%assetId)) @@ -981,6 +981,7 @@ function processGUIntoAsset(%guiName, %file) warn("Processing GUI into asset: " @ %guiName @ ", file: " @ %file); %filePath = filePath(%file); + %fileName = fileBase(%file); %moduleDef = AssetBrowser.dirHandler.getModuleFromAddress(%file); %moduleName = %moduleDef.ModuleId; %modulePath = %moduleDef.ModulePath; @@ -1182,7 +1183,7 @@ function deleteAssetDefinitions() %dlg = new OpenFolderDialog() { Title = "Select Folder"; - Filters = %filter; + Filters = ""; DefaultFile = "data/"; ChangePath = false; MustExist = true; From 98a2fa0f337aba89145329ac801208fffc800d5a Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Tue, 17 Aug 2021 20:52:59 -0400 Subject: [PATCH 030/399] Fix bugs with internalName accessor --- Engine/source/console/astNodes.cpp | 5 +-- Engine/source/console/compiledEval.cpp | 5 +++ Engine/source/console/test/ScriptTest.cpp | 41 +++++++++++++++++++++-- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index c95a45cae..c45d13667 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -1304,12 +1304,13 @@ U32 InternalSlotAccessNode::compile(CodeStream& codeStream, U32 ip, TypeReq type ip = objectExpr->compile(codeStream, ip, TypeReqString); codeStream.emit(OP_SETCUROBJECT); + // we pop the stack as we will override the current object with the internal object + codeStream.emit(OP_POP_STK); + ip = slotExpr->compile(codeStream, ip, TypeReqString); codeStream.emit(OP_SETCUROBJECT_INTERNAL); codeStream.emit(recurse); - codeStream.emit(OP_POP_STK); - return codeStream.tell(); } diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index f3c432fcb..e9b4d2f61 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -1614,6 +1614,11 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa stack[_STK].setInt(0); } } + else + { + Con::errorf(ConsoleLogEntry::Script, "%s: Attempt to use ->, but the group object wasn't found.", getFileLine(ip - 2)); + stack[_STK].setInt(0); + } break; case OP_SETCUROBJECT_NEW: diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index 6a8d2ae12..f0aeb57bd 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -544,7 +544,7 @@ TEST(Script, Basic_SimObject) TEST(Script, Internal_Name) { ConsoleValue value = RunScript(R"( - function SimObject::_internalCall(%this) + function TheFirstInner::_internalCall(%this) { return 5; } @@ -552,7 +552,7 @@ TEST(Script, Internal_Name) function a() { %grp = new SimGroup(); - %obj = new SimObject() + %obj = new SimObject(TheFirstInner) { internalName = "Yay"; }; @@ -568,6 +568,43 @@ TEST(Script, Internal_Name) )"); ASSERT_EQ(value.getInt(), 5); + + ConsoleValue recursiveValue = RunScript(R"( + function SimGroup::doTheInternalCall(%this) + { + return %this-->Yeah._internalCall2(); + } + + function TheAnotherObject::_internalCall2(%this) + { + return %this.property; + } + + function a() + { + %grp = new SimGroup(); + %obj = new SimGroup() + { + internalName = "Yay2"; + + new SimObject(TheAnotherObject) + { + internalName = "Yeah"; + property = 12; + }; + }; + %grp.add(%obj); + + %val = %grp.doTheInternalCall(); + + %grp.delete(); + + return %val; + } + return a(); + )"); + + ASSERT_EQ(recursiveValue.getInt(), 12); } TEST(Script, Basic_Package) From 59312d7d529b405767570d30c7d8b32069605e8d Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Thu, 19 Aug 2021 22:05:43 -0400 Subject: [PATCH 031/399] debugger support --- Engine/source/console/astNodes.cpp | 2 +- Engine/source/console/codeBlock.h | 4 ++-- Engine/source/console/compiler.cpp | 16 ++++++++++------ Engine/source/console/console.cpp | 4 ++-- Engine/source/console/consoleInternal.cpp | 15 ++++++++++++++- Engine/source/console/consoleInternal.h | 2 ++ Engine/source/console/simEvents.cpp | 2 +- Engine/source/console/telnetDebugger.cpp | 16 ++++++++++++++-- 8 files changed, 46 insertions(+), 15 deletions(-) diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index c45d13667..7b60ca22c 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -1599,7 +1599,7 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream& codeStream, U32 ip) CompilerLocalVariableToRegisterMappingTable* tbl = &getFunctionVariableMappingTable(); for (const auto& pair : gFuncVars->variableNameMap) { - tbl->add(fnName, pair.second, pair.first); + tbl->add(fnName, nameSpace, pair.second, pair.first); } gFuncVars = NULL; diff --git a/Engine/source/console/codeBlock.h b/Engine/source/console/codeBlock.h index be6e48a46..be9de012f 100644 --- a/Engine/source/console/codeBlock.h +++ b/Engine/source/console/codeBlock.h @@ -35,8 +35,8 @@ struct CompilerLocalVariableToRegisterMappingTable std::unordered_map localVarToRegister; - void add(StringTableEntry functionName, StringTableEntry varName, S32 reg); - S32 lookup(StringTableEntry functionName, StringTableEntry varName); + void add(StringTableEntry functionName, StringTableEntry namespaceName, StringTableEntry varName, S32 reg); + S32 lookup(StringTableEntry namespaceName, StringTableEntry functionName, StringTableEntry varName); CompilerLocalVariableToRegisterMappingTable copy(); void reset(); }; diff --git a/Engine/source/console/compiler.cpp b/Engine/source/console/compiler.cpp index 969770d54..7a091c202 100644 --- a/Engine/source/console/compiler.cpp +++ b/Engine/source/console/compiler.cpp @@ -212,17 +212,21 @@ void CompilerStringTable::write(Stream &st) //------------------------------------------------------------ -void CompilerLocalVariableToRegisterMappingTable::add(StringTableEntry functionName, StringTableEntry varName, S32 reg) +void CompilerLocalVariableToRegisterMappingTable::add(StringTableEntry functionName, StringTableEntry namespaceName, StringTableEntry varName, S32 reg) { - localVarToRegister[functionName].table[varName] = reg; + StringTableEntry funcLookupTableName = StringTable->insert(avar("%s::%s", namespaceName, functionName)); + + localVarToRegister[funcLookupTableName].table[varName] = reg; } -S32 CompilerLocalVariableToRegisterMappingTable::lookup(StringTableEntry functionName, StringTableEntry varName) +S32 CompilerLocalVariableToRegisterMappingTable::lookup(StringTableEntry namespaceName, StringTableEntry functionName, StringTableEntry varName) { - auto functionPosition = localVarToRegister.find(functionName); + StringTableEntry funcLookupTableName = StringTable->insert(avar("%s::%s", namespaceName, functionName)); + + auto functionPosition = localVarToRegister.find(funcLookupTableName); if (functionPosition != localVarToRegister.end()) { - const auto& table = localVarToRegister[functionName].table; + const auto& table = localVarToRegister[funcLookupTableName].table; auto varPosition = table.find(varName); if (varPosition != table.end()) { @@ -230,7 +234,7 @@ S32 CompilerLocalVariableToRegisterMappingTable::lookup(StringTableEntry functio } } - Con::errorf("Unable to find local variable %s in function name %s", varName, functionName); + Con::errorf("Unable to find local variable %s in function name %s", varName, funcLookupTableName); return -1; } diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index 8195eee85..d49454a07 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -1923,7 +1923,7 @@ void postConsoleInput( RawData data ) { // TODO(JTH): Mem leak // Schedule this to happen at the next time event. - ConsoleValue* argv = new ConsoleValue[2]; + ConsoleValue* argv = new ConsoleValue[2](); argv[0].setString("eval"); argv[1].setString(reinterpret_cast(data.data)); @@ -2563,7 +2563,7 @@ ConsoleValueToStringArrayWrapper::~ConsoleValueToStringArrayWrapper() StringArrayToConsoleValueWrapper::StringArrayToConsoleValueWrapper(int targc, const char** targv) { - argv = new ConsoleValue[targc]; + argv = new ConsoleValue[targc](); argc = targc; for (int i=0; iscopeName; + newFrame.scopeNamespace = stack[stackIndex]->scopeNamespace; + newFrame.code = stack[stackIndex]->code; + newFrame.ip = stack[stackIndex]->ip; +} + ExprEvalState::ExprEvalState() { VECTOR_SET_ASSOCIATION(stack); diff --git a/Engine/source/console/consoleInternal.h b/Engine/source/console/consoleInternal.h index 6b7cc2294..758fd1327 100644 --- a/Engine/source/console/consoleInternal.h +++ b/Engine/source/console/consoleInternal.h @@ -634,6 +634,8 @@ public: /// on the top of the stack. void pushFrameRef(S32 stackIndex); + void pushDebugFrame(S32 stackIndex); + U32 getStackDepth() const { return mStackDepth; diff --git a/Engine/source/console/simEvents.cpp b/Engine/source/console/simEvents.cpp index 6c943f054..f6a044c11 100644 --- a/Engine/source/console/simEvents.cpp +++ b/Engine/source/console/simEvents.cpp @@ -33,7 +33,7 @@ SimConsoleEvent::SimConsoleEvent(S32 argc, ConsoleValue *argv, bool onObject) mOnObject = onObject; mArgc = argc; - mArgv = new ConsoleValue[argc]; + mArgv = new ConsoleValue[argc](); for (int i=0; i 0 && evalBuffer[0] == '%'; if (isEvaluatingLocalVariable) { + // See calculation of current frame in pushing a reference frame for console exec, we need access + // to the proper scope. + //frame = gEvalState.getTopOfStack() - frame - 1; + S32 stackIndex = gEvalState.getTopOfStack() - frame - 1; + const char* format = "EVALOUT %s %s\r\n"; - Dictionary &stackFrame = gEvalState.getFrameAt(frame); + gEvalState.pushDebugFrame(stackIndex); + + Dictionary& stackFrame = gEvalState.getCurrentFrame(); StringTableEntry functionName = stackFrame.scopeName; - S32 registerId = stackFrame.code->variableRegisterTable.lookup(functionName, StringTable->insert(evalBuffer)); + StringTableEntry namespaceName = stackFrame.scopeNamespace->mName; + StringTableEntry varToLookup = StringTable->insert(evalBuffer); + + S32 registerId = stackFrame.code->variableRegisterTable.lookup(namespaceName, functionName, varToLookup); if (registerId == -1) { @@ -885,6 +895,8 @@ void TelnetDebugger::evaluateExpression(const char *tag, S32 frame, const char * const char* varResult = gEvalState.getLocalStringVariable(registerId); + gEvalState.popFrame(); + S32 len = dStrlen(format) + dStrlen(tag) + dStrlen(varResult); char* buffer = new char[len]; dSprintf(buffer, len, format, tag, varResult[0] ? varResult : "\"\""); From 1b54162580347187e37482f0c00077775d724444 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Thu, 19 Aug 2021 22:25:11 -0400 Subject: [PATCH 032/399] cleanup todos --- Engine/source/console/astNodes.cpp | 4 +--- Engine/source/console/console.cpp | 3 +-- Engine/source/console/console.h | 1 - Engine/source/console/simSet.cpp | 12 ++---------- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index 7b60ca22c..c85c32ebe 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -382,7 +382,7 @@ U32 IterStmtNode::compileStmt(CodeStream& codeStream, U32 ip) TypeReq varType = isStringIter ? TypeReqString : TypeReqUInt; const U32 startIp = ip; - containerExpr->compile(codeStream, startIp, TypeReqString); // todo: figure out better way to codegen this so we don't rely on STR + containerExpr->compile(codeStream, startIp, TypeReqString); codeStream.emit(isStringIter ? OP_ITER_BEGIN_STR : OP_ITER_BEGIN); codeStream.emit(isGlobal); @@ -544,8 +544,6 @@ void IntBinaryExprNode::getSubTypeOperand() U32 IntBinaryExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) { - // TODO: What if we do other optimizations and this doesn't work for it..this - // so far only works for simple MOD optimizations... if (optimize()) right = optimizedNode; diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index d49454a07..36b0aa4d8 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -1921,9 +1921,8 @@ StringTableEntry getModNameFromPath(const char *path) void postConsoleInput( RawData data ) { - // TODO(JTH): Mem leak // Schedule this to happen at the next time event. - ConsoleValue* argv = new ConsoleValue[2](); + ConsoleValue argv[2]; argv[0].setString("eval"); argv[1].setString(reinterpret_cast(data.data)); diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index 4a9f3be9d..d975ccd4d 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -133,7 +133,6 @@ struct ConsoleValueConsoleType EnumTable* enumTable; }; -// TODO: replace malloc/free with custom allocator... class ConsoleValue { union diff --git a/Engine/source/console/simSet.cpp b/Engine/source/console/simSet.cpp index 7daa515d7..bce5cd47d 100644 --- a/Engine/source/console/simSet.cpp +++ b/Engine/source/console/simSet.cpp @@ -231,20 +231,13 @@ void SimSet::scriptSort( const String &scriptCallbackFn ) void SimSet::callOnChildren( const String &method, S32 argc, ConsoleValue argv[], bool executeOnChildGroups ) { - // TODO(JTH): Implement - AssertISV(false, "TODO Implement"); - return; - - /* // Prep the arguments for the console exec... // Make sure and leave args[1] empty. ConsoleValue args[21] = { }; - ConsoleValue name_method; - name_method.setStackStringValue(method.c_str()); - args[0] = ConsoleValueRef::fromValue(&name_method); + args[0].setString(method.c_str()); for (S32 i = 0; i < argc; i++) - args[i + 2] = argv[i]; + args[i + 2].setString(argv[i].getString()); for( iterator i = begin(); i != end(); i++ ) { @@ -260,7 +253,6 @@ void SimSet::callOnChildren( const String &method, S32 argc, ConsoleValue argv[] childSet->callOnChildren( method, argc, argv, executeOnChildGroups ); } } - */ } //----------------------------------------------------------------------------- From 452ef71274cc4e8ce761136e1b21fec858a6a4fc Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Fri, 20 Aug 2021 20:38:24 -0400 Subject: [PATCH 033/399] * BugFix: Correct $i and %i interchangeably being used in parseArgs.tscript. --- .../core/utility/scripts/parseArgs.tscript | 194 +++++++++--------- 1 file changed, 97 insertions(+), 97 deletions(-) diff --git a/Templates/BaseGame/game/core/utility/scripts/parseArgs.tscript b/Templates/BaseGame/game/core/utility/scripts/parseArgs.tscript index d5a098c90..fcff3efb9 100644 --- a/Templates/BaseGame/game/core/utility/scripts/parseArgs.tscript +++ b/Templates/BaseGame/game/core/utility/scripts/parseArgs.tscript @@ -43,11 +43,11 @@ function popFront(%list, %delim) function parseArgs() { - for ($i = 1; $i < $Game::argc ; $i++) + for (%i = 1; %i < $Game::argc ; %i++) { - $arg = $Game::argv[$i]; - $nextArg = $Game::argv[$i+1]; - $hasNextArg = $Game::argc - $i > 1; + $arg = $Game::argv[%i]; + $nextArg = $Game::argv[%i+1]; + $hasNextArg = $Game::argc - %i > 1; $logModeSpecified = false; // Check for dedicated run @@ -55,7 +55,7 @@ function parseArgs() { $userDirs = $defaultGame; $dirCount = 1; - $isDedicated = true; + %isDedicated = true; }*/ switch$ ($arg) @@ -64,39 +64,39 @@ function parseArgs() case "-dedicated": $userDirs = $defaultGame; $dirCount = 1; - $isDedicated = true; + %isDedicated = true; $Server::Dedicated = true; enableWinConsole(true); - $argUsed[$i]++; - + $argUsed[%i]++; + //-------------------- case "-mission": - $argUsed[$i]++; - if ($hasNextArg) + $argUsed[%i]++; + if ($hasNextArg) { $missionArg = $nextArg; - $argUsed[$i+1]++; - $i++; + $argUsed[%i+1]++; + %i++; } else error("Error: Missing Command Line argument. Usage: -mission "); //-------------------- case "-connect": - $argUsed[$i]++; - if ($hasNextArg) + $argUsed[%i]++; + if ($hasNextArg) { $JoinGameAddress = $nextArg; - $argUsed[$i+1]++; - $i++; + $argUsed[%i+1]++; + %i++; } else error("Error: Missing Command Line argument. Usage: -connect "); - + //-------------------- case "-log": - $argUsed[$i]++; + $argUsed[%i]++; if ($hasNextArg) { // Turn on console logging @@ -107,22 +107,22 @@ function parseArgs() } setLogMode($nextArg); $logModeSpecified = true; - $argUsed[$i+1]++; - $i++; + $argUsed[%i+1]++; + %i++; } else error("Error: Missing Command Line argument. Usage: -log "); //-------------------- case "-dir": - $argUsed[$i]++; + $argUsed[%i]++; if ($hasNextArg) { // Append the mod to the end of the current list $userDirs = strreplace($userDirs, $nextArg, ""); $userDirs = pushFront($userDirs, $nextArg, ";"); - $argUsed[$i+1]++; - $i++; + $argUsed[%i+1]++; + %i++; $dirCount++; } else @@ -130,15 +130,15 @@ function parseArgs() //-------------------- // changed the default behavior of this command line arg. It now - // defaults to ONLY loading the game, not tools + // defaults to ONLY loading the game, not tools // default auto-run already loads in tools --SRZ 11/29/07 case "-game": - $argUsed[$i]++; + $argUsed[%i]++; if ($hasNextArg) { // Set the selected dir --NOTE: we no longer allow tools with this argument - /* - if( $isDedicated ) + /* + if( %isDedicated ) { $userDirs = $nextArg; $dirCount = 1; @@ -151,8 +151,8 @@ function parseArgs() */ $userDirs = $nextArg; $dirCount = 1; - $argUsed[$i+1]++; - $i++; + $argUsed[%i+1]++; + %i++; error($userDirs); } else @@ -161,121 +161,121 @@ function parseArgs() //-------------------- case "-console": enableWinConsole(true); - $argUsed[$i]++; + $argUsed[%i]++; //-------------------- case "-jSave": - $argUsed[$i]++; + $argUsed[%i]++; if ($hasNextArg) { echo("Saving event log to journal: " @ $nextArg); saveJournal($nextArg); - $argUsed[$i+1]++; - $i++; + $argUsed[%i+1]++; + %i++; } else error("Error: Missing Command Line argument. Usage: -jSave "); //-------------------- case "-jPlay": - $argUsed[$i]++; + $argUsed[%i]++; if ($hasNextArg) { playJournal($nextArg); - $argUsed[$i+1]++; - $i++; + $argUsed[%i+1]++; + %i++; } else error("Error: Missing Command Line argument. Usage: -jPlay "); - + //-------------------- case "-jPlayToVideo": - $argUsed[$i]++; + $argUsed[%i]++; if ($hasNextArg) { $VideoCapture::journalName = $nextArg; $VideoCapture::captureFromJournal = true; - $argUsed[$i+1]++; - $i++; + $argUsed[%i+1]++; + %i++; } else error("Error: Missing Command Line argument. Usage: -jPlayToVideo "); - + //-------------------- case "-vidCapFile": - $argUsed[$i]++; + $argUsed[%i]++; if ($hasNextArg) { $VideoCapture::fileName = $nextArg; - $argUsed[$i+1]++; - $i++; + $argUsed[%i+1]++; + %i++; } else error("Error: Missing Command Line argument. Usage: -vidCapFile "); - + //-------------------- case "-vidCapFPS": - $argUsed[$i]++; + $argUsed[%i]++; if ($hasNextArg) { $VideoCapture::fps = $nextArg; - $argUsed[$i+1]++; - $i++; + $argUsed[%i+1]++; + %i++; } else error("Error: Missing Command Line argument. Usage: -vidCapFPS "); - + //-------------------- case "-vidCapEncoder": - $argUsed[$i]++; + $argUsed[%i]++; if ($hasNextArg) { $VideoCapture::encoder = $nextArg; - $argUsed[$i+1]++; - $i++; + $argUsed[%i+1]++; + %i++; } else error("Error: Missing Command Line argument. Usage: -vidCapEncoder "); - + //-------------------- case "-vidCapWidth": - $argUsed[$i]++; + $argUsed[%i]++; if ($hasNextArg) { $videoCapture::width = $nextArg; - $argUsed[$i+1]++; - $i++; + $argUsed[%i+1]++; + %i++; } else error("Error: Missing Command Line argument. Usage: -vidCapWidth "); - + //-------------------- case "-vidCapHeight": - $argUsed[$i]++; + $argUsed[%i]++; if ($hasNextArg) { $videoCapture::height = $nextArg; - $argUsed[$i+1]++; - $i++; + $argUsed[%i+1]++; + %i++; } else error("Error: Missing Command Line argument. Usage: -vidCapHeight "); //-------------------- case "-level": - $argUsed[$i]++; + $argUsed[%i]++; if ($hasNextArg) { %hasExt = strpos($nextArg, ".mis"); if(%hasExt == -1) { $levelToLoad = $nextArg @ " "; - - for(%j = $i + 2; %j < $Game::argc; %j++) + + for(%j = %i + 2; %j < $Game::argc; %j++) { $arg = $Game::argv[%j]; %hasExt = strpos($arg, ".mis"); - + if(%hasExt == -1) { $levelToLoad = $levelToLoad @ $arg @ " "; @@ -285,14 +285,14 @@ function parseArgs() break; } } - } + } else { $levelToLoad = $nextArg; } - - $argUsed[$i+1]++; - $i++; + + $argUsed[%i+1]++; + %i++; } else error("Error: Missing Command Line argument. Usage: -level "); @@ -300,93 +300,93 @@ function parseArgs() //------------------- case "-worldeditor": $startWorldEditor = true; - $argUsed[$i]++; + $argUsed[%i]++; //------------------- case "-guieditor": $startGUIEditor = true; - $argUsed[$i]++; + $argUsed[%i]++; //------------------- case "-help": $displayHelp = true; - $argUsed[$i]++; + $argUsed[%i]++; //------------------- case "-compileAll": $compileAll = true; - $argUsed[$i]++; - + $argUsed[%i]++; + //------------------- case "-compileTools": $compileTools = true; - $argUsed[$i]++; + $argUsed[%i]++; //------------------- case "-genScript": $genScript = true; - $argUsed[$i]++; - + $argUsed[%i]++; + case "-fullscreen": $cliFullscreen = true; - $argUsed[$i]++; + $argUsed[%i]++; case "-windowed": $cliFullscreen = false; - $argUsed[$i]++; + $argUsed[%i]++; case "-openGL": $pref::Video::displayDevice = "OpenGL"; - $argUsed[$i]++; + $argUsed[%i]++; case "-directX": $pref::Video::displayDevice = "D3D"; - $argUsed[$i]++; + $argUsed[%i]++; case "-autoVideo": $pref::Video::displayDevice = ""; - $argUsed[$i]++; + $argUsed[%i]++; case "-prefs": - $argUsed[$i]++; + $argUsed[%i]++; if ($hasNextArg) { exec($nextArg, true, true); - $argUsed[$i+1]++; - $i++; + $argUsed[%i+1]++; + %i++; } else error("Error: Missing Command Line argument. Usage: -prefs "); - + //------------------- default: - $argUsed[$i]++; + $argUsed[%i]++; if($userDirs $= "") $userDirs = $arg; } } - + //----------------------------------------------- // Play journal to video file? if ($VideoCapture::captureFromJournal && $VideoCapture::journalName !$= "") - { + { if ($VideoCapture::fileName $= "") - $VideoCapture::fileName = $VideoCapture::journalName; - + $VideoCapture::fileName = $VideoCapture::journalName; + if ($VideoCapture::encoder $= "") $VideoCapture::encoder = "THEORA"; - + if ($VideoCapture::fps $= "") $VideoCapture::fps = 30; - + if ($videoCapture::width $= "") $videoCapture::width = 0; - + if ($videoCapture::height $= "") $videoCapture::height = 0; - - playJournalToVideo( $VideoCapture::journalName, $VideoCapture::fileName, - $VideoCapture::encoder, $VideoCapture::fps, + + playJournalToVideo( $VideoCapture::journalName, $VideoCapture::fileName, + $VideoCapture::encoder, $VideoCapture::fps, $videoCapture::width SPC $videoCapture::height ); } -} \ No newline at end of file +} From a2d5e475fb41fda7af806c5ca4d180d2a48b96b8 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sun, 29 Aug 2021 22:41:48 -0400 Subject: [PATCH 034/399] fix script issue. --- .../game/tools/assetBrowser/scripts/assetTypes/terrain.tscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript index 85a9cd9c2..1c51a7d42 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript @@ -169,7 +169,7 @@ function AssetBrowser::buildTerrainAssetPreview(%this, %assetDef, %previewData) %previewData.tooltip = "Asset Name: " @ %assetDef.assetName @ "\nAsset Type: Terrain Asset" @ "\nAsset Definition ID: " @ %assetDef @ - "\nDefinition Path: " @ %assetPath @ %assetDef.getTerrainFilePath(); + "\nDefinition Path: " @ %assetDef.getTerrainFilePath(); } function GuiInspectorTypeTerrainAssetPtr::onClick( %this, %fieldName ) From 56b0a0cb8598cf31997fd024c28ca4b5590987ab Mon Sep 17 00:00:00 2001 From: JeffR Date: Tue, 31 Aug 2021 00:54:05 -0500 Subject: [PATCH 035/399] Initial hook-in of the sound asset's integration into sfxEmitter, as well as some fixups for editor/workflow usage. --- Engine/source/T3D/assets/SoundAsset.cpp | 157 ++++++++++++++++-- Engine/source/T3D/assets/SoundAsset.h | 17 +- Engine/source/T3D/assets/assetImporter.cpp | 97 ++--------- Engine/source/T3D/sfx/sfxEmitter.cpp | 65 +++++--- Engine/source/T3D/sfx/sfxEmitter.h | 9 +- .../scripts/assetTypes/sound.tscript | 7 +- 6 files changed, 214 insertions(+), 138 deletions(-) diff --git a/Engine/source/T3D/assets/SoundAsset.cpp b/Engine/source/T3D/assets/SoundAsset.cpp index 14cb00744..d4e9a745a 100644 --- a/Engine/source/T3D/assets/SoundAsset.cpp +++ b/Engine/source/T3D/assets/SoundAsset.cpp @@ -40,6 +40,10 @@ #include "assets/assetPtr.h" #endif +#ifndef _SFXSOURCE_H_ +#include "sfx/sfxSource.h" +#endif + // Debug Profiling. #include "platform/profiler.h" #include "sfx/sfxTypes.h" @@ -159,7 +163,7 @@ void SoundAsset::initPersistFields() addField("maxDistance", TypeF32, Offset(mProfileDesc.mMaxDistance, SoundAsset), "Max distance for sound."); addField("coneInsideAngle", TypeS32, Offset(mProfileDesc.mConeInsideAngle, SoundAsset), "Cone inside angle."); addField("coneOutsideAngle", TypeS32, Offset(mProfileDesc.mConeOutsideAngle, SoundAsset), "Cone outside angle."); - addField("coneOutsideVolume", TypeS32, Offset(mProfileDesc.mConeOutsideVolume, SoundAsset), "Cone outside volume."); + addField("coneOutsideVolume", TypeF32, Offset(mProfileDesc.mConeOutsideVolume, SoundAsset), "Cone outside volume."); addField("rolloffFactor", TypeF32, Offset(mProfileDesc.mRolloffFactor, SoundAsset), "Rolloff factor."); addField("scatterDistance", TypePoint3F, Offset(mProfileDesc.mScatterDistance, SoundAsset), "Randomization to the spacial position of the sound."); addField("sourceGroup", TypeSFXSourceName, Offset(mProfileDesc.mSourceGroup, SoundAsset), "Group that sources playing with this description should be put into."); @@ -181,13 +185,7 @@ void SoundAsset::initializeAsset(void) if (mSoundFile == StringTable->EmptyString()) return; - //ResourceManager::get().getChangedSignal.notify(this, &SoundAsset::_onResourceChanged); - - //Ensure our path is expando'd if it isn't already mSoundPath = getOwned() ? expandAssetFilePath(mSoundFile) : mSoundPath; - - mSoundPath = expandAssetFilePath(mSoundPath); - loadSound(); } @@ -208,7 +206,6 @@ void SoundAsset::onAssetRefresh(void) //Update mSoundPath = getOwned() ? expandAssetFilePath(mSoundFile) : mSoundPath; - loadSound(); } @@ -225,7 +222,7 @@ bool SoundAsset::loadSound() else {// = new SFXProfile(mProfileDesc, mSoundFile, mPreload); mSFXProfile.setDescription(&mProfileDesc); - mSFXProfile.setSoundFileName(mSoundFile); + mSFXProfile.setSoundFileName(mSoundPath); mSFXProfile.setPreload(mPreload); } @@ -254,11 +251,98 @@ void SoundAsset::setSoundFile(const char* pSoundFile) refreshAsset(); } +StringTableEntry SoundAsset::getAssetIdByFileName(StringTableEntry fileName) +{ + if (fileName == StringTable->EmptyString()) + return StringTable->EmptyString(); + + StringTableEntry materialAssetId = ""; + + AssetQuery query; + U32 foundCount = AssetDatabase.findAssetType(&query, "SoundAsset"); + if (foundCount != 0) + { + for (U32 i = 0; i < foundCount; i++) + { + SoundAsset* soundAsset = AssetDatabase.acquireAsset(query.mAssetList[i]); + if (soundAsset && soundAsset->getSoundPath() == fileName) + { + materialAssetId = soundAsset->getAssetId(); + AssetDatabase.releaseAsset(query.mAssetList[i]); + break; + } + AssetDatabase.releaseAsset(query.mAssetList[i]); + } + } + + return materialAssetId; +} + +U32 SoundAsset::getAssetById(StringTableEntry assetId, AssetPtr* materialAsset) +{ + (*materialAsset) = assetId; + + if (materialAsset->notNull()) + { + return (*materialAsset)->mLoadedState; + } + else + { + //Well that's bad, loading the fallback failed. + Con::warnf("MaterialAsset::getAssetById - Finding of asset with id %s failed with no fallback asset", assetId); + return AssetErrCode::Failed; + } +} + +U32 SoundAsset::getAssetByFileName(StringTableEntry fileName, AssetPtr* soundAsset) +{ + AssetQuery query; + U32 foundAssetcount = AssetDatabase.findAssetType(&query, "SoundAsset"); + if (foundAssetcount == 0) + { + //Well that's bad, loading the fallback failed. + Con::warnf("MaterialAsset::getAssetByMaterialName - Finding of asset associated with filename %s failed with no fallback asset", fileName); + return AssetErrCode::Failed; + } + else + { + for (U32 i = 0; i < foundAssetcount; i++) + { + SoundAsset* tSoundAsset = AssetDatabase.acquireAsset(query.mAssetList[i]); + if (tSoundAsset && tSoundAsset->getSoundPath() == fileName) + { + soundAsset->setAssetId(query.mAssetList[i]); + AssetDatabase.releaseAsset(query.mAssetList[i]); + return (*soundAsset)->mLoadedState; + } + AssetDatabase.releaseAsset(query.mAssetList[i]); //cleanup if that's not the one we needed + } + } + + //No good match + return AssetErrCode::Failed; +} + DefineEngineMethod(SoundAsset, getSoundPath, const char*, (), , "") { return object->getSoundPath(); } +DefineEngineMethod(SoundAsset, playSound, S32, (Point3F position), (Point3F::Zero), + "Gets the number of materials for this shape asset.\n" + "@return Material count.\n") +{ + if (object->getSfxProfile()) + { + MatrixF transform; + transform.setPosition(position); + SFXSource* source = SFX->playOnce(object->getSfxProfile(), &transform, NULL, -1); + return source->getId(); + } + else + return 0; +} + IMPLEMENT_CONOBJECT(GuiInspectorTypeSoundAssetPtr); ConsoleDocClass(GuiInspectorTypeSoundAssetPtr, @@ -276,12 +360,63 @@ void GuiInspectorTypeSoundAssetPtr::consoleInit() GuiControl * GuiInspectorTypeSoundAssetPtr::constructEditControl() { - return nullptr; + // Create base filename edit controls + GuiControl* retCtrl = Parent::constructEditControl(); + if (retCtrl == NULL) + return retCtrl; + + // Change filespec + char szBuffer[512]; + dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"SoundAsset\", \"AssetBrowser.changeAsset\", %s, \"\");", + getIdString()); + mBrowseButton->setField("Command", szBuffer); + + setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString()); + + // Create "Open in Editor" button + mEditButton = new GuiBitmapButtonCtrl(); + + dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.editAsset(%d.getText());", retCtrl->getId()); + mEditButton->setField("Command", szBuffer); + + char bitmapName[512] = "ToolsModule:SFXEmitter_image"; + mEditButton->setBitmap(StringTable->insert(bitmapName)); + + mEditButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile"); + mEditButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile"); + mEditButton->setDataField(StringTable->insert("hovertime"), NULL, "1000"); + mEditButton->setDataField(StringTable->insert("tooltip"), NULL, "Test play this sound"); + + mEditButton->registerObject(); + addObject(mEditButton); + + return retCtrl; } bool GuiInspectorTypeSoundAssetPtr::updateRects() { - return false; + S32 dividerPos, dividerMargin; + mInspector->getDivider(dividerPos, dividerMargin); + Point2I fieldExtent = getExtent(); + Point2I fieldPos = getPosition(); + + mCaptionRect.set(0, 0, fieldExtent.x - dividerPos - dividerMargin, fieldExtent.y); + mEditCtrlRect.set(fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 34, fieldExtent.y); + + bool resized = mEdit->resize(mEditCtrlRect.point, mEditCtrlRect.extent); + if (mBrowseButton != NULL) + { + mBrowseRect.set(fieldExtent.x - 32, 2, 14, fieldExtent.y - 4); + resized |= mBrowseButton->resize(mBrowseRect.point, mBrowseRect.extent); + } + + if (mEditButton != NULL) + { + RectI shapeEdRect(fieldExtent.x - 16, 2, 14, fieldExtent.y - 4); + resized |= mEditButton->resize(shapeEdRect.point, shapeEdRect.extent); + } + + return resized; } IMPLEMENT_CONOBJECT(GuiInspectorTypeSoundAssetId); diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index eb273291c..b70c4ca80 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -122,6 +122,9 @@ public: bool isLoop() { return mProfileDesc.mIsLooping; } bool is3D() { return mProfileDesc.mIs3D; } + static StringTableEntry getAssetIdByFileName(StringTableEntry fileName); + static U32 getAssetById(StringTableEntry assetId, AssetPtr* materialAsset); + static U32 getAssetByFileName(StringTableEntry fileName, AssetPtr* matAsset); protected: virtual void initializeAsset(void); @@ -143,7 +146,7 @@ class GuiInspectorTypeSoundAssetPtr : public GuiInspectorTypeFileName typedef GuiInspectorTypeFileName Parent; public: - GuiBitmapButtonCtrl* mSoundButton; + GuiBitmapButtonCtrl* mEditButton; DECLARE_CONOBJECT(GuiInspectorTypeSoundAssetPtr); static void consoleInit(); @@ -168,14 +171,14 @@ public: /// Declares a sound asset /// This establishes the assetId, asset and legacy filepath fields, along with supplemental getter and setter functions /// -#define DECLARE_SOUNDASSET(className, name, profile) public: \ +#define DECLARE_SOUNDASSET(className, name) public: \ Resource m##name;\ StringTableEntry m##name##Name; \ StringTableEntry m##name##AssetId;\ AssetPtr m##name##Asset = NULL;\ - SFXProfile* m##name##Profile = &profile;\ + SFXProfile* m##name##Profile = NULL;\ public: \ - const StringTableEntry get##name##File() const { return m##name##Name); }\ + const StringTableEntry get##name##File() const { return m##name##Name; }\ void set##name##File(const FileName &_in) { m##name##Name = StringTable->insert(_in.c_str());}\ const AssetPtr & get##name##Asset() const { return m##name##Asset; }\ void set##name##Asset(const AssetPtr &_in) { m##name##Asset = _in;}\ @@ -206,7 +209,7 @@ public: \ }\ else\ {\ - StringTableEntry assetId = SoundAsset::getAssetIdByFilename(_in);\ + StringTableEntry assetId = SoundAsset::getAssetIdByFileName(_in);\ if (assetId != StringTable->EmptyString())\ {\ m##name##AssetId = assetId;\ @@ -232,9 +235,9 @@ public: \ m##name = NULL;\ }\ \ - if (m##name##Asset.notNull() && m##name##Asset->getStatus() != ShapeAsset::Ok)\ + if (m##name##Asset.notNull() && m##name##Asset->getStatus() != SoundAsset::Ok)\ {\ - Con::errorf("%s(%s)::_set%s() - sound asset failure\"%s\" due to [%s]", macroText(className), getName(), macroText(name), _in, ShapeAsset::getAssetErrstrn(m##name##Asset->getStatus()).c_str());\ + Con::errorf("%s(%s)::_set%s() - sound asset failure\"%s\" due to [%s]", macroText(className), getName(), macroText(name), _in, SoundAsset::getAssetErrstrn(m##name##Asset->getStatus()).c_str());\ return false; \ }\ else if (bool(m##name) == NULL)\ diff --git a/Engine/source/T3D/assets/assetImporter.cpp b/Engine/source/T3D/assets/assetImporter.cpp index b0497631e..c6095726e 100644 --- a/Engine/source/T3D/assets/assetImporter.cpp +++ b/Engine/source/T3D/assets/assetImporter.cpp @@ -1412,8 +1412,10 @@ void AssetImporter::processImportAssets(AssetImportObject* assetItem) { processShapeAsset(item); } - /*else if (item->assetType == String("SoundAsset")) - SoundAsset::prepareAssetForImport(this, item);*/ + else if (item->assetType == String("SoundAsset")) + { + processSoundAsset(item); + } else if (item->assetType == String("MaterialAsset")) { processMaterialAsset(item); @@ -1462,8 +1464,10 @@ void AssetImporter::processImportAssets(AssetImportObject* assetItem) { processShapeAsset(childItem); } - /*else if (item->assetType == String("SoundAsset")) - SoundAsset::prepareAssetForImport(this, item);*/ + else if (childItem->assetType == String("SoundAsset")) + { + processSoundAsset(childItem); + } else if (childItem->assetType == String("MaterialAsset")) { processMaterialAsset(childItem); @@ -2046,93 +2050,12 @@ void AssetImporter::processShapeMaterialInfo(AssetImportObject* assetItem, S32 m void AssetImporter::processSoundAsset(AssetImportObject* assetItem) { - dSprintf(importLogBuffer, sizeof(importLogBuffer), "Preparing Image for Import: %s", assetItem->assetName.c_str()); + dSprintf(importLogBuffer, sizeof(importLogBuffer), "Preparing Sound for Import: %s", assetItem->assetName.c_str()); activityLog.push_back(importLogBuffer); - if ((activeImportConfig->GenerateMaterialOnImport && assetItem->parentAssetItem == nullptr)/* || assetItem->parentAssetItem != nullptr*/) - { - //find our suffix match, if any - String noSuffixName = assetItem->assetName; - String suffixType; - String suffix = parseImageSuffixes(assetItem->assetName, &suffixType); - if (suffix.isNotEmpty()) - { - assetItem->imageSuffixType = suffixType; - S32 suffixPos = assetItem->assetName.find(suffix, 0, String::NoCase | String::Left); - noSuffixName = assetItem->assetName.substr(0, suffixPos); - } - - //We try to automatically populate materials under the naming convention: materialName: Rock, image maps: Rock_Albedo, Rock_Normal, etc - - AssetImportObject* materialAsset = findImportingAssetByName(noSuffixName); - if (materialAsset != nullptr && materialAsset->assetType != String("MaterialAsset")) - { - //We may have a situation where an asset matches the no-suffix name, but it's not a material asset. Ignore this - //asset item for now - - materialAsset = nullptr; - } - - //If we didn't find a matching material asset in our current items, we'll make one now - if (materialAsset == nullptr) - { - if (!assetItem->filePath.isEmpty()) - { - materialAsset = addImportingAsset("MaterialAsset", assetItem->filePath, nullptr, noSuffixName); - } - } - - //Not that, one way or another, we have the generated material asset, lets move on to associating our image with it - if (materialAsset != nullptr && materialAsset != assetItem->parentAssetItem) - { - if (assetItem->parentAssetItem != nullptr) - { - //If the image had an existing parent, it gets removed from that parent's child item list - assetItem->parentAssetItem->childAssetItems.remove(assetItem); - } - else - { - //If it didn't have one, we're going to pull it from the importingAssets list - importingAssets.remove(assetItem); - } - - //Now we can add it to the correct material asset - materialAsset->childAssetItems.push_back(assetItem); - assetItem->parentAssetItem = materialAsset; - - assetHeirarchyChanged = true; - } - - //Now to do some cleverness. If we're generating a material, we can parse like assets being imported(similar filenames) but different suffixes - //If we find these, we'll just populate into the original's material - - //if we need to append the diffuse suffix and indeed didn't find a suffix on the name, do that here - if (suffixType.isEmpty()) - { - if (activeImportConfig->UseDiffuseSuffixOnOriginImage) - { - String diffuseToken = StringUnit::getUnit(activeImportConfig->DiffuseTypeSuffixes, 0, ",;\t"); - assetItem->assetName = assetItem->assetName + diffuseToken; - assetItem->cleanAssetName = assetItem->assetName; - } - else - { - //We need to ensure that our image asset doesn't match the same name as the material asset, so if we're not trying to force the diffuse suffix - //we'll give it a generic one - if ((materialAsset && materialAsset->assetName.compare(assetItem->assetName) == 0) || activeImportConfig->AlwaysAddImageSuffix) - { - assetItem->assetName = assetItem->assetName + activeImportConfig->AddedImageSuffix; - assetItem->cleanAssetName = assetItem->assetName; - } - } - - //Assume for abledo if it has no suffix matches - assetItem->imageSuffixType = "Albedo"; - } - } - assetItem->processed = true; } + // // Validation // diff --git a/Engine/source/T3D/sfx/sfxEmitter.cpp b/Engine/source/T3D/sfx/sfxEmitter.cpp index e48ca8fee..655e0071a 100644 --- a/Engine/source/T3D/sfx/sfxEmitter.cpp +++ b/Engine/source/T3D/sfx/sfxEmitter.cpp @@ -94,22 +94,23 @@ ColorI SFXEmitter::smRenderColorRangeSphere( 200, 0, 0, 90 ); SFXEmitter::SFXEmitter() : SceneObject(), mSource( NULL ), - mTrack( NULL ), mUseTrackDescriptionOnly( false ), - mLocalProfile( &mDescription ), mPlayOnAdd( true ) { mTypeMask |= MarkerObjectType; mNetFlags.set( Ghostable | ScopeAlways ); - + mDescription.mIs3D = true; mDescription.mIsLooping = true; mDescription.mIsStreaming = false; mDescription.mFadeInTime = -1.f; mDescription.mFadeOutTime = -1.f; - + + mLocalProfile.mFilename = StringTable->EmptyString(); mLocalProfile._registerSignals(); + INIT_SOUNDASSET(Sound); + mObjBox.minExtents.set( -1.f, -1.f, -1.f ); mObjBox.maxExtents.set( 1.f, 1.f, 1.f ); } @@ -174,15 +175,17 @@ void SFXEmitter::consoleInit() void SFXEmitter::initPersistFields() { addGroup( "Media" ); - - addField( "track", TypeSFXTrackName, Offset( mTrack, SFXEmitter), + + INITPERSISTFIELD_SOUNDASSET(Sound, SFXEmitter, ""); + + /*addField("track", TypeSFXTrackName, Offset(mTrack, SFXEmitter), "The track which the emitter should play.\n" "@note If assigned, this field will take precedence over a #fileName that may also be assigned to the " "emitter." ); addField( "fileName", TypeStringFilename, Offset( mLocalProfile.mFilename, SFXEmitter), "The sound file to play.\n" "Use @b either this property @b or #track. If both are assigned, #track takes precendence. The primary purpose of this " - "field is to avoid the need for the user to define SFXTrack datablocks for all sounds used in a level." ); + "field is to avoid the need for the user to define SFXTrack datablocks for all sounds used in a level." );*/ endGroup( "Media"); @@ -287,12 +290,13 @@ U32 SFXEmitter::packUpdate( NetConnection *con, U32 mask, BitStream *stream ) stream->writeAffineTransform( mObjToWorld ); // track - if( stream->writeFlag( mDirty.test( Track ) ) ) - sfxWrite( stream, mTrack ); + PACK_SOUNDASSET(con, Sound); + //if (stream->writeFlag(mDirty.test(Track))) + // sfxWrite( stream, mTrack ); // filename - if( stream->writeFlag( mDirty.test( Filename ) ) ) - stream->writeString( mLocalProfile.mFilename ); + //if( stream->writeFlag( mDirty.test( Filename ) ) ) + // stream->writeString( mLocalProfile.mFilename ); // volume if( stream->writeFlag( mDirty.test( Volume ) ) ) @@ -397,7 +401,8 @@ void SFXEmitter::unpackUpdate( NetConnection *conn, BitStream *stream ) } // track - if ( _readDirtyFlag( stream, Track ) ) + UNPACK_SOUNDASSET(conn, Sound); + /*if (_readDirtyFlag(stream, Track)) { String errorStr; if( !sfxReadAndResolve( stream, &mTrack, errorStr ) ) @@ -406,7 +411,7 @@ void SFXEmitter::unpackUpdate( NetConnection *conn, BitStream *stream ) // filename if ( _readDirtyFlag( stream, Filename ) ) - mLocalProfile.mFilename = stream->readSTString(); + mLocalProfile.mFilename = stream->readSTString();*/ // volume if ( _readDirtyFlag( stream, Volume ) ) @@ -586,8 +591,8 @@ void SFXEmitter::inspectPostApply() // Parent will call setScale so sync up scale with distance. F32 maxDistance = mDescription.mMaxDistance; - if( mUseTrackDescriptionOnly && mTrack ) - maxDistance = mTrack->getDescription()->mMaxDistance; + if( mUseTrackDescriptionOnly && mSoundAsset ) + maxDistance = mSoundAsset->getSfxDescription()->mMaxDistance; mObjScale.set( maxDistance, maxDistance, maxDistance ); @@ -608,8 +613,8 @@ bool SFXEmitter::onAdd() mDescription.validate(); // Read an old 'profile' field for backwards-compatibility. - - if( !mTrack ) + /* + if(mSoundAsset.isNull() || !mSoundAsset->getSfxProfile()) { static const char* sProfile = StringTable->insert( "profile" ); const char* profileName = getDataField( sProfile, NULL ); @@ -643,7 +648,7 @@ bool SFXEmitter::onAdd() // Remove the old 'channel' field. setDataField( sChannel, NULL, "" ); } - } + }*/ } else { @@ -683,6 +688,12 @@ void SFXEmitter::_update() // we can restore it. SFXStatus prevState = mSource ? mSource->getStatus() : SFXStatusNull; + if (mSoundAsset.notNull() ) + { + mLocalProfile = *mSoundAsset->getSfxProfile(); + mDescription = *mSoundAsset->getSfxDescription(); + } + // Make sure all the settings are valid. mDescription.validate(); @@ -695,12 +706,12 @@ void SFXEmitter::_update() SFX_DELETE( mSource ); // Do we have a track? - if( mTrack ) + if( mSoundAsset && mSoundAsset->getSfxProfile() ) { - mSource = SFX->createSource( mTrack, &transform, &velocity ); + mSource = SFX->createSource(mSoundAsset->getSfxProfile(), &transform, &velocity ); if( !mSource ) Con::errorf( "SFXEmitter::_update() - failed to create sound for track %i (%s)", - mTrack->getId(), mTrack->getName() ); + mSoundAsset->getSfxProfile()->getId(), mSoundAsset->getSfxProfile()->getName() ); // If we're supposed to play when the emitter is // added to the scene then also restart playback @@ -739,12 +750,12 @@ void SFXEmitter::_update() // is toggled on a local profile sound. It makes the // editor feel responsive and that things are working. if( gEditingMission && - !mTrack && + (mSoundAsset.isNull() || !mSoundAsset->getSfxProfile()) && mPlayOnAdd && mDirty.test( IsLooping ) ) prevState = SFXStatusPlaying; - bool useTrackDescriptionOnly = ( mUseTrackDescriptionOnly && mTrack ); + bool useTrackDescriptionOnly = ( mUseTrackDescriptionOnly && mSoundAsset.notNull() && mSoundAsset->getSfxProfile()); // The rest only applies if we have a source. if( mSource ) @@ -1087,8 +1098,8 @@ SFXStatus SFXEmitter::_getPlaybackStatus() const bool SFXEmitter::is3D() const { - if( mTrack != NULL ) - return mTrack->getDescription()->mIs3D; + if( mSoundAsset.notNull() && mSoundAsset->getSfxProfile() != NULL ) + return mSoundAsset->getSfxProfile()->getDescription()->mIs3D; else return mDescription.mIs3D; } @@ -1124,8 +1135,8 @@ void SFXEmitter::setScale( const VectorF &scale ) { F32 maxDistance; - if( mUseTrackDescriptionOnly && mTrack ) - maxDistance = mTrack->getDescription()->mMaxDistance; + if( mUseTrackDescriptionOnly && mSoundAsset.notNull() && mSoundAsset->getSfxProfile()) + maxDistance = mSoundAsset->getSfxProfile()->getDescription()->mMaxDistance; else { // Use the average of the three coords. diff --git a/Engine/source/T3D/sfx/sfxEmitter.h b/Engine/source/T3D/sfx/sfxEmitter.h index 226cf5ce5..aeecd13bf 100644 --- a/Engine/source/T3D/sfx/sfxEmitter.h +++ b/Engine/source/T3D/sfx/sfxEmitter.h @@ -36,6 +36,7 @@ #include "gfx/gfxStateBlock.h" #endif +#include "T3D/assets/SoundAsset.h" class SFXSource; class SFXTrack; @@ -103,13 +104,11 @@ class SFXEmitter : public SceneObject /// The current dirty flags. BitSet32 mDirty; + DECLARE_SOUNDASSET(SFXEmitter, Sound); + DECLARE_SOUNDASSET_NET_SETGET(SFXEmitter, Sound, DirtyUpdateMask); + /// The sound source for the emitter. SFXSource *mSource; - - /// The selected track or null if the local - /// profile should be used. - SFXTrack *mTrack; - /// Whether to leave sound setup exclusively to the assigned mTrack and not /// override part of the track's description with emitter properties. bool mUseTrackDescriptionOnly; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript index c32222568..304d21532 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript @@ -38,7 +38,7 @@ function AssetBrowser::onSoundAssetEditorDropped(%this, %assetDef, %position) %newSFXEmitter = new SFXEmitter() { position = %pos; - fileName = %assetDef.getSoundPath(); + soundAsset = %assetDef.getAssetId(); pitch = %assetDef.pitchAdjust; volume = %assetDef.volumeAdjust; }; @@ -50,4 +50,9 @@ function AssetBrowser::onSoundAssetEditorDropped(%this, %assetDef, %position) EWorldEditor.isDirty = true; +} + +function AssetBrowser::editSoundAsset(%this, %assetDef) +{ + %soundSource = %assetDef.playSound(); } \ No newline at end of file From f04aca9def3a15727d8a7f4bac77c190b41d0100 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Tue, 31 Aug 2021 22:18:08 -0400 Subject: [PATCH 036/399] Fix string stack issue returning from a foreach statement. --- Engine/source/console/compiledEval.cpp | 71 +++++------- Engine/source/console/test/ScriptTest.cpp | 133 ++++++++++++++++++++++ 2 files changed, 162 insertions(+), 42 deletions(-) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index e9b4d2f61..99e5a633a 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -1257,9 +1257,9 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa { iterStack[--_ITER].mIsStringIter = false; --iterDepth; - } - _STK--; // this is a pop from foreach() + _STK--; // this is a pop from foreach() + } } returnValue.setEmptyString(); @@ -1269,61 +1269,48 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_RETURN: { - if (iterDepth > 0) - { - // Clear iterator state. - while (iterDepth > 0) - { - iterStack[--_ITER].mIsStringIter = false; - --iterDepth; - } - - - const char* retVal = stack[_STK].getString(); - _STK--; - _STK--; - stack[_STK + 1].setString(retVal); - _STK++; // Not nice but works. - } - returnValue = std::move(stack[_STK]); _STK--; + // Clear iterator state. + while (iterDepth > 0) + { + iterStack[--_ITER].mIsStringIter = false; + --iterDepth; + + _STK--; + } + goto execFinished; } case OP_RETURN_FLT: - - if (iterDepth > 0) - { - // Clear iterator state. - while (iterDepth > 0) - { - iterStack[--_ITER].mIsStringIter = false; - --iterDepth; - } - - } - returnValue.setFloat(stack[_STK].getFloat()); _STK--; + // Clear iterator state. + while (iterDepth > 0) + { + iterStack[--_ITER].mIsStringIter = false; + --iterDepth; + + _STK--; + } + goto execFinished; case OP_RETURN_UINT: - - if (iterDepth > 0) - { - // Clear iterator state. - while (iterDepth > 0) - { - iterStack[--_ITER].mIsStringIter = false; - --iterDepth; - } - } - returnValue.setInt(stack[_STK].getInt()); _STK--; + // Clear iterator state. + while (iterDepth > 0) + { + iterStack[--_ITER].mIsStringIter = false; + --iterDepth; + + _STK--; + } + goto execFinished; case OP_CMPEQ: diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index f0aeb57bd..fefdf446d 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -405,6 +405,124 @@ TEST(Script, ForEachLoop) )"); ASSERT_EQ(forEach4.getInt(), 5); + + ConsoleValue forEach5 = RunScript(R"( + function SimObject::ret1(%this) + { + return 1; + } + + function SimSet::doForeach5(%this) + { + %count = 0; + foreach (%obj in %this) + { + %count += %obj.ret1(); + } + return %count; + } + + function a() + { + %set = new SimSet(); + %set.add(new SimObject()); + %set.add(new SimObject()); + %set.add(new SimObject()); + + return %set.doForeach5(); + } + + return a(); + )"); + + ASSERT_EQ(forEach5.getInt(), 3); + + ConsoleValue forEachContinue = RunScript(R"( + function SimSet::foreach6(%this) + { + %count = 0; + foreach (%obj in %this) + { + if (%obj.getName() $= "A") + continue; + + %count++; + } + return %count; + } + + function a() + { + %set = new SimSet(); + %set.add(new SimObject(A)); + %set.add(new SimObject()); + %set.add(new SimObject()); + + return %set.foreach6(); + } + + return a(); + )"); + + ASSERT_EQ(forEachContinue.getInt(), 2); + + ConsoleValue forEachReturn = RunScript(R"( + function SimSet::findA(%this) + { + foreach (%obj in %this) + { + if (%obj.getName() $= "A") + return 76; + } + return 0; + } + + function a() + { + %set = new SimSet(); + %set.add(new SimObject(A)); + %set.add(new SimObject()); + %set.add(new SimObject()); + + return %set.findA(); + } + + return a(); + )"); + + ASSERT_EQ(forEachReturn.getInt(), 76); + + ConsoleValue forEachNestedReturn = RunScript(R"( + function SimSet::findA(%this) + { + foreach (%obj in %this) + { + foreach (%innerObj in %this) + { + if (%innerObj.getName() $= "A") + return 42; + } + } + return 0; + } + + function a() + { + %set = new SimSet(); + %set.add(new SimObject(A)); + %set.add(new SimObject()); + %set.add(new SimObject()); + + %group = new SimGroup(); + %group.add(%set); + + return %set.findA(); + } + + return a(); + )"); + + ASSERT_EQ(forEachNestedReturn.getInt(), 42); } TEST(Script, TorqueScript_Array_Testing) @@ -682,6 +800,21 @@ TEST(Script, Sugar_Syntax) )"); ASSERT_EQ(valueSetArray.getInt(), 5); + + ConsoleValue valueStoreCalculated = RunScript(R"( + function a() + { + %extent = 10 SPC 20; + %scaling = 1; + %size = %extent.x * %scaling; + echo("%size = " @ %size @ " calculated = " @ (%extent.x * %scaling)); + return %size; + } + + return a(); + )"); + + ASSERT_EQ(valueStoreCalculated.getInt(), 10); } TEST(Script, InnerObjectTests) From 94482564227c847041fc7eb3bdc1c35d0e9ac993 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Wed, 1 Sep 2021 20:16:08 -0400 Subject: [PATCH 037/399] Fix console garbage error when evaluating strings. --- Engine/source/console/consoleFunctions.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Engine/source/console/consoleFunctions.cpp b/Engine/source/console/consoleFunctions.cpp index 88bbc14e3..d0eccde40 100644 --- a/Engine/source/console/consoleFunctions.cpp +++ b/Engine/source/console/consoleFunctions.cpp @@ -2410,7 +2410,9 @@ DefineEngineFunction( exec, bool, ( const char* fileName, bool noCalls, bool jou DefineEngineFunction( eval, const char*, ( const char* consoleString ), , "eval(consoleString)" ) { - return Con::evaluate(consoleString, false, NULL); + ConsoleValue returnValue = Con::evaluate(consoleString, false, NULL); + + return Con::getReturnBuffer(returnValue.getString()); } DefineEngineFunction( getVariable, const char*, ( const char* varName ), , "(string varName)\n" From 1b55dce613dab6122aa7660d546328e83b103534 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Wed, 1 Sep 2021 21:12:12 -0400 Subject: [PATCH 038/399] * Workaround: Implement noinline attributes for problematic functions in str.cpp due to what appears to be GCC compiler bugs. --- Engine/source/core/util/str.cpp | 4 ++-- Engine/source/platform/types.gcc.h | 3 +++ Engine/source/platform/types.visualc.h | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Engine/source/core/util/str.cpp b/Engine/source/core/util/str.cpp index c93a95aba..bec26609b 100644 --- a/Engine/source/core/util/str.cpp +++ b/Engine/source/core/util/str.cpp @@ -284,8 +284,8 @@ class String::StringData : protected StringDataImpl delete [] mUTF16; } - void* operator new(size_t size, U32 len); - void* operator new( size_t size, U32 len, DataChunker& chunker ); + void* TORQUE_NOINLINE operator new(size_t size, U32 len); + void* TORQUE_NOINLINE operator new( size_t size, U32 len, DataChunker& chunker ); void operator delete(void *); bool isShared() const diff --git a/Engine/source/platform/types.gcc.h b/Engine/source/platform/types.gcc.h index 53538dd8d..a36759bc0 100644 --- a/Engine/source/platform/types.gcc.h +++ b/Engine/source/platform/types.gcc.h @@ -165,5 +165,8 @@ typedef unsigned long U64; #endif #endif +// Set GCC noinline +#define TORQUE_NOINLINE __attribute__ ((noinline)) + #endif // INCLUDED_TYPES_GCC_H diff --git a/Engine/source/platform/types.visualc.h b/Engine/source/platform/types.visualc.h index 57dabc4dd..4b937ddf8 100644 --- a/Engine/source/platform/types.visualc.h +++ b/Engine/source/platform/types.visualc.h @@ -104,6 +104,8 @@ typedef unsigned _int64 U64; // see msdn.microsoft.com "Compiler Warning (level 1) C4291" for more details #pragma warning(disable: 4291) +// Set MSVC noline attribute +#define TORQUE_NOINLINE __declspec(noinline) #endif // INCLUDED_TYPES_VISUALC_H From 8d75d60f9159722fbb137014d303b50fbff08225 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Wed, 1 Sep 2021 22:15:37 -0400 Subject: [PATCH 039/399] Write out variable mapping table to DSO stream, and fix .dump() --- Engine/source/console/astNodes.cpp | 6 +++-- Engine/source/console/codeBlock.cpp | 36 +++++++++++++++++++++++++---- Engine/source/console/codeBlock.h | 6 ++--- Engine/source/console/compiler.cpp | 27 +++++++++++++++++----- 4 files changed, 60 insertions(+), 15 deletions(-) diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index c85c32ebe..1ee165272 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -1594,10 +1594,12 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream& codeStream, U32 ip) setCurrentFloatTable(&getGlobalFloatTable()); // map local variables to registers for this function. + // Note we have to map these in order because the table itself is ordered by the register id. CompilerLocalVariableToRegisterMappingTable* tbl = &getFunctionVariableMappingTable(); - for (const auto& pair : gFuncVars->variableNameMap) + for (size_t i = 0; i < gFuncVars->variableNameMap.size(); ++i) { - tbl->add(fnName, nameSpace, pair.second, pair.first); + StringTableEntry varName = gFuncVars->variableNameMap[i]; + tbl->add(fnName, nameSpace, varName); } gFuncVars = NULL; diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index 8d0cde4d5..14c447ba0 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -405,6 +405,30 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st) for (i = 0; i < size; i++) st.read(&functionFloats[i]); } + + // Variable register mapping table + st.read(&size); + if (size) + { + for (i = 0; i < size; i++) + { + char functionNameBuffer[256]; + st.readString(functionNameBuffer); + StringTableEntry fnName = StringTable->insert(functionNameBuffer); + + U32 count; + st.read(&count); + for (U32 j = 0; j < count; j++) + { + char varNameBuffer[256]; + st.readString(varNameBuffer); + StringTableEntry varName = StringTable->insert(varNameBuffer); + + variableRegisterTable.localVarToRegister[fnName].varList.push_back(varName); + } + } + } + U32 codeLength; st.read(&codeLength); st.read(&lineBreakPairCount); @@ -533,6 +557,9 @@ bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, con getGlobalFloatTable().write(st); getFunctionFloatTable().write(st); + // write variable mapping table + getFunctionVariableMappingTable().write(st); + if (lastIp != codeSize) Con::errorf(ConsoleLogEntry::General, "CodeBlock::compile - precompile size mismatch, a precompile/compile function pair is probably mismatched."); @@ -645,9 +672,6 @@ ConsoleValue CodeBlock::compileExec(StringTableEntry fileName, const char *inStr codeStream.emit(OP_RETURN_VOID); codeStream.emitCodeStream(&codeSize, &code, &lineBreakPairs); - //if (Con::getBoolVariable("dump")) - //dumpInstructions(0, false); - consoleAllocReset(); if (lineBreakPairCount && fileName) @@ -679,10 +703,14 @@ String CodeBlock::getFunctionArgs(U32 ip) { StringBuilder str; + StringTableEntry fnName = CodeToSTE(code, ip); + StringTableEntry fnNamespace = CodeToSTE(code, ip + 2); + StringTableEntry fnNsName = StringTable->insert(avar("%s::%s", fnNamespace, fnName)); + U32 fnArgc = code[ip + 8]; for (U32 i = 0; i < fnArgc; ++i) { - StringTableEntry var = CodeToSTE(code, ip + (i * 2) + 9); + StringTableEntry var = variableRegisterTable.localVarToRegister[fnNsName].varList[i]; if (i != 0) str.append(", "); diff --git a/Engine/source/console/codeBlock.h b/Engine/source/console/codeBlock.h index be9de012f..a3c1015e9 100644 --- a/Engine/source/console/codeBlock.h +++ b/Engine/source/console/codeBlock.h @@ -27,18 +27,18 @@ struct CompilerLocalVariableToRegisterMappingTable { - // First key: function name struct RemappingTable { - std::unordered_map table; + std::vector varList; }; std::unordered_map localVarToRegister; - void add(StringTableEntry functionName, StringTableEntry namespaceName, StringTableEntry varName, S32 reg); + void add(StringTableEntry functionName, StringTableEntry namespaceName, StringTableEntry varName); S32 lookup(StringTableEntry namespaceName, StringTableEntry functionName, StringTableEntry varName); CompilerLocalVariableToRegisterMappingTable copy(); void reset(); + void write(Stream& stream); }; #include "console/compiler.h" diff --git a/Engine/source/console/compiler.cpp b/Engine/source/console/compiler.cpp index 7a091c202..9af61bef2 100644 --- a/Engine/source/console/compiler.cpp +++ b/Engine/source/console/compiler.cpp @@ -212,11 +212,11 @@ void CompilerStringTable::write(Stream &st) //------------------------------------------------------------ -void CompilerLocalVariableToRegisterMappingTable::add(StringTableEntry functionName, StringTableEntry namespaceName, StringTableEntry varName, S32 reg) +void CompilerLocalVariableToRegisterMappingTable::add(StringTableEntry functionName, StringTableEntry namespaceName, StringTableEntry varName) { StringTableEntry funcLookupTableName = StringTable->insert(avar("%s::%s", namespaceName, functionName)); - localVarToRegister[funcLookupTableName].table[varName] = reg; + localVarToRegister[funcLookupTableName].varList.push_back(varName);; } S32 CompilerLocalVariableToRegisterMappingTable::lookup(StringTableEntry namespaceName, StringTableEntry functionName, StringTableEntry varName) @@ -226,11 +226,11 @@ S32 CompilerLocalVariableToRegisterMappingTable::lookup(StringTableEntry namespa auto functionPosition = localVarToRegister.find(funcLookupTableName); if (functionPosition != localVarToRegister.end()) { - const auto& table = localVarToRegister[funcLookupTableName].table; - auto varPosition = table.find(varName); + const auto& table = localVarToRegister[funcLookupTableName].varList; + auto varPosition = std::find(table.begin(), table.end(), varName); if (varPosition != table.end()) { - return varPosition->second; + return std::distance(table.begin(), varPosition); } } @@ -243,7 +243,7 @@ CompilerLocalVariableToRegisterMappingTable CompilerLocalVariableToRegisterMappi // Trivilly copyable as its all plain old data and using STL containers... (We want a deep copy though!) CompilerLocalVariableToRegisterMappingTable table; table.localVarToRegister = localVarToRegister; - return std::move(table); + return table; } void CompilerLocalVariableToRegisterMappingTable::reset() @@ -251,6 +251,21 @@ void CompilerLocalVariableToRegisterMappingTable::reset() localVarToRegister.clear(); } +void CompilerLocalVariableToRegisterMappingTable::write(Stream& stream) +{ + stream.write(localVarToRegister.size()); + for (const auto& pair : localVarToRegister) + { + StringTableEntry functionName = pair.first; + stream.writeString(functionName); + + const auto& localVariableTableForFunction = localVarToRegister[functionName].varList; + stream.write(localVariableTableForFunction.size()); + for (const StringTableEntry& varName : localVariableTableForFunction) + stream.writeString(varName); + } +} + //------------------------------------------------------------ U32 CompilerFloatTable::add(F64 value) From b0549118b64629ad489fa0f2b5cd9bc297c42dda Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Wed, 1 Sep 2021 22:36:59 -0400 Subject: [PATCH 040/399] various misc fixes from merge. --- Engine/source/core/util/str.cpp | 4 ++-- .../game/tools/assetBrowser/scripts/assetTypes/shape.tscript | 2 +- .../BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript | 1 + .../scripts/interfaces/terrainMaterialDlg.ed.tscript | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Engine/source/core/util/str.cpp b/Engine/source/core/util/str.cpp index bec26609b..4feb5c20a 100644 --- a/Engine/source/core/util/str.cpp +++ b/Engine/source/core/util/str.cpp @@ -284,8 +284,8 @@ class String::StringData : protected StringDataImpl delete [] mUTF16; } - void* TORQUE_NOINLINE operator new(size_t size, U32 len); - void* TORQUE_NOINLINE operator new( size_t size, U32 len, DataChunker& chunker ); + TORQUE_NOINLINE void* operator new(size_t size, U32 len); + TORQUE_NOINLINE void* operator new( size_t size, U32 len, DataChunker& chunker ); void operator delete(void *); bool isShared() const diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript index 4bf17453a..422d7238b 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript @@ -340,7 +340,7 @@ function AssetBrowser::onShapeAssetEditorDropped(%this, %assetDef, %position) %newStatic = new TSStatic() { - position = %pos; + position = %position; shapeAsset = %assetId; }; diff --git a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript index f9a025b59..c4ed141b3 100644 --- a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript +++ b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript @@ -515,6 +515,7 @@ function ESettingsWindow::getAssetEditingSettings(%this) SettingsInspector.addSettingsField("Assets/New/alwaysPromptModuleTarget", "Always Prompt Target Module", "bool", "If off, use the default module"); SettingsInspector.endGroup(); + %formattedConfigList = ""; for(%i=0; %i < ImportAssetWindow.importConfigsList.Count(); %i++) { %configName = ImportAssetWindow.importConfigsList.getKey(%i); diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.tscript index 296fea200..0a47f96ee 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.tscript @@ -298,7 +298,7 @@ function TerrainMaterialDlg::changeTerrainMatMapAsset(%this) %targetMap.setBitmap( %image ); - %targetMapName = %mapName @ "AssetId"; + %targetMapName = %targetMap @ "AssetId"; %targetMapName.setText(%imgAsset); TerrainMaterialDlg.matDirty = true; From d7ed88494e3e4c7374c367abe9f3ca3b59069468 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Wed, 1 Sep 2021 22:38:55 -0400 Subject: [PATCH 041/399] * BugFix: Correct placement of the TORQUE_NOINLINE statements for MSVC compat. --- Engine/source/core/util/str.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/core/util/str.cpp b/Engine/source/core/util/str.cpp index bec26609b..4feb5c20a 100644 --- a/Engine/source/core/util/str.cpp +++ b/Engine/source/core/util/str.cpp @@ -284,8 +284,8 @@ class String::StringData : protected StringDataImpl delete [] mUTF16; } - void* TORQUE_NOINLINE operator new(size_t size, U32 len); - void* TORQUE_NOINLINE operator new( size_t size, U32 len, DataChunker& chunker ); + TORQUE_NOINLINE void* operator new(size_t size, U32 len); + TORQUE_NOINLINE void* operator new( size_t size, U32 len, DataChunker& chunker ); void operator delete(void *); bool isShared() const From 7efe72aced60fa1bc30a281390d1dfab5abb32a7 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Thu, 2 Sep 2021 22:21:00 -0400 Subject: [PATCH 042/399] More fixes with xyz lookup, and some cleanup and test cases. --- Engine/source/console/compiledEval.cpp | 81 +++++------------------ Engine/source/console/test/ScriptTest.cpp | 42 +++++++++++- 2 files changed, 59 insertions(+), 64 deletions(-) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 99e5a633a..b3f8bebc7 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -164,16 +164,11 @@ namespace Con } } -// Gets a component of an object's field value or a variable and returns it -// in val. -static void getFieldComponent(SimObject* object, StringTableEntry field, const char* array, StringTableEntry subField, char val[], S32 currentLocalRegister) +static void getFieldComponent(StringTableEntry subField, char val[], S32 currentLocalRegister) { const char* prevVal = NULL; - // Grab value from object. - if (object && field) - prevVal = object->getDataField(field, array); - else if (currentLocalRegister != -1) + if (currentLocalRegister != -1) prevVal = gEvalState.getLocalStringVariable(currentLocalRegister); else if (gEvalState.currentVariable) prevVal = gEvalState.getStringVariable(); @@ -197,22 +192,15 @@ static void getFieldComponent(SimObject* object, StringTableEntry field, const c StringTable->insert("a") }; - static const StringTableEntry uvw[] = - { - StringTable->insert("u"), - StringTable->insert("v"), - StringTable->insert("w") - }; - // Translate xyzw and rgba into the indexed component // of the variable or field. - if (subField == xyzw[0] || subField == rgba[0] || subField == uvw[0]) + if (subField == xyzw[0] || subField == rgba[0]) dStrcpy(val, StringUnit::getUnit(prevVal, 0, " \t\n"), 128); - else if (subField == xyzw[1] || subField == rgba[1] || subField == uvw[1]) + else if (subField == xyzw[1] || subField == rgba[1]) dStrcpy(val, StringUnit::getUnit(prevVal, 1, " \t\n"), 128); - else if (subField == xyzw[2] || subField == rgba[2] || subField == uvw[2]) + else if (subField == xyzw[2] || subField == rgba[2]) dStrcpy(val, StringUnit::getUnit(prevVal, 2, " \t\n"), 128); else if (subField == xyzw[3] || subField == rgba[3]) @@ -225,9 +213,7 @@ static void getFieldComponent(SimObject* object, StringTableEntry field, const c val[0] = 0; } -// Sets a component of an object's field value based on the sub field. 'x' will -// set the first field, 'y' the second, and 'z' the third. -static void setFieldComponent(SimObject* object, StringTableEntry field, const char* array, StringTableEntry subField, S32 currentLocalRegister) +static void setFieldComponent(StringTableEntry subField, S32 currentLocalRegister) { // Copy the current string value char strValue[1024]; @@ -236,10 +222,7 @@ static void setFieldComponent(SimObject* object, StringTableEntry field, const c char val[1024] = ""; const char* prevVal = NULL; - // Set the value on an object field. - if (object && field) - prevVal = object->getDataField(field, array); - else if (currentLocalRegister != -1) + if (currentLocalRegister != -1) prevVal = gEvalState.getLocalStringVariable(currentLocalRegister); // Set the value on a variable. else if (gEvalState.currentVariable) @@ -282,9 +265,7 @@ static void setFieldComponent(SimObject* object, StringTableEntry field, const c if (val[0] != 0) { // Update the field or variable. - if (object && field) - object->setDataField(field, 0, val); - else if (currentLocalRegister != -1) + if (currentLocalRegister != -1) gEvalState.setLocalStringVariable(currentLocalRegister, val, dStrlen(val)); else if (gEvalState.currentVariable) gEvalState.setStringVariable(val); @@ -740,9 +721,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa } objectCreationStack[objectCreationStackSize]; SimObject* currentNewObject = 0; - StringTableEntry prevField = NULL; StringTableEntry curField = NULL; - SimObject* prevObject = NULL; SimObject* curObject = NULL; SimObject* saveObject = NULL; Namespace::Entry* nsEntry; @@ -1410,6 +1389,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_INC: reg = code[ip++]; + currentRegister = reg; gEvalState.setLocalFloatVariable(reg, gEvalState.getLocalFloatVariable(reg) + 1.0); break; @@ -1420,8 +1400,6 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // If a variable is set, then these must be NULL. It is necessary // to set this here so that the vector parser can appropriately // identify whether it's dealing with a vector. - prevField = NULL; - prevObject = NULL; curObject = NULL; // Used for local variable caching of what is active...when we @@ -1442,8 +1420,6 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa ip += 2; // See OP_SETCURVAR - prevField = NULL; - prevObject = NULL; curObject = NULL; // Used for local variable caching of what is active...when we @@ -1461,8 +1437,6 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa var = StringTable->insert(stack[_STK].getString()); // See OP_SETCURVAR - prevField = NULL; - prevObject = NULL; curObject = NULL; // Used for local variable caching of what is active...when we @@ -1480,8 +1454,6 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa var = StringTable->insert(stack[_STK].getString()); // See OP_SETCURVAR - prevField = NULL; - prevObject = NULL; curObject = NULL; // Used for local variable caching of what is active...when we @@ -1549,25 +1521,25 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_SAVE_LOCAL_VAR_UINT: reg = code[ip++]; + currentRegister = reg; gEvalState.setLocalIntVariable(reg, stack[_STK].getInt()); break; case OP_SAVE_LOCAL_VAR_FLT: reg = code[ip++]; + currentRegister = reg; gEvalState.setLocalFloatVariable(reg, stack[_STK].getFloat()); break; case OP_SAVE_LOCAL_VAR_STR: reg = code[ip++]; val = stack[_STK].getString(); + currentRegister = reg; gEvalState.setLocalStringVariable(reg, val, (S32)dStrlen(val)); break; case OP_SETCUROBJECT: - // Save the previous object for parsing vector fields. - prevObject = curObject; val = stack[_STK].getString(); - //_STK--; // Sim::findObject will sometimes find valid objects from // multi-component strings. This makes sure that doesn't @@ -1613,8 +1585,6 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_SETCURFIELD: - // Save the previous field for parsing vector fields. - prevField = curField; dStrcpy(prevFieldArray, curFieldArray, 256); curField = CodeToSTE(code, ip); curFieldArray[0] = 0; @@ -1640,7 +1610,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // a special accessor? char buff[FieldBufferSizeNumeric]; memset(buff, 0, sizeof(buff)); - getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff, currentRegister); + getFieldComponent(curField, buff, currentRegister); stack[_STK + 1].setInt(dAtol(buff)); } _STK++; @@ -1655,7 +1625,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // a special accessor? char buff[FieldBufferSizeNumeric]; memset(buff, 0, sizeof(buff)); - getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff, currentRegister); + getFieldComponent(curField, buff, currentRegister); stack[_STK + 1].setFloat(dAtod(buff)); } _STK++; @@ -1673,7 +1643,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // a special accessor? char buff[FieldBufferSizeString]; memset(buff, 0, sizeof(buff)); - getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff, currentRegister); + getFieldComponent(curField, buff, currentRegister); stack[_STK + 1].setString(buff); } _STK++; @@ -1683,36 +1653,21 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa if (curObject) curObject->setDataField(curField, curFieldArray, stack[_STK].getString()); else - { - // The field is not being set on an object. Maybe it's - // a special accessor? - setFieldComponent( prevObject, prevField, prevFieldArray, curField, currentRegister ); - prevObject = NULL; - } + setFieldComponent( curField, currentRegister ); break; case OP_SAVEFIELD_FLT: if (curObject) curObject->setDataField(curField, curFieldArray, stack[_STK].getString()); else - { - // The field is not being set on an object. Maybe it's - // a special accessor? - setFieldComponent( prevObject, prevField, prevFieldArray, curField, currentRegister ); - prevObject = NULL; - } + setFieldComponent( curField, currentRegister ); break; case OP_SAVEFIELD_STR: if (curObject) curObject->setDataField(curField, curFieldArray, stack[_STK].getString()); else - { - // The field is not being set on an object. Maybe it's - // a special accessor? - setFieldComponent( prevObject, prevField, prevFieldArray, curField, currentRegister ); - prevObject = NULL; - } + setFieldComponent( curField, currentRegister ); break; case OP_POP_STK: diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index fefdf446d..cce1e6824 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -807,7 +807,6 @@ TEST(Script, Sugar_Syntax) %extent = 10 SPC 20; %scaling = 1; %size = %extent.x * %scaling; - echo("%size = " @ %size @ " calculated = " @ (%extent.x * %scaling)); return %size; } @@ -815,6 +814,25 @@ TEST(Script, Sugar_Syntax) )"); ASSERT_EQ(valueStoreCalculated.getInt(), 10); + + ConsoleValue globalValueGet = RunScript(R"( + new SimObject(AAAA); + AAAA.doSomething = false; + $vec = "1 2 3"; + return $vec.x * 4; + )"); + + ASSERT_EQ(globalValueGet.getFloat(), 4); + + ConsoleValue globalValueSet = RunScript(R"( + new SimObject(AAAAB); + AAAAB.doSomething = false; + $vec2 = "1 2 3"; + $vec2.x *= 4; + return $vec2.x; + )"); + + ASSERT_EQ(globalValueSet.getFloat(), 4); } TEST(Script, InnerObjectTests) @@ -871,4 +889,26 @@ TEST(Script, InnerObjectTests) ASSERT_EQ(nestedFuncCall.getInt(), 123); } +TEST(Script, MiscRegressions) +{ + ConsoleValue regression1 = RunScript(R"( + new SimObject(TheRegressionObject); + + function doTest() + { + TheRegressionObject.hidden = false; + + %previewSize = 100 SPC 100; + %previewScaleSize = 2; + %size = %previewSize.x * %previewScaleSize; + + return %size; + } + + return doTest(); + )"); + + ASSERT_EQ(regression1.getInt(), 200); +} + #endif From 5cce344bb1690598436556597fc564dfb01ccc15 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Fri, 3 Sep 2021 00:26:48 -0400 Subject: [PATCH 043/399] * BugFix: Fix a missing include for GCC. * BugFix: Correct some globally used local variables in the editor code. --- Engine/source/console/codeBlock.h | 1 + Engine/source/gui/editor/inspector/field.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Engine/source/console/codeBlock.h b/Engine/source/console/codeBlock.h index a3c1015e9..57370f683 100644 --- a/Engine/source/console/codeBlock.h +++ b/Engine/source/console/codeBlock.h @@ -23,6 +23,7 @@ #ifndef _CODEBLOCK_H_ #define _CODEBLOCK_H_ +#include #include struct CompilerLocalVariableToRegisterMappingTable diff --git a/Engine/source/gui/editor/inspector/field.cpp b/Engine/source/gui/editor/inspector/field.cpp index 617287e68..6ee578512 100644 --- a/Engine/source/gui/editor/inspector/field.cpp +++ b/Engine/source/gui/editor/inspector/field.cpp @@ -318,7 +318,8 @@ void GuiInspectorField::setData( const char* data, bool callbacks ) { char buffer[ 2048 ]; expandEscape( buffer, newValue ); - newValue = (const char*)Con::evaluatef( "%%f = \"%s\"; return ( %s );", oldValue.c_str(), buffer ); + newValue = (const char*)Con::evaluatef( "$f = \"%s\"; return ( %s );", oldValue.c_str(), buffer ); + Con::evaluatef("$f=0;"); } else if( type == TypeS32Vector || type == TypeF32Vector @@ -353,9 +354,10 @@ void GuiInspectorField::setData( const char* data, bool callbacks ) char buffer[ 2048 ]; expandEscape( buffer, newComponentExpr ); - const char* newComponentVal = Con::evaluatef( "%%f = \"%s\"; %%v = \"%s\"; return ( %s );", + const char* newComponentVal = Con::evaluatef( "$f = \"%s\"; $v = \"%s\"; return ( %s );", oldComponentVal, oldValue.c_str(), buffer ); - + Con::evaluatef("$f=0;$v=0;"); + if( !isFirst ) strNew.append( ' ' ); strNew.append( newComponentVal ); From 313c069ecb4be14b3f3532a06f56c661644ac4d7 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Fri, 3 Sep 2021 23:27:39 -0400 Subject: [PATCH 044/399] Fix xyz again by reverting previous commit and fixing the local variables from not resetting the object states. --- Engine/source/console/codeBlock.cpp | 7 ++ Engine/source/console/compiledEval.cpp | 88 ++++++++++++++++++++--- Engine/source/console/test/ScriptTest.cpp | 18 +++++ 3 files changed, 103 insertions(+), 10 deletions(-) diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index 14c447ba0..91b91aa55 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -674,6 +674,13 @@ ConsoleValue CodeBlock::compileExec(StringTableEntry fileName, const char *inStr consoleAllocReset(); +#ifndef TORQUE_SHIPPING + if (Con::getBoolVariable("$Debug::DumpByteCode")) + { + dumpInstructions(); + } +#endif + if (lineBreakPairCount && fileName) calcBreakList(); diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index b3f8bebc7..e96999dfd 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -164,11 +164,13 @@ namespace Con } } -static void getFieldComponent(StringTableEntry subField, char val[], S32 currentLocalRegister) +static void getFieldComponent(SimObject* object, StringTableEntry field, const char* array, StringTableEntry subField, char val[], S32 currentLocalRegister) { const char* prevVal = NULL; - if (currentLocalRegister != -1) + if (object && field) + prevVal = object->getDataField(field, array); + else if (currentLocalRegister != -1) prevVal = gEvalState.getLocalStringVariable(currentLocalRegister); else if (gEvalState.currentVariable) prevVal = gEvalState.getStringVariable(); @@ -213,7 +215,7 @@ static void getFieldComponent(StringTableEntry subField, char val[], S32 current val[0] = 0; } -static void setFieldComponent(StringTableEntry subField, S32 currentLocalRegister) +static void setFieldComponent(SimObject* object, StringTableEntry field, const char* array, StringTableEntry subField, S32 currentLocalRegister) { // Copy the current string value char strValue[1024]; @@ -222,6 +224,8 @@ static void setFieldComponent(StringTableEntry subField, S32 currentLocalRegiste char val[1024] = ""; const char* prevVal = NULL; + if (object && field) + prevVal = object->getDataField(field, array); if (currentLocalRegister != -1) prevVal = gEvalState.getLocalStringVariable(currentLocalRegister); // Set the value on a variable. @@ -265,7 +269,9 @@ static void setFieldComponent(StringTableEntry subField, S32 currentLocalRegiste if (val[0] != 0) { // Update the field or variable. - if (currentLocalRegister != -1) + if (object && field) + object->setDataField(field, 0, val); + else if (currentLocalRegister != -1) gEvalState.setLocalStringVariable(currentLocalRegister, val, dStrlen(val)); else if (gEvalState.currentVariable) gEvalState.setStringVariable(val); @@ -721,7 +727,9 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa } objectCreationStack[objectCreationStackSize]; SimObject* currentNewObject = 0; + StringTableEntry prevField = NULL; StringTableEntry curField = NULL; + SimObject* prevObject = NULL; SimObject* curObject = NULL; SimObject* saveObject = NULL; Namespace::Entry* nsEntry; @@ -1400,6 +1408,8 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // If a variable is set, then these must be NULL. It is necessary // to set this here so that the vector parser can appropriately // identify whether it's dealing with a vector. + prevField = NULL; + prevObject = NULL; curObject = NULL; // Used for local variable caching of what is active...when we @@ -1420,6 +1430,8 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa ip += 2; // See OP_SETCURVAR + prevField = NULL; + prevObject = NULL; curObject = NULL; // Used for local variable caching of what is active...when we @@ -1437,6 +1449,8 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa var = StringTable->insert(stack[_STK].getString()); // See OP_SETCURVAR + prevField = NULL; + prevObject = NULL; curObject = NULL; // Used for local variable caching of what is active...when we @@ -1454,6 +1468,8 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa var = StringTable->insert(stack[_STK].getString()); // See OP_SETCURVAR + prevField = NULL; + prevObject = NULL; curObject = NULL; // Used for local variable caching of what is active...when we @@ -1500,6 +1516,12 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_LOAD_LOCAL_VAR_UINT: reg = code[ip++]; currentRegister = reg; + + // See OP_SETCURVAR + prevField = NULL; + prevObject = NULL; + curObject = NULL; + stack[_STK + 1].setInt(gEvalState.getLocalIntVariable(reg)); _STK++; break; @@ -1507,6 +1529,12 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_LOAD_LOCAL_VAR_FLT: reg = code[ip++]; currentRegister = reg; + + // See OP_SETCURVAR + prevField = NULL; + prevObject = NULL; + curObject = NULL; + stack[_STK + 1].setFloat(gEvalState.getLocalFloatVariable(reg)); _STK++; break; @@ -1514,6 +1542,12 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_LOAD_LOCAL_VAR_STR: reg = code[ip++]; currentRegister = reg; + + // See OP_SETCURVAR + prevField = NULL; + prevObject = NULL; + curObject = NULL; + val = gEvalState.getLocalStringVariable(reg); stack[_STK + 1].setString(val); _STK++; @@ -1522,12 +1556,24 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa case OP_SAVE_LOCAL_VAR_UINT: reg = code[ip++]; currentRegister = reg; + + // See OP_SETCURVAR + prevField = NULL; + prevObject = NULL; + curObject = NULL; + gEvalState.setLocalIntVariable(reg, stack[_STK].getInt()); break; case OP_SAVE_LOCAL_VAR_FLT: reg = code[ip++]; currentRegister = reg; + + // See OP_SETCURVAR + prevField = NULL; + prevObject = NULL; + curObject = NULL; + gEvalState.setLocalFloatVariable(reg, stack[_STK].getFloat()); break; @@ -1535,10 +1581,18 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa reg = code[ip++]; val = stack[_STK].getString(); currentRegister = reg; + + // See OP_SETCURVAR + prevField = NULL; + prevObject = NULL; + curObject = NULL; + gEvalState.setLocalStringVariable(reg, val, (S32)dStrlen(val)); break; case OP_SETCUROBJECT: + // Save the previous object for parsing vector fields. + prevObject = curObject; val = stack[_STK].getString(); // Sim::findObject will sometimes find valid objects from @@ -1585,6 +1639,8 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; case OP_SETCURFIELD: + // Save the previous field for parsing vector fields. + prevField = curField; dStrcpy(prevFieldArray, curFieldArray, 256); curField = CodeToSTE(code, ip); curFieldArray[0] = 0; @@ -1610,7 +1666,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // a special accessor? char buff[FieldBufferSizeNumeric]; memset(buff, 0, sizeof(buff)); - getFieldComponent(curField, buff, currentRegister); + getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff, currentRegister); stack[_STK + 1].setInt(dAtol(buff)); } _STK++; @@ -1625,7 +1681,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // a special accessor? char buff[FieldBufferSizeNumeric]; memset(buff, 0, sizeof(buff)); - getFieldComponent(curField, buff, currentRegister); + getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff, currentRegister); stack[_STK + 1].setFloat(dAtod(buff)); } _STK++; @@ -1643,7 +1699,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // a special accessor? char buff[FieldBufferSizeString]; memset(buff, 0, sizeof(buff)); - getFieldComponent(curField, buff, currentRegister); + getFieldComponent(prevObject, prevField, prevFieldArray, curField, buff, currentRegister); stack[_STK + 1].setString(buff); } _STK++; @@ -1653,21 +1709,33 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa if (curObject) curObject->setDataField(curField, curFieldArray, stack[_STK].getString()); else - setFieldComponent( curField, currentRegister ); + { + // The field is not being set on an object. Maybe it's a special accessor? + setFieldComponent(prevObject, prevField, prevFieldArray, curField, currentRegister); + prevObject = NULL; + } break; case OP_SAVEFIELD_FLT: if (curObject) curObject->setDataField(curField, curFieldArray, stack[_STK].getString()); else - setFieldComponent( curField, currentRegister ); + { + // The field is not being set on an object. Maybe it's a special accessor? + setFieldComponent(prevObject, prevField, prevFieldArray, curField, currentRegister); + prevObject = NULL; + } break; case OP_SAVEFIELD_STR: if (curObject) curObject->setDataField(curField, curFieldArray, stack[_STK].getString()); else - setFieldComponent( curField, currentRegister ); + { + // The field is not being set on an object. Maybe it's a special accessor? + setFieldComponent(prevObject, prevField, prevFieldArray, curField, currentRegister); + prevObject = NULL; + } break; case OP_POP_STK: diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index cce1e6824..73b9b1e47 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -909,6 +909,24 @@ TEST(Script, MiscRegressions) )"); ASSERT_EQ(regression1.getInt(), 200); + + ConsoleValue regression2 = RunScript(R"( + new SimObject(TheRegressionObject2) + { + extent = "100 200"; + }; + + function doTest() + { + %scale = 2; + %position = TheRegressionObject2.extent.x SPC TheRegressionObject2.extent.y * %scale; + return %position.y; + } + + return doTest(); + )"); + + ASSERT_EQ(regression2.getInt(), 400); } #endif From df0f8dafa6db89fcae52d1e002771aa5a0f2409a Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 4 Sep 2021 02:27:21 -0500 Subject: [PATCH 045/399] Imported in UI sounds Fixed asset properties editing so it applies after saving Added fix for making sound asset preview playback properly --- .../data/UI/sounds/buttonClick.asset.taml | 1 + .../data/UI/sounds/buttonHover.asset.taml | 1 + .../assetBrowser/scripts/assetBrowser.tscript | 2 +- .../scripts/assetTypes/sound.tscript | 42 +++++++++++++++++-- .../assetBrowser/scripts/editAsset.tscript | 15 ++++++- 5 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 Templates/BaseGame/game/data/UI/sounds/buttonClick.asset.taml create mode 100644 Templates/BaseGame/game/data/UI/sounds/buttonHover.asset.taml diff --git a/Templates/BaseGame/game/data/UI/sounds/buttonClick.asset.taml b/Templates/BaseGame/game/data/UI/sounds/buttonClick.asset.taml new file mode 100644 index 000000000..99773fd2d --- /dev/null +++ b/Templates/BaseGame/game/data/UI/sounds/buttonClick.asset.taml @@ -0,0 +1 @@ + diff --git a/Templates/BaseGame/game/data/UI/sounds/buttonHover.asset.taml b/Templates/BaseGame/game/data/UI/sounds/buttonHover.asset.taml new file mode 100644 index 000000000..00b1af405 --- /dev/null +++ b/Templates/BaseGame/game/data/UI/sounds/buttonHover.asset.taml @@ -0,0 +1 @@ + diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript index e95ec0572..bf21750ff 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript @@ -1178,7 +1178,7 @@ function AssetBrowserPreviewButton::onRightClick(%this) EditAssetPopup.enableItem(7, true); //Is it an editable type? - if(%assetType $= "ImageAsset" /*|| %assetType $= "GameObjectAsset"*/ || %assetType $= "CppAsset" || %assetType $= "SoundAsset") + if(%assetType $= "ImageAsset" /*|| %assetType $= "GameObjectAsset"*/ || %assetType $= "CppAsset") { EditAssetPopup.enableItem(0, false); } diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript index 304d21532..77eb1a7cd 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript @@ -1,13 +1,30 @@ +function AssetBrowser::editSoundAsset(%this, %assetDef) +{ + if (isObject($PreviewSoundSource)) + sfxStop($PreviewSoundSource); + $PreviewSoundSource = %assetDef.playSound(); +} + function AssetBrowser::buildSoundAssetPreview(%this, %assetDef, %previewData) { %previewData.assetName = %assetDef.assetName; %previewData.assetPath = %assetDef.soundFilePath; - //%previewData.doubleClickCommand = "EditorOpenFileInTorsion( "@%previewData.assetPath@", 0 );"; if(%this.selectMode) + { %previewData.doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );"; + } else + { + if(EditorSettings.value("Assets/Browser/doubleClickAction", "Edit Asset") $= "Edit Asset") + { %previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );"; + } + else + { + %previewData.doubleClickCommand = "AssetBrowser.onSoundAssetEditorDropped( "@%assetDef@" );"; + } + } %previewData.previewImage = "ToolsModule:soundIcon_image"; @@ -52,7 +69,26 @@ function AssetBrowser::onSoundAssetEditorDropped(%this, %assetDef, %position) } -function AssetBrowser::editSoundAsset(%this, %assetDef) +function GuiInspectorTypeShapeAssetPtr::onControlDropped( %this, %payload, %position ) { - %soundSource = %assetDef.playSound(); + Canvas.popDialog(EditorDragAndDropLayer); + + // Make sure this is a color swatch drag operation. + if( !%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ) ) + return; + + %assetType = %payload.assetType; + + if(%assetType $= "SoundAsset") +{ + %module = %payload.moduleName; + %asset = %payload.assetName; + + %targetComponent = %this.targetObject; + %targetComponent.soundAsset = %module @ ":" @ %asset; + + //Inspector.refresh(); + } + + EWorldEditor.isDirty = true; } \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript index 856ba7d11..b031c6124 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript @@ -3,7 +3,9 @@ function AssetBrowser_editAsset::saveAsset(%this) %file = AssetDatabase.getAssetFilePath(%this.editedAssetId); %success = TamlWrite(AssetBrowser_editAsset.editedAsset, %file); - AssetBrowser.loadFilters(); + AssetBrowser.reloadAsset(%this.editedAssetId); + + AssetBrowser.refresh(); Canvas.popDialog(AssetBrowser_editAsset); } @@ -79,6 +81,17 @@ function AssetBrowser::editAssetInfo(%this) } //------------------------------------------------------------ +function AssetBrowser::reloadAsset(%this, %assetId) +{ + %moduleName = getToken(%assetId, ":", 0); + %moduleDef = ModuleDatabase.findModule(%moduleName); + + %assetName = getToken(%assetId, ":", 1); + %assetFilePath = AssetDatabase.getAssetFilePath(%assetId); + + AssetDatabase.removeDeclaredAsset(%assetId); + AssetDatabase.addDeclaredAsset(%moduleDef, %assetFilePath); +} function AssetBrowser::refreshAsset(%this, %assetId) { From 278bef8d1a8aacddf5545ab0f18d2be056e79920 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 4 Sep 2021 16:23:20 -0400 Subject: [PATCH 046/399] Fix if to else if regression. --- Engine/source/console/compiledEval.cpp | 2 +- Engine/source/console/test/ScriptTest.cpp | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index e96999dfd..c8b1547a1 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -226,7 +226,7 @@ static void setFieldComponent(SimObject* object, StringTableEntry field, const c if (object && field) prevVal = object->getDataField(field, array); - if (currentLocalRegister != -1) + else if (currentLocalRegister != -1) prevVal = gEvalState.getLocalStringVariable(currentLocalRegister); // Set the value on a variable. else if (gEvalState.currentVariable) diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index 73b9b1e47..d42c4fe73 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -927,6 +927,29 @@ TEST(Script, MiscRegressions) )"); ASSERT_EQ(regression2.getInt(), 400); + + ConsoleValue regression3 = RunScript(R"( + function doTest() + { + %button = new GuiIconButtonCtrl() + { + active = true; + }; + + %button.setExtent(120, 20); + + %button.setExtent("120 20"); + + %button.extent = "120 20"; + + %button.extent.x = 120; + %button.extent.y = 20; + return %button.extent; + } + return doTest(); + )"); + + ASSERT_STREQ(regression3.getString(), "120 20"); } #endif From 478a04bea82b6b9a38752bf45d86c52f1038c3d3 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 4 Sep 2021 16:37:59 -0400 Subject: [PATCH 047/399] Fix DSOs and bump version! --- Engine/source/console/codeBlock.cpp | 8 ++------ Engine/source/console/compiler.cpp | 8 ++++++-- Engine/source/console/console.h | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index 91b91aa55..1d1ad7593 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -412,17 +412,13 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st) { for (i = 0; i < size; i++) { - char functionNameBuffer[256]; - st.readString(functionNameBuffer); - StringTableEntry fnName = StringTable->insert(functionNameBuffer); + StringTableEntry fnName = st.readSTString(); U32 count; st.read(&count); for (U32 j = 0; j < count; j++) { - char varNameBuffer[256]; - st.readString(varNameBuffer); - StringTableEntry varName = StringTable->insert(varNameBuffer); + StringTableEntry varName = st.readSTString(); variableRegisterTable.localVarToRegister[fnName].varList.push_back(varName); } diff --git a/Engine/source/console/compiler.cpp b/Engine/source/console/compiler.cpp index 9af61bef2..1ab6e7b22 100644 --- a/Engine/source/console/compiler.cpp +++ b/Engine/source/console/compiler.cpp @@ -253,16 +253,20 @@ void CompilerLocalVariableToRegisterMappingTable::reset() void CompilerLocalVariableToRegisterMappingTable::write(Stream& stream) { - stream.write(localVarToRegister.size()); + stream.write((U32)localVarToRegister.size()); + for (const auto& pair : localVarToRegister) { StringTableEntry functionName = pair.first; stream.writeString(functionName); const auto& localVariableTableForFunction = localVarToRegister[functionName].varList; - stream.write(localVariableTableForFunction.size()); + stream.write((U32)localVariableTableForFunction.size()); + for (const StringTableEntry& varName : localVariableTableForFunction) + { stream.writeString(varName); + } } } diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index d975ccd4d..a5086488c 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -496,7 +496,8 @@ namespace Con /// 10/14/14 - jamesu - 47->48 Added opcodes to reduce reliance on strings in function calls /// 10/07/17 - JTH - 48->49 Added opcode for function pointers and revamp of interpreter /// from switch to function calls. - DSOVersion = 49, + /// 09/04/21 - JTH - 49->50 Rewrite of interpreter + DSOVersion = 50, MaxLineLength = 512, ///< Maximum length of a line of console input. MaxDataTypes = 256 ///< Maximum number of registered data types. From c16b88d709a31a1268a4b48eb0222592f786fb87 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 4 Sep 2021 21:25:11 -0400 Subject: [PATCH 048/399] Fix temporary buffer for scripting conversions. --- Engine/source/app/mainLoop.cpp | 1 + Engine/source/console/console.cpp | 18 +++++++++++++----- Engine/source/console/console.h | 10 ++++++++-- Engine/source/core/util/tVector.h | 10 ++++++++++ 4 files changed, 32 insertions(+), 7 deletions(-) diff --git a/Engine/source/app/mainLoop.cpp b/Engine/source/app/mainLoop.cpp index 871a7cc88..97f25e4f3 100644 --- a/Engine/source/app/mainLoop.cpp +++ b/Engine/source/app/mainLoop.cpp @@ -633,6 +633,7 @@ bool StandardMainLoop::doMainLoop() ThreadPool::processMainThreadWorkItems(); Sampler::endFrame(); + ConsoleValue::resetConversionBuffer(); PROFILE_END_NAMED(MainLoop); } diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index 36b0aa4d8..399298864 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -46,21 +46,29 @@ extern StringStack STR; extern ConsoleValueStack<4096> gCallStack; -char ConsoleValue::sConversionBuffer[ConversionBufferSize]; +Vector ConsoleValue::sConversionBuffer; void ConsoleValue::init() { - dMemset(sConversionBuffer, '\0', ConversionBufferSize); + sConversionBuffer.reserve(8192); +} + +void ConsoleValue::resetConversionBuffer() +{ + sConversionBuffer.resetAndTreatAsScratchBuffer(); } char* ConsoleValue::convertToBuffer() const { + ConversionBuffer conversion; + if (type == ConsoleValueType::cvFloat) - dSprintf(sConversionBuffer, ConversionBufferSize, "%.9g", f); + dSprintf(conversion.buffer, ConversionBufferStride, "%.9g", f); else - dSprintf(sConversionBuffer, ConversionBufferSize, "%lld", i); + dSprintf(conversion.buffer, ConversionBufferStride, "%lld", i); - return sConversionBuffer; + sConversionBuffer.push_back(std::move(conversion)); + return sConversionBuffer.last().buffer; } const char* ConsoleValue::getConsoleData() const diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index a5086488c..5c72f34e1 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -148,10 +148,15 @@ class ConsoleValue enum Constants { - ConversionBufferSize = 32 + ConversionBufferStride = 32 }; - static char sConversionBuffer[ConversionBufferSize]; + struct ConversionBuffer + { + char buffer[ConversionBufferStride]; + }; + + static Vector sConversionBuffer; char* convertToBuffer() const; @@ -387,6 +392,7 @@ public: } static void init(); + static void resetConversionBuffer(); }; // Transparently converts ConsoleValue[] to const char** diff --git a/Engine/source/core/util/tVector.h b/Engine/source/core/util/tVector.h index 0700a5554..57cb84e24 100644 --- a/Engine/source/core/util/tVector.h +++ b/Engine/source/core/util/tVector.h @@ -160,6 +160,7 @@ class Vector void erase(U32 index, U32 count); void erase_fast(iterator); void clear(); + void resetAndTreatAsScratchBuffer(); void compact(); void sort(compare_func f); void fill( const T& value ); @@ -529,6 +530,15 @@ template inline void Vector::clear() mElementCount = 0; } +/// This method sets the vector as its 0 and will overwrite memory on subsequent usage. +/// Note that the current memory in use is never freed or deallocated, so only use this if the vector +/// is being used as a scratch buffer only. +template inline +void Vector::resetAndTreatAsScratchBuffer() +{ + mElementCount = 0; +} + template inline void Vector::compact() { resize(mElementCount); From 9b2f4976c980621142bbddaac97818cc2e0560ca Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 4 Sep 2021 22:00:32 -0400 Subject: [PATCH 049/399] small regression fix. --- Engine/source/console/compiledEval.cpp | 4 ++-- Engine/source/console/test/ScriptTest.cpp | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index c8b1547a1..378afd290 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -2002,7 +2002,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; } - stack[_STK + 1].setInt(result); + stack[_STK + 1].setFloat(result); _STK++; break; } @@ -2139,7 +2139,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa { bool isGlobal = code[ip]; - U32 failIp = code[ip + isGlobal ? 3 : 2]; + U32 failIp = code[ip + (isGlobal ? 3 : 2)]; IterStackRecord& iter = iterStack[_ITER]; iter.mIsGlobalVariable = isGlobal; diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index d42c4fe73..a2295f774 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -950,6 +950,24 @@ TEST(Script, MiscRegressions) )"); ASSERT_STREQ(regression3.getString(), "120 20"); + + ConsoleValue regression4 = RunScript(R"( + function doTest() + { + %slider = new GuiSliderCtrl() + { + range = "0 2"; + ticks = 5; + active = true; + }; + + %slider.setValue(0.5); + return %slider.getValue(); + } + return doTest(); + )"); + + ASSERT_EQ(regression4.getFloat(), 0.5); } #endif From 0ca66b99db81a3363dde1ea6dbc4d84e5a764467 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sun, 5 Sep 2021 03:43:41 -0500 Subject: [PATCH 050/399] Added fix so if a looping sound is preview-playing in the AB and you edit the properties, it doesn't try to reload the asset while it's playing, causing a crash Added console method for looking up a soundAsset by filename Added initial pass of project importer for sound assets content --- Engine/source/T3D/assets/SoundAsset.cpp | 8 + Engine/source/sfx/sfxSource.cpp | 11 +- .../scripts/assetTypes/shape.tscript | 4 + .../scripts/assetTypes/sound.tscript | 6 + .../assetBrowser/scripts/editAsset.tscript | 5 + .../pre40/T3Dpre4ProjectImporter.tscript | 168 ++++++++++++++++++ .../scripts/projectImporter.tscript | 115 +++++++++++- 7 files changed, 309 insertions(+), 8 deletions(-) diff --git a/Engine/source/T3D/assets/SoundAsset.cpp b/Engine/source/T3D/assets/SoundAsset.cpp index d4e9a745a..d00c0dbe2 100644 --- a/Engine/source/T3D/assets/SoundAsset.cpp +++ b/Engine/source/T3D/assets/SoundAsset.cpp @@ -343,6 +343,14 @@ DefineEngineMethod(SoundAsset, playSound, S32, (Point3F position), (Point3F::Zer return 0; } +#ifdef TORQUE_TOOLS +DefineEngineStaticMethod(SoundAsset, getAssetIdByFilename, const char*, (const char* filePath), (""), + "Queries the Asset Database to see if any asset exists that is associated with the provided file path.\n" + "@return The AssetId of the associated asset, if any.") +{ + return SoundAsset::getAssetIdByFileName(StringTable->insert(filePath)); +} +#endif IMPLEMENT_CONOBJECT(GuiInspectorTypeSoundAssetPtr); ConsoleDocClass(GuiInspectorTypeSoundAssetPtr, diff --git a/Engine/source/sfx/sfxSource.cpp b/Engine/source/sfx/sfxSource.cpp index abc5b35e1..9b776af94 100644 --- a/Engine/source/sfx/sfxSource.cpp +++ b/Engine/source/sfx/sfxSource.cpp @@ -791,6 +791,9 @@ void SFXSource::_setStatus( SFXStatus status ) void SFXSource::_updateVolume( const MatrixF& listener ) { + if (!mDescription) + return; + // Handle fades (compute mFadedVolume). mFadedVolume = mPreFadeVolume; @@ -919,13 +922,19 @@ void SFXSource::_updateVolume( const MatrixF& listener ) void SFXSource::_updatePitch() { + if (!mDescription) + return; + mEffectivePitch = mModulativePitch * mPitch; } //----------------------------------------------------------------------------- void SFXSource::_updatePriority() -{ +{ + if (!mDescription) + return; + mEffectivePriority = mPriority * mModulativePriority; SFXSource* group = getSourceGroup(); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript index 4bf17453a..8ca2a21ed 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript @@ -42,6 +42,10 @@ function AssetBrowser::editShapeAsset(%this, %assetDef) ShapeEditorPlugin.openShapeAsset(%assetDef); } +function AssetBrowser::onShapeAssetChanged(%this, %assetDef) +{ +} + function AssetBrowser::deleteShapeAsset(%this, %assetDef) { diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript index 77eb1a7cd..3322964bc 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript @@ -5,6 +5,12 @@ function AssetBrowser::editSoundAsset(%this, %assetDef) $PreviewSoundSource = %assetDef.playSound(); } +function AssetBrowser::onSoundAssetChanged(%this, %assetDef) +{ + if (isObject($PreviewSoundSource)) + sfxStop($PreviewSoundSource); +} + function AssetBrowser::buildSoundAssetPreview(%this, %assetDef, %previewData) { %previewData.assetName = %assetDef.assetName; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript index b031c6124..13269cb25 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript @@ -6,6 +6,11 @@ function AssetBrowser_editAsset::saveAsset(%this) AssetBrowser.reloadAsset(%this.editedAssetId); AssetBrowser.refresh(); + + %assetType = AssetDatabase.getAssetType(%this.editedAssetId); + %assetDef = AssetDatabase.acquireAsset(%this.editedAssetId); + AssetBrowser.call("on" @ %assetType @ "Changed", %assetDef); + AssetDatabase.releaseAsset(%this.editedAssetId); Canvas.popDialog(AssetBrowser_editAsset); } diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript index 735e8dd66..4c6ede9fb 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript @@ -838,6 +838,7 @@ T3Dpre4ProjectImporter::genProcessor("afxBillboardData", "texture textureAsset") T3Dpre4ProjectImporter::genProcessor("afxModelData", "shapeName shapeAsset shapeFile shapeAsset"); T3Dpre4ProjectImporter::genProcessor("afxZodiacData", "texture textureAsset"); T3Dpre4ProjectImporter::genProcessor("afxZodiacPlaneData", "texture textureAsset"); +T3Dpre4ProjectImporter::genProcessor("sfxEmitter", "track soundAsset filename soundAsset"); //============================================================================== // Levels //============================================================================== @@ -1064,6 +1065,173 @@ function T3Dpre4ProjectImporter::processTerrainMaterialObject(%this, %file, %obj //============================================================================== T3Dpre4ProjectImporter::genProcessor("PostEffect", "texture textureAsset"); +//============================================================================== +// Sounds +// Sounds are a little weird because there's so much data tied up in a given sound +// source. So our approach is find old SFXProfiles and process those into sound assets +// by cross-referencing the filename for existing asset definitions. +// Using existing SFXProfiles allows us to also injest the descriptions, giving us +// our meta-properties on the sound asset itself. +//============================================================================== +function T3Dpre4ProjectImporter::processSFXProfileLine(%this, %line) +{ + return %line; +} + +function T3Dpre4ProjectImporter::processSFXProfileObject(%this, %file, %objectName) +{ + %soundFilename = findObjectField("filename"); + + %soundFilename = sanitizeFilename(%soundFilename); + + %soundAsset = SoundAsset::getAssetIdByFilename(%soundFilename); + + //Throw a warn that this file's already been claimed and move on + if(%soundAsset !$= "") + { + error("T3Dpre4ProjectImporter::processSFXProfileObject() - attempting to process SFXProfile " @ %objectName + @ " but its filename is already associated to another sound asset."); + return false; + } + //Otherwise, process it into an asset + else + { + %assetName = %objectName; + + %moduleName = AssetBrowser.dirHandler.getModuleFromAddress(%soundFilename).ModuleId; + + %assetPath = filePath(%soundFilename) @ "/"; + + %tamlpath = %assetPath @ %assetName @ ".asset.taml"; + + if(isFile(%tamlpath)) + { + error("T3Dpre4ProjectImporter::processSFXProfileObject() - Failed to create as taml file already exists: " @ %soundFilename); + return false; + } + + %asset = new SoundAsset() + { + AssetName = %assetName; + versionId = 1; + shaderData = ""; + soundFile = fileBase(%soundFilename) @ fileExt(%soundFilename); + }; + + %descriptionName = findObjectField("description"); + + if(%descriptionName !$= "") + { + //Optimization, see if we already have this description by happenstance + if(isObject(%descriptionName)) + { + %asset.sourceGroup = %descriptionName.sourceGroup; + %asset.volume = %descriptionName.volume; + %asset.pitch = %descriptionName.pitch; + %asset.isLooping = %descriptionName.isLooping; + %asset.priority = %descriptionName.priority; + %asset.useHardware = %descriptionName.useHardware; + %asset.is3D = %descriptionName.is3D; + %asset.minDistance = %descriptionName.minDistance; + %asset.maxDistance = %descriptionName.maxDistance; + %asset.scatterDistance = %descriptionName.scatterDistance; + %asset.coneInsideAngle = %descriptionName.coneInsideAngle; + %asset.coneOutsideAngle = %descriptionName.coneOutsideAngle; + %asset.coneOutsideVolume = %descriptionName.coneOutsideVolume; + %asset.rolloffFactor = %descriptionName.rolloffFactor; + %asset.isStreaming = %descriptionName.isStreaming; + } + else + { + %objFileFinder = findObjectInFiles(%descriptionName); + if(%objFileFinder !$= "") + { + %valueArray = new ArrayObject(); + + %valueArray.add("sourceGroup" SPC findObjectField("sourceGroup", %objFileFinder)); + %valueArray.add("volume" SPC findObjectField("volume", %objFileFinder)); + %valueArray.add("pitch" SPC findObjectField("pitch", %objFileFinder)); + %valueArray.add("isLooping" SPC findObjectField("isLooping", %objFileFinder)); + %valueArray.add("priority" SPC findObjectField("priority", %objFileFinder)); + %valueArray.add("useHardware" SPC findObjectField("useHardware", %objFileFinder)); + %valueArray.add("is3D" SPC findObjectField("is3D", %objFileFinder)); + %valueArray.add("minDistance" SPC findObjectField("minDistance", %objFileFinder)); + %valueArray.add("maxDistance" SPC findObjectField("maxDistance", %objFileFinder)); + %valueArray.add("scatterDistance" SPC findObjectField("scatterDistance", %objFileFinder)); + %valueArray.add("coneInsideAngle" SPC findObjectField("coneInsideAngle", %objFileFinder)); + %valueArray.add("coneOutsideAngle" SPC findObjectField("coneOutsideAngle", %objFileFinder)); + %valueArray.add("coneOutsideVolume" SPC findObjectField("coneOutsideVolume", %objFileFinder)); + %valueArray.add("rolloffFactor" SPC findObjectField("rolloffFactor", %objFileFinder)); + %valueArray.add("isStreaming" SPC findObjectField("isStreaming", %objFileFinder)); + + %objFileFinder.delete(); + + for(%v=0; %v < %valueArray.Count(); %v++) + { + %varSet = %valueArray.getKey(%v); + %var = getWord(%varSet, 0); + %varVal = getWord(%varSet, 1); + + if(%varVal !$= "") + %asset.setFieldValue(%var, %varVal); + } + } + } + } + + TamlWrite(%asset, %tamlpath); + + %moduleDef = ModuleDatabase.findModule(%moduleName, 1); + %success = AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath); + + if(!%success) + return false; + } + + //Now mark the original SFXProfile for removal from the file as it's redundant + //now that we have the asset def + + /*if(%matAsset $= "" || %matAsset $= "Core_Rendering:NoMaterial") + { + %assetName = %objectName; + + %moduleName = AssetBrowser.dirHandler.getModuleFromAddress(%file).ModuleId; + + %assetPath = filePath(%file) @ "/"; + + %tamlpath = %assetPath @ %assetName @ ".asset.taml"; + + if(isFile(%tamlpath)) + { + error("T3Dpre4ProjectImporter::processMaterialObject() - Failed to create as taml file already exists: " @ %file); + return false; + } + + %asset = new MaterialAsset() + { + AssetName = %assetName; + versionId = 1; + shaderData = ""; + materialDefinitionName = %assetName; + scriptFile = fileBase(%file); + }; + + TamlWrite(%asset, %tamlpath); + + %moduleDef = ModuleDatabase.findModule(%moduleName, 1); + %success = AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath); + + if(!%success) + return false; + }*/ + + return true; +} + +function T3Dpre4ProjectImporter::processAudioProfileObject(%this, %file, %objectName) +{ + return %this.processSFXProfileObject(%file, %objectName); +} //============================================================================== // Misc Utility functions diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript index 05a0847f4..d49e4eac4 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript @@ -416,7 +416,7 @@ function sanitizeFilename(%file) %sanitizedName = sanitizeString(%targetName); if(startsWith(%sanitizedName, "_")) { - %sanitizedName = substr(%sanitizedName, 1, -1); + %sanitizedName = getSubStr(%sanitizedName, 1, -1); } if(%sanitizedName !$= %targetName) { @@ -472,6 +472,12 @@ function testFilenameExtensions(%filename) return %filename @ ".dae"; else if(isFile(%filename @ ".dds")) return %filename @ ".dds"; + else if(isFile(%filename @ ".ogg")) + return %filename @ ".ogg"; + else if(isFile(%filename @ ".wav")) + return %filename @ ".wav"; + else if(isFile(%filename @ ".mp3")) + return %filename @ ".dds"; return %filename; } @@ -659,11 +665,14 @@ function findObjectName(%line, %createWord) return %objectName; } -function findObjectField(%fieldName) +function findObjectField(%fieldName, %fileObj) { + if(%fileObj $= "") + %fileObj = $ProjectImporter::fileObject; + %value = ""; %peekLineOffset = 0; - %peekLine = $ProjectImporter::fileObject.peekLine(%peekLineOffset); + %peekLine = %fileObj.peekLine(%peekLineOffset); while(!strIsMatchExpr("*};*", %peekLine) && !strIsMatchExpr("*singleton*(*)*", %peekLine) && !strIsMatchExpr("*new*(*)*", %peekLine) && @@ -671,7 +680,7 @@ function findObjectField(%fieldName) !strIsMatchExpr("\n", %peekLine) && !strIsMatchExpr("\r", %peekLine)) { - if(strpos(%peekLine, %fieldName) != -1) + if(strpos(strlwr(%peekLine), strlwr(%fieldName)) != -1) { %value = ""; %pos = strpos(%peekLine, "= \""); @@ -682,8 +691,7 @@ function findObjectField(%fieldName) %value = getSubStr(%peekLine, %pos+3, %endPos-%pos-3); break; } - else - { + %pos = strpos(%peekLine, "=\""); if(%pos != -1) { @@ -692,16 +700,109 @@ function findObjectField(%fieldName) %value = getSubStr(%peekLine, %pos+2, %endPos-%pos-2); break; } + + %pos = strpos(%peekLine, "= "); + if(%pos != -1) + { + %endPos = strpos(%peekLine, ";", %pos); + + %value = getSubStr(%peekLine, %pos+2, %endPos-%pos-2); + break; + } + + %pos = strpos(%peekLine, "="); + if(%pos != -1) + { + %endPos = strpos(%peekLine, ";", %pos); + + %value = getSubStr(%peekLine, %pos+2, %endPos-%pos-2); + break; } } %peekLineOffset++; - %peekLine = $ProjectImporter::fileObject.peekLine(%peekLineOffset); + %peekLine = %fileObj.peekLine(%peekLineOffset); } return %value; } +function findObjectInFiles(%objectName) +{ + //First, wipe out any files inside the folder first + %file = findFirstFileMultiExpr( "*.*", true); + + %fileObj = new FileObject(); + + while( %file !$= "" ) + { + %filename = fileName(%file); + %fileBase = fileBase(%file); + %fileExt = fileExt(%file); + %filePath = filePath(%file); + + if ( %fileObj.openForRead( %file ) ) + { + %lineNum = 0; + while ( !%fileObj.isEOF() ) + { + %line = %fileObj.readLine(); + %trimmedLine = trim(%line); + + if(strIsMatchExpr("*new*(*)*", %line) && strpos(%line, "::") == -1) + { + %className = findObjectClass(%line, "new"); + if (%className $= "") continue; + + %objName = findObjectName(%line, "new"); + + if(%objectName $= %objName) + { + return %fileObj; + } + } + else if(strIsMatchExpr("*datablock*(*)*", %line) && strpos(%line, "::") == -1) + { + %className = findObjectClass(%line, "datablock"); + if (%className $= "") continue; + + %objName = findObjectName(%line, "datablock"); + + if(%objectName $= %objName) + { + return %fileObj; + } + } + else if(strIsMatchExpr("*singleton*(*)*", %line) && strpos(%line, "::") == -1) + { + %className = findObjectClass(%line, "singleton"); + if (%className $= "") continue; + + %objName = findObjectName(%line, "singleton"); + + if(%objectName $= %objName) + { + return %fileObj; + } + } + + %lineNum++; + } + + %fileObj.close(); + } + else + { + error("findObjectInFiles() - File not able to be opened: " @ %file); + } + + %file = findNextFileMultiExpr( "*.*" ); + } + + %fileObj.delete(); + + return ""; +} //============================================================================== //Shape Importing //============================================================================== From 252f1b65f37226c933297b6227faad4d9e480365 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 5 Sep 2021 14:54:41 -0500 Subject: [PATCH 051/399] followup to #531. fixes the same issue on mac --- Engine/source/platformMac/macFileIO.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/platformMac/macFileIO.mm b/Engine/source/platformMac/macFileIO.mm index b2549e0f7..dae844163 100644 --- a/Engine/source/platformMac/macFileIO.mm +++ b/Engine/source/platformMac/macFileIO.mm @@ -911,7 +911,7 @@ static bool recurseDumpDirectories(const char *basePath, const char *subPath, Ve //----------------------------------------------------------------------------- bool Platform::dumpDirectories(const char *path, Vector &directoryVector, S32 depth, bool noBasePath) { - bool retVal = recurseDumpDirectories(path, "", directoryVector, 0, depth, noBasePath); + bool retVal = recurseDumpDirectories(path, "", directoryVector, -1, depth, noBasePath); clearExcludedDirectories(); return retVal; } From 6439cb84d45aa953c4b1b0b6b0fbeb3eb804b040 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sun, 5 Sep 2021 23:47:11 -0500 Subject: [PATCH 052/399] Adds handling in project import to process SFXDescriptions and Profiles into assets and remove the redundant OG declarations --- .../pre40/T3Dpre4ProjectImporter.tscript | 112 +++++++++--------- .../scripts/projectImporter.tscript | 38 +++++- 2 files changed, 89 insertions(+), 61 deletions(-) diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript index 4c6ede9fb..99099085e 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript @@ -1089,13 +1089,10 @@ function T3Dpre4ProjectImporter::processSFXProfileObject(%this, %file, %objectNa //Throw a warn that this file's already been claimed and move on if(%soundAsset !$= "") { - error("T3Dpre4ProjectImporter::processSFXProfileObject() - attempting to process SFXProfile " @ %objectName - @ " but its filename is already associated to another sound asset."); - return false; + warn("T3Dpre4ProjectImporter::processSFXProfileObject() - attempting to process SFXProfile " @ %objectName + @ " but its filename is already associated to another sound asset. Continuing, but be aware."); } - //Otherwise, process it into an asset - else - { + %assetName = %objectName; %moduleName = AssetBrowser.dirHandler.getModuleFromAddress(%soundFilename).ModuleId; @@ -1142,29 +1139,46 @@ function T3Dpre4ProjectImporter::processSFXProfileObject(%this, %file, %objectNa %asset.isStreaming = %descriptionName.isStreaming; } else + { + %objFileFinder = ""; + //first check our cache + if(isObject($ProjectImporter::SFXDescriptionCache) && + $ProjectImporter::SFXDescriptionCache.getIndexFromKey(%descriptionName) !$= "") + { + %key = $ProjectImporter::SFXDescriptionCache.getIndexFromKey(%descriptionName); + %objFileFinder = $ProjectImporter::SFXDescriptionCache.getValue(%key); + } + else { %objFileFinder = findObjectInFiles(%descriptionName); + } + if(%objFileFinder !$= "") { %valueArray = new ArrayObject(); - %valueArray.add("sourceGroup" SPC findObjectField("sourceGroup", %objFileFinder)); - %valueArray.add("volume" SPC findObjectField("volume", %objFileFinder)); - %valueArray.add("pitch" SPC findObjectField("pitch", %objFileFinder)); - %valueArray.add("isLooping" SPC findObjectField("isLooping", %objFileFinder)); - %valueArray.add("priority" SPC findObjectField("priority", %objFileFinder)); - %valueArray.add("useHardware" SPC findObjectField("useHardware", %objFileFinder)); - %valueArray.add("is3D" SPC findObjectField("is3D", %objFileFinder)); - %valueArray.add("minDistance" SPC findObjectField("minDistance", %objFileFinder)); - %valueArray.add("maxDistance" SPC findObjectField("maxDistance", %objFileFinder)); - %valueArray.add("scatterDistance" SPC findObjectField("scatterDistance", %objFileFinder)); - %valueArray.add("coneInsideAngle" SPC findObjectField("coneInsideAngle", %objFileFinder)); - %valueArray.add("coneOutsideAngle" SPC findObjectField("coneOutsideAngle", %objFileFinder)); - %valueArray.add("coneOutsideVolume" SPC findObjectField("coneOutsideVolume", %objFileFinder)); - %valueArray.add("rolloffFactor" SPC findObjectField("rolloffFactor", %objFileFinder)); - %valueArray.add("isStreaming" SPC findObjectField("isStreaming", %objFileFinder)); + %fileObj = getField(%objFileFinder, 0); - %objFileFinder.delete(); + %valueArray.add("sourceGroup" SPC findObjectField("sourceGroup", %fileObj)); + %valueArray.add("volume" SPC findObjectField("volume", %fileObj)); + %valueArray.add("pitch" SPC findObjectField("pitch", %fileObj)); + %valueArray.add("isLooping" SPC findObjectField("isLooping", %fileObj)); + %valueArray.add("priority" SPC findObjectField("priority", %fileObj)); + %valueArray.add("useHardware" SPC findObjectField("useHardware", %fileObj)); + %valueArray.add("is3D" SPC findObjectField("is3D", %fileObj)); + %valueArray.add("minDistance" SPC findObjectField("minDistance", %fileObj)); + %valueArray.add("maxDistance" SPC findObjectField("maxDistance", %fileObj)); + %valueArray.add("scatterDistance" SPC findObjectField("scatterDistance", %fileObj)); + %valueArray.add("coneInsideAngle" SPC findObjectField("coneInsideAngle", %fileObj)); + %valueArray.add("coneOutsideAngle" SPC findObjectField("coneOutsideAngle", %fileObj)); + %valueArray.add("coneOutsideVolume" SPC findObjectField("coneOutsideVolume", %fileObj)); + %valueArray.add("rolloffFactor" SPC findObjectField("rolloffFactor", %fileObj)); + %valueArray.add("isStreaming" SPC findObjectField("isStreaming", %fileObj)); + + if(isObject($ProjectImporter::SFXDescriptionCache)) + { + $ProjectImporter::SFXDescriptionCache.add(%descriptionName, %objFileFinder); + } for(%v=0; %v < %valueArray.Count(); %v++) { @@ -1175,6 +1189,8 @@ function T3Dpre4ProjectImporter::processSFXProfileObject(%this, %file, %objectNa if(%varVal !$= "") %asset.setFieldValue(%var, %varVal); } + + %valueArray.delete(); } } } @@ -1186,51 +1202,31 @@ function T3Dpre4ProjectImporter::processSFXProfileObject(%this, %file, %objectNa if(!%success) return false; - } //Now mark the original SFXProfile for removal from the file as it's redundant //now that we have the asset def - - /*if(%matAsset $= "" || %matAsset $= "Core_Rendering:NoMaterial") - { - %assetName = %objectName; - - %moduleName = AssetBrowser.dirHandler.getModuleFromAddress(%file).ModuleId; - - %assetPath = filePath(%file) @ "/"; - - %tamlpath = %assetPath @ %assetName @ ".asset.taml"; - - if(isFile(%tamlpath)) - { - error("T3Dpre4ProjectImporter::processMaterialObject() - Failed to create as taml file already exists: " @ %file); - return false; - } - - %asset = new MaterialAsset() - { - AssetName = %assetName; - versionId = 1; - shaderData = ""; - materialDefinitionName = %assetName; - scriptFile = fileBase(%file); - }; - - TamlWrite(%asset, %tamlpath); - - %moduleDef = ModuleDatabase.findModule(%moduleName, 1); - %success = AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath); - - if(!%success) - return false; - }*/ + $ProjectImporter::ToRemoveObjectList.add(%objectName, %file TAB 0); return true; } function T3Dpre4ProjectImporter::processAudioProfileObject(%this, %file, %objectName) -{ + { return %this.processSFXProfileObject(%file, %objectName); + } + +function T3Dpre4ProjectImporter::processSFXDescriptionObject(%this, %file, %objectName) + { + $ProjectImporter::ToRemoveObjectList.add(%objectName, %file TAB 0); + + return true; +} + +function T3Dpre4ProjectImporter::processAudioDescriptionObject(%this, %file, %objectName) +{ + $ProjectImporter::ToRemoveObjectList.add(%objectName, %file TAB 0); + + return true; } //============================================================================== diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript index d49e4eac4..a28233596 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript @@ -166,6 +166,16 @@ function ProjectImportWizardPage2::openPage(%this) $ProjectImporter::importTool.delete(); $ProjectImporter::importTool = new ScriptObject($ProjectImporter::versionMode @ "Importer"); + + if(isObject($ProjectImporter::SFXDescriptionCache)) + $ProjectImporter::SFXDescriptionCache.delete(); + + $ProjectImporter::SFXDescriptionCache = new ArrayObject(); + + if(isObject($ProjectImporter::ToRemoveObjectList)) + $ProjectImporter::ToRemoveObjectList.delete(); + + $ProjectImporter::ToRemoveObjectList = new ArrayObject(); } function ProjectImportWizardPage2::processPage(%this) @@ -312,6 +322,28 @@ function ProjectImportWizardPage6::openPage(%this) { $ProjectImporter::importTool.processScriptExtensions(); } + + //All good? now go through and wipe any objects flagged in our files for deletion + %objRemovePM = new PersistenceManager(); + + for(%o = 0; %o < $ProjectImporter::ToRemoveObjectList.count(); %o++) + { + %name = $ProjectImporter::ToRemoveObjectList.getKey(%o); + %file = getField($ProjectImporter::ToRemoveObjectList.getValue(%o),0); + + if(%name !$= "" && isFile(%file)) + { + if(!isObject(%name)) + { + //spoof it + %tmpObj = new SimObject(%name); + %objRemovePM.setDirty(%name, %file); + } + %objRemovePM.removeObjectFromFile(%name, %file); + + %tmpObj.delete(); + } + } } function ProjectImportWizardPage6::processPage(%this) @@ -758,7 +790,7 @@ function findObjectInFiles(%objectName) if(%objectName $= %objName) { - return %fileObj; + return %fileObj TAB %file TAB %lineNum; } } else if(strIsMatchExpr("*datablock*(*)*", %line) && strpos(%line, "::") == -1) @@ -770,7 +802,7 @@ function findObjectInFiles(%objectName) if(%objectName $= %objName) { - return %fileObj; + return %fileObj TAB %file TAB %lineNum; } } else if(strIsMatchExpr("*singleton*(*)*", %line) && strpos(%line, "::") == -1) @@ -782,7 +814,7 @@ function findObjectInFiles(%objectName) if(%objectName $= %objName) { - return %fileObj; + return %fileObj TAB %file TAB %lineNum; } } From 55c0a748b4b7db093c50e0599dd104bee71fca85 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Tue, 7 Sep 2021 19:43:39 -0400 Subject: [PATCH 053/399] Don't generate op_inc whenever its used as an expression. --- Engine/source/console/astNodes.cpp | 2 +- Engine/source/console/test/ScriptTest.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index 1ee165272..091f6cf1c 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -1083,7 +1083,7 @@ U32 AssignOpExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) bool oldVariables = arrayIndex || varName[0] == '$'; - if (op == opPLUSPLUS && !oldVariables) + if (op == opPLUSPLUS && !oldVariables && type == TypeReqNone) { const S32 varIdx = getFuncVars(dbgLineNumber)->assign(varName, TypeReqFloat, dbgLineNumber); diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index a2295f774..24905aba3 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -968,6 +968,20 @@ TEST(Script, MiscRegressions) )"); ASSERT_EQ(regression4.getFloat(), 0.5); + + Con::setBoolVariable("$Debug::DumpByteCode", true); + + ConsoleValue regression5 = RunScript(R"( + function noOpInc() + { + %count = 0; + %var[%count++] = 2; + return %var[1]; + } + return noOpInc(); + )"); + + ASSERT_EQ(regression5.getInt(), 2); } #endif From 6d93e96dc3dbd31458cf90db0f35a5dea82e08bd Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Tue, 7 Sep 2021 21:03:57 -0400 Subject: [PATCH 054/399] NULL out an object variable if it fails to register. --- Engine/source/console/compiledEval.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 378afd290..a18729fd4 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -1087,6 +1087,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // This error is usually caused by failing to call Parent::initPersistFields in the class' initPersistFields(). Con::warnf(ConsoleLogEntry::General, "%s: Register object failed for object %s of class %s.", getFileLine(ip - 2), currentNewObject->getName(), currentNewObject->getClassName()); delete currentNewObject; + currentNewObject = NULL; ip = failJump; break; } From 27a4868b6ed203a4e5d0489262056e7fc5d08370 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Tue, 7 Sep 2021 21:52:36 -0400 Subject: [PATCH 055/399] Fix buffer corruption. --- Engine/source/T3D/gameBase/gameConnection.cpp | 9 ++++++--- Engine/source/console/consoleFunctions.cpp | 3 ++- Engine/source/console/simObject.cpp | 3 ++- Engine/source/gui/editor/popupMenu.cpp | 6 ++++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Engine/source/T3D/gameBase/gameConnection.cpp b/Engine/source/T3D/gameBase/gameConnection.cpp index ed5c691e5..09cfa13cf 100644 --- a/Engine/source/T3D/gameBase/gameConnection.cpp +++ b/Engine/source/T3D/gameBase/gameConnection.cpp @@ -512,10 +512,13 @@ bool GameConnection::readConnectRequest(BitStream *stream, const char **errorStr connectArgv[2].setString(buffer); // NOTE: Cannot convert over to IMPLEMENT_CALLBACK as it has variable args. - const char *ret = Con::execute(this, mConnectArgc + 3, connectArgv); - if(ret[0]) + ConsoleValue returnValue = Con::execute(this, mConnectArgc + 3, connectArgv); + + StringTableEntry returnStr = StringTable->insert(returnValue.getString()); + + if(returnStr[0]) { - *errorString = ret; + *errorString = returnStr; return false; } return true; diff --git a/Engine/source/console/consoleFunctions.cpp b/Engine/source/console/consoleFunctions.cpp index d0eccde40..9a57c31c1 100644 --- a/Engine/source/console/consoleFunctions.cpp +++ b/Engine/source/console/consoleFunctions.cpp @@ -2286,7 +2286,8 @@ DefineEngineStringlyVariadicFunction( call, const char *, 2, 0, "( string functi "@endtsexample\n\n" "@ingroup Scripting" ) { - return Con::execute( argc - 1, argv + 1 ); + ConsoleValue returnValue = Con::execute(argc - 1, argv + 1); + return Con::getReturnBuffer(returnValue.getString()); } //----------------------------------------------------------------------------- diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index d727e2403..e9cae8130 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -2972,7 +2972,8 @@ DefineEngineStringlyVariadicMethod( SimObject, call, const char*, 3, 0, "( strin "@return The result of the method call." ) { argv[1].setString(argv[2]); - return Con::execute( object, argc - 1, argv + 1 ); + ConsoleValue returnValue = Con::execute(object, argc - 1, argv + 1); + return Con::getReturnBuffer(returnValue.getString()); } //----------------------------------------------------------------------------- diff --git a/Engine/source/gui/editor/popupMenu.cpp b/Engine/source/gui/editor/popupMenu.cpp index 2f250ece7..14fff6844 100644 --- a/Engine/source/gui/editor/popupMenu.cpp +++ b/Engine/source/gui/editor/popupMenu.cpp @@ -120,12 +120,14 @@ void PopupMenu::handleSelectEvent(U32 popID, U32 command) //----------------------------------------------------------------------------- bool PopupMenu::onMessageReceived(StringTableEntry queue, const char* event, const char* data) { - return Con::executef(this, "onMessageReceived", queue, event, data); + ConsoleValue returnValue = Con::executef(this, "onMessageReceived", queue, event, data); + return returnValue.getBool(); } bool PopupMenu::onMessageObjectReceived(StringTableEntry queue, Message *msg ) { - return Con::executef(this, "onMessageReceived", queue, Con::getIntArg(msg->getId())); + ConsoleValue returnValue = Con::executef(this, "onMessageReceived", queue, Con::getIntArg(msg->getId())); + return returnValue.getBool(); } ////////////////////////////////////////////////////////////////////////// From c285813540da06896685263b4cdb4af691b3c380 Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 8 Sep 2021 15:18:04 +0100 Subject: [PATCH 056/399] replace new with singletone to fix cannot re-declare object lof file spam --- .../scripts/advancedLighting_Shaders.tscript | 12 ++++++------ .../scripts/gfxData/warningTerrainMat.tscript | 2 +- .../templateFiles/terrainMaterial.tscript.template | 2 +- .../worldEditor/scripts/visibility/shadowViz.tscript | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.tscript b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.tscript index f7bdf56f9..55100d729 100644 --- a/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.tscript +++ b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.tscript @@ -75,7 +75,7 @@ singleton shaderData( AL_VectorLightShader ) pixVersion = 3.0; }; -new CustomMaterial( AL_VectorLightMaterial ) +singleton CustomMaterial( AL_VectorLightMaterial ) { shader = AL_VectorLightShader; stateBlock = AL_VectorLightState; @@ -149,7 +149,7 @@ singleton shaderData( AL_PointLightShader ) pixVersion = 3.0; }; -new CustomMaterial( AL_PointLightMaterial ) +singleton CustomMaterial( AL_PointLightMaterial ) { shader = AL_PointLightShader; stateBlock = AL_ConvexLightState; @@ -186,7 +186,7 @@ singleton shaderData( AL_SpotLightShader ) pixVersion = 3.0; }; -new CustomMaterial( AL_SpotLightMaterial ) +singleton CustomMaterial( AL_SpotLightMaterial ) { shader = AL_SpotLightShader; stateBlock = AL_ConvexLightState; @@ -205,7 +205,7 @@ new CustomMaterial( AL_SpotLightMaterial ) /// This material is used for generating deferred /// materials for objects that do not have materials. -new Material( AL_DefaultDeferredMaterial ) +singleton Material( AL_DefaultDeferredMaterial ) { // We need something in the first pass else it // won't create a proper material instance. @@ -219,7 +219,7 @@ new Material( AL_DefaultDeferredMaterial ) /// This material is used for generating shadow /// materials for objects that do not have materials. -new Material( AL_DefaultShadowMaterial ) +singleton Material( AL_DefaultShadowMaterial ) { // We need something in the first pass else it // won't create a proper material instance. @@ -255,7 +255,7 @@ singleton shaderData( AL_ParticlePointLightShader ) pixVersion = 3.0; }; -new CustomMaterial( AL_ParticlePointLightMaterial ) +singleton CustomMaterial( AL_ParticlePointLightMaterial ) { shader = AL_ParticlePointLightShader; stateBlock = AL_ConvexLightState; diff --git a/Templates/BaseGame/game/core/rendering/scripts/gfxData/warningTerrainMat.tscript b/Templates/BaseGame/game/core/rendering/scripts/gfxData/warningTerrainMat.tscript index 55b8562ac..f528e285a 100644 --- a/Templates/BaseGame/game/core/rendering/scripts/gfxData/warningTerrainMat.tscript +++ b/Templates/BaseGame/game/core/rendering/scripts/gfxData/warningTerrainMat.tscript @@ -1,4 +1,4 @@ -new TerrainMaterial() +singleton TerrainMaterial() { diffuseSize = "200"; detailSize = "10"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/terrainMaterial.tscript.template b/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/terrainMaterial.tscript.template index ef614edaf..ee54d964a 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/terrainMaterial.tscript.template +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/terrainMaterial.tscript.template @@ -11,7 +11,7 @@ singleton Material(TerrainFX_@) impactSoundId = "0"; }; -new TerrainMaterial(@) +singleton TerrainMaterial(@) { internalName = "@"; diffuseMap = ""; diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shadowViz.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shadowViz.tscript index bb07ba596..92cd4a6e5 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shadowViz.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shadowViz.tscript @@ -34,7 +34,7 @@ singleton shaderData( AL_ShadowVisualizeShader ) pixVersion = 2.0; }; -new CustomMaterial( AL_ShadowVisualizeMaterial ) +singleton CustomMaterial( AL_ShadowVisualizeMaterial ) { shader = AL_ShadowVisualizeShader; stateBlock = AL_DepthVisualizeState; From 3d488bbbf0eae8954999e8631f4376eb81ca9566 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 9 Sep 2021 13:29:31 -0500 Subject: [PATCH 057/399] macro cleanup --- Engine/source/T3D/assets/ImageAsset.h | 4 ++-- Engine/source/T3D/assets/MaterialAsset.h | 2 +- Engine/source/T3D/assets/ShapeAsset.h | 4 ++-- Engine/source/T3D/assets/SoundAsset.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Engine/source/T3D/assets/ImageAsset.h b/Engine/source/T3D/assets/ImageAsset.h index 241cae7b6..ff50ef655 100644 --- a/Engine/source/T3D/assets/ImageAsset.h +++ b/Engine/source/T3D/assets/ImageAsset.h @@ -248,7 +248,7 @@ public: \ Con::errorf("%s(%s)::_set%s() - image asset failure\"%s\" due to [%s]", macroText(className), getName(), macroText(name), _in, ImageAsset::getAssetErrstrn(m##name##Asset->getStatus()).c_str());\ return false; \ }\ - else if (m##name)\ + else if (!m##name)\ {\ Con::errorf("%s(%s)::_set%s() - Couldn't load image \"%s\"", macroText(className), getName(), macroText(name), _in);\ return false;\ @@ -467,7 +467,7 @@ public: \ Con::errorf("%s(%s)::_set%s(%i) - image asset failure\"%s\" due to [%s]", macroText(className), getName(), macroText(name), index, _in, ImageAsset::getAssetErrstrn(m##name##Asset[index]->getStatus()).c_str());\ return false; \ }\ - else if (bool(m##name[index]) == NULL)\ + else if (!m##name[index])\ {\ Con::errorf("%s(%s)::_set%s(%i) - Couldn't load image \"%s\"", macroText(className), getName(), macroText(name), index, _in);\ return false; \ diff --git a/Engine/source/T3D/assets/MaterialAsset.h b/Engine/source/T3D/assets/MaterialAsset.h index e046b31bd..018e2a989 100644 --- a/Engine/source/T3D/assets/MaterialAsset.h +++ b/Engine/source/T3D/assets/MaterialAsset.h @@ -231,7 +231,7 @@ public: \ Con::errorf("%s::_set%s() - material asset failure\"%s\" due to [%s]", macroText(className), macroText(name), _in, MaterialAsset::getAssetErrstrn(m##name##Asset->getStatus()).c_str());\ return false; \ }\ - else if (m##name)\ + else if (!m##name)\ {\ Con::errorf("%s::_set%s() - Couldn't load material \"%s\"", macroText(className), macroText(name), _in);\ return false;\ diff --git a/Engine/source/T3D/assets/ShapeAsset.h b/Engine/source/T3D/assets/ShapeAsset.h index b5bc0a97a..d5c899564 100644 --- a/Engine/source/T3D/assets/ShapeAsset.h +++ b/Engine/source/T3D/assets/ShapeAsset.h @@ -299,7 +299,7 @@ public: \ Con::errorf("%s(%s)::_set%s() - shape asset failure \"%s\" due to [%s]", macroText(className), getName(), macroText(name), _in, ShapeAsset::getAssetErrstrn(m##name##Asset->getStatus()).c_str());\ return false; \ }\ - else if (m##name)\ + else if (!m##name)\ {\ Con::errorf("%s(%s)::_set%s() - Couldn't load shape \"%s\"", macroText(className), getName(), macroText(name), _in);\ return false;\ @@ -495,7 +495,7 @@ public: \ Con::errorf("%s(%s)::_set%s(%i) - shape asset failure \"%s\" due to [%s]", macroText(className), getName(), macroText(name), index, _in, ShapeAsset::getAssetErrstrn(m##name##Asset[index]->getStatus()).c_str());\ return false; \ }\ - else if (bool(m##name[index]) == NULL)\ + else if (!m##name[index])\ {\ Con::errorf("%s(%s)::_set%s(%i) - Couldn't load shape \"%s\"", macroText(className), getName(), macroText(name), index, _in);\ return false; \ diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index 321c461b4..710652830 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -240,7 +240,7 @@ public: \ Con::errorf("%s(%s)::_set%s() - sound asset failure\"%s\" due to [%s]", macroText(className), getName(), macroText(name), _in, SoundAsset::getAssetErrstrn(m##name##Asset->getStatus()).c_str());\ return false; \ }\ - else if (m##name)\ + else if (!m##name)\ {\ Con::errorf("%s(%s)::_set%s() - Couldn't load sound \"%s\"", macroText(className), getName(), macroText(name), _in);\ return false;\ From 35b33f186429ad9f39358531e0361a9ead44e7e2 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Thu, 9 Sep 2021 19:30:32 -0400 Subject: [PATCH 058/399] various fixes and memory corruption bug. --- Engine/source/cinterface/cinterface.cpp | 4 ++-- Engine/source/console/console.cpp | 7 +++--- Engine/source/console/simObject.cpp | 3 ++- Engine/source/console/test/ScriptTest.cpp | 29 +++++++++++++++++++++-- 4 files changed, 35 insertions(+), 8 deletions(-) diff --git a/Engine/source/cinterface/cinterface.cpp b/Engine/source/cinterface/cinterface.cpp index e62db2c91..3cd717c13 100644 --- a/Engine/source/cinterface/cinterface.cpp +++ b/Engine/source/cinterface/cinterface.cpp @@ -55,7 +55,7 @@ bool CInterface::_isMethod(const char* className, const char* methodName) const if (mIsMethodCallback) return mIsMethodCallback(className, methodName); - return NULL; + return false; } const char* CInterface::_CallFunction(const char* nameSpace, const char* name, const char **argv, int argc, bool *result) const @@ -93,4 +93,4 @@ TORQUE_API void SetCallbacks(void* ptr, void* methodPtr, void* isMethodPtr, void CInterface::GetCInterface().SetCallMethodCallback(methodPtr); CInterface::GetCInterface().SetCallIsMethodCallback(isMethodPtr); CInterface::GetCInterface().SetMainCallback(mainPtr); -} \ No newline at end of file +} diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index 399298864..ab93d554e 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -1643,13 +1643,13 @@ static ConsoleValue _internalExecute(SimObject *object, S32 argc, ConsoleValue a { ConsoleValue val; val.setString(methodRes); - return std::move(val); + return val; } if(object->getNamespace()) { U32 ident = object->getId(); - const char* oldIdent = argv[1].getString(); + const char* oldIdent = dStrdup(argv[1].getString()); Namespace::Entry *ent = object->getNamespace()->lookup(funcName); @@ -1671,8 +1671,9 @@ static ConsoleValue _internalExecute(SimObject *object, S32 argc, ConsoleValue a // Twiddle it back argv[1].setString(oldIdent); + dFree(oldIdent); - return std::move(ret); + return ret; } warnf(ConsoleLogEntry::Script, "Con::execute - %d has no namespace: %s", object->getId(), funcName); diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index e9cae8130..6b54bdd1d 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -2971,7 +2971,8 @@ DefineEngineStringlyVariadicMethod( SimObject, call, const char*, 3, 0, "( strin "@param args Zero or more arguments for the method.\n" "@return The result of the method call." ) { - argv[1].setString(argv[2]); + argv[1].setString(argv[2].getString()); + ConsoleValue returnValue = Con::execute(object, argc - 1, argv + 1); return Con::getReturnBuffer(returnValue.getString()); } diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index 24905aba3..05775694f 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -969,8 +969,6 @@ TEST(Script, MiscRegressions) ASSERT_EQ(regression4.getFloat(), 0.5); - Con::setBoolVariable("$Debug::DumpByteCode", true); - ConsoleValue regression5 = RunScript(R"( function noOpInc() { @@ -982,6 +980,33 @@ TEST(Script, MiscRegressions) )"); ASSERT_EQ(regression5.getInt(), 2); + + ConsoleValue regression6 = RunScript(R"( + function SimObject::crashMe(%this, %line) + { + return %line @ "1"; + } + + function doTest() + { + %obj = new SimObject(); + for (%i = 0; %i < 99999; %i++) + { + %function = "crashMe"; + if (%obj.isMethod(%function)) + { + %line = "abcdefg"; + %output = %obj.call(%function, %line); + } + } + + return true; + } + + return doTest(); + )"); + + ASSERT_EQ(regression6.getBool(), true); } #endif From e4d16a8c61bdad523d3ce888c582e9a7e1eac1ac Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 9 Sep 2021 18:33:03 -0500 Subject: [PATCH 059/399] (re) add collision yo noshape.dts set all rigidshapedatas to default to noshape instead of blank to fix the lack of a basic collision mesh blocking datablock creation --- Engine/source/T3D/rigidShape.cpp | 1 + .../game/core/rendering/shapes/noshape.dts | Bin 18389 -> 14146 bytes 2 files changed, 1 insertion(+) diff --git a/Engine/source/T3D/rigidShape.cpp b/Engine/source/T3D/rigidShape.cpp index 8eeaffb3f..cf26f8ea9 100644 --- a/Engine/source/T3D/rigidShape.cpp +++ b/Engine/source/T3D/rigidShape.cpp @@ -263,6 +263,7 @@ RigidShapeData::RigidShapeData() dustTrailEmitter = NULL; dustTrailID = 0; + _setShape(ShapeAsset::smNoShapeAssetFallback); } RigidShapeData::~RigidShapeData() diff --git a/Templates/BaseGame/game/core/rendering/shapes/noshape.dts b/Templates/BaseGame/game/core/rendering/shapes/noshape.dts index a7a64cf1099e4247aecded23bec3923eb6e3a198..81720460ca6d1a7a09297d14fb557284448412fe 100644 GIT binary patch literal 14146 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 POt$~y%yKhanquhxwppnO literal 18389 zcmeI43Aj~N6~`|EB8Z4)l3IwMQi?e|3#|+9na!G7QVtbG!4n)Iu|O>^R+f!4rJ)c^|L2G&Gu%CY#LW$+9f9-+!OI?)~rAJNoSV$i6Sn=a0S4UjMbu-us-r?s*R{ zyEblK@rxZAjpJYuY}IHqMuCoKtFwRq)BUo=Xi$zgF5mI`IfCKu;3s4D zY)`m-^}x(KSI@z2j=z2NoXB@)K6EZK`V}9(7-#rG+i0`~HHI-TRsnWwjU9379%sIx z<~DSUhY88i>J9(47!zST@Og6Dr)!JLIH@}(Wykik8gq~U^e+JkO8VnDtjcGLQsrgyu2(%8KQW?lRHl*cq}vt8dbz1wYF z|6s2+pce#-tG46+m6saO843{p5OIN)4Lt|rp99$w_P7O zrFT1xzlXI}o;;qRw(HXzv)=7=e>D!}(LGhJA$Gc7xj#JvS?{)D+vnt1tyAPQ+x5yB zdbit*v3)xCGLIoNp5OIN)4Q!41F=4)@%*lDn%-?)e?aS^@tDSK*Edb?c2O%#GnxCT{v*fp;xxm@3qD2Nzre5kKOi?lLz)&zK`~`*PnDx zPN&Xq@TI%Mm4$hE8JcfH%1(_+RtTx_m~MNZedt?TF7pRQ}MQM-!%q56m= zXVb>hiM86L@pSrK?>2LsGbyi+$6DYnS}CdVADm)6H)t#%dtu6KLMO&8A5dMS^` zTJ0+OUGKI&Q?+)=Gfb@ZSJCf!x0UmH*4oCCY|Sz6_ZUy=cfH%1)lokol9RucAn>`rA5E%-PW8mKIPGKGF-j&e%HILG1&V{)Zw%ja(zzY@fz;>u*umz zr8^$gsWdjLrA1EHyUiR2Cg=6>SgWN)9d^CjaA%!zw6tkce|+?5cSP8p5OIt z)4QFXJ*%0WoHhEkp67TsH(TTB)LZX2yNETt#?y&qE}eSo{bsvfa}2%PP1OLci=Hdf zxb6D3>D^8>fNQsv$24xczO9;(^=>zZ*38IRqfbBgXzjSJ+i5(pUp%MTu1{mgdbiW~ zWB+;`Hrw@Sj#=+^Q+-iy)kaRUUEemn+f9v8*Va0l#%qfa@Oe6Gnw^n zYdoELtNRc+&33)U5PG*Y{!YC$jpuj0<`{ann_e?b)qD#phIKuSdA;!=c2z-5BogFJG1Ir zCsz8Xx8AR3M)T2i-IhMT8`sub&pA{dvE+<*=GuD8cvQ1u3?044+Bzn!=^mQALOg~GbInj5<7Hf~J%?z!T_uU7tOm8HssKIN?1q~}~dr_s3hqKi7$jxo5V^0(%OuBYe9 zq>uB`-XR z@plr|hF{l_KU%HNE=d=0rC;kJf3#Y`zNGKz>9JPpp>thF{%F(lkaQ7O`ZbOtlfG&- zo)eNj&P%_>A%C=uMt^^Q(nnnB*E-4{ZKKiCb7s; z#+7t=F1j!2ylT6;%CGsPIp=*-+0m!#hc53U#-n{0`$qGq&P#uzH}9j|rg;`|r9Z6; z{%B+0bmQ_q)A}S`-bcN$k7BHGUi#C0)4j_mZ?%6SuIsBbc^`4TO2>MqwTSc5pYBu2 z9lHMhy^}u9tG27F{0+um>0;l-dFj`BrhS@Q-KV~kKjKQi<{*Ex>G?_eh%5c+xk!4R zlcbCN7w1*m)#ZK4^HA;M*ne?e`ZdqAzjGV=GWK({U0vR%%(vRdJacJWabEg0Px+%w z^G*AWJ{|IL^mSV1gTIga8~Zf&XPmoVI{BlGeW~?`IQRGEeH*QG+K1gZo`-Y~qpkeP zU+H4s#d+!1Ji5<7l~?;P&EMLtuG*g(Po<0f7w4tFFYnuE(>zn&h^yN0YuwtG(ds^? z&&S*!@!{{w{%AGsiioS)@M|9ON2`3=msL!+4Zp4DN5vk5=)*B;csPsv?*_Tz9X(`!>>5)+i24~@_tZ%#D`z=NT0R2)p)co zyK$vo*O5P3t*hQ|yK$wzmHpA``qlo7xT+1m#wCBWy3g9b-MG@<%Km6I?gn(@s`&70 zzVb(_yw(1UxYDn2$RDldsn6eTTDN4^iB{vT_Gi@}@!{7z<&Re5uJ&idm43}r{%AGdYJWyt>DN5vk5=QZ_GiSE ze$7+s{zU+3Xd8;AErf3%@d8-4dw-)O8{ac1w? zvoB>YRCxwwU+}QIvR&`?_+1wEE?9PR%H#cYw(H&I+O3#R^MGk{cfaA>v>tV~>)mEf z8x}J+`gF7+XPxbOw|82(^Wea4N2fgAUuV1CZE_59p7MBqo$Y$JnbRQGPV4Obb++r> zW<3VAFgm=y&UU@qS-+vm)XnJ{w_Wcx&%hwhPs-!{b++r>W*n`!-gyU1+raaa=2>UE z-fgY1u1%kgR^+U+UGKK;x$cdUcz>Pkdbi2Zt7k=dyuZ$Nz1!N4$Fnz-$NTGS*SpPn z^hT}l{yN+BrLDEqk!n~gng6*>{5{I!`ul7auaW4i;eBgz@2-h%M{jjcQVqI0+x1(* zZrON7lHc`P!uBzYB){wLv#V$OF4uv2uJ?`3=Q}n3Dh2T0;BdC<-RAQ}??37D%lqqW z*SoD8I%f>}{OaVavt94D<`kdr-d|_C-ffLTYoR~Azs{B}^lqc~_l;pSb$X9w{Qpz$ z8?3Q@z8LZQhU?vC&7$_{eYKOb&UU@qSwAulG%ou7e}$NTGS*Sl@&67Q=ir)%7Hz1wK~=Pz98{#BA;Y}dQZ`2VMV{!+c- z{aN?A#XVB}iF-G!?RvKf@6=E4ud`iW+MW03L5-cz8#d07 zT+8)a!uBzYB){w3_E_()vt94D>%G6ucK!c@?dvd-`MQ2f*gl4lf{Y0NRBlJiq_n`GXW_`C=-*MJ=lJ$LNeXp6XfHx+C zzMs4k+z)nyDX=r#A9jUZ-~sR;cp&Ts(_nX)3Nv6j>;ZejUa%)T1Re}CVHWHQ`@sJ2 zP}mRjMR9%M`2f%_(+`FoI0RND)<e>fO=;2@X{4~K`rBj8Xt1oV$aG~toZ2fZ*C4u?m2M;P0Q2FQ@C;Z0&xU8gLU=Ab2Tp>1SOh1- z5?BnU!KrWxEQK@RbT|{92g~63a270wm9PR{0O!Iva5kI=FM=1s`LGIF@KSgQyck{% zFM|u4J3-5$? zzhEKsKVFL_68$JV{ zhC%o|d=5SfUxF{f7vNgB2EGi}!AAHBY=W=C_3#b&I(!Yj4c~%q!VU0U_zrv@z6YD( zNAN@V0qD3fx0A7VfF0G@7{zDvXg-g}@) z$wa2OQCp23Gj{87+l-&E?ZoXSZ9jG1ym?cnuA2($TIra{pEGAJn+ePMmOctm<6_y|?zlt($IzP4hOvyi@O`qZ;RC#<_X(l+7?@ z%@kNOYYp7Zn0-yAuUofn`t%voVMc2PwC;L+_Ptk+YO%Rp9NYws$vZ4O>$KBWHkKZ< qWa**<8w(dLU$ErVgYu)G=W5(hXB@kD!O}&e;}OdLDh^w|SNsbiRi_95 From 8781f2ab55720151c3a3449d4fda3fe5177a8c4d Mon Sep 17 00:00:00 2001 From: Areloch Date: Fri, 10 Sep 2021 02:13:56 -0500 Subject: [PATCH 060/399] Add getScriptPath console function to GUIAsset Shifted tracking of importing asset status to an enum for more robust handling Added logic to properly init freshly created shapeConstructors with the newly imported shapeAsset Fixed handling of assets that have been marked to be skipped, but needed to fill in the parent's dependencies(UseForDependencies enum value) Cleaned up redundant recursive logic for importing assets Disable Create Game Objects button in inspector Fixed material assignment for convex proxies Updated asset icons for AB with WIP images to be more clear Fixed issue where type-generic icons in the creator items in the AB weren't showing correctly. Force AB to show creator entries in list mode for efficiency and avoid icon scaling issues Moved creator functions for AB to separate file for convenience Filled out GUIControls in the AB's creator mode, and context world editor and GUI creator entries based on active editor Added drag-n-drop handling for guiControls via AB creator in guiEditor mode Added more types' profiles in the AB gui profiles to give more unique border colors for better visual clarity of asset type Added editor setting to indicate if the editor should load into the last edited level, or the editor default scene Fixed setting of highlight material overlay in shapeEditor Added global keybind for GUIEditor so space also toggles assetbrowser Fixed up binding/finding of shapeConstructor by assetId, which also fixed displaying of shape's material listing --- Engine/source/T3D/assets/GUIAsset.cpp | 7 + Engine/source/T3D/assets/assetImporter.cpp | 550 ++++++------------ Engine/source/T3D/assets/assetImporter.h | 21 +- Engine/source/T3D/tsStatic.cpp | 76 ++- .../worldEditor/guiConvexShapeEditorCtrl.cpp | 17 +- Engine/source/scene/sceneObject.cpp | 5 +- Engine/source/ts/tsShapeConstruct.cpp | 18 + Engine/source/ts/tsShapeConstruct.h | 2 + .../tools/assetBrowser/art/animationIcon.png | Bin 8177 -> 12242 bytes .../assetBrowser/art/clientScriptIcon.png | Bin 14572 -> 9016 bytes .../game/tools/assetBrowser/art/cppIcon.png | Bin 4894 -> 6954 bytes .../tools/assetBrowser/art/datablockIcon.png | Bin 6937 -> 8646 bytes .../tools/assetBrowser/art/folderIcon.png | Bin 11562 -> 7824 bytes .../game/tools/assetBrowser/art/guiIcon.png | Bin 5789 -> 10181 bytes .../game/tools/assetBrowser/art/levelIcon.png | Bin 6797 -> 20009 bytes .../tools/assetBrowser/art/materialIcon.png | Bin 7889 -> 40426 bytes .../tools/assetBrowser/art/postEffectIcon.png | Bin 8615 -> 10506 bytes .../tools/assetBrowser/art/prefabIcon.png | Bin 0 -> 12431 bytes .../art/prefabIcon_image.asset.taml | 8 + .../tools/assetBrowser/art/scriptIcon.png | Bin 10044 -> 7772 bytes .../assetBrowser/art/serverScriptIcon.png | Bin 14897 -> 9224 bytes .../game/tools/assetBrowser/art/soundIcon.png | Bin 10582 -> 11705 bytes .../assetBrowser/art/stateMachineIcon.png | Bin 13506 -> 20797 bytes .../tools/assetBrowser/art/terrainIcon.png | Bin 0 -> 13631 bytes .../art/terrainIcon_image.asset.taml | 8 + .../assetBrowser/art/terrainMaterialIcon.png | Bin 7889 -> 14057 bytes .../game/tools/assetBrowser/main.tscript | 4 + .../assetBrowser/scripts/assetBrowser.tscript | 199 +------ .../assetBrowser/scripts/assetImport.tscript | 142 ----- .../scripts/assetTypes/cpp.tscript | 13 + .../scripts/assetTypes/creatorObj.tscript | 15 + .../scripts/assetTypes/material.tscript | 14 +- .../scripts/assetTypes/prefab.tscript | 2 +- .../scripts/assetTypes/script.tscript | 16 + .../scripts/assetTypes/shape.tscript | 11 +- .../scripts/assetTypes/terrain.tscript | 2 +- .../assetBrowser/scripts/creator.tscript | 194 ++++++ .../assetBrowser/scripts/profiles.tscript | 63 ++ .../tools/gui/editorSettingsWindow.ed.tscript | 5 + .../images/{tab-border.png => tab_border.png} | Bin .../gui/images/tab_border_image.asset.taml | 2 +- .../guiEditor/scripts/guiEditor.ed.tscript | 15 +- Templates/BaseGame/game/tools/main.tscript | 28 + .../scripts/shapeEditor.ed.tscript | 6 +- 44 files changed, 695 insertions(+), 748 deletions(-) create mode 100644 Templates/BaseGame/game/tools/assetBrowser/art/prefabIcon.png create mode 100644 Templates/BaseGame/game/tools/assetBrowser/art/prefabIcon_image.asset.taml create mode 100644 Templates/BaseGame/game/tools/assetBrowser/art/terrainIcon.png create mode 100644 Templates/BaseGame/game/tools/assetBrowser/art/terrainIcon_image.asset.taml create mode 100644 Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript rename Templates/BaseGame/game/tools/gui/images/{tab-border.png => tab_border.png} (100%) diff --git a/Engine/source/T3D/assets/GUIAsset.cpp b/Engine/source/T3D/assets/GUIAsset.cpp index 781cabc9e..f9a2b500c 100644 --- a/Engine/source/T3D/assets/GUIAsset.cpp +++ b/Engine/source/T3D/assets/GUIAsset.cpp @@ -221,6 +221,13 @@ DefineEngineStaticMethod(GUIAsset, getAssetIdByGUIName, const char*, (const char { return GUIAsset::getAssetIdByGUIName(StringTable->insert(guiName)); } + +DefineEngineMethod(GUIAsset, getScriptPath, const char*, (), , + "Gets the script file path associated to this asset.\n" + "@return The full script file path.") +{ + return object->getScriptPath(); +} #endif //----------------------------------------------------------------------------- diff --git a/Engine/source/T3D/assets/assetImporter.cpp b/Engine/source/T3D/assets/assetImporter.cpp index b0497631e..5dadee79c 100644 --- a/Engine/source/T3D/assets/assetImporter.cpp +++ b/Engine/source/T3D/assets/assetImporter.cpp @@ -420,8 +420,7 @@ IMPLEMENT_CONOBJECT(AssetImportObject); AssetImportObject::AssetImportObject() : dirty(false), - skip(false), - processed(false), + importStatus(AssetImportObject::NotProcessed), generatedAsset(false), parentAssetItem(nullptr), tamlFilePath(""), @@ -463,8 +462,6 @@ void AssetImportObject::initPersistFields() addField("statusInfo", TypeRealString, Offset(statusInfo, AssetImportObject), "What is the articulated information of the status of the asset. Contains the error or warning log data"); addField("dirty", TypeBool, Offset(dirty, AssetImportObject), "Is the asset item currently flagged as dirty"); - addField("skip", TypeBool, Offset(skip, AssetImportObject), "Is this asset item marked to be skipped. If it is, it's usually due to being marked as deleted"); - addField("processed", TypeBool, Offset(processed, AssetImportObject), "Has the asset item been processed"); addField("generatedAsset", TypeBool, Offset(generatedAsset, AssetImportObject), "Is this specific asset item generated as part of the import process of another item"); addField("tamlFilePath", TypeRealString, Offset(tamlFilePath, AssetImportObject), "What is the ultimate asset taml file path for this import item"); @@ -622,8 +619,7 @@ AssetImportObject* AssetImporter::addImportingAsset(String assetType, Torque::Pa assetImportObj->statusInfo = ""; assetImportObj->dirty = false; - assetImportObj->skip = false; - assetImportObj->processed = false; + assetImportObj->importStatus = AssetImportObject::NotProcessed; assetImportObj->generatedAsset = false; if (parentItem != nullptr) @@ -656,7 +652,7 @@ AssetImportObject* AssetImporter::addImportingAsset(String assetType, Torque::Pa void AssetImporter::deleteImportingAsset(AssetImportObject* assetItem) { - assetItem->skip = true; + assetItem->importStatus = AssetImportObject::Skipped; //log it dSprintf(importLogBuffer, sizeof(importLogBuffer), "Deleting Importing Asset %s and all it's child items", assetItem->assetName.c_str()); @@ -665,36 +661,21 @@ void AssetImporter::deleteImportingAsset(AssetImportObject* assetItem) AssetImportObject* AssetImporter::findImportingAssetByName(String assetName, AssetImportObject* assetItem) { - if (assetItem == nullptr) - { - for (U32 i = 0; i < importingAssets.size(); i++) - { - if (importingAssets[i]->cleanAssetName == assetName) - { - return importingAssets[i]; - } + Vector itemList = importingAssets; + if (assetItem != nullptr) + itemList = assetItem->childAssetItems; - //If it wasn't a match, try recusing on the children(if any) - AssetImportObject* retItem = findImportingAssetByName(assetName, importingAssets[i]); - if (retItem != nullptr) - return retItem; - } - } - else + for (U32 i = 0; i < itemList.size(); i++) { - //this is the child recursing section - for (U32 i = 0; i < assetItem->childAssetItems.size(); i++) + if (itemList[i]->cleanAssetName == assetName) { - if (assetItem->childAssetItems[i]->cleanAssetName == assetName) - { - return assetItem->childAssetItems[i]; - } - - //If it wasn't a match, try recusing on the children(if any) - AssetImportObject* retItem = findImportingAssetByName(assetName, assetItem->childAssetItems[i]); - if (retItem != nullptr) - return retItem; + return itemList[i]; } + + //If it wasn't a match, try recusing on the children(if any) + AssetImportObject* retItem = findImportingAssetByName(assetName, itemList[i]); + if (retItem != nullptr) + return retItem; } return nullptr; @@ -1385,105 +1366,53 @@ void AssetImportConfig::loadSISFile(Torque::Path filePath) void AssetImporter::processImportAssets(AssetImportObject* assetItem) { - if (assetItem == nullptr) + Vector itemList = importingAssets; + if (assetItem != nullptr) + itemList = assetItem->childAssetItems; + + assetHeirarchyChanged = false; + + for (U32 i = 0; i < itemList.size(); i++) { - assetHeirarchyChanged = false; + AssetImportObject* item = itemList[i]; + if (item->importStatus != AssetImportObject::NotProcessed) + continue; - for (U32 i = 0; i < importingAssets.size(); i++) + //Sanitize before modifying our asset name(suffix additions, etc) + if (item->assetName != item->cleanAssetName) + item->assetName = item->cleanAssetName; + + //handle special pre-processing here for any types that need it + + //process the asset items + if (item->assetType == String("ImageAsset")) { - AssetImportObject* item = importingAssets[i]; - if (item->skip) - continue; - - if (!item->processed) - { - //Sanitize before modifying our asset name(suffix additions, etc) - if (item->assetName != item->cleanAssetName) - item->assetName = item->cleanAssetName; - - //handle special pre-processing here for any types that need it - - //process the asset items - if (item->assetType == String("ImageAsset")) - { - processImageAsset(item); - } - else if (item->assetType == String("ShapeAsset")) - { - processShapeAsset(item); - } - /*else if (item->assetType == String("SoundAsset")) - SoundAsset::prepareAssetForImport(this, item);*/ - else if (item->assetType == String("MaterialAsset")) - { - processMaterialAsset(item); - } - /*else if (item->assetType == String("ShapeAnimationAsset")) - ShapeAnimationAsset::prepareAssetForImport(this, item);*/ - else - { - String processCommand = "process"; - processCommand += item->assetType; - if(isMethod(processCommand.c_str())) - Con::executef(this, processCommand.c_str(), item); - } - - item->processed = true; - } - - //try recusing on the children(if any) - processImportAssets(item); + processImageAsset(item); } - } - else - { - //this is the child recursing section - for (U32 i = 0; i < assetItem->childAssetItems.size(); i++) + else if (item->assetType == String("ShapeAsset")) { - AssetImportObject* childItem = assetItem->childAssetItems[i]; - - if (childItem->skip) - continue; - - if (!childItem->processed) - { - //Sanitize before modifying our asset name(suffix additions, etc) - //if (childItem->assetName != childItem->cleanAssetName) - // childItem->assetName = childItem->cleanAssetName; - - //handle special pre-processing here for any types that need it - - //process the asset items - if (childItem->assetType == String("ImageAsset")) - { - processImageAsset(childItem); - } - else if (childItem->assetType == String("ShapeAsset")) - { - processShapeAsset(childItem); - } - /*else if (item->assetType == String("SoundAsset")) - SoundAsset::prepareAssetForImport(this, item);*/ - else if (childItem->assetType == String("MaterialAsset")) - { - processMaterialAsset(childItem); - } - /*else if (item->assetType == String("ShapeAnimationAsset")) - ShapeAnimationAsset::prepareAssetForImport(this, item);*/ - else - { - String processCommand = "process"; - processCommand += childItem->assetType; - if (isMethod(processCommand.c_str())) - Con::executef(this, processCommand.c_str(), childItem); - } - - childItem->processed = true; - } - - //try recusing on the children(if any) - processImportAssets(childItem); + processShapeAsset(item); } + /*else if (item->assetType == String("SoundAsset")) + SoundAsset::prepareAssetForImport(this, item);*/ + else if (item->assetType == String("MaterialAsset")) + { + processMaterialAsset(item); + } + /*else if (item->assetType == String("ShapeAnimationAsset")) + ShapeAnimationAsset::prepareAssetForImport(this, item);*/ + else + { + String processCommand = "process"; + processCommand += item->assetType; + if(isMethod(processCommand.c_str())) + Con::executef(this, processCommand.c_str(), item); + } + + item->importStatus == AssetImportObject::Processed; + + //try recusing on the children(if any) + processImportAssets(item); } //If our hierarchy changed, it's because we did so during processing @@ -1606,7 +1535,7 @@ void AssetImporter::processImageAsset(AssetImportObject* assetItem) assetItem->cleanAssetName = assetItem->assetName; } - assetItem->processed = true; + assetItem->importStatus = AssetImportObject::Processed; } void AssetImporter::processMaterialAsset(AssetImportObject* assetItem) @@ -1629,7 +1558,7 @@ void AssetImporter::processMaterialAsset(AssetImportObject* assetItem) String ignoredName = StringUnit::getUnit(activeImportConfig->IgnoreMaterials, i, ",;\t"); if (FindMatch::isMatch(ignoredName.c_str(), assetName, false)) { - assetItem->skip = true; + assetItem->importStatus = AssetImportObject::Skipped; dSprintf(importLogBuffer, sizeof(importLogBuffer), "Material %s has been ignored due to it's name being listed in the IgnoreMaterials list in the Import Config.", assetItem->assetName.c_str()); activityLog.push_back(importLogBuffer); @@ -1645,9 +1574,9 @@ void AssetImporter::processMaterialAsset(AssetImportObject* assetItem) //check to see if the definition for this already exists StringTableEntry existingMatAsset = MaterialAsset::getAssetIdByMaterialName(StringTable->insert(assetName)); - if (existingMatAsset != StringTable->EmptyString()) + if (existingMatAsset != StringTable->EmptyString() && existingMatAsset != StringTable->insert("Core_Rendering:NoMaterial")) { - assetItem->skip = true; + assetItem->importStatus = AssetImportObject::UseForDependencies; dSprintf(importLogBuffer, sizeof(importLogBuffer), "Material %s has been skipped because we already found an asset Id that uses that material definition. The found assetId is: %s", assetItem->assetName.c_str(), existingMatAsset); activityLog.push_back(importLogBuffer); return; @@ -1696,7 +1625,7 @@ void AssetImporter::processMaterialAsset(AssetImportObject* assetItem) { AssetImportObject* childAssetItem = assetItem->childAssetItems[i]; - if (childAssetItem->skip || childAssetItem->assetType != String("ImageAsset")) + if (childAssetItem->importStatus == AssetImportObject::Skipped || childAssetItem->assetType != String("ImageAsset")) continue; for (S32 t = 0; t < ImageAsset::ImageTypeCount; t++) @@ -1848,7 +1777,7 @@ void AssetImporter::processMaterialAsset(AssetImportObject* assetItem) } } - assetItem->processed = true; + assetItem->importStatus = AssetImportObject::Processed; } void AssetImporter::processShapeAsset(AssetImportObject* assetItem) @@ -1944,7 +1873,7 @@ void AssetImporter::processShapeAsset(AssetImportObject* assetItem) cachedConfig->CopyTo(activeImportConfig); cachedConfig->deleteObject(); - assetItem->processed = true; + assetItem->importStatus = AssetImportObject::Processed; } void AssetImporter::processShapeMaterialInfo(AssetImportObject* assetItem, S32 materialItemId) @@ -2131,7 +2060,7 @@ void AssetImporter::processSoundAsset(AssetImportObject* assetItem) } } - assetItem->processed = true; + assetItem->importStatus = AssetImportObject::Processed; } // // Validation @@ -2154,7 +2083,7 @@ bool AssetImporter::validateAssets() void AssetImporter::validateAsset(AssetImportObject* assetItem) { - if (assetItem->skip) + if (assetItem->importStatus == AssetImportObject::Skipped || assetItem->importStatus == AssetImportObject::NotProcessed) return; bool hasCollision = checkAssetForCollision(assetItem); @@ -2234,36 +2163,21 @@ void AssetImporter::validateAsset(AssetImportObject* assetItem) void AssetImporter::resetAssetValidationStatus(AssetImportObject* assetItem) { - if (assetItem == nullptr) + Vector itemList = importingAssets; + if (assetItem != nullptr) + itemList = assetItem->childAssetItems; + + for (U32 i = 0; i < itemList.size(); i++) { - for (U32 i = 0; i < importingAssets.size(); i++) - { - if (importingAssets[i]->skip) - continue; + if (itemList[i]->importStatus == AssetImportObject::Skipped) + continue; - importingAssets[i]->status = ""; - importingAssets[i]->statusType = ""; - importingAssets[i]->statusInfo = ""; + itemList[i]->status = ""; + itemList[i]->statusType = ""; + itemList[i]->statusInfo = ""; - //If it wasn't a match, try recusing on the children(if any) - resetAssetValidationStatus(importingAssets[i]); - } - } - else - { - //this is the child recursing section - for (U32 i = 0; i < assetItem->childAssetItems.size(); i++) - { - if (assetItem->childAssetItems[i]->skip) - continue; - - assetItem->childAssetItems[i]->status = ""; - assetItem->childAssetItems[i]->statusType = ""; - assetItem->childAssetItems[i]->statusInfo = ""; - - //If it wasn't a match, try recusing on the children(if any) - resetAssetValidationStatus(assetItem->childAssetItems[i]); - } + //If it wasn't a match, try recusing on the children(if any) + resetAssetValidationStatus(itemList[i]); } } @@ -2271,68 +2185,37 @@ bool AssetImporter::checkAssetForCollision(AssetImportObject* assetItemToCheck, { bool results = false; - if (assetItem == nullptr) + Vector itemList = importingAssets; + if (assetItem != nullptr) + itemList = assetItem->childAssetItems; + + for (U32 i = 0; i < itemList.size(); i++) { - for (U32 i = 0; i < importingAssets.size(); i++) + AssetImportObject* importingAsset = itemList[i]; + + if (importingAsset->importStatus == AssetImportObject::Skipped) + continue; + + if ((assetItemToCheck->assetName.compare(importingAsset->assetName) == 0) && (assetItemToCheck->getId() != importingAsset->getId())) { - AssetImportObject* importingAsset = importingAssets[i]; - - if (importingAsset->skip) - continue; - - if ((assetItemToCheck->assetName.compare(importingAsset->assetName) == 0) && (assetItemToCheck->getId() != importingAsset->getId())) - { - //we do have a collision, note the collsion and bail out - assetItemToCheck->status = "Warning"; - assetItemToCheck->statusType = "DuplicateImportAsset"; - assetItemToCheck->statusInfo = "Duplicate asset names found with importing assets!\nAsset \"" + importingAsset->assetName + "\" of the type \"" + importingAsset->assetType + "\" and \"" + - assetItemToCheck->assetName + "\" of the type \"" + assetItemToCheck->assetType + "\" have matching names.\nPlease rename one of them."; - - dSprintf(importLogBuffer, sizeof(importLogBuffer), "Warning! Asset %s, type %s has a naming collision with another importing asset: %s, type %s", - assetItemToCheck->assetName.c_str(), assetItemToCheck->assetType.c_str(), - importingAsset->assetName.c_str(), importingAsset->assetType.c_str()); - activityLog.push_back(importLogBuffer); - - return true; - } - - //If it wasn't a match, try recusing on the children(if any) - results = checkAssetForCollision(assetItemToCheck, importingAsset); - if (results) - return results; - } - } - else - { - //this is the child recursing section - for (U32 i = 0; i < assetItem->childAssetItems.size(); i++) - { - AssetImportObject* childAsset = assetItem->childAssetItems[i]; - - if (childAsset->skip) - continue; - - if ((assetItemToCheck->assetName.compare(childAsset->assetName) == 0) && (assetItemToCheck->getId() != childAsset->getId())) - { - //we do have a collision, note the collsion and bail out - assetItemToCheck->status = "Warning"; - assetItemToCheck->statusType = "DuplicateImportAsset"; - assetItemToCheck->statusInfo = "Duplicate asset names found with importing assets!\nAsset \"" + assetItem->assetName + "\" of the type \"" + assetItem->assetType + "\" and \"" + - assetItemToCheck->assetName + "\" of the type \"" + assetItemToCheck->assetType + "\" have matching names.\nPlease rename one of them."; + //we do have a collision, note the collsion and bail out + assetItemToCheck->status = "Warning"; + assetItemToCheck->statusType = "DuplicateImportAsset"; + assetItemToCheck->statusInfo = "Duplicate asset names found with importing assets!\nAsset \"" + importingAsset->assetName + "\" of the type \"" + importingAsset->assetType + "\" and \"" + + assetItemToCheck->assetName + "\" of the type \"" + assetItemToCheck->assetType + "\" have matching names.\nPlease rename one of them."; dSprintf(importLogBuffer, sizeof(importLogBuffer), "Warning! Asset %s, type %s has a naming collision with another importing asset: %s, type %s", assetItemToCheck->assetName.c_str(), assetItemToCheck->assetType.c_str(), - childAsset->assetName.c_str(), childAsset->assetType.c_str()); + importingAsset->assetName.c_str(), importingAsset->assetType.c_str()); activityLog.push_back(importLogBuffer); - return true; - } - - //If it wasn't a match, try recusing on the children(if any) - results = checkAssetForCollision(assetItemToCheck, childAsset); - if (results) - return results; + return true; } + + //If it wasn't a match, try recusing on the children(if any) + results = checkAssetForCollision(assetItemToCheck, importingAsset); + if (results) + return results; } return results; @@ -2348,7 +2231,16 @@ void AssetImporter::resolveAssetItemIssues(AssetImportObject* assetItem) if (activeImportConfig->DuplicateAutoResolution == String("AutoPrune")) { //delete the item - deleteImportingAsset(assetItem); + if (assetItem->parentAssetItem == nullptr) + { + //if there's no parent, just delete + deleteImportingAsset(assetItem); + } + else + { + //otherwise, we'll likely want to retain our dependency for our parent + assetItem->importStatus = AssetImportObject::UseForDependencies; + } //log it's deletion dSprintf(importLogBuffer, sizeof(importLogBuffer), "Asset %s was autopruned due to %s as part of the Import Configuration", assetItem->assetName.c_str(), humanReadableReason.c_str()); @@ -2537,161 +2429,102 @@ void AssetImporter::importAssets(AssetImportObject* assetItem) return; } - if (assetItem == nullptr) + Vector itemList = importingAssets; + if (assetItem != nullptr) + itemList = assetItem->childAssetItems; + + for (U32 i = 0; i < itemList.size(); i++) { - for (U32 i = 0; i < importingAssets.size(); i++) + AssetImportObject* item = itemList[i]; + if (!item->canImport()) + continue; + + Torque::Path assetPath; + if (item->assetType == String("ImageAsset")) { - if (importingAssets[i]->skip) - continue; + assetPath = importImageAsset(item); + } + else if (item->assetType == String("ShapeAsset")) + { + assetPath = importShapeAsset(item); + } + else if (item->assetType == String("SoundAsset")) + { + assetPath = importSoundAsset(item); + } + else if (item->assetType == String("MaterialAsset")) + { + assetPath = importMaterialAsset(item); + } + else + { + finalImportedAssetPath = String::EmptyString; - Torque::Path assetPath; - if (importingAssets[i]->assetType == String("ImageAsset")) + String processCommand = "import"; + processCommand += item->assetType; + if (isMethod(processCommand.c_str())) { - assetPath = importImageAsset(importingAssets[i]); - } - else if (importingAssets[i]->assetType == String("ShapeAsset")) - { - assetPath = importShapeAsset(importingAssets[i]); - } - else if (importingAssets[i]->assetType == String("SoundAsset")) - { - assetPath = importSoundAsset(importingAssets[i]); - } - else if (importingAssets[i]->assetType == String("MaterialAsset")) - { - assetPath = importMaterialAsset(importingAssets[i]); - } - else - { - finalImportedAssetPath = String::EmptyString; + Con::executef(this, processCommand.c_str(), item); - String processCommand = "import"; - processCommand += importingAssets[i]->assetType; - if (isMethod(processCommand.c_str())) + assetPath = finalImportedAssetPath; + } + } + /*else if (importingAssets[i]->assetType == String("ShapeAnimationAsset")) + assetPath = ShapeAnimationAsset::importAsset(importingAssets[i]);*/ + + if (assetPath.isEmpty() && item->assetType != String("MaterialAsset")) + { + dSprintf(importLogBuffer, sizeof(importLogBuffer), "AssetImporter::importAssets - Import attempt of %s failed, so skipping asset.", item->assetName.c_str()); + activityLog.push_back(importLogBuffer); + + continue; + } + else + { + //If we got a valid filepath back from the import action, then we know we're good to go and we can go ahead and register the asset! + if (!isReimport) + { + bool registerSuccess = AssetDatabase.addDeclaredAsset(moduleDef, assetPath.getFullPath().c_str()); + + if (!registerSuccess) { - Con::executef(this, processCommand.c_str(), importingAssets[i]); - - assetPath = finalImportedAssetPath; - } - } - /*else if (importingAssets[i]->assetType == String("ShapeAnimationAsset")) - assetPath = ShapeAnimationAsset::importAsset(importingAssets[i]);*/ - - if (assetPath.isEmpty() && importingAssets[i]->assetType != String("MaterialAsset")) - { - dSprintf(importLogBuffer, sizeof(importLogBuffer), "AssetImporter::importAssets - Import attempt of %s failed, so skipping asset.", importingAssets[i]->assetName.c_str()); - activityLog.push_back(importLogBuffer); - - continue; - } - else - { - //If we got a valid filepath back from the import action, then we know we're good to go and we can go ahead and register the asset! - if (!isReimport) - { - bool registerSuccess = AssetDatabase.addDeclaredAsset(moduleDef, assetPath.getFullPath().c_str()); - - if (!registerSuccess) - { - dSprintf(importLogBuffer, sizeof(importLogBuffer), "AssetImporter::importAssets - Failed to successfully register new asset at path %s to moduleId %s", assetPath.getFullPath().c_str(), targetModuleId.c_str()); - activityLog.push_back(importLogBuffer); - } + dSprintf(importLogBuffer, sizeof(importLogBuffer), "AssetImporter::importAssets - Failed to successfully register new asset at path %s to moduleId %s", assetPath.getFullPath().c_str(), targetModuleId.c_str()); + activityLog.push_back(importLogBuffer); } else { - String assetId = importingAssets[i]->moduleName + ":" + importingAssets[i]->assetName; - bool refreshSuccess = AssetDatabase.refreshAsset(assetId.c_str()); - - if (!refreshSuccess) + //Any special-case post-reg stuff here + if (item->assetType == String("ShapeAsset")) { - dSprintf(importLogBuffer, sizeof(importLogBuffer), "AssetImporter::importAssets - Failed to refresh reimporting asset %s.", importingAssets[i]->assetName.c_str()); - activityLog.push_back(importLogBuffer); + String assetIdStr = item->moduleName + ":" + item->assetName; + StringTableEntry assetId = StringTable->insert(assetIdStr.c_str()); + + //forcefully update it's shape constructor + TSShapeConstructor* tss = TSShapeConstructor::findShapeConstructorByAssetId(assetId); + + if(tss) + tss->setShapeAssetId(assetId); } } } - - //recurse if needed - importAssets(importingAssets[i]); - } - } - else - { - //this is the child recursing section - for (U32 i = 0; i < assetItem->childAssetItems.size(); i++) - { - AssetImportObject* childItem = assetItem->childAssetItems[i]; - - if (childItem->skip) - continue; - - Torque::Path assetPath; - if (childItem->assetType == String("ImageAsset")) - { - assetPath = importImageAsset(childItem); - } - else if (childItem->assetType == String("ShapeAsset")) - { - assetPath = importShapeAsset(childItem); - } - else if (childItem->assetType == String("SoundAsset")) - { - assetPath = importSoundAsset(childItem); - } - else if (childItem->assetType == String("MaterialAsset")) - { - assetPath = importMaterialAsset(childItem); - } - /*else if (childItem->assetType == String("ShapeAnimationAsset")) - assetPath = ShapeAnimationAsset::importAsset(childItem);*/ - else - { - finalImportedAssetPath = String::EmptyString; - - String processCommand = "import"; - processCommand += childItem->assetType; - if (isMethod(processCommand.c_str())) - { - ConsoleValueRef importReturnVal = Con::executef(this, processCommand.c_str(), childItem); - assetPath = Torque::Path(importReturnVal.getStringValue()); - } - } - - if (assetPath.isEmpty() && childItem->assetType != String("MaterialAsset")) - { - dSprintf(importLogBuffer, sizeof(importLogBuffer), "AssetImporter::importAssets - Import attempt of %s failed, so skipping asset.", childItem->assetName.c_str()); - activityLog.push_back(importLogBuffer); - - continue; - } else { - //If we got a valid filepath back from the import action, then we know we're good to go and we can go ahead and register the asset! - if (!isReimport) - { - bool registerSuccess = AssetDatabase.addDeclaredAsset(moduleDef, assetPath.getFullPath().c_str()); + String assetId = item->moduleName + ":" + item->assetName; + bool refreshSuccess = AssetDatabase.refreshAsset(assetId.c_str()); - if (!registerSuccess) - { - dSprintf(importLogBuffer, sizeof(importLogBuffer), "AssetImporter::importAssets - Failed to successfully register new asset at path %s to moduleId %s", assetPath.getFullPath().c_str(), targetModuleId.c_str()); - activityLog.push_back(importLogBuffer); - } - } - else + if (!refreshSuccess) { - String assetId = childItem->moduleName + ":" + childItem->assetName; - bool refreshSuccess = AssetDatabase.refreshAsset(assetId.c_str()); - - if (!refreshSuccess) - { - dSprintf(importLogBuffer, sizeof(importLogBuffer), "AssetImporter::importAssets - Failed to refresh reimporting asset %s.", childItem->assetName.c_str()); - activityLog.push_back(importLogBuffer); - } + dSprintf(importLogBuffer, sizeof(importLogBuffer), "AssetImporter::importAssets - Failed to refresh reimporting asset %s.", item->assetName.c_str()); + activityLog.push_back(importLogBuffer); } } - - //recurse if needed - importAssets(childItem); } + + //Mark us as successfully imported + item->importStatus = AssetImportObject::Imported; + + //recurse if needed + importAssets(item); } } @@ -2796,7 +2629,7 @@ Torque::Path AssetImporter::importMaterialAsset(AssetImportObject* assetItem) { AssetImportObject* childItem = assetItem->childAssetItems[i]; - if (childItem->skip || !childItem->processed || childItem->assetType.compare("ImageAsset") != 0) + if ((!childItem->canImport() && childItem->importStatus != AssetImportObject::UseForDependencies) || childItem->assetType.compare("ImageAsset") != 0) continue; char dependencyFieldName[64]; @@ -2833,7 +2666,7 @@ Torque::Path AssetImporter::importMaterialAsset(AssetImportObject* assetItem) { AssetImportObject* childItem = assetItem->childAssetItems[i]; - if (childItem->skip || childItem->assetType.compare("ImageAsset") != 0) + if (childItem->canImport() || childItem->assetType.compare("ImageAsset") != 0) continue; if (childItem->imageSuffixType.compare("ORMConfig") == 0) @@ -2890,7 +2723,7 @@ Torque::Path AssetImporter::importMaterialAsset(AssetImportObject* assetItem) { AssetImportObject* childItem = assetItem->childAssetItems[i]; - if (childItem->skip || !childItem->processed || childItem->assetType.compare("ImageAsset") != 0) + if (childItem->canImport() || childItem->assetType.compare("ImageAsset") != 0) continue; String path = childItem->filePath.getFullFileName(); @@ -2967,7 +2800,7 @@ Torque::Path AssetImporter::importMaterialAsset(AssetImportObject* assetItem) { AssetImportObject* childItem = assetItem->childAssetItems[i]; - if (childItem->skip || !childItem->processed || childItem->assetType.compare("ImageAsset") != 0) + if ((!childItem->canImport() && childItem->importStatus != AssetImportObject::UseForDependencies) || childItem->assetType.compare("ImageAsset") != 0) continue; String mapFieldName = ""; @@ -3090,7 +2923,7 @@ Torque::Path AssetImporter::importShapeAsset(AssetImportObject* assetItem) { AssetImportObject* childItem = assetItem->childAssetItems[i]; - if (childItem->skip || !childItem->processed) + if (!childItem->canImport() && childItem->importStatus != AssetImportObject::UseForDependencies) continue; if (childItem->assetType.compare("MaterialAsset") == 0) @@ -3195,7 +3028,8 @@ Torque::Path AssetImporter::importShapeAsset(AssetImportObject* assetItem) TSShapeConstructor* constructor = TSShapeConstructor::findShapeConstructorByFilename(Torque::Path(qualifiedToFile).getFullPath()); if (constructor == nullptr) { - constructor = new TSShapeConstructor(StringTable->insert(qualifiedToFile)); + String fullAssetName = assetItem->moduleName + ":" + assetItem->assetName; + constructor = new TSShapeConstructor(StringTable->insert(fullAssetName.c_str())); String constructorName = assetItem->filePath.getFileName() + assetItem->filePath.getExtension().substr(0, 3); constructorName.replace(" ", "_"); diff --git a/Engine/source/T3D/assets/assetImporter.h b/Engine/source/T3D/assets/assetImporter.h index af4fac28b..0c176840a 100644 --- a/Engine/source/T3D/assets/assetImporter.h +++ b/Engine/source/T3D/assets/assetImporter.h @@ -492,15 +492,20 @@ public: /// bool dirty; + enum + { + NotProcessed=0, + Processed, + Skipped, + UseForDependencies, + Error, + Imported + }; + /// /// Is this asset item marked to be skipped. If it is, it's usually due to being marked as deleted /// - bool skip; - - /// - /// Has the asset item been processed - /// - bool processed; + U32 importStatus; /// /// Is this specific asset item generated as part of the import process of another item @@ -564,6 +569,10 @@ public: { return o.getId() == this->getId(); } + + bool canImport() { + return (importStatus == AssetImportObject::Processed); + } }; /// diff --git a/Engine/source/T3D/tsStatic.cpp b/Engine/source/T3D/tsStatic.cpp index 2ed98a265..9b093f476 100644 --- a/Engine/source/T3D/tsStatic.cpp +++ b/Engine/source/T3D/tsStatic.cpp @@ -1015,7 +1015,7 @@ U32 TSStatic::packUpdate(NetConnection* con, U32 mask, BitStream* stream) con->packNetStringHandleU(stream, matNameStr); } - mChangingMaterials.clear(); + //mChangingMaterials.clear(); } return retMask; @@ -1670,53 +1670,49 @@ void TSStatic::onInspect(GuiInspector* inspector) { StringTableEntry materialname = StringTable->insert(mShapeAsset->getShape()->materialList->getMaterialName(i).c_str()); - //Iterate through our assetList to find the compliant entry in our matList - for (U32 m = 0; m < mShapeAsset->getMaterialCount(); m++) + AssetPtr matAsset; + if(MaterialAsset::getAssetByMaterialName(materialname, &matAsset) == MaterialAsset::Ok) { - AssetPtr matAsset = mShapeAsset->getMaterialAsset(m); + dSprintf(matFieldName, 128, "MaterialSlot%d", i); - if (matAsset->getMaterialDefinitionName() == materialname) + //addComponentField(matFieldName, "A material used in the shape file", "Material", matAsset->getAssetId(), ""); + //Con::executef(this, "onConstructComponentField", mTargetComponent, field->mFieldName); + Con::printf("Added material field for MaterialSlot %d", i); + + GuiInspectorField* fieldGui = materialGroup->constructField(TypeMaterialAssetPtr); + fieldGui->init(inspector, materialGroup); + + fieldGui->setSpecialEditField(true); + fieldGui->setTargetObject(this); + + StringTableEntry fldnm = StringTable->insert(matFieldName); + + fieldGui->setSpecialEditVariableName(fldnm); + + fieldGui->setInspectorField(NULL, fldnm); + fieldGui->setDocs(""); + + if (fieldGui->registerObject()) { - dSprintf(matFieldName, 128, "MaterialSlot%d", i); + StringTableEntry fieldValue = matAsset->getAssetId(); - //addComponentField(matFieldName, "A material used in the shape file", "Material", matAsset->getAssetId(), ""); - //Con::executef(this, "onConstructComponentField", mTargetComponent, field->mFieldName); - Con::printf("Added material field for MaterialSlot %d", i); - - GuiInspectorField* fieldGui = materialGroup->constructField(TypeMaterialAssetPtr); - fieldGui->init(inspector, materialGroup); - - fieldGui->setSpecialEditField(true); - fieldGui->setTargetObject(this); - - StringTableEntry fldnm = StringTable->insert(matFieldName); - - fieldGui->setSpecialEditVariableName(fldnm); - - fieldGui->setInspectorField(NULL, fldnm); - fieldGui->setDocs(""); - - if (fieldGui->registerObject()) + //Check if we'd already actually changed it, and display the modified value + for (U32 c = 0; c < mChangingMaterials.size(); c++) { - fieldGui->setValue(materialname); - - stack->addObject(fieldGui); - } - else - { - SAFE_DELETE(fieldGui); + if (mChangingMaterials[c].slot == i) + { + fieldValue = StringTable->insert(mChangingMaterials[i].assetId.c_str()); + break; + } } - /*if (materialGroup->isMethod("onConstructField")) - { - //ensure our stack variable is bound if we need it - //Con::evaluatef("%d.stack = %d;", materialGroup->getId(), materialGroup->at(0)->getId()); + fieldGui->setValue(fieldValue); - Con::executef(materialGroup, "onConstructField", matFieldName, - matFieldName, "material", matFieldName, - materialname, "", "", this); - }*/ - break; + stack->addObject(fieldGui); + } + else + { + SAFE_DELETE(fieldGui); } } } diff --git a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp index 0e494602a..9350f39e0 100644 --- a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp +++ b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp @@ -236,7 +236,7 @@ void GuiConvexEditorCtrl::setVisible( bool val ) bool isPortal = (scene->at(c)->getClassName() == StringTable->insert("Portal")); bool isOccluder = (scene->at(c)->getClassName() == StringTable->insert("OcclusionVolume")); - if (isZone || isPortal || isOccluder) + if (isTrigger || isZone || isPortal || isOccluder) { SceneObject* sceneObj = static_cast(scene->at(c)); if (!sceneObj) @@ -247,15 +247,18 @@ void GuiConvexEditorCtrl::setVisible( bool val ) ConvexShape* proxyShape = createConvexShapeFrom(sceneObj); + if (proxyShape == NULL) + continue; + //Set the texture to a representatory one so we know what's what if (isTrigger) - proxyShape->mMaterialName = "ToolsModule:TriggerProxyMaterial"; + proxyShape->_setMaterial(StringTable->insert("ToolsModule:TriggerProxyMaterial")); else if (isPortal) - proxyShape->mMaterialName = "ToolsModule:PortalProxyMaterial"; + proxyShape->_setMaterial(StringTable->insert("ToolsModule:PortalProxyMaterial")); else if (isZone) - proxyShape->mMaterialName = "ToolsModule:ZoneProxyMaterial"; + proxyShape->_setMaterial(StringTable->insert("ToolsModule:ZoneProxyMaterial")); else if (isOccluder) - proxyShape->mMaterialName = "ToolsModule:OccluderProxyMaterial"; + proxyShape->_setMaterial(StringTable->insert("ToolsModule:OccluderProxyMaterial")); proxyShape->_updateMaterial(); @@ -707,8 +710,6 @@ void GuiConvexEditorCtrl::on3DMouseDragged(const Gui3DMouseEvent & event) float zRot = mRadToDeg(newSufRot.z - curSufRot.z); - float curZRot = mConvexSEL->mSurfaceUVs[mFaceSEL].zRot; - mConvexSEL->mSurfaceUVs[mFaceSEL].zRot += zRot; } @@ -2005,8 +2006,6 @@ void GuiConvexEditorCtrl::setSelectedFaceMaterial(const char* materialName) //run through and find out if there are any other faces still using the old mat texture if (oldmatID != 0) { - S32 curMatCount = mConvexSEL->mSurfaceTextures.size(); - bool used = false; for (U32 i = 0; i < mConvexSEL->mSurfaceUVs.size(); i++) { diff --git a/Engine/source/scene/sceneObject.cpp b/Engine/source/scene/sceneObject.cpp index f60321097..233030331 100644 --- a/Engine/source/scene/sceneObject.cpp +++ b/Engine/source/scene/sceneObject.cpp @@ -631,12 +631,13 @@ void SceneObject::setHidden( bool hidden ) void SceneObject::initPersistFields() { - addGroup("GameObject"); + //Disabled temporarily + /*addGroup("GameObject"); addField("GameObject", TypeGameObjectAssetPtr, Offset(mGameObjectAsset, SceneObject), "The asset Id used for the game object this entity is based on."); addField("dirtyGameObject", TypeBool, Offset(mDirtyGameObject, SceneObject), "If this entity is a GameObject, it flags if this instance delinates from the template.", AbstractClassRep::FieldFlags::FIELD_HideInInspectors); - endGroup("GameObject"); + endGroup("GameObject");*/ addGroup( "Transform" ); diff --git a/Engine/source/ts/tsShapeConstruct.cpp b/Engine/source/ts/tsShapeConstruct.cpp index 4fcc54ba2..08dbc21c2 100644 --- a/Engine/source/ts/tsShapeConstruct.cpp +++ b/Engine/source/ts/tsShapeConstruct.cpp @@ -556,6 +556,24 @@ void TSShapeConstructor::_onUnload() mShape = NULL; } +//----------------------------------------------------------------------------- +void TSShapeConstructor::setShapeAssetId(StringTableEntry assetId) +{ + mShapeAssetId = assetId; + mShapeAsset = mShapeAssetId; + if (mShapeAsset.notNull()) + { + Resource shape = mShapeAsset->getShapeResource(); + + if (shape) + _onLoad(shape); + } + + if (mShape && mShape->needsReinit()) + { + mShape->init(); + } +} //----------------------------------------------------------------------------- // Storage diff --git a/Engine/source/ts/tsShapeConstruct.h b/Engine/source/ts/tsShapeConstruct.h index caaf6ceff..465861599 100644 --- a/Engine/source/ts/tsShapeConstruct.h +++ b/Engine/source/ts/tsShapeConstruct.h @@ -222,6 +222,8 @@ public: void notifyShapeChanged(); + void setShapeAssetId(StringTableEntry assetId); + /// @name Shape paths for MeshFit ///@{ static const String& getCapsuleShapePath() { return smCapsuleShapePath; } diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/animationIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/animationIcon.png index 381dcee849583825fed664f50d9314fda2d8eb3d..d8f3e35b9fba11279a49bd465d3b367e2d62933a 100644 GIT binary patch literal 12242 zcmeHtWl&v9*XG6{xH}vO?iSqL-Cc6f;O-D0xCIaH2~M!!?j$%QxCJM;+jnyBow+qt z?>Fy#YpSMds^-V8K6~}ktDj!I`{}iJpGZ|@8PpdEiZn1!0ux&Ie0zNG6rH;u@6lXuEK`}2D|i->gumP= za(+wd7Z4Em*f-uP(stb8kKxUDnze%N^XT{0EBB@NLtE$S4x4wUpJ#ztF8W+N`Pg`* z`Lp4gon$U@@riL)?s(+(jwF3RRn}_f{LYB`#nmH@@ap;X`7QRls!ykkrFeFq^1%T+ zy9VVU^Fnt^5sQ9TO+=2BFD+eH`!CP zByq{?u*UH!ZwjA#b61Jm?*ndf>z}iJos_!;`d$t<-j9gK=Auuj=#{PJ1l|VFnb6+R zSE~H#XmvSSt$OIa=LvgyOkUQxyLeuiK5p>z;M6HG6iK@KFmfKXnObn^SAJ&Q!5>v~ zE*{@qIE|N?OxF3hQQM1{sJW8Ri^REPI)09pNwIBRdrGqD@mj~x<30OEfO_U7A`iEE zfO;vwO`Yh)6F{us#UhY1YER>xB@!%QvG!VXTqN*Ir_Y+d4<+nsXMdEllon~>N$|x% zWbcsdm)yKm+Afp$+`!~{N%&Fh?QgK9CclLG8P-kuQ*tC}(U=4~+i@0dvw|?3_j*jl zDPcO^X^Mj-nFsKogAb{!IWE#&3}1tivCu_7z6*|>!}YHC+q9)fs^$#w8Cc>%2eGOXIvO78|PZ=3cu#~{3@Pb@i{IW z$CQC~AI&3|A-5PCmZG)F@$+@*%3`dlKVvAbYP=(I_^Nb!*fv_#dekwPL!0BayQ!ff z@EF6%Oi=v#N0gS`oc;H<Lf(sM%uVU=08WG-c4MzjkxpU&21ac_bt7Q8~V zBJDV6!X@BTFKyEpWEP;R0+3Uk8P0wsyKL}U+DRErUCNp`y=xwTJC@KJr86&DRlK;R zPc>Uwk{yq!2k9goC5I0nvlYdThb3$=hZO zg;Q_pes+27F5Do_kS(FPqA8qn)DuB}E?-#gN+@YoQ)jdvPo5$b%0`QvZ%`mi3qe1U zKS3N2Vlk4rOO#d>ycT zizPAt7sYi=sa&QlkK+rA75@Av7j%uzREbO(8IlRLah~2<=_?lRH&uqMr3q2UvMR)V zrNnA1gNWjkWcYw^;dl51IisQJruKXGpGB{Y%J7w85uiGxPZm%^HYC{gCU7_5)Q+R1 z!G@E82j1Y;{2wPT&R;yL5`-pK7;!~|Zt8ijKf$3{W8NI%*enc=Z&%W6rhn0YX@Yk) zY(K~`Pqtd690S6pbG?A(zAQ{XFIABtUs7{ZrXPxP)Gpp9hRQLgvgon#4dr$b2tU#W$F7=i?Om!E2u~RRJY_)RS-Pne={f`>8ELMVFyo;n$Y}%!;NM z53*I<+R;vve$@KnC^@fN{$?3t#Kj3Jd0e-@Cls?nY z51-AQT}@hmkuQpd!XK3#VZL-1@dPn9(Z!}8Y~Lk*89>qvIgK^J4GM%|E+Pm9sR{y> z6eni@>%Dk8v#BWx!dbuz8DlcZbj=jF1_#g}S>9#5MaY3HM9iEi~O| zwi2*s_zF_wyH?r3-j{FrnGf7_EXibHKLn=HQg3ECsALI;Km5XkOCR7ljP{|C_J@)v zVl-KJTYFX4BGXao6#11xUz&pSTZ*U9kVSGW4m5YX9s`rWCTv!<1%VSjNdLo@4XN8H zskgg=Y`AZ_b+i=bmoM#Xw`rTg1CNjy648h?a; z3<^&&8y47W&=N9^W0Z~pL5JB@@zo@^Z?F(PrAlP`{R;4opt&G(L8$Kr=uL?lnamU*BGmMRU}0ntx6Lq_HVhqkSPT8L5lWo)nqwwF)JNJ~dHV z6E>RYF=$@5aj`b}rKY5;2OQTY`s?F{-8BUtT|iJpa|k3s{~ zp)<|Dd1bGS8yJu-KxLb(-hewQPb(8nFJJBrVk7ITp_5=tkn-#Q`DwpLv!Y5(tg71` z6D>gtA*-WWbDlxifxBz})9qEo*>NmIt0IC}Ep90M!DFMkZ<$qP+A;};;DgrDb+pyi zb4pDm+Y!8?v++Ag;fH{jQB$J6vpBcKGFh3|smt&YQH3eKWGP+k_8RT_Th$)nH}b;O zSi9XKpVjaTUD@6@v?@85O#4actMjNjKhJ|Z1c;r*0CnD!wsb10Z{V;soiUtwr`l^2 zMBfCOJdR4a8D@KSK}pU#R+wbPWTA=oE!*qGjNxx%F_9HGZGuTA;45Fp!R+EN#1Z2Y zr!k-e0~i$QL$fbp;N-LkreE}X)5Bb7VY=(^qAsHF+joj7@FEP?YH8ts7OFMgHGqeJ zJl$CB{9LdR2BwU{&l_u%d$k5G5f4AWO6bBL^9SCZ2mG|k+iwrhJfe@Yd&KcYWxT;H zt>=&wqjIGCcxf6|S`8iij*m#$VG#JT_BLwyTN+GZyMA^h^ta*RPo(?bzt&(hdiioe zAzB~}^jPI9-dB;vV&!d%abBSnQ{!SSz!JLe$p(|vcv2=aw+2e8(Kh(u)vbNjr$Qp0 zx;%A@F)exg5|?&nka+-l{h%1nPO2+_0mZ0)>RPHi1fmujSRl6dk94+5{*EDqtf0D} zSei66S3+c#&-Wo!eDC=)X#pC&bZf$FK^vP86IT_CE=AcBU_t|5Jj^Mhlpb~6HKcGy zNR^^*=Oz}h-8v34D`^(uOy?trQ6|?xC#{NQAhrJ5F_Bg7K4~1yPW+ zREf;V_#t#?=DiZL4<5q{PJS_r8n?kmCW4uvbf;p>Pb%Z{8`^(I9 zyrvi&^Bb5n(D-8nABs`-X3INU(EZ+NBI1#J_{@Pr)SJ7m(Pe?rlj?D)$;N?+v-94y zu=_+>lUOeW^>RV9nAtgS11X%n4f(s6N;wt3Xl6Ymrp7|=7)|Z zrBXnrSPnNB@A_D_&8cl_1#dMY+;1a?wt|AUKk>gVW(4_V@SmLOtlbg7HXQ@sD0KX> zjJc20oGAG}jG&~zkF7Bdm@7YChERt(vqO8k3 ze1DKnJ}j@&iCW%Z+LG*TbO&{g`jOmX{VW~`xkd?B;q}93V!&ZxahCMc7-FWK-kCLw zG4d+|VsZSJ&oQX0@I$MuCvI7@j`m31(`1SzC&S8~PKIMHGBS91tg4UPY{C?>szomc z<4Pn&sGKMU``Wri$FgN^ueQXb`;-ddqF)!bzyMRZ$@Rs zI<({jB;}(AG|=;0Bonk2<*BC6ih6bfPq`*R;j+>RehxKom4c|2YfLI4q!aOpDSXzt zWj(DNfQs^T{VrU->H=&w6R8(jy;`V>KMve-oO51AGiVzdNx9u7%o=AO(c3)U^#TS} zaMl4e5%x2*JT6XXk|0Z?T!O9oO$Xfyr%z&I-Aw&eE-8q84YWZYD~@gWz2L;1UBJRh zSBu`1MOy6Rjtv~FkZ`$NU_l?RivUHwcIq0V$v}xFeM3EUD`dUB#rI!kvo^&sfI1m1 zBV@)CYF~vfv+st9BV!~YlLxD#C&Sl-enpFq>KGDKzFn8_1Zt!Uajekn9ce z5^XZSCc2oyW12&ISKQ(LQmQjUQJp5$!M(^&+uL|qGdR0BoMDtp@?8!;7oNbHcM63* zy?d~o712aUmTb%viR_D+2sketCrkH_x@F7N3yQ6ZDhxy#-*o}B@|q>t_? z?pvr)zEV0j1&<`GzQ$^VgpWv96c?3|e46hq;?b*(Lr_jqeU9uv!#1qU%T7~6SNx9P zJ~|wmwTaET-S^}&AuAf8RSrQtB?c6>Rzvv%FJ7coWkTEjpu1hKxnH35nWL=wdH(is zvcSlnLWhE-^|ha39ld~tgRMLUpKkmJOrTSOE82psrBXHj!tjQr%hmQMe?HNu-0})z`OJ9tAM? zMR#q)DR#h8^&JW}2rxCOGkF9x1{0h@9`ut|7Wf9gI8)KFCVI$s^3K>mQU_%3OigOc zDOi=tls9hk>u05D_esN2*@lvovwiC`*;m@hD6X_ut#qBIoH$jOj4 zi=xx`j0BO^ff?qV1` zxh6|t#CK(XI8f`jjfMCi>h{qbaoDXN7$eUb3^lfg%t8^ZbYBGFM^yXEOD1bAZ}iZ= zfC7(P=qksybZ2Zl(m?^qs*OPPX}H5B3BIMw1o=KPsDDmfG@WIgH!-Yt%VM%exIa9= z)a?{F`GotxUEjX}9T8>(`wT-Ejn#SmHm)xxdXyx{lUG70#2q%-m>+h1A-^=dk)bHV z-SKO3OADR2+mH0AHxpFV4|VmC-*P$TFBG@V^7B0G_J-W1te3oS(;do34aFV}zK zAK_N8?y-Rp?wMxU2*m`CoP`>0=<&~@is(X#ii*Z!OWeJh;Ry|)JSHASL!+wJdY#v5 zmnHzM0h5ScaSgX1E|;~HckfB*+eHdRIGAxIKSdD&NQ}(j*>n>@nZuRq-Y^)w(HGfO zFMt_ke|7P;s8qMMEG=kV3N%s$=JZN`4?6kCJ?1{EWSYkkz%&>9ZeW~=Diq3#cZ~?$ zxM4Vb(=Rc}0ZFHwTAC4guAy+UzQ#GB(q?Z(TeOJ$w1hj8u|XhYD|gI)Iv}u+y|uAl zFriAoGZEYTphRd~4tZ)Lg$VY?S|f6~$vU=rb8#Ux=@60)Ib85LZxwQGaO8PLS#sDF zF$cVDcfFSld}{_R1r|u`6f9~@nTq-iM7x>4VI5EdSMskbmj9c|pJ~4YW06UPy0yXwBK@yGl<(#-f zgaxx%oz11J9zlc%!kRoevw#{2Dh_j2uZt#`tzd~YY7VjG8G<*`XL~tX%Rcz@?qwU41M_t~iOZi_S(dpM zTO1gv7rFxQv8GQ?n`@zrGxL;+j)~feaYd^QsI^PUyJy{0(`#f;u(YDkJ2DSfG#eb0 z(aB-B-V9I~)Z4;GfxI z(XQSXgFM_2D%!Wwm`dI-h*e%hd#QEwrM+NWbTj< z`mmY8HjC9gtwC1Boe}=KZZ)wgUHs#clbnyN-Snf-mb;Hcg|*sS=@5hiy`#hM_YF|M zS;Zh?RYpUzaDP2-C74lsh$@iD($`tx3Gg-J|X$kS5f~Ys9xli7>m48_wlW^ z8h25HLfaC%)t!Lbd8x3j+izLSo2D1n^(JUEDOWimo`23f?pKzNL~N(#M=>7pb|iP2 z8Gsxt`U&L9sTk5Ho#C+ji?Tqssg;^ACDlr;u8wcOc3B3S!Xsk-fY(*p<^&`|n z@vbbWHq|RA#MG6@Z%>>1fp9n29vpQ8zH7D#uMy_YFZvkUNnpx=da`y;E_jMyl1$-( z*e>$<*jnW%#osc==d5i1qftS+)47&5-%{3y>j7)~yASy|vRQjH+g7dg&qS`26& z7|uhg*-R1S{c2^pu*k)g6J;U8#U>L)6mrhaIEKh*0ZiJYhFR|JPPnk$=omaav{Lx= zr-5?$QZWdFk6xa~&ev!s+zg8BEi{1Ct4mEmn%A!7;%m6=yYI+3BcjG8u=e^<3q!ridhsHymveEgN4$#rF;LesXwUFE6A)YwSQHG3OzLsuMH z4lzMhf)F=7VxsK5IY{cB9sjxJNaei(r4C^X3GzqrVC(zt=QYnJX*1g?xfcV#b2QjL z20GX%Pp_%s*kaT+2k5X`lefPwM>V}ly6`bTCWnGq?CN(nNV*CdB{kiZ!*-uc_2X&} zgFXq6UQLF9cMR@$RoXNstV|w+;@;o~LqY;=AvI#`>Fudv<@lUqb9oIjT;wtWMRqp` zIWL1ZSCEl}lmIaF=Hc`aQX)CY>bU{{GWPEa3iyyk05KxC$tg)8{6vC>fAzBDaY`Oy zB6O3|b(3(kw+B180TM1?GdJ*Skf)8CHAqHINmVBp4Icn-Fy$o0G$99W%La}lp37aQ ztA|zBYZ7s(jMSJ?niClGdB$2BQYSQC#zW`Y3=ToWee3UtLpAeh#Kmn3#fg=vH|So- zSqz?5d3xp`Cl#rD;BEA@ycRis_M>vh`+l(c?U$d`-FZvI7cF=oAteqI2!arU1ppAF zfC2zS01$=zf*cQG0ROJ)KZO6?$v^V`H~eo-|H}67c|uzK?cyK7{|*KQApH-c@vpf3 zE89OJ@PEJ;2!hPtf75Xn!$nLG&G#Sl8w(AT#)0j`I@MR^cICuiLbX)P#{kSiHQKvJ zO3JvW*6{<6Xu44j4^OMp`A)KdcHiln>0C?aYX_T}Z4_ug-Q!3fbH2K||7&LN&D}hY zxvwt_;W7uT2L}kJb-B&rudFbDgqUi-;t1BjW@3~31yGgAY78;Yx50sdg=y?5&i=>_ zV>KM-y(u>7LSr1MzV2>8O3H!F!P97yv9TXnVu0w26|X{K$M#ndJgbKB+1cyUNmEHl zV|uaD?OsO>YKEP{@eK`>aUGf+w6w19P=MU+RGN?T`L?v*WqGFauOj3`OZ z;qE7eH4MgEv1dvh9$pl#9up`lxyIEHL;wI5JJIFFNQ&B+B{)WUnEs7T{y{ z_%p0-?c_)NG}i0QkrXq-*17o6wAOcTAzr(kzDFM&i5(uIY%K9Pe*Nu0Krn0YHAnQG z8(EzmA=rjyW*iOZdO=Duwz1wTx72z~C;a5a3b{mtZ?`5)A)0RgDr0Q3Zk*<{sq<(M zfm|>q_vu3H;Urx7i77k~4yY+edVah|cy2#ijTP`D^IzZUYyc~NfdM9nHcy$z1k?N4 zeeX{XOhh8CR~Dm99`~blo?2Ti!vMfKthd)&(96kf@fkhvd-U&W&lN&q$fC+S(s|1D z`;1Q>;039?Wqht=)_M9(K3y@#=r-_X-QnS85Pd^N#APvewiXsKCGwEz^2}q zWx#3MucYU5>)dNj!XdNRN}1g!@^s3} z&F#ZZ;$gvy18CL#RY5vP{``fw^Y*K;VLN{eB#2oet2|jmRS=&PKoC{cLwuDi`QZKW z@xXQGGh4^wk)GdqCO%4ODxbm4OQTePq7WjQQuXn|3$cq$to~prr z+U2Wd;|(MkqawtiW`wPf0}%mJdgYb~?NmMN^8K7rdLB88xdsidiLyh+_}S$~Cq z)=1KV&(-5+JOJ2QVSfFs@+CS&c$0rfTMy+2zFr$W=uo_@WTt`)PRQ&L)<*oHew=?n ze57puY(?`MpxKQD;yNsP4Ka0-0z(l}T)$;Fyl8Ez1mXhzJaYLICf;pJ5Rr{~?Kr57eT%-Ezaf9SHyln1A(Y@vlZF z5yb>0{*{*cH|7^0D*by9kUnGnB5s_hFZqY6BmD*_nIT~?2-538Oil;@hxwllE&pnB z5jFD{bzKO+nnNMTY2Y7@t`YLA((?W@$3wx?qVKhF`lnRn`B?s(6Qu0qxTiX%=HIu! zw?#iP_RN$&cD26@Zu$eSIpTj*#5go{D9kM3|1rB%V8NWhLYZl=i(NKu?zsZUe%q;K z4;d4MPAVWb_w+O=x4GWiOAv3>@IM0|>3w2~_x!NK%VNkIG5L}B;9!=t>d%Rz+Miaj zaz0)Wd*kps!@?&fwu3Ak{HK=R)ffQP;do$9zqK1iot~hP^5P2Fz?`;-PkY^RX^x_$ z^K-}VfVW^ipLY(3Mm;@UbNpJ$km_T4*X!-p3U+IS`h|w=xWNK4}Sio^e?HevVA{aymI4ZpTY&>s&F~jWLtt2oVs@zj!%6TgvngWsQyRl;5|9K{%hGLX7C;|D5}P$ zYjcZ2*Ns)ZKo@hO_|fmn+5Le}oUyCV0X_xCcHg#9?6oA97-Aux95!45S^ecs@?Y2E zUkR5WuMEGh|0X^C-(;?TXXK)g^!7h^f%sqHAF8cjpH1{S{12avahgz(Ag?^CV5jIe zO8n1AQliytt6wS!{bR4L6dy5sQi19W+skQB`+wSKc394#RXns`FbsD8Q-6 zxf9;YP^cwV9y^;xanbDouiw6tVQ!<`Z@d!tc!+vJh43vYa9hhn1y=ML<7bAmrw=S=uXNn~s`hou@9uMcLho`Z_`7$KSL{Es&R&Z`CF~l7 z(ms!IpxvcC)|LBclv%(>kM(G|yXLIUkUcY4CN3Pb(~s|P>`Y$F%a+5K&eC?2p#?Dr zV|l00t}#^Um#52Uh=algn+`1mX9qinYPAQm6AeQ=6EkKm4NQ~*Vi1CZxmsbAxsH5MN{#SrH!2N1 zF=0P>7d>;*)WSF|HJ(Sqr;ZSB=rxKRJUxv*@oq_3I!z5aR>{ZuOYHs4zof2!3k zU6v)KHLjLYeO>2QIV0{iJ1#?P{4#qccWm<)Vufv&l=J=fL4%#@yte)O&iz{E1HSTo zcE~?iCTTOm7^`PVHp~4UO8sNK+DkpbZM)}c{RbU;)rm#WYZWjC9w=EC>{WNe)%W+g z+m4)DC%k1|t^x;{anf+SO^on#x)DBt{5fJq!I#=r|fAac9W2AI<`yl8gbVGQ~ zPg~Cqltl%X2(K%Hj>@QuBL+84eR^!q1w1K>l+E46x+-*=koB(a06T(^y=1CcPhK&zh{m&2le?#s~r0=k{iR=wkIDp#8}TR+%WE#M1b* z-hZ(FfK=ZPp^F%&+-p;DU8yO`V)X!_+BJN~M@DI;)s=nqXP1|UK z^8}QA6LwB?p5yKb(;m+|_gBSO4^YpvM6Sy%Q}2;rtFM!l%c6~OxNo7Ie!SO(7W_(X zr`j?*mS09)D@7(VJ1)TxNX=3Fu?A%~s`1~m!{VBtzSx5vVMI!D4tM1jGRqAj0q-Fy7wbFEh;WXY@KfK(nf;`wIZ z8ecpc%#Lf#JEu}M$+xe#c48+?AGA+Gsa|5wUC?%XEB^_8zQ1QM8B>Z8YkFnVb0E}U zVKaH{R2^$!iS1neW-&$4Aom3PWPD)rq&i&|xH>n-YJ7a;kD}yb2pu%ndF$m2#g!`p z5BqO~R+okx4h8u2p9%8cUzvg+4gd3<;CHM4hrT?406-MN_&?aO{vKTrq#?&?AWy3< Uj()O6D&!83lTwzf5;uMOUx(WyrT_o{ literal 8177 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 G;NJk(1STH< diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/clientScriptIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/clientScriptIcon.png index 3f83a2ff3189fae48971c2975fb3e26b2696da03..698c688527418a5c4f36fbf9de19bcf0626a32a7 100644 GIT binary patch literal 9016 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 M4_210k~9kbFPx{d>i_@% literal 14572 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 MK~ug`)-vS(0P0TN6#xJL diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/cppIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/cppIcon.png index 8b027957b0fbe3594c73d1abfc84390b48ee152a..3f7e4efd502bb2bd8416e9b1e2e19356c3f7d5b0 100644 GIT binary patch literal 6954 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 YfH@rOb*sbJ2IK}f+PT_NZ7%)sKae%rivR!s diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/datablockIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/datablockIcon.png index 5a691045347bfe7965935c2a368b9a42ecfd81e4..e1fa5917a48bb943d9f5160460040688a337f87c 100644 GIT binary patch delta 7317 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 delta 5506 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 Ef|Fx_KL7v# diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/folderIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/folderIcon.png index 2a528419e2839468f7ebc9a6cd1b125afc4d798a..bb425c1b245a6d0a2a5a3ee41165dafc1aa3a8b0 100644 GIT binary patch literal 7824 zcmbVwXH*kRuxJtpB1j1!O%S9bMHH3Z0~kR-y7b9q)Qc$-a7;d zMWi<=A&}(p{do7>-*?aMnc3N$vpci1vpW;1rJ+he#!LnP04QKDpxOWc@CF3}NJ(yh ziD$7L06+zJuWRV7ZRyMI?&)Ud=wi$6?eA{OZtLfGGw8Rtoc_iWB~9~j#Un}rL}m=^ z>tcQ^mbyM>VB=gP_$Kj8PCaIkX2B#%UMTHN&N6;gf z=P(;CAZv=q4%|4tNLfGd7psnSSr5qF>od()^Ze8PV8|_Z__*4=bNuG>E z_4oTB9~h%nWrgDpD?{N$DF##i*P{VxM<*iKbGUX!&68W!?v|=?=7?@wzC#C%)Y3bg zkcmSdcHOPD^255^1@EoE4LLcszV&FSw@R8*58bX$#f2{e2&QK5WjJn+X;N0H>YgNt z1zxO3lx2NCT<{sn`!Z;)t*O&|-sFxR^;_1*@O7jGw8_S5o-J$UHl*&j2Obr`&=p=1crZ4+^V8YAGyfh@|xM!svM_Q&RUhd5bxp26Uaw-YZq86=q+Yk8zG2bW0m3*``MI#7VfOvsZ!$hEK9z?o zjFvqKD)()-it}P+VcBVRS++an-$&YiMv;@cmkFBs)Xy}!Xgd~V`YyEWzWu@Gx!;qd zA^T^mq$m^5Qm?9uh+SOj$4NMyL>M)JZ0EMsrp3##Hi~yNYI|cMLb;$OLLe^h>eS1J z{NU(}-r+`S(-;YnL6@#KRuIl$N40*{Eb9xJW~%kgqXXY{`rpwR-^X#Z310Lq1_@U( zZx5laXXJ0!@3NOEejrm+8H^`?xBuyMd zrf>_~Df?MF0OfHmaxO`qo6e=do)nOx$Xnym80IQff99ZR%k{xH%Z7%t+Vb9^Z__ZC z@GIlTJ`R-umubyT^@3;Vd8?K&s2Tk z)!WxQ@vwXd2_k~e4epDsnM${WH89fO)!!+OMAR1My6{y64oZ_LAYopDFlaQ*z}%>2 zkZ3>hMBw{}2S)MZ_^(fa8~Tobn`O`17agg0Je6T6e@)7)3Vm;2bkTbXM z+3RIt6cZ%P^faXkKbixt#l&^}jD4&jP2I%QswXWhCHAO3Gf`in1{(yJdY;LD&Ep=Z zAjlQ0?JE{!(3rbHro8Cy$I(0Yt?PyRoy+!y!c3lFV%N`arlsgmJs%T73K)N`eT3e> zGy2dv{B!?;tXJkkub&3>T68S|Mv5wlD5E}hJ|jW!3VT%MJ@#EwuZ!{w8%VHoZif0bPl*aWc6 z-emmPzNxA6PmuT*Bvp?;n!-=lE&8m8WI3rfo7vkf9Med$tm=iYRJcf^?Qj~G5sYK1 zazdW>-={8PndBKqxP-(-tOEMo$rpgWI~k#~b(-#}&+SRXc4o?f)5&l1^#@)m4Z8#! zUKzhq49b{N41Lx@Ve2=?0RK_x!nqQnz`k-eOpTK+w-ZU(iRhiN!ZXBiZ1whEu=%%gOvv=@Xyd6wIBHI zYH0ajf8YP9mrYJp=x}FdyLE8jOK3aDC?{*U4sPxf0`nY5?2+c|45(PKZnWr z-Tgom%5t|OhJLr5SEt^byVa>$-So-NNvB^fF8RAW%`(u8u19Yy4Xaf1cK9Zkuq^k2 zG`zwX7r{d8V2%d7WAdzu#DBt-5)8%!#hHv3CA3DXu}_~M{6 zzcs#sJmXH$q`+GdG0bC?w+Squmw6wlqa&dkRJ2RMQ07^xB_qhuLv5zr(-axPxA5Ti%$G8*$#fRO=leSWEbZpb4EQqRiv{rU=!J&C{e$76i3C0D1NE@* z=r~nx3CYYwUR@>kfw%?74o$No={NGWuK&arNqxj-pR#?GSe>o(7hbGxDo)*eQOBCA zaz-;)7rMVLH7W8gaek1?Q}%G1LTRk;daeEIBesI*tGDf~DZ+&q!T8oK=zi~j1hKhr z%{Vys$emJ;rCe&A*@XF5IS^ZOn%iRCy&DraZqwqYf3JT{5KL?#x#Ve=Q+_KSs%hL% z6K?gA-s(A-_A|b&H~lj;**4#=LbC8D&+}j`s{(l$)jUSlq(X0BK6Bd*N$6n}7i@4N z4cZZs@!8ldaZan2d%>}&s3iQeioJ*FGAfD*R+mFRsAP-Yb9}oqTh5VD&p^Q?`)Uue zsGF~r!8D)?$=jIO@~^jWBt593u}r_MFXYJm=l57i93E_8+E8U z+iiRGN}P7EMXj35Vrl0YIR9R))}W-pFkYSNR&5Ay?WHY4 z`=`H;_uAn+6=bC0vj(>kv>5}9xqEt#x((T2wr%t}|NQsxlSwV`2O^n2dfQqi%Xr(2 z$8+nNX#KV88g-TmpF23KWj3#8H1z)=<|6i(9w{{V-a92u73-Ui<=8tdybM^ndbfiV z?g=kbO$aSl*nL;6IwAVfYKw(fjzQeHl3E64^(V*z(2+R5mxpgh9RxO@5tYN{rePtz zT`$T8z72_ftXHgQeBkxglPrh4Ctfi?sq}EtcOzwBSQvO*;f;}< zD6)u`T~PRyan6ARcfnU4m5ofTDk37|*IwS!km-ALXNl~$ZHB$5IR7fx*>x5qlT1BX zadM`L)wZv}Uutcvd#l(q24fkol_SA1eUS=EIg@aT>!`pfoG|aTS>Gx^IhuY%-tI zHJ-lmY5N&-GGw_;9Qa&NYBMh3T;yrk6YwmOys+!+{DF{3x_9&$Rtu0zzFm;vJ6_?^ z9}urtx$(-)jGx!bqhZD)mFTHzlvt>!<&ov1DuEwp_w71ASEur+`Votc4JKo~{Hwa4 zzq`E;7CKxD!jmt+#b7jzX)lP?2)ed!=1ASCLuweNs>O`o3s{>eSYY0$*Pa{TH~wf( zJL{foZavx^S4R}D3BSig3Lly+_-M9@cRhK*B#GtuU51!j`ofy9Fhj?k560_=BFE_iq^rKn%{`yMe`?J3nu_H8lzDw_|2bPJhE}Kv? z)!FewZSUqafBi9&+M`+r8BEEOWt06m6XIU_A;iV@O8-b=lI3DXsg9sbv(2Z;m9!Z| z2>(o7!aBw3B6LwE=T`Nt(u4gMn_Jx6f7txgb&3`gpbSBHbH8u_-tZCM=MF*!cFlWb87G2w1Yx2ypt#>hLZ6W!BX!E z;oNUTmotcCs2-ov+gsH4xCx9y9hH={U`k5=KNh};fHMLTWL|X3v-Fx9JL^59d`Iok zuazkn!Pfh_)R36Gpkll91z1OG7s z_DwnFRv*sK_t4{l^62?P^~Wtd0OeB=c^BwMqv#PzRchwmx& zVW;X&S>jMZIw`{)3;oHvYmRHx<;BT|Ba(t%zt_rjoyvVQ@jorhOkrM`o1|-oiXa&2 zCoLtWyQvZ5rHNMT%2$sW2-W+ViE11MOff9v#fm`=S6u|OZ=;H((lb|AB~w1!S!}Xy)tht7-2>$Z|ZpAR5T`90cCS_TA(t zNUYRUp*Ii!=y$n3#@)c%?l0bW0RWWU|21HrTd~az@s>C2mGZ4Ww@Ge+*ef5y{@tWI zkT9r%uHWMRvRZ_V0c+nep`-MNXoANyF%&XMNmEPBAWG)(U{tYh#3jQN`UKOd%*$@W z$@=uuH!&g7?_``2Umc;Q6r}q{0{+|nYeB8~!t}3ekFLWb~a_)*B;;#tBl4IcvzYv;G z8%@1OQ+4t{@ulMq0gkHZ{z;5l$gzN}8tty=epM;<&Z|4U3;@xq`iKwTHkZ1O1)kwZ zZm*e_VinSvtY*l^FFVBY{%OABdbKxWgFOO@!sSJkYHoK9lTb(vy|xPdzKtiMO;{=3 z@kzfI^%Ah|kB|$q-EQhP6a6mc@RrY&?C3JJkdyW5OIn+Jk`fGTp*M-@5*zDZwdalZ zMu~nGcq)~w4d9vrp=-^apB;wZbaerqLZG~;Q5ok`xe8Ld@TW32B$YJ!Aca>D#!<{~ z7zD#RLS<@9CT$h>OS#BkD(xI3G?aG?-xuCG4A6lJYeEB^kE9Moznhorq&S52C#K;B zhAD^ls=Ic_BCB@Iy3aBK1H!)qqly3vIx~8Z%Q1<-GXWPFEx-vM=&!^fA<3@6*=~@Y z7|f32s9wVgaGdZ%B%XZFPFJ;zC2y4#r4b;~gQUitbX%>Y?m^B=BuRSAF>fXXFwP=tvWBMt^! zj>p!s6_wgOb4UbS^9Jp5oD_C%X_7_wicF)l0pOgk97v2LV(LmCRR}=0Dx(i+4(|s- zMO-OeBgaG?Acm~wx97Qj&+QY5NGcSC(E;lCK>~KqJ@=sc#{_y<-`F?CCYK=y7~mQ$ z@1_9}FWoxjDKgMC3J1&oIgQc~5@fRRg-L;Px;fZ6p6HQM7OG&9G~_b;Sas5O7u;Sz3F9$+UK-aGuuYLmEwayXfgZ+ zv-ih@3|U1<8*TQ_8@3`dhnoTI9jDDA?H52OJhncqZMB+pUJR+cEk)V0qS*|%?p?K4 zGPlNAg;2hwt&(+R$f7YdB@@@0Y19@52#;x!&vyNq`)cmaxC#Rp63;1(7`HPNPj@4C zbqM!IwobVZbAkyNbGEzEE95yFAon~+!<>;^PN@gK^P4~-aRdS34n^Z0(6Ho8>y8MT z8O*MJUA42-gZQ}TtPdgh@&kGh8I?r}2&e?AATWCdK2yQ3$mHiSR38rvd@>OoWf*fs5Idgp9MduL=jWywK;OAt<2wA& z#PWGrKS=&sRkbuuc!m`VN1grL%mA15! zI`Zr37#SXz%jpyTr7TWZCeC%$>m^_} zj*TXqFh1Mw;ohtS+~UDsL=s5n5hTx!5h0-QSJwtA2*K3d(T+?;1CA8p>I2L_Ish>% zjyq8Y;UxqRizGzkAL@<}sH`Q=v-N-uN7LE&^W;FigqA9|z7`G%F60?#j%hmv&jHEA zezmqwy-P@OEF+zE%Wd6tn+2m;sBkQk?^gNos{V5;H&QP%t&}ZJ%oX8s3)+=V;}51+ zP-LAmOe^aLaz_fR+Fk4O20RNOk-rTqYCQ-)5l~yxj9JTIYHsDWMEfcR!^rtcop|V zRLTJ>TiP;tO7gm4|X25I}#zg=t&Gd2ZS%i3-p*Du63w?X0< z@#ySxY#RXO&4`O6I0#(nAd=ER)C9;xvc)Is>v$O;%7-ururg7ZRfDVHC3Eu5* z?b>S%Aj^8kZ7PuRke$&~SZy5PH4ichBjh!&(G3 zmZS{yj%Qo3-9v8B6Rgz$m3b1pgdA7i>}O5tO9LL9ryQnVczTfn1a#j1+$-`~ zPZVj5I#A>OiN~}E-s=zBhmyrBL~$vDm&tZe`Hly5|$1Y2ub* zsT3mrWVA!#{#86bu!)}i#*aC9=?z#sx`>@n+r#k#9P%(a2L#<5RkobrdF|pH`&;G-Tga8-c85178xbu@W$M(8NxK3iS7cAdR7U- zc>dLSgwt&Rscli+-2-KOU=N~h_5Go6Ys2AxIocv$M5y+H&g|JL-1FfCv= zj8UrNg+dYjT|E_2#~<>2MB6}mnhqU&*jVDX`a$RG@98T5%VmcYSu;9zI@R zk(63w7=^i3w(boqur|_rbZy1Y`IK#tP;&rdSXS)i`-I<#OqTpy{Sk2gv)`VaH^?1F zy?t%VEVy;3Ui9gW4pJp_~dn*M}XCz?!Uj42N-GZgbn}f%$pL)iBhH2-#7FhR*XJT- im^uE>(aZlZj_x8FsF*@N-iC7iM}sMAKr0n3g8v`rcK@gV literal 11562 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 diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/guiIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/guiIcon.png index ffeb015f1fa198083840d9870738f5f59766abd5..3d25b953abf46e5a3bb98eb931ec0da0ba0e7935 100644 GIT binary patch literal 10181 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 delta 4495 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 diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/levelIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/levelIcon.png index 7fdb61d1b1cfd9e2af585bcded85a68824021509..d3a2f55e8486cdfbef4f7b1ffc0958c6bbf7ba4a 100644 GIT binary patch literal 20009 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 z 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 J(z*N7e*q&EOz;2z diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/materialIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/materialIcon.png index 0e6c456a644cf50a23d8fd1abf5609681bcda256..2b805f6d84f65c026bfff629832423591984464f 100644 GIT binary patch literal 40426 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 B!Mgwe literal 7889 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 FzW}kW_3i)w literal 8615 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 diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/prefabIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/prefabIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..91ce8888ce5e704cf22edf0e5523a247d9830bda GIT binary patch literal 12431 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%0A9$dAkV=0A5oCYSMn53|^8U=hMgt(AsAYx{E;0 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 cKD&R0QDP>!(XcqN0pO2{lIEi#MT diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/scriptIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/scriptIcon.png index 1a2433dea6c67e3abe4e89db66fac55c32c7db5b..2cd25eee460f7221f09b18fe8b4fd714938982a6 100644 GIT binary patch literal 7772 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 Lrb4Nl<%@p<1DT1* literal 10044 zcmeHtcTiJNw{JiNlqMpeARwZERHYNDg7n^d=slqH4vG+^_ZB)r=)FkjBB0VC5Q=~Z z2uTQt5RiTk_s#w9&G)|h?swNXr!FU4%0#T|c zE9ini#K0*rh>Qd{?E9mRfdh$+nvw!=90wsGp{PaR?D|V(6E6^moc6L2fwFV%0DqEt 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 diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/serverScriptIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/serverScriptIcon.png index f65bccb3980c63b93a36c873f539048e41e3558f..23b7861bd95ac17291bb6f76a459c919cca005fe 100644 GIT binary patch literal 9224 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 literal 14897 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 YMz1{4xS6F|;CzzmDmuz_Pi?~g7vXvhjsO4v diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/stateMachineIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/stateMachineIcon.png index 95ef798eec2267de8e28636ebd4b9ba740244bcc..ed94703a1f3af737695fa008be3fc088623b4f0d 100644 GIT binary patch literal 20797 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 BQEUJJ diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/terrainIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/terrainIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..29036c61e58dc59aedbbc577037f5b1c874aa7f1 GIT binary patch literal 13631 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 literal 0 HcmV?d00001 diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/terrainIcon_image.asset.taml b/Templates/BaseGame/game/tools/assetBrowser/art/terrainIcon_image.asset.taml new file mode 100644 index 000000000..4a6ef4a57 --- /dev/null +++ b/Templates/BaseGame/game/tools/assetBrowser/art/terrainIcon_image.asset.taml @@ -0,0 +1,8 @@ + diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/terrainMaterialIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/terrainMaterialIcon.png index 0e6c456a644cf50a23d8fd1abf5609681bcda256..75ae72c45d0a3d164969db47da33b66cff8411b8 100644 GIT binary patch literal 14057 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.setValue(1); } - if(%previewScaleSize == 0) + if(%previewScaleSize == 0 || startsWith(AssetBrowser.dirHandler.currentAddress, "Creator")) { %previewButton.iconLocation = "Left"; %previewButton.textLocation = "Right"; @@ -830,137 +830,6 @@ function AssetBrowser::setTagActive(%this, %tag) %this.rebuildAssetArray(); } -function AssetBrowser::loadCreatorClasses(%this) -{ - // Just so we can recall this method for testing changes - // without restarting. - if ( isObject( %this.creatorClassArray ) ) - %this.creatorClassArray.delete(); - - %this.creatorClassArray = new ArrayObject(); - %this.creatorClassArray.caseSensitive = true; - //%this.setListView( true ); - - %this.beginCreatorGroup( "Environment" ); - - // Removed Prefab as there doesn't really seem to be a point in creating a blank one - //%this.addCreatorClass( "Prefab", "Prefab" ); - %this.addCreatorClass( "SkyBox", "Sky Box" ); - %this.addCreatorClass( "CloudLayer", "Cloud Layer" ); - %this.addCreatorClass( "BasicClouds", "Basic Clouds" ); - %this.addCreatorClass( "ScatterSky", "Scatter Sky" ); - %this.addCreatorClass( "Sun", "Basic Sun" ); - %this.addCreatorClass( "Lightning" ); - %this.addCreatorClass( "WaterBlock", "Water Block" ); - %this.addCreatorClass( "SFXEmitter", "Sound Emitter" ); - %this.addCreatorClass( "Precipitation" ); - %this.addCreatorClass( "ParticleEmitterNode", "Particle Emitter" ); - - // Legacy features. Users should use Ground Cover and the Forest Editor. - //%this.addCreatorClass( "fxShapeReplicator", "Shape Replicator" ); - //%this.addCreatorClass( "fxFoliageReplicator", "Foliage Replicator" ); - - %this.addCreatorClass( "PointLight", "Point Light" ); - %this.addCreatorClass( "SpotLight", "Spot Light" ); - %this.addCreatorClass( "GroundCover", "Ground Cover" ); - %this.addCreatorClass( "TerrainBlock", "Terrain Block" ); - %this.addCreatorClass( "GroundPlane", "Ground Plane" ); - %this.addCreatorClass( "WaterPlane", "Water Plane" ); - %this.addCreatorClass( "PxCloth", "Cloth" ); - %this.addCreatorClass( "ForestWindEmitter", "Wind Emitter" ); - - %this.addCreatorClass( "DustEmitter", "Dust Emitter" ); - %this.addCreatorClass( "DustSimulation", "Dust Simulation" ); - %this.addCreatorClass( "DustEffecter", "Dust Effecter" ); - - %this.endCreatorGroup(); - - %this.beginCreatorGroup( "Level" ); - - %this.addCreatorClass("MissionArea", "Mission Area" ); - %this.addCreatorClass("Path" ); - %this.addCreatorClass("Marker", "Path Node" ); - %this.addCreatorClass("Trigger" ); - %this.addCreatorClass("PhysicalZone", "Physical Zone" ); - %this.addCreatorClass("Camera" ); - %this.addCreatorClass( "LevelInfo", "Level Info" ); - %this.addCreatorClass( "TimeOfDay", "Time of Day" ); - %this.addCreatorClass( "Zone", "Zone" ); - %this.addCreatorClass( "Portal", "Zone Portal" ); - %this.addCreatorClass( "SpawnSphere", "Player Spawn Sphere"/*, "PlayerDropPoint"*/ ); - %this.addCreatorClass( "SpawnSphere", "Observer Spawn Sphere"/*, "ObserverDropPoint"*/ ); - %this.addCreatorClass( "SFXSpace", "Sound Space" ); - %this.addCreatorClass( "OcclusionVolume", "Occlusion Volume" ); - - %this.endCreatorGroup(); - - %this.beginCreatorGroup( "System" ); - - %this.addCreatorClass( "SimGroup" ); - %this.addCreatorClass( "AIPathGroup" ); - - %this.endCreatorGroup(); - - %this.beginCreatorGroup( "ExampleObjects" ); - - %this.addCreatorClass( "RenderObjectExample" ); - %this.addCreatorClass( "RenderMeshExample" ); - %this.addCreatorClass( "RenderShapeExample" ); - - %this.endCreatorGroup(); - - %this.creatorClassArray.sortk(); -} - -function AssetBrowser::beginCreatorGroup(%this, %group) -{ - AssetBrowser-->filterTree.insertItem(AssetBrowser-->filterTree.creatorIdx, %group); - %this.currentCreatorGroup = %group; -} - -function AssetBrowser::endCreatorGroup(%this, %group) -{ - %this.currentCreatorGroup = ""; -} - -function AssetBrowser::addCreatorClass(%this, %class, %name, %buildfunc) -{ - if( !isClass(%class) ) - return; - - if ( %name $= "" ) - %name = %class; - - if ( %this.currentCreatorGroup !$= "" && %group $= "" ) - %group = %this.currentCreatorGroup; - - if ( %class $= "" || %group $= "" ) - { - warn( "AssetBrowser::addCreatorClass, invalid parameters!" ); - return; - } - - if(%buildfunc $= "") - { - %method = "build" @ %buildfunc; - if( !ObjectBuilderGui.isMethod( %method ) ) - %method = "build" @ %class; - - if( !ObjectBuilderGui.isMethod( %method ) ) - %cmd = "return new " @ %class @ "();"; - else - %cmd = "ObjectBuilderGui." @ %method @ "();"; - - %buildfunc = "ObjectBuilderGui.newObjectCallback = \"AssetBrowser.onFinishCreateObject\"; EWCreatorWindow.createObject( \"" @ %cmd @ "\" );"; - } - - %args = new ScriptObject(); - %args.val[0] = %class; - %args.val[1] = %name; - %args.val[2] = %buildfunc; - - %this.creatorClassArray.push_back( %group, %args ); -} // //needs to be deleted with the persistence manager and needs to be blanked out of the matmanager //also need to update instances... i guess which is the tricky part.... @@ -1474,47 +1343,6 @@ function AssetBrowser::doRebuildAssetArray(%this) %assetType = AssetDatabase.getAssetType(%assetId); } - /*%validType = false; - - if(AssetBrowser.assetTypeFilter $= "") - { - if(AssetTypeListPopup.isItemChecked(0)) - { - %validType = true; - } - else - { - for(%f=1; %f < AssetFilterTypeList.Count(); %f++) - { - %isChecked = AssetTypeListPopup.isItemChecked(%f+1); - - if(%isChecked) - { - %filterTypeName = AssetFilterTypeList.getKey(%f); - - if(%activeTypeFilterList $= "") - %activeTypeFilterList = %filterTypeName; - else - %activeTypeFilterList = %activeTypeFilterList @ ", " @ %filterTypeName; - - if(%filterTypeName @ "Asset" $= %assetType) - { - %validType = true; - break; - } - } - } - } - - if(!%validType) - continue; - } - else - { - if(%assetType !$= AssetBrowser.assetTypeFilter) - continue; - }*/ - //stop adding after previewsPerPage is hit %assetName = AssetDatabase.getAssetName(%assetId); @@ -1589,7 +1417,7 @@ function AssetBrowser::doRebuildAssetArray(%this) } //Add Non-Asset Scripted Objects. Datablock, etc based - if(AssetBrowser.assetTypeFilter $= "" && %breadcrumbPath !$= "" && !startsWith(%breadcrumbPath, "Creator/")) + if(AssetBrowser.assetTypeFilter $= "" && %breadcrumbPath !$= "" && isDirectory(%breadcrumbPath)) { %category = getWord( %breadcrumbPath, 1 ); %dataGroup = "DataBlockGroup"; @@ -1779,11 +1607,28 @@ function AssetBrowser::doRebuildAssetArray(%this) //One of the creator folders was selected %creatorGroup = AssetBrowserFilterTree.getItemText(AssetBrowserFilterTree.getSelectedItem(0)); + if(%creatorGroup $= "Creator") + { + //add folders for the groups + %placeholderVar = ""; + } + else + { for ( %i = 0; %i < AssetBrowser.creatorClassArray.count(); %i++ ) { %group = AssetBrowser.creatorClassArray.getKey( %i ); - if ( %group $= %creatorGroup ) + //Do some filter logic do skip out of groups if we're in the wrong editor mode for it + %creatorEditorFilter = "WorldEditor"; + if(GuiEditorIsActive()) + { + %creatorEditorFilter = "GuiEditor"; + } + + %creatorGroupIndex = AssetBrowserCreatorGroupsList.getIndexFromValue(%group); + %creatorGroupKey = AssetBrowserCreatorGroupsList.getKey(%creatorGroupIndex); + + if ( %group $= %creatorGroup && %creatorGroupKey $= %creatorEditorFilter ) { %creatorObj = AssetBrowser.creatorClassArray.getValue( %i ); %class = %creatorObj.val[0]; @@ -1794,6 +1639,7 @@ function AssetBrowser::doRebuildAssetArray(%this) } } } + } for(%i=0; %i < $AssetBrowser::AssetArray.count(); %i++) AssetBrowser.buildAssetPreview( $AssetBrowser::AssetArray.getValue(%i), $AssetBrowser::AssetArray.getKey(%i) ); @@ -2519,6 +2365,9 @@ function AssetBrowserFilterTree::onDragDropped( %this ) function AssetBrowser::hasLooseFilesInDir(%this) { + if(!isDirectory(%this.dirHandler.currentAddress)) + return false; + //First, wipe out any files inside the folder first %file = findFirstFileMultiExpr( %this.dirHandler.currentAddress @ "/*.*", false); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.tscript index 152a4c78c..c4de919f9 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.tscript @@ -410,63 +410,6 @@ function ImportAssetWindow::reloadImportOptionConfigs(%this) //ImportAssetConfigList.setSelected(%importConfigIdx); } -// -/*function importLooseFile(%filePath, %forceAutoImport) -{ - %assetType = getAssetTypeByFilename(%filePath); - - if(%forceAutoImport) - { - //If we're attempting to fast-track the import, check that that's even an option - if(ImportAssetWindow.importConfigsList.count() == 0 || - EditorSettings.value("Assets/AssetImporDefaultConfig") $= "" || - EditorSettings.value("Assets/AutoImport", false) == false) - { - toolsMessageBoxOK("Unable to AutoImport", "Attempted to import a loose file " @ %filePath @ " with AutoImport but was unable to either due to lacking a valid import config, or the editor settings are not set to auto import."); - return false; - } - - if(%assetType $= "folder" || %assetType $= "zip") - { - toolsMessageBoxOK("Unable to AutoImport", "Unable to auto import folders or zips at this time"); - return false; - } - - if(%assetType $= "") - { - toolsMessageBoxOK("Unable to AutoImport", "Unable to auto import unknown file type for file " @ %filePath); - return false; - } - } - - %assetItem = AssetBrowser.addImportingAsset(%assetType, %filePath, "", ""); - ImportAssetItems.add(%assetItem); - - if(%forceAutoImport) - { - %targetModule = AssetBrowser.dirHandler.getModuleFromAddress(filePath(%filePath)).ModuleId; - AssetImportTargetModule.text = %targetModule; - - %assetItem.moduleName = %targetModule; - - %assetName = %assetItem.assetName; - - AssetBrowser.dirHandler.currentAddress = filePath(%filePath); - - //skip the refresh delay, we'll force it here - ImportAssetWindow.doRefresh(); - - ImportAssetItems.empty(); - - if(ImportAssetWindow.hasImportIssues) - return false; - } - - $importedLooseFileAsset = %assetItem.moduleName @ ":" @ %assetItem.assetName; - - return true; -}*/ - // function assetImportUpdatePath(%newPath) { @@ -475,91 +418,6 @@ function assetImportUpdatePath(%newPath) AssetImportTargetModule.text = AssetBrowser.dirHandler.getModuleFromAddress(AssetBrowser.dirHandler.currentAddress).ModuleId; } -// -/*function ImportAssetWindow::processImportAssets(%this, %assetItem) -{ - if(!isObject(%assetItem)) - { - //Zero this out - ImportAssetWindow.assetHeirarchyChanged = false; - - for(%i=0; %i < ImportAssetItems.count(); %i++) - { - %assetItem = ImportAssetItems.getKey(%i); - - if(!isObject(%assetItem) || %assetItem.skip ) - return; - - if(%assetItem.processed == false) - { - //sanetize before modifying our asset name(suffix additions, etc) - if(%assetItem.assetName !$= %assetItem.cleanAssetName) - %assetItem.assetName = %assetItem.cleanAssetName; - - if(%assetItem.assetType $= "AnimationAsset") - { - //if we don't have our own file, that means we're gunna be using our parent shape's file so reference that - if(!isFile(%assetItem.filePath)) - { - %assetItem.filePath = %assetItem.parentAssetItem.filePath; - } - } - - if(AssetBrowser.isMethod("prepareImport" @ %assetItem.assetType)) - { - %command = AssetBrowser @ ".prepareImport" @ %assetItem.assetType @ "(" @ %assetItem @ ");"; - eval(%command); - } - - %assetItem.processed = true; - } - - %this.processImportAssets(%assetItem); - } - } - else - { - for(%i=0; %i < %assetItem.childAssetItems.count(); %i++) - { - %childAssetItem = %assetItem.childAssetItems.getKey(%i); - - if(!isObject(%childAssetItem) || %childAssetItem.skip) - return; - - if(%childAssetItem.processed == false) - { - //sanetize before modifying our asset name(suffix additions, etc) - if(%childAssetItem.assetName !$= %childAssetItem.cleanAssetName) - %childAssetItem.assetName = %childAssetItem.cleanAssetName; - - if(%childAssetItem.assetType $= "AnimationAsset") - { - //if we don't have our own file, that means we're gunna be using our parent shape's file so reference that - if(!isFile(%childAssetItem.filePath)) - { - %childAssetItem.filePath = %childAssetItem.parentAssetItem.filePath; - } - } - - if(AssetBrowser.isMethod("prepareImport" @ %childAssetItem.assetType)) - { - %command = AssetBrowser @ ".prepareImport" @ %childAssetItem.assetType @ "(" @ %childAssetItem @ ");"; - eval(%command); - } - - %childAssetItem.processed = true; - } - - %this.processImportAssets(%childAssetItem); - } - } - - //If our hierarchy changed, it's because we did so during processing - //so we'll loop back through again until everything has been processed - if(ImportAssetWindow.assetHeirarchyChanged) - %this.processImportAssets(); -}*/ - function ImportAssetWindow::findImportingAssetByName(%this, %assetName, %assetItem) { if(!isObject(%assetItem)) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cpp.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cpp.tscript index 4fdd7b173..a2686fd37 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cpp.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cpp.tscript @@ -11,6 +11,19 @@ function AssetBrowser::buildCppPreview(%this, %assetDef, %previewData) %previewData.tooltip = %assetDef.assetName; } +function AssetBrowser::buildCppAssetPreview(%this, %assetDef, %previewData) +{ + %previewData.assetName = %assetDef.assetName; + %previewData.assetPath = %assetDef.codeFilePath; + %previewData.doubleClickCommand = "echo(\"Not yet implemented to edit C++ files from the editor\");";//"EditorOpenFileInTorsion( "@%previewData.assetPath@", 0 );"; + + %previewData.previewImage = "ToolsModule:cppIcon_image"; + + %previewData.assetFriendlyName = %assetDef.assetName; + %previewData.assetDesc = %assetDef.description; + %previewData.tooltip = %assetDef.assetName; +} + function AssetBrowser::createCpp(%this) { %moduleName = AssetBrowser.newAssetSettings.moduleName; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/creatorObj.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/creatorObj.tscript index 3c90e1782..1dec09e34 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/creatorObj.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/creatorObj.tscript @@ -9,6 +9,14 @@ function AssetBrowser::buildCreatorPreview(%this, %assetDef, %previewData) %previewData.previewImage = "ToolsModule:" @ %class @ "_image"; + if(!AssetDatabase.isDeclaredAsset(%previewData.previewImage)) + { + if(EditorIsActive()) + %previewData.previewImage = "ToolsModule:SceneObject_image"; + else if(GuiEditorIsActive()) + %previewData.previewImage = "ToolsModule:GuiControl_image"; + } + //%previewData.assetFriendlyName = %assetDef.assetName; %previewData.assetDesc = %assetDef; %previewData.tooltip = "This creates a new object of the class " @ %class; @@ -22,6 +30,8 @@ function AssetBrowser::onFinishCreateObject(%this, %objId) function AssetBrowser::onCreatorEditorDropped(%this, %assetDef, %position) { + if(EditorIsActive()) + { %targetPosition = EWorldEditor.unproject(%position SPC 1000); %camPos = LocalClientConnection.camera.getPosition(); %rayResult = containerRayCast(%camPos, %targetPosition, -1); @@ -41,4 +51,9 @@ function AssetBrowser::onCreatorEditorDropped(%this, %assetDef, %position) %this.createdObjectPos = %pos; %newObj = eval(%func); + } + else if(GuiEditorIsActive()) + { + %placeholderVar = ""; + } } \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.tscript index 37e874fb4..4363209a5 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.tscript @@ -434,10 +434,20 @@ function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData) %generatePreview = false; %previewFilePath = %previewPath @ %assetDef.assetName @ "_Preview.png"; - if(!isFile(%previewFilePath) || (compareFileTimes(%assetDef.getImagePath(), %previewFilePath) == 1)) + if(!isFile(%previewFilePath)) { %generatePreview = true; } + else + { + if(isObject(%assetDef.materialDefinitionName)) + { + if(compareFileTimes(%assetDef.materialDefinitionName.getDiffuseMap(0), %previewFilePath) == 1 || + compareFileTimes(%assetDef.materialDefinitionName.getFilename(), %previewFilePath) == 1) + %generatePreview = true; + + } + } %previewAssetName = %module.moduleId @ "_" @ %assetDef.assetName @ "_PreviewImage"; @@ -479,7 +489,7 @@ function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData) //Revalidate. If it didn't work, just use the default placeholder one if(!isFile(%previewFilePath)) - %previewAssetName = "ToolsModule:genericAssetIcon_image"; + %previewAssetName = "ToolsModule:materialIcon_image"; %previewData.assetName = %assetDef.assetName; %previewData.assetPath = %assetDef.scriptFile; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.tscript index a13711aae..f4b42a66b 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.tscript @@ -21,7 +21,7 @@ function AssetBrowser::buildPrefabPreview(%this, %assetDef, %previewData) %previewData.assetName = %assetDef.assetName; %previewData.assetPath = %fullPath; - %previewData.previewImage = "ToolsModule:genericAssetIcon_image"; + %previewData.previewImage = "ToolsModule:prefabIcon_image"; //%previewData.assetFriendlyName = %assetDef.assetName; %previewData.assetDesc = %assetDef.description; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.tscript index c23850c2c..78003103f 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.tscript @@ -90,6 +90,22 @@ function AssetBrowser::moveScriptAsset(%this, %assetDef, %destination) AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath); } +function AssetBrowser::buildScriptAssetPreview(%this, %assetDef, %previewData) +{ + %previewData.assetName = %assetDef.assetName; + %previewData.assetPath = %assetDef.scriptFile; + %previewData.doubleClickCommand = "EditorOpenFileInTorsion( \""@%previewData.assetPath@"\", 0 );"; + + if(%assetDef.isServerSide) + %previewData.previewImage = "ToolsModule:serverScriptIcon_image"; + else + %previewData.previewImage = "ToolsModule:clientScriptIcon_image"; + + %previewData.assetFriendlyName = %assetDef.assetName; + %previewData.assetDesc = %assetDef.description; + %previewData.tooltip = "Asset Name: " @ %assetDef.assetName @ "\nDefinition Path: " @ %assetDef.getFilename(); +} + function AssetBrowser::buildTScriptPreview(%this, %assetDef, %previewData) { %previewData.assetName = %assetDef.assetName; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript index 4bf17453a..1908e3f23 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript @@ -353,6 +353,7 @@ function AssetBrowser::onShapeAssetEditorDropped(%this, %assetDef, %position) EWorldEditor.isDirty = true; + MECreateUndoAction::submit(%newStatic ); } function GuiInspectorTypeShapeAssetPtr::onControlDropped( %this, %payload, %position ) @@ -367,15 +368,15 @@ function GuiInspectorTypeShapeAssetPtr::onControlDropped( %this, %payload, %posi if(%assetType $= "ShapeAsset") { - //echo("DROPPED A SHAPE ON A SHAPE ASSET COMPONENT FIELD!"); - %module = %payload.moduleName; %asset = %payload.assetName; - %targetComponent = %this.targetObject; - %targetComponent.shapeAsset = %module @ ":" @ %asset; + %oldValue = %targetObject.shapeAsset; + %arrayIndex = ""; - //Inspector.refresh(); + %targetObject = %this.targetObject; + %targetObject.shapeAsset = %module @ ":" @ %asset; + } EWorldEditor.isDirty = true; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript index 27cbc0b7c..9081729d0 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript @@ -166,7 +166,7 @@ function AssetBrowser::buildTerrainAssetPreview(%this, %assetDef, %previewData) %previewData.assetName = %assetDef.assetName; %previewData.assetPath = ""; - %previewData.previewImage = "ToolsModule:gameObjectIcon_image"; + %previewData.previewImage = "ToolsModule:terrainIcon_image"; %previewData.assetFriendlyName = %assetDef.gameObjectName; %previewData.assetDesc = %assetDef.description; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript new file mode 100644 index 000000000..1c04ea1b7 --- /dev/null +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript @@ -0,0 +1,194 @@ +function AssetBrowser::loadCreatorClasses(%this) +{ + // Just so we can recall this method for testing changes + // without restarting. + if ( isObject( %this.creatorClassArray ) ) + %this.creatorClassArray.delete(); + + AssetBrowserCreatorGroupsList.empty(); + + %this.creatorClassArray = new ArrayObject(); + %this.creatorClassArray.caseSensitive = true; + //%this.setListView( true ); + + //World Editor Creator Groups + %this.beginCreatorGroup( "Environment" ); + %this.addCreatorClass( "BasicClouds", "Basic Clouds" ); + %this.addCreatorClass( "PxCloth", "Cloth" ); + %this.addCreatorClass( "CloudLayer", "Cloud Layer" ); + %this.addCreatorClass( "GroundCover", "Ground Cover" ); + %this.addCreatorClass( "Lightning" ); + %this.addCreatorClass( "ParticleEmitterNode","Particle Emitter" ); + %this.addCreatorClass( "Precipitation" ); + // Legacy features. Users should use Ground Cover and the Forest Editor. + //%this.addCreatorClass( "fxShapeReplicator", "Shape Replicator" ); + //%this.addCreatorClass( "fxFoliageReplicator", "Foliage Replicator" ); + %this.addCreatorClass( "RibbonNode", "Ribbon Emitter" ); + %this.addCreatorClass( "ScatterSky", "Scatter Sky" ); + %this.addCreatorClass( "SkyBox", "Sky Box" ); + %this.addCreatorClass( "SFXEmitter", "Sound Emitter" ); + %this.addCreatorClass( "TerrainBlock", "Terrain Block" ); + %this.addCreatorClass( "VolumetricFog", "Volumetric Fog" ); + %this.addCreatorClass( "TimeOfDay", "Time of Day" ); + %this.addCreatorClass( "WaterBlock", "Water Block" ); + %this.addCreatorClass( "WaterPlane", "Water Plane" ); + %this.addCreatorClass( "ForestWindEmitter", "Wind Emitter" ); + %this.endCreatorGroup(); + + %this.beginCreatorGroup( "ExampleObjects" ); + %this.addCreatorClass( "RenderMeshExample" ); + %this.addCreatorClass( "RenderObjectExample" ); + %this.addCreatorClass( "RenderShapeExample" ); + %this.endCreatorGroup(); + + %this.beginCreatorGroup( "Level" ); + %this.addCreatorClass("Camera" ); + %this.addCreatorClass("GroundPlane", "Ground Plane" ); + %this.addCreatorClass("LevelInfo", "Level Info" ); + %this.addCreatorClass("Marker", "Path Node" ); + %this.addCreatorClass("MissionArea", "Mission Area" ); + %this.addCreatorClass("Note", "Note" ); + %this.addCreatorClass("Path" ); + %this.addCreatorClass("SpawnSphere", "General Spawn Sphere" ); + %this.addCreatorClass("SpawnSphere", "Player Spawn Sphere"/*, "PlayerDropPoint"*/ ); + %this.addCreatorClass("SpawnSphere", "Observer Spawn Sphere"/*, "ObserverDropPoint"*/ ); + %this.addCreatorClass("VPath", "Verve Path" ); + %this.endCreatorGroup(); + + %this.beginCreatorGroup( "Lighting" ); + %this.addCreatorClass( "BoxEnvironmentProbe", "Box Env. Probe" ); + %this.addCreatorClass( "PointLight", "Point Light" ); + %this.addCreatorClass( "Skylight", "Skylight" ); + %this.addCreatorClass( "SphereEnvironmentProbe", "Sphere Env. Probe" ); + %this.addCreatorClass( "SpotLight", "Spot Light" ); + %this.addCreatorClass( "Sun", "Basic Sun" ); + %this.endCreatorGroup(); + + %this.beginCreatorGroup( "Navigation" ); + %this.addCreatorClass( "AIPathGroup" ); + %this.addCreatorClass( "CoverPoint", "Cover Point" ); + %this.addCreatorClass( "NavMesh", "Navigation Mesh" ); + %this.addCreatorClass( "NavPath", "Navigation Path" ); + %this.endCreatorGroup(); + + %this.beginCreatorGroup( "System" ); + %this.addCreatorClass( "SimGroup" ); + %this.endCreatorGroup(); + + %this.beginCreatorGroup( "Volumes" ); + %this.addCreatorClass("AccumulationVolume", "Accumulation Volume" ); + %this.addCreatorClass("OcclusionVolume", "Occlusion Volume" ); + %this.addCreatorClass("PhysicalZone", "Physical Zone" ); + %this.addCreatorClass("Portal", "Zone Portal" ); + %this.addCreatorClass("SFXSpace", "Sound Space" ); + %this.addCreatorClass("Trigger" ); + %this.addCreatorClass("Zone", "Zone" ); + %this.endCreatorGroup(); + + + + //Gui Editor Creator Groups + %controls = enumerateConsoleClassesByCategory( "Gui" ); + %guiClasses = new ArrayObject(); + + foreach$( %className in %controls ) + { + if( GuiEditor.isFilteredClass( %className ) + || !isMemberOfClass( %className, "GuiControl" ) ) + continue; + + %category = getWord( getCategoryOfClass( %className ), 1 ); + if( %category $= "" ) + continue; + + %guiClasses.add(%category, %className); + } + + %guiCats.sortk(true); + %guiClasses.sortk(true); + + %guiClasses.echo(); + + %currentCat = ""; + for(%i=0; %i < %guiClasses.count(); %i++) + { + %guiCat = %guiClasses.getKey(%i); + if(%currentCat !$= %guiCat) + { + if(%currentCat !$= "") + %this.endCreatorGroup(); + + %this.beginCreatorGroup( %guiCat, "GuiEditor" ); + %currentCat = %guiCat; + } + + %guiClass = %guiClasses.getValue(%i); + %this.addCreatorClass( %guiClass ); + } + + %this.endCreatorGroup(); + + %this.creatorClassArray.sortk(true); + %this.creatorClassArray.sort(true); + + %guiClasses.delete(); +} + +function AssetBrowser::beginCreatorGroup(%this, %group, %editor) +{ + if(%editor $= "") + %editor = "WorldEditor"; + + if((GuiEditorIsActive() && %editor $= "GuiEditor") || (EditorIsActive() && %editor $= "WorldEditor")) + { + AssetBrowser-->filterTree.insertItem(AssetBrowser-->filterTree.creatorIdx, %group); + } + + %this.currentCreatorGroup = %group; + + AssetBrowserCreatorGroupsList.add(%editor, %group); +} + +function AssetBrowser::endCreatorGroup(%this, %group) +{ + %this.currentCreatorGroup = ""; +} + +function AssetBrowser::addCreatorClass(%this, %class, %name, %buildfunc) +{ + if( !isClass(%class) ) + return; + + if ( %name $= "" ) + %name = %class; + + if ( %this.currentCreatorGroup !$= "" && %group $= "" ) + %group = %this.currentCreatorGroup; + + if ( %class $= "" || %group $= "" ) + { + warn( "AssetBrowser::addCreatorClass, invalid parameters!" ); + return; + } + + if(%buildfunc $= "") + { + %method = "build" @ %buildfunc; + if( !ObjectBuilderGui.isMethod( %method ) ) + %method = "build" @ %class; + + if( !ObjectBuilderGui.isMethod( %method ) ) + %cmd = "return new " @ %class @ "();"; + else + %cmd = "ObjectBuilderGui." @ %method @ "();"; + + %buildfunc = "ObjectBuilderGui.newObjectCallback = \"AssetBrowser.onFinishCreateObject\"; EWCreatorWindow.createObject( \"" @ %cmd @ "\" );"; + } + + %args = new ScriptObject(); + %args.val[0] = %class; + %args.val[1] = %name; + %args.val[2] = %buildfunc; + + %this.creatorClassArray.push_back( %group, %args ); +} \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/profiles.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/profiles.tscript index 5010d6cd0..b8825155e 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/profiles.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/profiles.tscript @@ -24,4 +24,67 @@ singleton GuiControlProfile(AssetBrowserPreviewShapeAsset : ToolsGuiDefaultProfi border = true; borderColor = "0 0 200 255"; borderColorNA = "0 0 200 255"; +}; + +singleton GuiControlProfile(AssetBrowserPreviewShapeAnimationAsset : ToolsGuiDefaultProfile) +{ + fillColor = "128 128 128 255"; //hovered/selected + + border = true; + borderColor = "0 0 200 255"; + borderColorNA = "0 0 200 255"; +}; + +singleton GuiControlProfile(AssetBrowserPreviewSoundAsset : ToolsGuiDefaultProfile) +{ + fillColor = "128 128 128 255"; //hovered/selected + + border = true; + borderColor = "75 101 135 255"; + borderColorNA = "75 101 135 255"; +}; + +singleton GuiControlProfile(AssetBrowserPreviewTerrainAsset : ToolsGuiDefaultProfile) +{ + fillColor = "128 128 128 255"; //hovered/selected + + border = true; + borderColor = "200 198 198 255"; + borderColorNA = "200 198 198 255"; +}; + +singleton GuiControlProfile(AssetBrowserPreviewTerrainMaterialAsset : ToolsGuiDefaultProfile) +{ + fillColor = "128 128 128 255"; //hovered/selected + + border = true; + borderColor = "200 198 198 255"; + borderColorNA = "200 198 198 255"; +}; + +singleton GuiControlProfile(AssetBrowserPreviewStateMachineAsset : ToolsGuiDefaultProfile) +{ + fillColor = "128 128 128 255"; //hovered/selected + + border = true; + borderColor = "0 76 135 255"; + borderColorNA = "0 76 135 255"; +}; + +singleton GuiControlProfile(AssetBrowserPreviewGUIAsset : ToolsGuiDefaultProfile) +{ + fillColor = "128 128 128 255"; //hovered/selected + + border = true; + borderColor = "17 5 44 255"; + borderColorNA = "17 5 44 255"; +}; + +singleton GuiControlProfile(AssetBrowserPreviewLevelAsset : ToolsGuiDefaultProfile) +{ + fillColor = "128 128 128 255"; //hovered/selected + + border = true; + borderColor = "0 208 186 255"; + borderColorNA = "0 208 186 255"; }; \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript index 3b41dca16..07b3e12b2 100644 --- a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript +++ b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript @@ -289,6 +289,11 @@ function ESettingsWindow::getAxisSettings(%this) function ESettingsWindow::getGeneralSettings(%this) { + SettingsInspector.startGroup("Level Load"); + SettingsInspector.addSettingsField("WorldEditor/LevelLoad/LoadMode", "Editor Startup Scene", "list", "When the editor loads, this setting dictates what scene is loaded first", + "Last Edited Level,Editor Default Scene"); + SettingsInspector.endGroup(); + SettingsInspector.startGroup("Autosave"); SettingsInspector.addSettingsField("WorldEditor/AutosaveInterval", "Autosave Interval(in minutes)", "int", ""); SettingsInspector.endGroup(); diff --git a/Templates/BaseGame/game/tools/gui/images/tab-border.png b/Templates/BaseGame/game/tools/gui/images/tab_border.png similarity index 100% rename from Templates/BaseGame/game/tools/gui/images/tab-border.png rename to Templates/BaseGame/game/tools/gui/images/tab_border.png diff --git a/Templates/BaseGame/game/tools/gui/images/tab_border_image.asset.taml b/Templates/BaseGame/game/tools/gui/images/tab_border_image.asset.taml index 9d4db0d2d..c5f250a2d 100644 --- a/Templates/BaseGame/game/tools/gui/images/tab_border_image.asset.taml +++ b/Templates/BaseGame/game/tools/gui/images/tab_border_image.asset.taml @@ -2,7 +2,7 @@ canSave="true" canSaveDynamicFields="true" AssetName="tab_border_image" - imageFile="@assetFile=tab-border.png" + imageFile="@assetFile=tab_border.png" UseMips="true" isHDRImage="false" imageType="Albedo" /> diff --git a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript index 3c5d36d89..2a9717571 100644 --- a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript +++ b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript @@ -670,16 +670,21 @@ function GuiEditor::onControlDropped(%this, %payload, %position) { // Make sure we have the right kind of D&D. - if( !%payload.parentGroup.isInNamespaceHierarchy( "GuiDragAndDropControlType_GuiControl" ) ) + if( !%payload.parentGroup.isInNamespaceHierarchy( "GuiDragAndDropControlType_GuiControl" ) && + !%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" )) return; %pos = %payload.getGlobalPosition(); %x = getWord(%pos, 0); %y = getWord(%pos, 1); - %this.addNewCtrl(%payload); + %asset = %payload.assetName; + %cmd = "return new " @ %asset @ "();"; + %ctrl = eval( %cmd ); + + %this.addNewCtrl(%ctrl); - %payload.setPositionGlobal(%x, %y); + %ctrl.setPositionGlobal(%x, %y); %this.setFirstResponder(); } @@ -844,6 +849,8 @@ function GuiEditorTabBook::onWake( %this ) item[ 0 ] = "Alphabetical View" TAB "" TAB "GuiEditorToolbox.setViewType( \"Alphabetical\" );"; item[ 1 ] = "Categorized View" TAB "" TAB "GuiEditorToolbox.setViewType( \"Categorized\" );"; }; + + GlobalActionMap.bindCmd( keyboard, space, "", "AssetBrowser.toggleDialog();" ); } //--------------------------------------------------------------------------------------------- @@ -1008,6 +1015,8 @@ function GuiEditorGui::onWake( %this ) function GuiEditorGui::onSleep( %this) { + GlobalActionMap.unbind( keyboard, space ); + // If we are editing a control, store its guide state. %content = GuiEditor.getContentControl(); diff --git a/Templates/BaseGame/game/tools/main.tscript b/Templates/BaseGame/game/tools/main.tscript index 99c8e01ff..7e613bc31 100644 --- a/Templates/BaseGame/game/tools/main.tscript +++ b/Templates/BaseGame/game/tools/main.tscript @@ -278,7 +278,35 @@ function fastLoadWorldEdit(%val) if( !$missionRunning ) { + if(EditorSettings.value("WorldEditor/LevelLoad/LoadMode", "Editor Default Scene") $= "Editor Default Scene") + { EditorNewLevel("ToolsModule:DefaultEditorLevel"); + } + else + { + //go back through our recent levels list to find the most recent valid editor level. + //if NONE work, then just load the default editor scene + %recentLevels = EditorSettings.value("WorldEditor/recentLevelsList"); + %recentCount = getTokenCount(%recentLevels, ","); + %loadedScene = false; + + for(%i=0; %i < %recentCount; %i++) + { + %recentEntry = getToken(%recentLevels, ",", %i); + + if(AssetDatabase.isDeclaredAsset(%recentEntry)) + { + EditorOpenMission(%recentEntry); + %loadedScene = true; + break; + } + } + + if(!%loadedScene) + { + EditorNewLevel("ToolsModule:DefaultEditorLevel"); + } + } } else { diff --git a/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.tscript b/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.tscript index 987ff1640..17e617862 100644 --- a/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.tscript +++ b/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.tscript @@ -315,7 +315,7 @@ function ShapeEditor::selectShape( %this, %shapeAsset, %saveOld ) ShapeEditor.shape = findShapeConstructorByAssetId( %shapeAsset.getAssetId() ); if ( ShapeEditor.shape <= 0 ) { - ShapeEditor.shape = %this.createConstructor( %shapeAsset ); + ShapeEditor.shape = %this.createConstructor( %shapeAsset.getAssetId() ); if ( ShapeEditor.shape <= 0 ) { error( "ShapeEditor: Error - could not select " @ %shapeAsset.getAssetId() ); @@ -2336,7 +2336,7 @@ function ShapeEdMaterials::updateSelectedMaterial( %this, %highlight ) %this.savedMap = %this.selectedMaterial.diffuseMap[1]; if ( %highlight && isObject( %this.selectedMaterial ) ) { - %this.selectedMaterial.diffuseMap[1] = "tools/shapeEditor/images/highlight_material"; + %this.selectedMaterial.setDiffuseMap("ToolsModule:highlight_material_image", 1); %this.selectedMaterial.reload(); } } @@ -3066,7 +3066,7 @@ function ShapeEditor::addLODFromFile( %this, %dest, %assetId, %size, %allowUnmat %source = findShapeConstructorByAssetId( %assetId ); if ( %source == -1 ) - %source = ShapeEditor.createConstructor( %filename ); + %source = ShapeEditor.createConstructor( %assetId ); %source.lodType = "SingleSize"; %source.singleDetailSize = %size; From b9c071b9fdb9c71c4b9f72d69f88a8bbd96c941a Mon Sep 17 00:00:00 2001 From: Areloch Date: Fri, 10 Sep 2021 15:14:57 -0500 Subject: [PATCH 061/399] Cleanup mismerge lines --- Engine/source/T3D/assets/assetImporter.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Engine/source/T3D/assets/assetImporter.cpp b/Engine/source/T3D/assets/assetImporter.cpp index 380c9bcd6..5df1ca8ab 100644 --- a/Engine/source/T3D/assets/assetImporter.cpp +++ b/Engine/source/T3D/assets/assetImporter.cpp @@ -2433,8 +2433,6 @@ void AssetImporter::importAssets(AssetImportObject* assetItem) if (!refreshSuccess) { - const char* importReturnVal = Con::executef(this, processCommand.c_str(), childItem).getString(); - assetPath = Torque::Path(importReturnVal); dSprintf(importLogBuffer, sizeof(importLogBuffer), "AssetImporter::importAssets - Failed to refresh reimporting asset %s.", item->assetName.c_str()); activityLog.push_back(importLogBuffer); } From 140c575f474b308999d5b8136ffb310b69b99b16 Mon Sep 17 00:00:00 2001 From: Areloch Date: Fri, 10 Sep 2021 16:23:00 -0500 Subject: [PATCH 062/399] Minor corrections for localvar issues --- .../game/tools/assetBrowser/scripts/assetTypes/shape.tscript | 2 +- .../BaseGame/game/tools/assetBrowser/scripts/creator.tscript | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript index 7764376b4..89f981438 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript @@ -375,7 +375,7 @@ function GuiInspectorTypeShapeAssetPtr::onControlDropped( %this, %payload, %posi %module = %payload.moduleName; %asset = %payload.assetName; - %oldValue = %targetObject.shapeAsset; + %oldValue = %this.targetObject.shapeAsset; %arrayIndex = ""; %targetObject = %this.targetObject; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript index 1c04ea1b7..d2254ee12 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript @@ -104,7 +104,6 @@ function AssetBrowser::loadCreatorClasses(%this) %guiClasses.add(%category, %className); } - %guiCats.sortk(true); %guiClasses.sortk(true); %guiClasses.echo(); @@ -162,8 +161,7 @@ function AssetBrowser::addCreatorClass(%this, %class, %name, %buildfunc) if ( %name $= "" ) %name = %class; - if ( %this.currentCreatorGroup !$= "" && %group $= "" ) - %group = %this.currentCreatorGroup; + %group = %this.currentCreatorGroup; if ( %class $= "" || %group $= "" ) { From 5f0551b831888e295d7baf2e11eab16756bc6adf Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Fri, 10 Sep 2021 18:18:30 -0500 Subject: [PATCH 063/399] don't try to generate mipmaps for images that aren't n^2 dureing preview map generation --- Engine/source/gfx/bitmap/gBitmap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/gfx/bitmap/gBitmap.cpp b/Engine/source/gfx/bitmap/gBitmap.cpp index 33c1c700c..9560586dd 100644 --- a/Engine/source/gfx/bitmap/gBitmap.cpp +++ b/Engine/source/gfx/bitmap/gBitmap.cpp @@ -1385,8 +1385,8 @@ DefineEngineFunction(saveScaledImage, bool, (const char* bitmapSource, const cha } } }*/ - - image->extrudeMipLevels(); + if (isPow2(image->getWidth())&& isPow2(image->getHeight())) + image->extrudeMipLevels(); U32 mipCount = image->getNumMipLevels(); U32 targetMips = mFloor(mLog2((F32)resolutionSize)) + 1; From f6f204a13a064158958cd86b8577ded001ecf29d Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Fri, 10 Sep 2021 20:10:53 -0400 Subject: [PATCH 064/399] * BugFix: Correct an error where the GUI editor cannot be opened when going from GUI editor to mission editor (or any other editor). --- .../BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript index 3c5d36d89..c867a74cc 100644 --- a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript +++ b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript @@ -121,6 +121,8 @@ function GuiEditor::close(%this) if(Canvas.getContent() != GuiEditorGui.getId()) return; + $InGuiEditor = false; + GuiGroup.add(GuiEditorGui); Canvas.setContent(GuiEditor.lastContent); From 3384d7f42670f67451d20e1dc30bbd2727986f11 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Fri, 10 Sep 2021 22:37:05 -0500 Subject: [PATCH 065/399] fix PhysicsShapeData upconvert entry --- .../scripts/pre40/T3Dpre4ProjectImporter.tscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript index 99099085e..ceb9dfbcc 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript @@ -917,7 +917,7 @@ T3Dpre4ProjectImporter::genProcessor("PrecipitationData", "drop dropAsset dropTe T3Dpre4ProjectImporter::genProcessor("SplashData", "texture textureAsset"); T3Dpre4ProjectImporter::genProcessor("LightFlareData", "flareTexture flareTextureAsset"); T3Dpre4ProjectImporter::genProcessor("PhysicsDebrisData", "shape shapeAsset shapeFile shapeAsset"); -T3Dpre4ProjectImporter::genProcessor("PhysicsShapeData", "shape shapeAsset"); +T3Dpre4ProjectImporter::genProcessor("PhysicsShapeData", "shape shapeAsset shapeName shapeAsset"); T3Dpre4ProjectImporter::genProcessor("PlayerData", "shapeFP shapeFPAsset shapeNameFP shapeFPAsset"); T3Dpre4ProjectImporter::genProcessor("ProjectileData", "projectileShape projectileShapeAsset projectileShapeName projectileShapeAsset"); T3Dpre4ProjectImporter::genProcessor("ShapeBaseData", "shapeFile shapeAsset shape shapeAsset debrisShape debrisShapeAsset debrisShapeName debrisShapeAsset"); From 4cf40defe66ea192d038a54301d3488ae82a7c44 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 11 Sep 2021 02:28:14 -0500 Subject: [PATCH 066/399] Adds handling to project importer so if incoming gui files have the %guiContent declaration at the start, it's converted to a global to comply with the script interpreter --- .../scripts/pre40/T3Dpre4ProjectImporter.tscript | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript index ceb9dfbcc..d996182dd 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript @@ -470,6 +470,12 @@ function T3Dpre4ProjectImporter::beginCodeFilesImport(%this) %objectName = findObjectName(%line, "new"); + if(strIsMatchExpr("*%guiContent*=*new*", %line)) + { + %line = strReplace(%line, "%guiContent", "$guiContent"); + %fileWasChanged = true; + } + if(%objectName !$= "") { %sanitizedName = sanitizeString(%objectName); From 7f59bc6350aa3637a1600b350996bcb4e622cc35 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 11 Sep 2021 15:16:36 -0400 Subject: [PATCH 067/399] Forgot to null out the datablock after being deleted when it fails to preload. --- Engine/source/console/compiledEval.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index a18729fd4..f33586676 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -1103,6 +1103,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa Con::errorf(ConsoleLogEntry::General, "%s: preload failed for %s: %s.", getFileLine(ip - 2), currentNewObject->getName(), errorStr.c_str()); dataBlock->deleteObject(); + currentNewObject = NULL; ip = failJump; break; } From 41bd5ef6b6919bc30abcdae57ec54ea1c9b4bb37 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 11 Sep 2021 14:53:28 -0400 Subject: [PATCH 068/399] remove FMODex from Torque3D The current version of FMod in Torque3D uses the legacy ex plugin, which hasn't been around for a long time. --- Engine/source/sfx/fmod/fmodErrors.h | 115 ---- Engine/source/sfx/fmod/fmodFunctions.h | 157 ----- Engine/source/sfx/fmod/sfxFMODBuffer.cpp | 322 ---------- Engine/source/sfx/fmod/sfxFMODBuffer.h | 63 -- Engine/source/sfx/fmod/sfxFMODDevice.cpp | 578 ------------------ Engine/source/sfx/fmod/sfxFMODDevice.h | 342 ----------- Engine/source/sfx/fmod/sfxFMODEvent.cpp | 339 ---------- Engine/source/sfx/fmod/sfxFMODEvent.h | 135 ---- Engine/source/sfx/fmod/sfxFMODEventGroup.cpp | 510 ---------------- Engine/source/sfx/fmod/sfxFMODEventGroup.h | 159 ----- Engine/source/sfx/fmod/sfxFMODEventSource.cpp | 337 ---------- Engine/source/sfx/fmod/sfxFMODEventSource.h | 101 --- Engine/source/sfx/fmod/sfxFMODPlugin.cpp | 37 -- Engine/source/sfx/fmod/sfxFMODPlugin.h | 48 -- Engine/source/sfx/fmod/sfxFMODProject.cpp | 493 --------------- Engine/source/sfx/fmod/sfxFMODProject.h | 162 ----- Engine/source/sfx/fmod/sfxFMODProvider.cpp | 398 ------------ Engine/source/sfx/fmod/sfxFMODVoice.cpp | 303 --------- Engine/source/sfx/fmod/sfxFMODVoice.h | 121 ---- Engine/source/sfx/sfxDescription.cpp | 5 +- Engine/source/sfx/sfxDevice.h | 1 - Engine/source/sfx/sfxProfile.cpp | 2 +- Engine/source/sfx/sfxSystem.cpp | 22 +- Engine/source/sfx/sfxTrack.cpp | 2 +- .../game/core/sfx/scripts/audio.tscript | 12 +- .../game/data/UI/guis/guiMusicPlayer.tscript | 1 - .../game/data/UI/guis/profiler.tscript | 3 +- .../datablockEditor/datablockEditor.tscript | 9 +- ...ddFMODProjectDlg,EditorGuiGroup.asset.taml | 7 - .../worldEditor/gui/AddFMODProjectDlg.ed.gui | 284 --------- .../game/tools/worldEditor/main.tscript | 2 - .../scripts/AddFMODProjectDlg.ed.tscript | 253 -------- .../worldEditor/scripts/menus.ed.tscript | 5 +- Tools/CMake/torque3d.cmake | 2 - 34 files changed, 13 insertions(+), 5317 deletions(-) delete mode 100644 Engine/source/sfx/fmod/fmodErrors.h delete mode 100644 Engine/source/sfx/fmod/fmodFunctions.h delete mode 100644 Engine/source/sfx/fmod/sfxFMODBuffer.cpp delete mode 100644 Engine/source/sfx/fmod/sfxFMODBuffer.h delete mode 100644 Engine/source/sfx/fmod/sfxFMODDevice.cpp delete mode 100644 Engine/source/sfx/fmod/sfxFMODDevice.h delete mode 100644 Engine/source/sfx/fmod/sfxFMODEvent.cpp delete mode 100644 Engine/source/sfx/fmod/sfxFMODEvent.h delete mode 100644 Engine/source/sfx/fmod/sfxFMODEventGroup.cpp delete mode 100644 Engine/source/sfx/fmod/sfxFMODEventGroup.h delete mode 100644 Engine/source/sfx/fmod/sfxFMODEventSource.cpp delete mode 100644 Engine/source/sfx/fmod/sfxFMODEventSource.h delete mode 100644 Engine/source/sfx/fmod/sfxFMODPlugin.cpp delete mode 100644 Engine/source/sfx/fmod/sfxFMODPlugin.h delete mode 100644 Engine/source/sfx/fmod/sfxFMODProject.cpp delete mode 100644 Engine/source/sfx/fmod/sfxFMODProject.h delete mode 100644 Engine/source/sfx/fmod/sfxFMODProvider.cpp delete mode 100644 Engine/source/sfx/fmod/sfxFMODVoice.cpp delete mode 100644 Engine/source/sfx/fmod/sfxFMODVoice.h delete mode 100644 Templates/BaseGame/game/tools/worldEditor/gui/AddFMODProjectDlg,EditorGuiGroup.asset.taml delete mode 100644 Templates/BaseGame/game/tools/worldEditor/gui/AddFMODProjectDlg.ed.gui delete mode 100644 Templates/BaseGame/game/tools/worldEditor/scripts/AddFMODProjectDlg.ed.tscript diff --git a/Engine/source/sfx/fmod/fmodErrors.h b/Engine/source/sfx/fmod/fmodErrors.h deleted file mode 100644 index 265d0dd55..000000000 --- a/Engine/source/sfx/fmod/fmodErrors.h +++ /dev/null @@ -1,115 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -FMOD_ERROR( FMOD_OK ) -FMOD_ERROR( FMOD_ERR_ALREADYLOCKED ) -FMOD_ERROR( FMOD_ERR_BADCOMMAND ) -FMOD_ERROR( FMOD_ERR_CDDA_DRIVERS ) -FMOD_ERROR( FMOD_ERR_CDDA_INIT ) -FMOD_ERROR( FMOD_ERR_CDDA_INVALID_DEVICE ) -FMOD_ERROR( FMOD_ERR_CDDA_NOAUDIO ) -FMOD_ERROR( FMOD_ERR_CDDA_NODEVICES ) -FMOD_ERROR( FMOD_ERR_CDDA_NODISC ) -FMOD_ERROR( FMOD_ERR_CDDA_READ ) -FMOD_ERROR( FMOD_ERR_CHANNEL_ALLOC ) -FMOD_ERROR( FMOD_ERR_CHANNEL_STOLEN ) -FMOD_ERROR( FMOD_ERR_COM ) -FMOD_ERROR( FMOD_ERR_DMA ) -FMOD_ERROR( FMOD_ERR_DSP_CONNECTION ) -FMOD_ERROR( FMOD_ERR_DSP_FORMAT ) -FMOD_ERROR( FMOD_ERR_DSP_NOTFOUND ) -FMOD_ERROR( FMOD_ERR_DSP_RUNNING ) -FMOD_ERROR( FMOD_ERR_DSP_TOOMANYCONNECTIONS ) -FMOD_ERROR( FMOD_ERR_FILE_BAD ) -FMOD_ERROR( FMOD_ERR_FILE_COULDNOTSEEK ) -FMOD_ERROR( FMOD_ERR_FILE_DISKEJECTED ) -FMOD_ERROR( FMOD_ERR_FILE_EOF ) -FMOD_ERROR( FMOD_ERR_FILE_NOTFOUND ) -FMOD_ERROR( FMOD_ERR_FILE_UNWANTED ) -FMOD_ERROR( FMOD_ERR_FORMAT ) -FMOD_ERROR( FMOD_ERR_HTTP ) -FMOD_ERROR( FMOD_ERR_HTTP_ACCESS ) -FMOD_ERROR( FMOD_ERR_HTTP_PROXY_AUTH ) -FMOD_ERROR( FMOD_ERR_HTTP_SERVER_ERROR ) -FMOD_ERROR( FMOD_ERR_HTTP_TIMEOUT ) -FMOD_ERROR( FMOD_ERR_INITIALIZATION ) -FMOD_ERROR( FMOD_ERR_INITIALIZED ) -FMOD_ERROR( FMOD_ERR_INTERNAL ) -FMOD_ERROR( FMOD_ERR_INVALID_ADDRESS ) -FMOD_ERROR( FMOD_ERR_INVALID_FLOAT ) -FMOD_ERROR( FMOD_ERR_INVALID_HANDLE ) -FMOD_ERROR( FMOD_ERR_INVALID_PARAM ) -FMOD_ERROR( FMOD_ERR_INVALID_POSITION ) -FMOD_ERROR( FMOD_ERR_INVALID_SPEAKER ) -FMOD_ERROR( FMOD_ERR_INVALID_SYNCPOINT ) -FMOD_ERROR( FMOD_ERR_INVALID_VECTOR ) -FMOD_ERROR( FMOD_ERR_MAXAUDIBLE ) -FMOD_ERROR( FMOD_ERR_MEMORY ) -FMOD_ERROR( FMOD_ERR_MEMORY_CANTPOINT ) -FMOD_ERROR( FMOD_ERR_MEMORY_SRAM ) -FMOD_ERROR( FMOD_ERR_NEEDS2D ) -FMOD_ERROR( FMOD_ERR_NEEDS3D ) -FMOD_ERROR( FMOD_ERR_NEEDSHARDWARE ) -FMOD_ERROR( FMOD_ERR_NEEDSSOFTWARE ) -FMOD_ERROR( FMOD_ERR_NET_CONNECT ) -FMOD_ERROR( FMOD_ERR_NET_SOCKET_ERROR ) -FMOD_ERROR( FMOD_ERR_NET_URL ) -FMOD_ERROR( FMOD_ERR_NET_WOULD_BLOCK ) -FMOD_ERROR( FMOD_ERR_NOTREADY ) -FMOD_ERROR( FMOD_ERR_OUTPUT_ALLOCATED ) -FMOD_ERROR( FMOD_ERR_OUTPUT_CREATEBUFFER ) -FMOD_ERROR( FMOD_ERR_OUTPUT_DRIVERCALL ) -FMOD_ERROR( FMOD_ERR_OUTPUT_ENUMERATION ) -FMOD_ERROR( FMOD_ERR_OUTPUT_FORMAT ) -FMOD_ERROR( FMOD_ERR_OUTPUT_INIT ) -FMOD_ERROR( FMOD_ERR_OUTPUT_NOHARDWARE ) -FMOD_ERROR( FMOD_ERR_OUTPUT_NOSOFTWARE ) -FMOD_ERROR( FMOD_ERR_PAN ) -FMOD_ERROR( FMOD_ERR_PLUGIN ) -FMOD_ERROR( FMOD_ERR_PLUGIN_INSTANCES ) -FMOD_ERROR( FMOD_ERR_PLUGIN_MISSING ) -FMOD_ERROR( FMOD_ERR_PLUGIN_RESOURCE ) -FMOD_ERROR( FMOD_ERR_RECORD ) -FMOD_ERROR( FMOD_ERR_REVERB_INSTANCE ) -FMOD_ERROR( FMOD_ERR_SUBSOUND_ALLOCATED ) -FMOD_ERROR( FMOD_ERR_SUBSOUND_CANTMOVE ) -FMOD_ERROR( FMOD_ERR_SUBSOUND_MODE ) -FMOD_ERROR( FMOD_ERR_SUBSOUNDS ) -FMOD_ERROR( FMOD_ERR_TAGNOTFOUND ) -FMOD_ERROR( FMOD_ERR_TOOMANYCHANNELS ) -FMOD_ERROR( FMOD_ERR_UNIMPLEMENTED ) -FMOD_ERROR( FMOD_ERR_UNINITIALIZED ) -FMOD_ERROR( FMOD_ERR_UNSUPPORTED ) -FMOD_ERROR( FMOD_ERR_UPDATE ) -FMOD_ERROR( FMOD_ERR_VERSION ) -FMOD_ERROR( FMOD_ERR_PRELOADED ) -FMOD_ERROR( FMOD_ERR_EVENT_FAILED ) -FMOD_ERROR( FMOD_ERR_EVENT_INFOONLY ) -FMOD_ERROR( FMOD_ERR_EVENT_INTERNAL ) -FMOD_ERROR( FMOD_ERR_EVENT_MAXSTREAMS ) -FMOD_ERROR( FMOD_ERR_EVENT_MISMATCH ) -FMOD_ERROR( FMOD_ERR_EVENT_NAMECONFLICT ) -FMOD_ERROR( FMOD_ERR_EVENT_NOTFOUND ) -FMOD_ERROR( FMOD_ERR_EVENT_NEEDSSIMPLE ) -FMOD_ERROR( FMOD_ERR_EVENT_GUIDCONFLICT ) -FMOD_ERROR( FMOD_ERR_EVENT_ALREADY_LOADED ) -FMOD_ERROR( FMOD_ERR_MUSIC_UNINITIALIZED ) diff --git a/Engine/source/sfx/fmod/fmodFunctions.h b/Engine/source/sfx/fmod/fmodFunctions.h deleted file mode 100644 index f01e79ccb..000000000 --- a/Engine/source/sfx/fmod/fmodFunctions.h +++ /dev/null @@ -1,157 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -// Xcode has problems properly detecting the dependencies for this file. -// If you change something here, manually recompile all the FMOD modules. - - -// FMOD Ex API: - -FMOD_FUNCTION( FMOD_Channel_GetPaused, (FMOD_CHANNEL *channel, FMOD_BOOL *paused)) -FMOD_FUNCTION( FMOD_Channel_SetPaused, (FMOD_CHANNEL *channel, FMOD_BOOL paused)); -FMOD_FUNCTION( FMOD_Channel_IsPlaying, (FMOD_CHANNEL *channel, FMOD_BOOL *isplaying)) -FMOD_FUNCTION( FMOD_Channel_Set3DAttributes, (FMOD_CHANNEL *channel, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel)) -FMOD_FUNCTION( FMOD_Channel_SetFrequency, (FMOD_CHANNEL *channel, float frequency)) -FMOD_FUNCTION( FMOD_Channel_SetLoopCount, (FMOD_CHANNEL *channel, int loopcount)) -FMOD_FUNCTION( FMOD_Channel_SetPosition, (FMOD_CHANNEL *channel, unsigned int position, FMOD_TIMEUNIT postype)) -FMOD_FUNCTION( FMOD_Channel_GetPosition, (FMOD_CHANNEL* channel, unsigned int* position, FMOD_TIMEUNIT postype)) -FMOD_FUNCTION( FMOD_Channel_SetVolume, (FMOD_CHANNEL *channel, float volume)) -FMOD_FUNCTION( FMOD_Channel_GetVolume, (FMOD_CHANNEL *channel, float *volume)) -FMOD_FUNCTION( FMOD_Channel_Stop, (FMOD_CHANNEL *channel)) -FMOD_FUNCTION( FMOD_Channel_SetMode, (FMOD_CHANNEL *channel, FMOD_MODE mode)) -FMOD_FUNCTION( FMOD_Channel_Set3DMinMaxDistance, (FMOD_CHANNEL *channel, float mindistance, float maxdistance)); -FMOD_FUNCTION( FMOD_Channel_Set3DConeSettings, (FMOD_CHANNEL *channel, float insideconeangle, float outsideconeangle, float outsidevolume)) -FMOD_FUNCTION( FMOD_Channel_Set3DConeOrientation, (FMOD_CHANNEL *channel, FMOD_VECTOR *orientation)) -FMOD_FUNCTION( FMOD_Channel_SetReverbProperties, ( FMOD_CHANNEL* channel, const FMOD_REVERB_CHANNELPROPERTIES* prop ) ) -FMOD_FUNCTION( FMOD_Channel_SetPriority, ( FMOD_CHANNEL* channel, int priority ) ) -FMOD_FUNCTION( FMOD_Channel_IsVirtual, ( FMOD_CHANNEL* channel, FMOD_BOOL* isvirtual ) ) -FMOD_FUNCTION( FMOD_Channel_AddDSP, ( FMOD_CHANNEL* channel, FMOD_DSP* dsp, FMOD_DSPCONNECTION** connection ) ) - -FMOD_FUNCTION( FMOD_Sound_Lock, (FMOD_SOUND *sound, unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2)) -FMOD_FUNCTION( FMOD_Sound_Unlock, (FMOD_SOUND *sound, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2)) -FMOD_FUNCTION( FMOD_Sound_Release, (FMOD_SOUND *sound)) -FMOD_FUNCTION( FMOD_Sound_Set3DMinMaxDistance, (FMOD_SOUND *sound, float min, float max)) -FMOD_FUNCTION( FMOD_Sound_SetMode, (FMOD_SOUND *sound, FMOD_MODE mode)) -FMOD_FUNCTION( FMOD_Sound_GetMode, (FMOD_SOUND *sound, FMOD_MODE *mode)) -FMOD_FUNCTION( FMOD_Sound_SetLoopCount, (FMOD_SOUND *sound, int loopcount)) -FMOD_FUNCTION( FMOD_Sound_GetFormat, ( FMOD_SOUND* sound, FMOD_SOUND_TYPE* type, FMOD_SOUND_FORMAT* format, int* channels, int* bits ) ) -FMOD_FUNCTION( FMOD_Sound_GetLength, ( FMOD_SOUND* sound, unsigned int* length, FMOD_TIMEUNIT lengthtype ) ) -FMOD_FUNCTION( FMOD_Sound_GetDefaults, ( FMOD_SOUND* sound, float* frequency, float* volume, float* pan, int* priority ) ) -FMOD_FUNCTION( FMOD_Sound_GetMemoryInfo, ( FMOD_SOUND* sound, unsigned int memorybits, unsigned int event_memorybits, unsigned int* memoryused, unsigned int* memoryused_array ) ); - -FMOD_FUNCTION( FMOD_Geometry_AddPolygon, ( FMOD_GEOMETRY* geometry, float directocclusion, float reverbocclusion, FMOD_BOOL doublesided, int numvertices, const FMOD_VECTOR* vertices, int* polygonindex ) ) -FMOD_FUNCTION( FMOD_Geometry_SetPosition, ( FMOD_GEOMETRY* geometry, const FMOD_VECTOR* position ) ) -FMOD_FUNCTION( FMOD_Geometry_SetRotation, ( FMOD_GEOMETRY* geometry, const FMOD_VECTOR* forward, const FMOD_VECTOR* up ) ) -FMOD_FUNCTION( FMOD_Geometry_SetScale, ( FMOD_GEOMETRY* geometry, const FMOD_VECTOR* scale ) ) -FMOD_FUNCTION( FMOD_Geometry_Release, ( FMOD_GEOMETRY* geometry ) ) - -FMOD_FUNCTION( FMOD_DSP_GetInfo, ( FMOD_DSP* dsp, char* name, unsigned int* version, int* channels, int* configwidth, int* configheight ) ) -FMOD_FUNCTION( FMOD_DSP_Release, ( FMOD_DSP* dsp ) ) -FMOD_FUNCTION( FMOD_DSP_GetParameterInfo, ( FMOD_DSP* dsp, int index, char* name, char* label, char* description, int descriptionlen, float* min, float* max ) ) -FMOD_FUNCTION( FMOD_DSP_GetNumParameters, ( FMOD_DSP* dsp, int* numparams ) ) -FMOD_FUNCTION( FMOD_DSP_GetParameter, ( FMOD_DSP* dsp, int index, float* value, char* valuestr, int valuestrlen ) ) -FMOD_FUNCTION( FMOD_DSP_SetParameter, ( FMOD_DSP* dsp, int index, float value ) ) -FMOD_FUNCTION( FMOD_DSP_GetNumInputs, ( FMOD_DSP* dsp, int* numinputs ) ) -FMOD_FUNCTION( FMOD_DSP_GetNumOutputs, ( FMOD_DSP* dsp, int* numoutputs ) ) - -FMOD_FUNCTION( FMOD_System_Close, (FMOD_SYSTEM *system)) -FMOD_FUNCTION( FMOD_System_Create, (FMOD_SYSTEM **system)) -FMOD_FUNCTION( FMOD_System_Release, (FMOD_SYSTEM *system)) -FMOD_FUNCTION( FMOD_System_CreateSound, (FMOD_SYSTEM *system, const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, FMOD_SOUND **sound)) -FMOD_FUNCTION( FMOD_System_CreateGeometry, ( FMOD_SYSTEM* system, int maxpolygons, int maxvertices, FMOD_GEOMETRY** geometry ) ) -FMOD_FUNCTION( FMOD_System_SetDriver, (FMOD_SYSTEM *system, int driver)) -FMOD_FUNCTION( FMOD_System_GetDriverCaps, (FMOD_SYSTEM *system, int id, FMOD_CAPS *caps, int *controlpaneloutputrate, FMOD_SPEAKERMODE *controlpanelspeakermode)) -FMOD_FUNCTION( FMOD_System_GetDriverInfo, (FMOD_SYSTEM *system, int id, char *name, int namelen, FMOD_GUID *GUID)) -FMOD_FUNCTION( FMOD_System_GetNumDrivers, (FMOD_SYSTEM *system, int *numdrivers)) -FMOD_FUNCTION( FMOD_System_GetVersion, (FMOD_SYSTEM *system, unsigned int *version)) -FMOD_FUNCTION( FMOD_System_Init, (FMOD_SYSTEM *system, int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata)) -FMOD_FUNCTION( FMOD_System_PlaySound, (FMOD_SYSTEM *system, FMOD_CHANNELINDEX channelid, FMOD_SOUND *sound, FMOD_BOOL paused, FMOD_CHANNEL **channel)) -FMOD_FUNCTION( FMOD_System_Set3DListenerAttributes, (FMOD_SYSTEM *system, int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up)) -FMOD_FUNCTION( FMOD_System_Set3DNumListeners, ( FMOD_SYSTEM* system, int numlisteners ) ) -FMOD_FUNCTION( FMOD_System_SetGeometrySettings, ( FMOD_SYSTEM* system, float maxworldsize ) ) -FMOD_FUNCTION( FMOD_System_Get3DSettings, (FMOD_SYSTEM* system, float* dopplerFactor, float* distanceFactor, float* rolloffFactor)) -FMOD_FUNCTION( FMOD_System_Set3DSettings, (FMOD_SYSTEM *system, float dopplerscale, float distancefactor, float rolloffscale)) -FMOD_FUNCTION( FMOD_System_SetDSPBufferSize, (FMOD_SYSTEM *system, unsigned int bufferlength, int numbuffers)) -FMOD_FUNCTION( FMOD_System_SetSpeakerMode, (FMOD_SYSTEM *system, FMOD_SPEAKERMODE speakermode)) -FMOD_FUNCTION( FMOD_System_SetReverbProperties, ( FMOD_SYSTEM* system, const FMOD_REVERB_PROPERTIES* prop ) ) -FMOD_FUNCTION( FMOD_System_SetReverbAmbientProperties, ( FMOD_SYSTEM* system, FMOD_REVERB_PROPERTIES* prop ) ) -FMOD_FUNCTION( FMOD_System_Update, ( FMOD_SYSTEM *system ) ) -FMOD_FUNCTION( FMOD_System_CreateDSPByType, ( FMOD_SYSTEM* system, FMOD_DSP_TYPE type, FMOD_DSP** dsp ) ) -FMOD_FUNCTION( FMOD_System_AddDSP, ( FMOD_SYSTEM* system, FMOD_DSP* dsp, FMOD_DSPCONNECTION** connection ) ) -FMOD_FUNCTION( FMOD_System_GetMemoryInfo, ( FMOD_SYSTEM* system, unsigned int memorybits, unsigned int event_memorybits, unsigned int* memoryused, unsigned int* memoryused_array ) ) -FMOD_FUNCTION( FMOD_System_SetFileSystem, ( FMOD_SYSTEM* system, FMOD_FILE_OPENCALLBACK useropen, FMOD_FILE_CLOSECALLBACK userclose, FMOD_FILE_READCALLBACK userread, FMOD_FILE_SEEKCALLBACK userseek, int blockalign ) ) -FMOD_FUNCTION( FMOD_System_SetPluginPath, ( FMOD_SYSTEM* system, const char* path ) ) -FMOD_FUNCTION( FMOD_System_GetHardwareChannels, ( FMOD_SYSTEM* system, int* num2d, int* num3d, int* total ) ) - -FMOD_FUNCTION( FMOD_Memory_GetStats, ( int*, int* ) ) -FMOD_FUNCTION( FMOD_Memory_Initialize, ( void *poolmem, int poollen, FMOD_MEMORY_ALLOCCALLBACK useralloc, FMOD_MEMORY_REALLOCCALLBACK userrealloc, FMOD_MEMORY_FREECALLBACK userfree ) ) - -// FMOD Designer API: - -FMOD_EVENT_FUNCTION( FMOD_EventSystem_Create, ( FMOD_EVENTSYSTEM** eventsystem ) ) -FMOD_EVENT_FUNCTION( FMOD_EventSystem_GetSystemObject, ( FMOD_EVENTSYSTEM* eventsystem, FMOD_SYSTEM** system ) ) -FMOD_EVENT_FUNCTION( FMOD_EventSystem_GetVersion, ( FMOD_EVENTSYSTEM* eventsystem, unsigned int* version ) ) -FMOD_EVENT_FUNCTION( FMOD_EventSystem_Init, ( FMOD_EVENTSYSTEM* eventsystem, int maxchannels, FMOD_INITFLAGS flags, void* extradriverdata, FMOD_EVENT_INITFLAGS eventflags ) ) -FMOD_EVENT_FUNCTION( FMOD_EventSystem_Release, ( FMOD_EVENTSYSTEM* eventsystem ) ) -FMOD_EVENT_FUNCTION( FMOD_EventSystem_Load, ( FMOD_EVENTSYSTEM* eventsystem, const char* name_or_data, FMOD_EVENT_LOADINFO* loadinfo, FMOD_EVENTPROJECT** project ) ) -FMOD_EVENT_FUNCTION( FMOD_EventSystem_Update, ( FMOD_EVENTSYSTEM* eventsystem ) ) -FMOD_EVENT_FUNCTION( FMOD_EventSystem_GetMemoryInfo, ( FMOD_EVENTSYSTEM* eventsystem, unsigned int memorybits, unsigned int event_memorybits, unsigned int* memoryused, unsigned int* memoryused_array ) ) -FMOD_EVENT_FUNCTION( FMOD_EventSystem_SetMediaPath, ( FMOD_EVENTSYSTEM* eventsystem, const char* path ) ) - -FMOD_EVENT_FUNCTION( FMOD_EventProject_Release, ( FMOD_EVENTPROJECT* eventproject ) ) -FMOD_EVENT_FUNCTION( FMOD_EventProject_GetInfo, ( FMOD_EVENTPROJECT* eventproject, FMOD_EVENT_PROJECTINFO* info ) ) -FMOD_EVENT_FUNCTION( FMOD_EventProject_GetNumEvents, ( FMOD_EVENTPROJECT* eventproject, int* numevents ) ) -FMOD_EVENT_FUNCTION( FMOD_EventProject_GetNumGroups, ( FMOD_EVENTPROJECT* eventproject, int* numgroups ) ) -FMOD_EVENT_FUNCTION( FMOD_EventProject_GetGroupByIndex, ( FMOD_EVENTPROJECT* eventproject, int index, FMOD_BOOL cacheevents, FMOD_EVENTGROUP** group ) ) -FMOD_EVENT_FUNCTION( FMOD_EventProject_GetGroup, ( FMOD_EVENTPROJECT* eventproject, const char* name, FMOD_BOOL cacheevents, FMOD_EVENTGROUP** group ) ) - -FMOD_EVENT_FUNCTION( FMOD_EventGroup_GetInfo, ( FMOD_EVENTGROUP* eventgroup, int* index, char** name ) ) -FMOD_EVENT_FUNCTION( FMOD_EventGroup_LoadEventData, ( FMOD_EVENTGROUP* eventgroup, FMOD_EVENT_RESOURCE resource, FMOD_EVENT_MODE mode ) ) -FMOD_EVENT_FUNCTION( FMOD_EventGroup_FreeEventData, ( FMOD_EVENTGROUP* eventgroup, FMOD_EVENT* event, FMOD_BOOL waituntilready ) ) -FMOD_EVENT_FUNCTION( FMOD_EventGroup_GetNumEvents, ( FMOD_EVENTGROUP* eventgroup, int* numevents ) ) -FMOD_EVENT_FUNCTION( FMOD_EventGroup_GetNumGroups, ( FMOD_EVENTGROUP* eventgroup, int* numgroups ) ) -FMOD_EVENT_FUNCTION( FMOD_EventGroup_GetEventByIndex, ( FMOD_EVENTGROUP* eventgroup, int index, FMOD_EVENT_MODE mode, FMOD_EVENT** event ) ) -FMOD_EVENT_FUNCTION( FMOD_EventGroup_GetEvent, ( FMOD_EVENTGROUP* eventgroup, const char* name, FMOD_EVENT_MODE mode, FMOD_EVENT** event ) ) -FMOD_EVENT_FUNCTION( FMOD_EventGroup_GetGroupByIndex, ( FMOD_EVENTGROUP* eventgroup, int index, FMOD_BOOL cacheevents, FMOD_EVENTGROUP** group ) ) -FMOD_EVENT_FUNCTION( FMOD_EventGroup_GetGroup, ( FMOD_EVENTGROUP* eventgroup, const char* name, FMOD_BOOL cacheevents, FMOD_EVENTGROUP** group ) ) - -FMOD_EVENT_FUNCTION( FMOD_Event_GetInfo, ( FMOD_EVENT* event, int* index, char** name, FMOD_EVENT_INFO* info ) ) -FMOD_EVENT_FUNCTION( FMOD_Event_Release, ( FMOD_EVENT* event, FMOD_BOOL freeeventdata, FMOD_BOOL waituntilready ) ) -FMOD_EVENT_FUNCTION( FMOD_Event_Start, ( FMOD_EVENT* event ) ) -FMOD_EVENT_FUNCTION( FMOD_Event_Stop, ( FMOD_EVENT* event, FMOD_BOOL immediate ) ) -FMOD_EVENT_FUNCTION( FMOD_Event_SetPaused, ( FMOD_EVENT* event, FMOD_BOOL paused ) ) -FMOD_EVENT_FUNCTION( FMOD_Event_SetVolume, ( FMOD_EVENT* event, float volume ) ) -FMOD_EVENT_FUNCTION( FMOD_Event_SetPitch, ( FMOD_EVENT* event, float pitch, FMOD_EVENT_PITCHUNITS units ) ) -FMOD_EVENT_FUNCTION( FMOD_Event_Set3DAttributes, ( FMOD_EVENT* event, const FMOD_VECTOR* position, const FMOD_VECTOR* velocity, const FMOD_VECTOR* orientation ) ) -FMOD_EVENT_FUNCTION( FMOD_Event_GetState, ( FMOD_EVENT* event, FMOD_EVENT_STATE* state ) ) -FMOD_EVENT_FUNCTION( FMOD_Event_GetNumParameters, ( FMOD_EVENT* event, int* numparameters ) ) -FMOD_EVENT_FUNCTION( FMOD_Event_GetParameter, ( FMOD_EVENT* event, const char* name, FMOD_EVENTPARAMETER** parameter ) ) -FMOD_EVENT_FUNCTION( FMOD_Event_GetParameterByIndex, ( FMOD_EVENT* event, int index, FMOD_EVENTPARAMETER** parameter ) ) -FMOD_EVENT_FUNCTION( FMOD_Event_GetPropertyByIndex, ( FMOD_EVENT* event, int propertyidex, void* value, FMOD_BOOL this_instance ) ) -FMOD_EVENT_FUNCTION( FMOD_Event_SetPropertyByIndex, ( FMOD_EVENT* event, int propertyidex, void* value, FMOD_BOOL this_instance ) ) -FMOD_EVENT_FUNCTION( FMOD_Event_GetProperty, ( FMOD_EVENT* event, const char* propertyname, void* value, FMOD_BOOL this_instance ) ) -FMOD_EVENT_FUNCTION( FMOD_Event_GetPropertyInfo, ( FMOD_EVENT* event, int* propertyindex, char** propertyname, FMOD_EVENTPROPERTY_TYPE* type ) ) - -FMOD_EVENT_FUNCTION( FMOD_EventParameter_GetInfo, ( FMOD_EVENTPARAMETER* eventparameter, int* index, char** name ) ) -FMOD_EVENT_FUNCTION( FMOD_EventParameter_GetValue, ( FMOD_EVENTPARAMETER* eventparameter, float* value ) ) -FMOD_EVENT_FUNCTION( FMOD_EventParameter_SetValue, ( FMOD_EVENTPARAMETER* eventparameter, float value ) ) -FMOD_EVENT_FUNCTION( FMOD_EventParameter_GetRange, ( FMOD_EVENTPARAMETER* eventparameter, float* rangemin, float* rangemax ) ) \ No newline at end of file diff --git a/Engine/source/sfx/fmod/sfxFMODBuffer.cpp b/Engine/source/sfx/fmod/sfxFMODBuffer.cpp deleted file mode 100644 index 07cbb8a0f..000000000 --- a/Engine/source/sfx/fmod/sfxFMODBuffer.cpp +++ /dev/null @@ -1,322 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#include "sfx/fmod/sfxFMODBuffer.h" -#include "sfx/fmod/sfxFMODDevice.h" -#include "sfx/sfxDescription.h" -#include "core/util/safeDelete.h" -#include "core/volume.h" - - -//----------------------------------------------------------------------------- - -static const char* sExtensions[] = -{ - "", // First try without doing anything with the given path. - "", // Then try it without an extension but by expanding it through Torque::FS. - "aiff", - "asf", - "asx", - "dls", - "flac", - "fsb", - "it", - "m3u", - "mid", - "mod", - "mp2", - "mp3", - "ogg", - "pls", - "s3m", - "vag", - "wav", - "wax", - "wma", - "xm", - -#ifdef TORQUE_OS_XENON - ".xma", -#endif - - NULL -}; - -//----------------------------------------------------------------------------- - -SFXFMODBuffer* SFXFMODBuffer::create( const ThreadSafeRef< SFXStream >& stream, SFXDescription* description ) -{ - SFXFMODBuffer *buffer = new SFXFMODBuffer( stream, description ); - if( !buffer->mSound ) - SAFE_DELETE( buffer ); - - return buffer; -} - -//----------------------------------------------------------------------------- - -SFXFMODBuffer* SFXFMODBuffer::create( const String& filename, SFXDescription* description ) -{ - if( Con::getBoolVariable( "$pref::SFX::FMOD::noCustomFileLoading", false ) ) - return NULL; - - SFXFMODBuffer *buffer = new SFXFMODBuffer( filename, description ); - if( !buffer->mSound ) - SAFE_DELETE( buffer ); - - return buffer; -} - -//----------------------------------------------------------------------------- - -SFXFMODBuffer::SFXFMODBuffer( const String& filename, SFXDescription* description ) - : Parent( description ), - mSound( NULL ) -{ - FMOD_MODE fMode = ( description->mUseHardware ? FMOD_HARDWARE : FMOD_SOFTWARE ) - | ( description->mIs3D ? FMOD_3D : FMOD_2D ); - - if( description->mIsStreaming ) - { - fMode |= FMOD_CREATESTREAM; - mIsUnique = true; - } - - // Go through the extensions and try each with the given path. The - // first two are special. First we try without touching the filename at all - // so FMOD gets a chance to handle URLs and whatever, and then second we - // try by expanding the path but without adding an extension. - - Torque::Path path = filename; - for( U32 i = 0; sExtensions[ i ]; ++ i ) - { - path.setExtension( sExtensions[ i ] ); - - if( !i || Torque::FS::IsFile( path ) ) - { - // Translate to full path. - //TODO: Remove this when hooking up the file system functions in sfxFMODDevice.cpp - - String fullPath; - if( !i ) - fullPath = filename; - else - { - Torque::Path realPath; - if( !Torque::FS::GetFSPath( path, realPath ) ) - continue; - - fullPath = realPath.getFullPath().c_str(); - } - - mSound = NULL; - FMOD_RESULT result = SFXFMODDevice::smFunc->FMOD_System_CreateSound( - SFXFMODDevice::smSystem, - fullPath.c_str(), - fMode, - ( FMOD_CREATESOUNDEXINFO* ) NULL, - &mSound ); - - if( result == FMOD_OK ) - { - SFXFMODDevice::smFunc->FMOD_Sound_GetMode( mSound, &mMode ); - - // Read out format. - - int numChannels; - int bitsPerSample; - unsigned int length; - float frequency; - - SFXFMODDevice::smFunc->FMOD_Sound_GetFormat( mSound, ( FMOD_SOUND_TYPE* ) NULL, ( FMOD_SOUND_FORMAT* ) NULL, &numChannels, &bitsPerSample ); - SFXFMODDevice::smFunc->FMOD_Sound_GetLength( mSound, &length, FMOD_TIMEUNIT_MS ); - SFXFMODDevice::smFunc->FMOD_Sound_GetDefaults( mSound, &frequency, ( float* ) NULL, ( float* ) NULL, ( int* ) NULL ); - - mDuration = length; - mFormat = SFXFormat( numChannels, numChannels * bitsPerSample, frequency ); - - break; - } - } - } - - if( !mSound ) - Con::errorf( "SFXFMODBuffer::SFXFMODBuffer - failed to load '%s' through FMOD", filename.c_str() ); -} - -//----------------------------------------------------------------------------- - -SFXFMODBuffer::SFXFMODBuffer( const ThreadSafeRef< SFXStream >& stream, SFXDescription* description ) - : Parent( stream, description ), - mSound( NULL ) -{ - FMOD_MODE fMode = ( description->mUseHardware ? FMOD_HARDWARE : FMOD_SOFTWARE ) - | ( description->mIs3D ? FMOD_3D : FMOD_2D ); - - FMOD_CREATESOUNDEXINFO* pCreatesoundexinfo = NULL; - FMOD_CREATESOUNDEXINFO createsoundexinfo; - - fMode |= FMOD_OPENUSER; // this tells fmod we are supplying the data directly - if( isStreaming() ) - fMode |= FMOD_LOOP_NORMAL | FMOD_UNIQUE; - - const SFXFormat& format = getFormat(); - U32 channels = format.getChannels(); - U32 frequency = format.getSamplesPerSecond(); - U32 bitsPerChannel = format.getBitsPerSample() / channels; - U32 dataSize = mBufferSize; - - FMOD_SOUND_FORMAT sfxFmt = FMOD_SOUND_FORMAT_NONE; - switch(bitsPerChannel) - { - case 8: - sfxFmt = FMOD_SOUND_FORMAT_PCM8; - break; - case 16: - sfxFmt = FMOD_SOUND_FORMAT_PCM16; - break; - case 24: - sfxFmt = FMOD_SOUND_FORMAT_PCM24; - break; - case 32: - sfxFmt = FMOD_SOUND_FORMAT_PCM32; - break; - default: - AssertISV(false, "SFXFMODBuffer::SFXFMODBuffer() - unsupported bits-per-sample (what format is it in, 15bit PCM?)"); - break; - } - - dMemset(&createsoundexinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - createsoundexinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); /* required. */ - createsoundexinfo.decodebuffersize = frequency; /* Chunk size of stream update in samples. This will be the amount of data passed to the user callback. */ - createsoundexinfo.length = dataSize; /* Length of PCM data in bytes of whole sound (for Sound::getLength) */ - createsoundexinfo.numchannels = channels; /* Number of channels in the sound. */ - createsoundexinfo.defaultfrequency = frequency; /* Default playback rate of sound. */ - createsoundexinfo.format = sfxFmt; /* Data format of sound. */ - createsoundexinfo.pcmreadcallback = NULL; /* User callback for reading. */ - createsoundexinfo.pcmsetposcallback = NULL; /* User callback for seeking. */ - pCreatesoundexinfo = &createsoundexinfo; - - FMOD_RESULT result = SFXFMODDevice::smFunc->FMOD_System_CreateSound( - SFXFMODDevice::smSystem, - ( const char* ) NULL, - fMode, - pCreatesoundexinfo, - &mSound ); - - if( result != FMOD_OK ) - { - mSound = NULL; - Con::errorf( "SFXFMODBuffer::SFXFMODBuffer - failed to create buffer (%i)", result ); - } - else - SFXFMODDevice::smFunc->FMOD_Sound_GetMode( mSound, &mMode ); -} - -//----------------------------------------------------------------------------- - -SFXFMODBuffer::~SFXFMODBuffer() -{ - if( mSound ) - FModAssert( SFXFMODDevice::smFunc->FMOD_Sound_Release( mSound ), - "SFXFMODBuffer::~SFXFMODBuffer - Failed to release a sound!" ); - - mSound = NULL; -} - -//----------------------------------------------------------------------------- - -void SFXFMODBuffer::_flush() -{ - AssertFatal( isStreaming(), "SFXFMODBuffer::_flush() - not a streaming buffer" ); - AssertFatal( SFXInternal::isSFXThread(), "SFXFMODBuffer::_flush() - not on SFX thread" ); - - Parent::_flush(); - SFXFMODDevice::smFunc->FMOD_Channel_SetPosition - ( ( ( SFXFMODVoice* ) mUniqueVoice.getPointer() )->mChannel, 0, FMOD_TIMEUNIT_PCM ); -} - -//----------------------------------------------------------------------------- - -bool SFXFMODBuffer::_copyData( U32 offset, const U8* data, U32 length ) -{ - AssertFatal( data != NULL && length > 0, "Must have data!" ); - - // Fill the buffer with the resource data. - void* lpvWrite; - U32 dwLength; - void* lpvWrite2; - U32 dwLength2; - int res = SFXFMODDevice::smFunc->FMOD_Sound_Lock( - mSound, - offset, // Offset at which to start lock. - length, // Size of lock. - &lpvWrite, // Gets address of first part of lock. - &lpvWrite2, // Address of wraparound not needed. - &dwLength, // Gets size of first part of lock. - &dwLength2 // Size of wraparound not needed. - ); - - if ( res != FMOD_OK ) - { - // You can remove this if it gets spammy. However since we can - // safely fail in this case it doesn't seem right to assert... - // at the same time it can be very annoying not to know why - // an upload fails! - Con::errorf("SFXFMODBuffer::_copyData - failed to lock a sound buffer! (%d)", this); - return false; - } - - // Copy the first part. - dMemcpy( lpvWrite, data, dwLength ); - - // Do we have a wrap? - if ( lpvWrite2 ) - dMemcpy( lpvWrite2, data + dwLength, dwLength2 ); - - // And finally, unlock. - FModAssert( SFXFMODDevice::smFunc->FMOD_Sound_Unlock( - mSound, - lpvWrite, // Address of lock start. - lpvWrite2, // No wraparound portion. - dwLength, // Size of lock. - dwLength2 ), // No wraparound size. - "Failed to unlock sound buffer!" ); - - return true; -} - -//----------------------------------------------------------------------------- - -U32 SFXFMODBuffer::getMemoryUsed() const -{ - unsigned int memoryUsed; - - SFXFMODDevice::smFunc->FMOD_Sound_GetMemoryInfo( - mSound, - FMOD_MEMBITS_ALL, - FMOD_EVENT_MEMBITS_ALL, - &memoryUsed, - ( unsigned int* ) NULL ); - - return memoryUsed; -} diff --git a/Engine/source/sfx/fmod/sfxFMODBuffer.h b/Engine/source/sfx/fmod/sfxFMODBuffer.h deleted file mode 100644 index 1ce76ecb5..000000000 --- a/Engine/source/sfx/fmod/sfxFMODBuffer.h +++ /dev/null @@ -1,63 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#ifndef _SFXFMODBUFFER_H_ -#define _SFXFMODBUFFER_H_ - -#include "fmod.h" - -#ifndef _SFXINTERNAL_H_ -# include "sfx/sfxInternal.h" -#endif - - -class SFXFMODBuffer : public SFXInternal::SFXWrapAroundBuffer -{ - typedef SFXInternal::SFXWrapAroundBuffer Parent; - - friend class SFXFMODDevice; - friend class SFXFMODVoice; - - protected: - - FMOD_SOUND *mSound; - FMOD_MODE mMode; - - SFXFMODBuffer( const ThreadSafeRef< SFXStream >& stream, SFXDescription* description ); - SFXFMODBuffer( const String& filename, SFXDescription* description ); - - // SFXWrapAroundBuffer. - virtual bool _copyData( U32 offset, const U8* data, U32 length ); - virtual void _flush(); - - virtual ~SFXFMODBuffer(); - - public: - - /// - static SFXFMODBuffer* create( const ThreadSafeRef< SFXStream >& stream, SFXDescription* description ); - static SFXFMODBuffer* create( const String& filename, SFXDescription* description ); - - virtual U32 getMemoryUsed() const; -}; - -#endif // _SFXFMODBUFFER_H_ \ No newline at end of file diff --git a/Engine/source/sfx/fmod/sfxFMODDevice.cpp b/Engine/source/sfx/fmod/sfxFMODDevice.cpp deleted file mode 100644 index 7875abf67..000000000 --- a/Engine/source/sfx/fmod/sfxFMODDevice.cpp +++ /dev/null @@ -1,578 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#include "platform/platform.h" -#include "platform/threads/mutex.h" -#include "sfx/fmod/sfxFMODDevice.h" -#include "sfx/fmod/sfxFMODBuffer.h" -#include "sfx/sfxSystem.h" -#include "platform/async/asyncUpdate.h" -#include "console/consoleTypes.h" -#include "core/volume.h" - - -bool SFXFMODDevice::smPrefDisableSoftware = false; -bool SFXFMODDevice::smPrefUseSoftwareOcclusion = true; -bool SFXFMODDevice::smPrefUseSoftwareHRTF = true; -bool SFXFMODDevice::smPrefEnableProfile = false; -bool SFXFMODDevice::smPrefGeometryUseClosest = false; -const char* SFXFMODDevice::smPrefDSoundHRTF = "full"; -const char* SFXFMODDevice::smPrefPluginPath = ""; -U32 SFXFMODDevice::smStatMemUsageCore; -U32 SFXFMODDevice::smStatMemUsageEvents; -U32 SFXFMODDevice::smStatNumEventSources; -SFXFMODDevice* SFXFMODDevice::smInstance; -FMOD_SYSTEM* SFXFMODDevice::smSystem; -FMOD_EVENTSYSTEM* SFXFMODDevice::smEventSystem; -FModFNTable* SFXFMODDevice::smFunc; -Mutex* FModFNTable::mutex; - - -//----------------------------------------------------------------------------- - -String FMODResultToString( FMOD_RESULT result ) -{ - switch( result ) - { - #define FMOD_ERROR( n ) case n: return #n; - #include "fmodErrors.h" - #undef FMOD_ERROR - - default: - break; - } - - return String(); -} - -//------------------------------------------------------------------------------ -// FMOD filesystem wrappers. -//FIXME: these are not thread-safe and cannot be used as such - -FMOD_RESULT F_CALLBACK fmodFileOpenCallback( const char* name, int unicode, unsigned int* filesize, void** handle, void** userdata ) -{ - String fileName; - if( unicode ) - fileName = String( ( UTF16* ) name ); - else - fileName = String( name ); - - Torque::FS::FileRef file = Torque::FS::OpenFile( fileName, Torque::FS::File::Read ); - if( !file ) - return FMOD_ERR_FILE_NOTFOUND; - else if( file->getStatus() != Torque::FS::File::Open ) - return FMOD_ERR_FILE_BAD; - - // Add a reference so we can pass it into FMOD. - file->incRefCount(); - - *filesize = U32( file->getSize() ); - *handle = file.getPointer(); - - return FMOD_OK; -} - -FMOD_RESULT F_CALLBACK fmodFileCloseCallback( void* handle, void* userdata ) -{ - Torque::FS::File* file = reinterpret_cast< Torque::FS::File* >( handle ); - file->decRefCount(); - return FMOD_OK; -} - -FMOD_RESULT F_CALLBACK fmodFileReadCallback( void* handle, void* buffer, unsigned int sizebytes, unsigned int* bytesread, void* userdata ) -{ - Torque::FS::File* file = reinterpret_cast< Torque::FS::File* >( handle ); - - U32 numRead = file->read( buffer, sizebytes ); - *bytesread = numRead; - - if( file->getStatus() == Torque::FS::File::EndOfFile ) - return FMOD_ERR_FILE_EOF; - else if( file->getStatus() != Torque::FS::File::Open ) - return FMOD_ERR_FILE_BAD; - - return FMOD_OK; -} - -FMOD_RESULT F_CALLBACK fmodFileSeekCallback( void* handle, unsigned int pos, void* userdata ) -{ - Torque::FS::File* file = reinterpret_cast< Torque::FS::File* >( handle ); - - if( file->setPosition( pos, Torque::FS::File::Begin ) != pos ) - return FMOD_ERR_FILE_COULDNOTSEEK; - - return FMOD_OK; -} - -//----------------------------------------------------------------------------- - -SFXFMODDevice::SFXFMODDevice( SFXProvider* provider, - FModFNTable *fmodFnTbl, - int deviceIdx, - String name ) - : SFXDevice( name, provider, false, 32 ), - m3drolloffmode( FMOD_3D_INVERSEROLLOFF ), - mDeviceIndex( deviceIdx ) -{ - // Store off the function pointers for later use. - smFunc = fmodFnTbl; - - smStatMemUsageCore = 0; - smStatMemUsageEvents = 0; - smStatNumEventSources = 0; - - // Register our SFXSystem plugin. - - SFX->addPlugin( &mPlugin ); - - smInstance = this; -} - -//----------------------------------------------------------------------------- - -SFXFMODDevice::~SFXFMODDevice() -{ - _releaseAllResources(); - - SFX->removePlugin( &mPlugin ); - - if( smEventSystem ) - { - smFunc->FMOD_EventSystem_Release( smEventSystem ); - smEventSystem = NULL; - smSystem = NULL; - } - else - smFunc->FMOD_System_Close( smSystem ); - - smInstance = NULL; -} - -//----------------------------------------------------------------------------- - -bool SFXFMODDevice::_init() -{ - #define FMOD_CHECK( message ) \ - if( result != FMOD_OK ) \ - { \ - Con::errorf( "SFXFMODDevice::_init() - %s (%s)", \ - message, \ - FMOD_ErrorString( result ) ); \ - return false; \ - } - - AssertISV(smSystem, - "SFXFMODDevice::_init() - can't init w/o an existing FMOD system handle!"); - - FMOD_RESULT result; - - // Get some prefs. - - if( smPrefPluginPath && smPrefPluginPath[ 0 ] ) - { - char fullPath[ 4096 ]; - Platform::makeFullPathName( smPrefPluginPath, fullPath, sizeof( fullPath ) ); - - smFunc->FMOD_System_SetPluginPath( smSystem, fullPath ); - } - else - { - smFunc->FMOD_System_SetPluginPath( smSystem, Platform::getExecutablePath() ); - } - - // Initialize everything from fmod. - FMOD_SPEAKERMODE speakermode; - FMOD_CAPS caps; - result = smFunc->FMOD_System_GetDriverCaps(smSystem, 0, &caps, ( int* ) 0, &speakermode); - FMOD_CHECK( "SFXFMODDevice::init - Failed to get driver caps" ); - - result = smFunc->FMOD_System_SetDriver(smSystem, mDeviceIndex); - FMOD_CHECK( "SFXFMODDevice::init - Failed to set driver" ); - - result = smFunc->FMOD_System_SetSpeakerMode(smSystem, speakermode); - FMOD_CHECK( "SFXFMODDevice::init - Failed to set the user selected speaker mode" ); - - if (caps & FMOD_CAPS_HARDWARE_EMULATED) /* The user has the 'Acceleration' slider set to off! This is really bad for latency!. */ - { /* You might want to warn the user about this. */ - result = smFunc->FMOD_System_SetDSPBufferSize(smSystem, 1024, 10); - FMOD_CHECK( "SFXFMODDevice::init - Failed to set DSP buffer size" ); - } - - Con::printf( "\nFMOD Device caps:" ); - #define PRINT_CAP( name ) \ - if( caps & FMOD_CAPS_ ## name ) \ - Con::printf( #name ); - - PRINT_CAP( HARDWARE ); - PRINT_CAP( HARDWARE_EMULATED ); - PRINT_CAP( OUTPUT_MULTICHANNEL ); - PRINT_CAP( OUTPUT_FORMAT_PCM8 ); - PRINT_CAP( OUTPUT_FORMAT_PCM16 ); - PRINT_CAP( OUTPUT_FORMAT_PCM24 ); - PRINT_CAP( OUTPUT_FORMAT_PCM32 ); - PRINT_CAP( OUTPUT_FORMAT_PCMFLOAT ); - PRINT_CAP( REVERB_LIMITED ); - - Con::printf( "" ); - - bool tryAgain; - do - { - tryAgain = false; - - FMOD_INITFLAGS flags = FMOD_INIT_NORMAL | FMOD_INIT_VOL0_BECOMES_VIRTUAL; - - if( smPrefDisableSoftware ) - flags |= FMOD_INIT_SOFTWARE_DISABLE; - if( smPrefUseSoftwareOcclusion ) - flags |= FMOD_INIT_OCCLUSION_LOWPASS; - if( smPrefUseSoftwareHRTF ) - flags |= FMOD_INIT_HRTF_LOWPASS; - if( smPrefEnableProfile ) - flags |= FMOD_INIT_ENABLE_PROFILE; - if( smPrefGeometryUseClosest ) - flags |= FMOD_INIT_GEOMETRY_USECLOSEST; - - if( smEventSystem ) - result = smFunc->FMOD_EventSystem_Init( smEventSystem, 100, flags, ( void* ) 0, FMOD_EVENT_INIT_NORMAL ); - else - result = smFunc->FMOD_System_Init( smSystem, 100, flags, ( void* ) 0 ); - - if( result == FMOD_ERR_OUTPUT_CREATEBUFFER ) /* Ok, the speaker mode selected isn't supported by this soundcard. Switch it back to stereo... */ - { - result = smFunc->FMOD_System_SetSpeakerMode( smSystem, FMOD_SPEAKERMODE_STEREO ); - FMOD_CHECK( "SFXFMODDevice::init - failed on fallback speaker mode setup" ); - tryAgain = true; - } - } while( tryAgain ); - FMOD_CHECK( "SFXFMODDevice::init - failed to init system" ); - - // Print hardware channel info. - - if( caps & FMOD_CAPS_HARDWARE ) - { - int num3D, num2D, numTotal; - - if( smFunc->FMOD_System_GetHardwareChannels( smSystem, &num2D, &num3D, &numTotal ) == FMOD_OK ) - Con::printf( "FMOD Hardware channels: 2d=%i, 3d=%i, total=%i", num2D, num3D, numTotal ); - } - - // Set up filesystem. - - //FIXME: Don't do this for now. Crashes on Windows. - #if 0 - smFunc->FMOD_System_SetFileSystem( smSystem, fmodFileOpenCallback, fmodFileCloseCallback, fmodFileReadCallback, fmodFileSeekCallback, -1 ); - #endif - - // Set capabilities. - - mCaps = CAPS_Reverb | CAPS_VoiceManagement; - if( smEventSystem ) - mCaps |= CAPS_FMODDesigner; - - // Start the update thread. - - #ifndef TORQUE_DEDICATED // Avoid dependency on platform/async for Linx dedicated. - - if( !Con::getBoolVariable( "$_forceAllMainThread" ) ) - { - SFXInternal::gUpdateThread = new AsyncPeriodicUpdateThread - ( "FMOD Update Thread", SFXInternal::gBufferUpdateList, - Con::getIntVariable( "$pref::SFX::updateInterval", SFXInternal::DEFAULT_UPDATE_INTERVAL ) ); - SFXInternal::gUpdateThread->start(); - } - - #endif - - return true; -} - -//----------------------------------------------------------------------------- - -SFXBuffer* SFXFMODDevice::createBuffer( const ThreadSafeRef< SFXStream >& stream, SFXDescription* description ) -{ - AssertFatal( stream, "SFXFMODDevice::createBuffer() - Got a null stream!" ); - AssertFatal( description, "SFXFMODDevice::createBuffer() - Got null description!" ); - - SFXFMODBuffer *buffer = SFXFMODBuffer::create( stream, description ); - if ( buffer ) - _addBuffer( buffer ); - - return buffer; -} - -//----------------------------------------------------------------------------- - -SFXBuffer* SFXFMODDevice::createBuffer( const String& filename, SFXDescription* description ) -{ - AssertFatal( filename.isNotEmpty(), "SFXFMODDevice::createBuffer() - Got an empty filename!" ); - AssertFatal( description, "SFXFMODDevice::createBuffer() - Got null description!" ); - - SFXFMODBuffer* buffer = SFXFMODBuffer::create( filename, description ); - if( buffer ) - _addBuffer( buffer ); - - return buffer; -} - -//----------------------------------------------------------------------------- - -SFXVoice* SFXFMODDevice::createVoice( bool is3D, SFXBuffer* buffer ) -{ - AssertFatal( buffer, "SFXFMODDevice::createVoice() - Got null buffer!" ); - - SFXFMODBuffer* fmodBuffer = dynamic_cast( buffer ); - AssertFatal( fmodBuffer, "SFXFMODDevice::createVoice() - Got bad buffer!" ); - - SFXFMODVoice* voice = SFXFMODVoice::create( this, fmodBuffer ); - if ( !voice ) - return NULL; - - _addVoice( voice ); - return voice; -} - -//----------------------------------------------------------------------------- - -void SFXFMODDevice::update() -{ - Parent::update(); - - if( smEventSystem ) - { - FModAssert( smFunc->FMOD_EventSystem_Update( smEventSystem ), "Failed to update event system!" ); - } - else - { - FModAssert(smFunc->FMOD_System_Update(smSystem), "Failed to update system!"); - } -} - -//----------------------------------------------------------------------------- - -void SFXFMODDevice::setNumListeners( U32 num ) -{ - smFunc->FMOD_System_Set3DNumListeners( smSystem, num ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODDevice::setListener( U32 index, const SFXListenerProperties& listener ) -{ - FMOD_VECTOR position, forward, up, velocity; - - TorqueTransformToFMODVectors( listener.getTransform(), position, forward, up ); - TorqueVectorToFMODVector( listener.getVelocity(), velocity ); - - // Do the listener state update, then update! - smFunc->FMOD_System_Set3DListenerAttributes( smSystem, index, &position, &velocity, &forward, &up ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODDevice::setDistanceModel( SFXDistanceModel model ) -{ - switch( model ) - { - case SFXDistanceModelLinear: - m3drolloffmode = FMOD_3D_LINEARROLLOFF; - break; - - case SFXDistanceModelLogarithmic: - m3drolloffmode = FMOD_3D_INVERSEROLLOFF; - break; - - default: - AssertWarn( false, "SFXFMODDevice::setDistanceModel - model not implemented" ); - } -} - -//----------------------------------------------------------------------------- - -void SFXFMODDevice::setDopplerFactor( F32 factor ) -{ - F32 dopplerFactor; - F32 distanceFactor; - F32 rolloffFactor; - - smFunc->FMOD_System_Get3DSettings( smSystem, &dopplerFactor, &distanceFactor, &rolloffFactor ); - dopplerFactor = factor; - smFunc->FMOD_System_Set3DSettings( smSystem, dopplerFactor, distanceFactor, rolloffFactor ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODDevice::setRolloffFactor( F32 factor ) -{ - F32 dopplerFactor; - F32 distanceFactor; - F32 rolloffFactor; - - smFunc->FMOD_System_Get3DSettings( smSystem, &dopplerFactor, &distanceFactor, &rolloffFactor ); - rolloffFactor = factor; - smFunc->FMOD_System_Set3DSettings( smSystem, dopplerFactor, distanceFactor, rolloffFactor ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODDevice::setReverb( const SFXReverbProperties& reverb ) -{ - FMOD_REVERB_PROPERTIES prop = FMOD_PRESET_GENERIC; - - prop.Environment = 0; - prop.EnvDiffusion = reverb.mEnvDiffusion; - prop.Room = reverb.mRoom; - prop.RoomHF = reverb.mRoomHF; - prop.RoomLF = reverb.mRoomLF; - prop.DecayTime = reverb.mDecayTime; - prop.DecayLFRatio = reverb.mDecayLFRatio; - prop.DecayHFRatio = reverb.mDecayHFRatio; - prop.Reflections = reverb.mReflections; - prop.ReflectionsDelay = reverb.mReflectionsDelay; - prop.Reverb = reverb.mReverb; - prop.ReverbDelay = reverb.mReverbDelay; - prop.ModulationTime = reverb.mModulationTime; - prop.ModulationDepth = reverb.mModulationDepth; - prop.HFReference = reverb.mHFReference; - prop.LFReference = reverb.mLFReference; - prop.Diffusion = reverb.mDiffusion; - prop.Density = reverb.mDensity; - prop.Flags = reverb.mFlags; - - // Here we only want to affect 3D sounds. While not quite obvious from the docs, - // SetReverbProperties sets the global reverb environment for 2D sounds whereas - // SetAmbientReverbProperties sets the global reverb environment for 3D sounds. - - FMOD_RESULT result = smFunc->FMOD_System_SetReverbAmbientProperties( smSystem, &prop ); - if( result != FMOD_OK ) - Con::errorf( "SFXFMODDevice::setReverb - Failed to set reverb (%s)", FMODResultToString( result ).c_str() ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODDevice::resetReverb() -{ - FMOD_REVERB_PROPERTIES prop = FMOD_PRESET_OFF; - smFunc->FMOD_System_SetReverbProperties( smSystem, &prop ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODDevice::updateMemUsageStats() -{ - smFunc->FMOD_System_GetMemoryInfo( smSystem, ( unsigned int ) FMOD_MEMBITS_ALL, - ( unsigned int ) 0, ( unsigned int* ) &smStatMemUsageCore, ( unsigned int* ) 0 ); - - if( smEventSystem ) - smFunc->FMOD_EventSystem_GetMemoryInfo( smEventSystem, ( unsigned int ) 0, - ( unsigned int ) FMOD_EVENT_MEMBITS_ALL, ( unsigned int* ) &smStatMemUsageEvents, ( unsigned int* ) 0 ); -} - -//============================================================================= -// Console Functions. -//============================================================================= -// MARK: ---- Console Functions ---- - -//------------------------------------------------------------------------------ - -ConsoleFunction( fmodDumpDSPInfo, void, 1, 1, "()" - "@brief Dump information about the standard DSP effects.\n\n" - "@ingroup SFXFMOD") -{ - if( !SFXFMODDevice::smFunc ) - return; - - const U32 firstDSPType = FMOD_DSP_TYPE_MIXER; - const U32 lastDSPType = FMOD_DSP_TYPE_TREMOLO; - - for( U32 i = firstDSPType; i <= lastDSPType; ++ i ) - { - FMOD_DSP* dsp; - if( SFXFMODDevice::smFunc->FMOD_System_CreateDSPByType( SFXFMODDevice::smSystem, ( FMOD_DSP_TYPE ) i, &dsp ) == FMOD_OK ) - { - // Print general info. - - char name[ 33 ]; - unsigned int version; - int channels; - int numParameters; - - dMemset( name, 0, sizeof( name ) ); - SFXFMODDevice::smFunc->FMOD_DSP_GetInfo( dsp, name, &version, &channels, ( int* ) NULL, ( int* ) NULL ); - SFXFMODDevice::smFunc->FMOD_DSP_GetNumParameters( dsp, &numParameters ); - - Con::printf( "----------------------------------------------------------------" ); - Con::printf( "DSP: %s", name ); - Con::printf( "Version: %i.%i", ( version & 0xffff0000 ) >> 16, version & 0xffff ); - Con::printf( "Channels: %i", channels ); - Con::printf( "Parameters: %i", numParameters ); - Con::printf( "" ); - - // Print parameter info. - - for( U32 n = 0; n < numParameters; ++ n ) - { - char name[ 17 ]; - char label[ 17 ]; - char description[ 1024 ]; - float minValue, maxValue; - float value; - char valueString[ 256 ]; - - dMemset( name, 0, sizeof( name ) ); - dMemset( label, 0, sizeof( label ) ); - dMemset( description, 0, sizeof( description ) ); - dMemset( valueString, 0, sizeof( valueString ) ); - - SFXFMODDevice::smFunc->FMOD_DSP_GetParameterInfo( dsp, n, name, label, description, sizeof( description ) - 1, &minValue, &maxValue ); - SFXFMODDevice::smFunc->FMOD_DSP_GetParameter( dsp, n, &value, valueString, sizeof( valueString ) - 1 ); - - Con::printf( "* Parameter %i", n ); - Con::printf( "Name: %s", name ); - Con::printf( "Label: %s", label ); - Con::printf( "Description: %s", description ); - Con::printf( "Min: %f", minValue ); - Con::printf( "Max: %f", maxValue ); - Con::printf( "Value: %f (%s)", value, valueString ); - Con::printf( "" ); - } - - // Release the DSP. - - SFXFMODDevice::smFunc->FMOD_DSP_Release( dsp ); - } - } -} - -//----------------------------------------------------------------------------- - -ConsoleFunction( fmodDumpMemoryStats, void, 1, 1, "()" - "@return Prints the current memory consumption of the FMOD module\n\n" - "@ingroup SFXFMOD") -{ - int current = 0; - int max = 0; - - if (SFXFMODDevice::smFunc && SFXFMODDevice::smFunc->FMOD_Memory_GetStats.fn) - SFXFMODDevice::smFunc->FMOD_Memory_GetStats(¤t, &max); - Con::printf("Fmod current: %d, max: %d", current, max); -} diff --git a/Engine/source/sfx/fmod/sfxFMODDevice.h b/Engine/source/sfx/fmod/sfxFMODDevice.h deleted file mode 100644 index fc15041e9..000000000 --- a/Engine/source/sfx/fmod/sfxFMODDevice.h +++ /dev/null @@ -1,342 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#ifndef _SFXFMODDEVICE_H_ -#define _SFXFMODDEVICE_H_ - -#ifndef _SFXDEVICE_H_ - #include "sfx/sfxDevice.h" -#endif -#ifndef _SFXFMODVOICE_H_ - #include "sfx/fmod/sfxFMODVoice.h" -#endif -#ifndef _SFXFMODBUFFER_H_ - #include "sfx/fmod/sfxFMODBuffer.h" -#endif -#ifndef _SFXFMODPLUGIN_H_ - #include "sfx/fmod/sfxFMODPlugin.h" -#endif - -#include "core/util/tDictionary.h" - - -// Disable warning for unused static functions. -#ifdef TORQUE_COMPILER_VISUALC - #pragma warning( disable : 4505 ) -#endif - -#if defined( TORQUE_OS_XENON ) || defined( TORQUE_OS_PS3 ) - #define TORQUE_FMOD_STATIC - #define TORQUE_FMOD_NO_EVENTS //TEMP -#endif - - -#include "fmod.h" -#include "fmod_errors.h" -#include "fmod_event.h" - -#include "platform/platformDlibrary.h" -#include "platform/threads/mutex.h" - - -// This doesn't appear to exist in some contexts, so let's just add it. -#if defined(TORQUE_OS_WIN) || defined(TORQUE_OS_XENON) -#ifndef WINAPI -#define WINAPI __stdcall -#endif -#else -#define WINAPI -#endif - - -#define FModAssert(x, msg) \ - { FMOD_RESULT result = ( x ); \ - AssertISV( result == FMOD_OK, String::ToString( "%s: %s", msg, FMOD_ErrorString( result ) ) ); } - -#define FMOD_FN_FILE "sfx/fmod/fmodFunctions.h" - - -// Typedefs -#define FMOD_FUNCTION(fn_name, fn_args) \ - typedef FMOD_RESULT (WINAPI *FMODFNPTR##fn_name)fn_args; -#define FMOD_EVENT_FUNCTION(fn_name, fn_args) \ - typedef FMOD_RESULT (WINAPI *FMODFNPTR##fn_name)fn_args; -#include FMOD_FN_FILE -#undef FMOD_FUNCTION -#undef FMOD_EVENT_FUNCTION - - -/// FMOD API function table. -/// -/// FMOD doesn't want to be called concurrently so in order to -/// not force everything to the main thread (where sound updates -/// would just stall during loading), we thunk all the API -/// calls and lock all API entry points to a single mutex. -struct FModFNTable -{ - FModFNTable() - : isLoaded( false ), - eventIsLoaded( false ), - dllRef( NULL ), - eventDllRef( NULL ) - { - AssertFatal( mutex == NULL, - "FModFNTable::FModFNTable() - this should be a singleton" ); - mutex = new Mutex; - } - ~FModFNTable() - { - dllRef = NULL; - eventDllRef = NULL; - delete mutex; - } - - bool isLoaded; - bool eventIsLoaded; - DLibraryRef dllRef; - DLibraryRef eventDllRef; - static Mutex* mutex; - - template< typename FN > - struct Thunk - { - FN fn; - - template< typename A > - FMOD_RESULT operator()( A a ) - { - mutex->lock(); - FMOD_RESULT result = fn( a ); - mutex->unlock(); - return result; - } - template< typename A, typename B > - FMOD_RESULT operator()( A a, B b ) - { - mutex->lock(); - FMOD_RESULT result = fn( a, b ); - mutex->unlock(); - return result; - } - template< typename A, typename B, typename C > - FMOD_RESULT operator()( A a, B b, C c ) - { - mutex->lock(); - FMOD_RESULT result = fn( a, b, c ); - mutex->unlock(); - return result; - } - template< typename A, typename B, typename C, typename D > - FMOD_RESULT operator()( A a, B b, C c, D d ) - { - mutex->lock(); - FMOD_RESULT result = fn( a, b, c, d ); - mutex->unlock(); - return result; - } - template< typename A, typename B, typename C, typename D, typename E > - FMOD_RESULT operator()( A a, B b, C c, D d, E e ) - { - mutex->lock(); - FMOD_RESULT result = fn( a, b, c, d, e ); - mutex->unlock(); - return result; - } - template< typename A, typename B, typename C, typename D, typename E, typename F > - FMOD_RESULT operator()( A a, B b, C c, D d, E e, F f ) - { - mutex->lock(); - FMOD_RESULT result = fn( a, b, c, d, e, f ); - mutex->unlock(); - return result; - } - template< typename A, typename B, typename C, typename D, typename E, typename F, typename G > - FMOD_RESULT operator()( A a, B b, C c, D d, E e, F f, G g ) - { - mutex->lock(); - FMOD_RESULT result = fn( a, b, c, d, e, f, g ); - mutex->unlock(); - return result; - } - template< typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H > - FMOD_RESULT operator()( A a, B b, C c, D d, E e, F f, G g, H h ) - { - mutex->lock(); - FMOD_RESULT result = fn( a, b, c, d, e, f, g, h ); - mutex->unlock(); - return result; - } - }; - -#define FMOD_FUNCTION(fn_name, fn_args) \ - Thunk< FMODFNPTR##fn_name > fn_name; -#define FMOD_EVENT_FUNCTION(fn_name, fn_args) \ - Thunk< FMODFNPTR##fn_name > fn_name; -#include FMOD_FN_FILE -#undef FMOD_FUNCTION -#undef FMOD_EVENT_FUNCTION -}; - - -inline void TorqueVectorToFMODVector( const Point3F& torque, FMOD_VECTOR& fmod ) -{ - fmod.x = torque.x; - fmod.y = torque.z; - fmod.z = torque.y; -} - -inline void TorqueTransformToFMODVectors( const MatrixF& transform, FMOD_VECTOR& position, FMOD_VECTOR& forward, FMOD_VECTOR& up ) -{ - Point3F _pos, _fwd, _up; - - transform.getColumn( 3, &_pos ); - transform.getColumn( 1, &_fwd ); - transform.getColumn( 2, &_up ); - - TorqueVectorToFMODVector( _pos, position ); - TorqueVectorToFMODVector( _fwd, forward ); - TorqueVectorToFMODVector( _up, up ); -} - -inline int TorquePriorityToFMODPriority( F32 priority ) -{ - // Map [-2,2] to [256,0]. - - F32 n = mClampF( priority, -2.0f, 2.0f ) + 2.0f; - return ( n * 256.0f / 4.0f ); -} - -inline String FMODEventPathToTorqueName( const String& path ) -{ - String p = path; - p.replace( '/', '_' ); - p.replace( '-', '_' ); - p.replace( ' ', '_' ); - p.replace( '(', '_' ); - p.replace( ')', '_' ); - p.replace( '%', '_' ); - p.replace( '$', '_' ); - return p; -} - -inline String FMODEventPathToTorqueName( const String& projectName, const String& path ) -{ - return String::ToString( "%s_%s", projectName.c_str(), FMODEventPathToTorqueName( path ).c_str() ); -} - -extern String FMODResultToString( FMOD_RESULT result ); - - -class SFXProvider; -class SFXFMODPlugin; - - - -class SFXFMODDevice : public SFXDevice -{ - public: - - typedef SFXDevice Parent; - friend class SFXFMODProvider; // _init - friend class SFXFMODEventSource; // smStatNumEventSources - - explicit SFXFMODDevice(); - - SFXFMODDevice( SFXProvider* provider, FModFNTable *fmodFnTbl, int deviceIdx, String name ); - - virtual ~SFXFMODDevice(); - - protected: - - FMOD_MODE m3drolloffmode; - int mDeviceIndex; - - /// The FMOD SFXSystemPlugin instance. - SFXFMODPlugin mPlugin; - - /// @name Console Variables - /// @{ - - /// Current core FMOD memory usage in bytes. - static U32 smStatMemUsageCore; - - /// Current FMOD Event DLL memory usage in bytes. - static U32 smStatMemUsageEvents; - - /// Current number of SFXFMODEventSource instances. - static U32 smStatNumEventSources; - - /// - static bool smPrefDisableSoftware; - - /// - static bool smPrefUseSoftwareOcclusion; - - /// - static bool smPrefUseSoftwareHRTF; - - /// - static bool smPrefEnableProfile; - - /// - static bool smPrefGeometryUseClosest; - - /// - static const char* smPrefDSoundHRTF; - - /// - static const char* smPrefPluginPath; - - /// @} - - bool _init(); - - static SFXFMODDevice* smInstance; - - public: - - static SFXFMODDevice* instance() { return smInstance; } - - FMOD_MODE get3dRollOffMode() { return m3drolloffmode; } - - static FMOD_SYSTEM* smSystem; - static FMOD_EVENTSYSTEM* smEventSystem; - static FModFNTable* smFunc; - - // Update memory usage stats for metrics display. - void updateMemUsageStats(); - - // SFXDevice. - virtual SFXBuffer* createBuffer( const ThreadSafeRef< SFXStream >& stream, SFXDescription* description ); - virtual SFXBuffer* createBuffer( const String& filename, SFXDescription* description ); - virtual SFXVoice* createVoice( bool is3D, SFXBuffer* buffer ); - virtual void update(); - virtual void setNumListeners( U32 num ); - virtual void setListener( U32 index, const SFXListenerProperties& listener ); - virtual void setDistanceModel( SFXDistanceModel model ); - virtual void setDopplerFactor( F32 factor ); - virtual void setRolloffFactor( F32 factor ); - virtual void setReverb( const SFXReverbProperties& reverb ); - virtual void resetReverb(); -}; - -#endif // _SFXFMODDEVICE_H_ diff --git a/Engine/source/sfx/fmod/sfxFMODEvent.cpp b/Engine/source/sfx/fmod/sfxFMODEvent.cpp deleted file mode 100644 index dd8fbfa0e..000000000 --- a/Engine/source/sfx/fmod/sfxFMODEvent.cpp +++ /dev/null @@ -1,339 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#include "platform/platform.h" -#include "sfx/fmod/sfxFMODEvent.h" -#include "sfx/fmod/sfxFMODEventGroup.h" -#include "sfx/fmod/sfxFMODProject.h" -#include "sfx/fmod/sfxFMODDevice.h" -#include "sfx/sfxParameter.h" -#include "sfx/sfxDescription.h" -#include "core/stream/bitStream.h" - - -IMPLEMENT_CO_DATABLOCK_V1( SFXFMODEvent ); - - -ConsoleDocClass( SFXFMODEvent, - "@brief A playable sound event in an FMOD Designer audio project.\n\n" - - "@ingroup SFXFMOD\n" - "@ingroup Datablocks" -); - - -//----------------------------------------------------------------------------- - -SFXFMODEvent::SFXFMODEvent() - : mGroup( NULL ), - mHandle( NULL ), - mGroupId( 0 ), - mSibling( NULL ) -{ - dMemset( mParameterRanges, 0, sizeof( mParameterRanges ) ); - dMemset( mParameterValues, 0, sizeof( mParameterValues ) ); -} - -//----------------------------------------------------------------------------- - -SFXFMODEvent::SFXFMODEvent( SFXFMODEventGroup* group, FMOD_EVENT* handle ) - : mGroup( group ), - mHandle( handle ), - mGroupId( 0 ), - mSibling( NULL ) -{ - dMemset( mParameterRanges, 0, sizeof( mParameterRanges ) ); - dMemset( mParameterValues, 0, sizeof( mParameterValues ) ); - - // Fetch name. - - int index; - char* name = NULL; - - SFXFMODDevice::smFunc->FMOD_Event_GetInfo( mHandle, &index, &name, ( FMOD_EVENT_INFO* ) 0 ); - - mName = name; - - // Read out the parameter info so we can immediately create - // the events on the client-side without having to open and - // read all the project info there. - - int numParameters; - SFXFMODDevice::smFunc->FMOD_Event_GetNumParameters( mHandle, &numParameters ); - if( numParameters > MaxNumParameters ) - { - Con::errorf( "SFXFMODEvent::SFXFMODEvent - event '%s' has more parameters (%i) than supported per SFXTrack (%i)", - getQualifiedName().c_str(), - numParameters, - MaxNumParameters ); - numParameters = MaxNumParameters; - } - - for( U32 i = 0; i < numParameters; ++ i ) - { - FMOD_EVENTPARAMETER* parameter; - SFXFMODDevice::smFunc->FMOD_Event_GetParameterByIndex( mHandle, i, ¶meter ); - - SFXFMODDevice::smFunc->FMOD_EventParameter_GetInfo( parameter, &index, &name ); - setParameter( i, name ); - - // Get value and range of parameter. - - SFXFMODDevice::smFunc->FMOD_EventParameter_GetValue( parameter, &mParameterValues[ i ] ); - SFXFMODDevice::smFunc->FMOD_EventParameter_GetRange( parameter, &mParameterRanges[ i ].x, &mParameterRanges[ i ].y ); - } - - // Read out the properties and create a custom SFXDescription for the event. - - mDescription = new SFXDescription; - if( !group->isClientOnly() ) - mDescription->assignId(); - - mDescription->registerObject( - String::ToString( "%s_%s_Description", - group->getName(), - FMODEventPathToTorqueName( mName ).c_str() - ) - ); - if( group->isClientOnly() ) - Sim::getRootGroup()->addObject( mDescription ); - - FMOD_MODE modeValue; - float floatValue; - - if( SFXFMODDevice::smFunc->FMOD_Event_GetPropertyByIndex( mHandle, FMOD_EVENTPROPERTY_MODE, &modeValue, true ) == FMOD_OK ) - mDescription->mIs3D = ( modeValue == FMOD_3D ); - if( SFXFMODDevice::smFunc->FMOD_Event_GetPropertyByIndex( mHandle, FMOD_EVENTPROPERTY_VOLUME, &floatValue, true ) == FMOD_OK ) - mDescription->mVolume = floatValue; - if( SFXFMODDevice::smFunc->FMOD_Event_GetPropertyByIndex( mHandle, FMOD_EVENTPROPERTY_PITCH, &floatValue, true ) == FMOD_OK ) - mDescription->mPitch = floatValue; - if( SFXFMODDevice::smFunc->FMOD_Event_GetPropertyByIndex( mHandle, FMOD_EVENTPROPERTY_3D_MINDISTANCE, &floatValue, true ) == FMOD_OK ) - mDescription->mMinDistance = floatValue; - if( SFXFMODDevice::smFunc->FMOD_Event_GetPropertyByIndex( mHandle, FMOD_EVENTPROPERTY_3D_MAXDISTANCE, &floatValue, true ) == FMOD_OK ) - mDescription->mMaxDistance = floatValue; - if( SFXFMODDevice::smFunc->FMOD_Event_GetPropertyByIndex( mHandle, FMOD_EVENTPROPERTY_3D_CONEINSIDEANGLE, &floatValue, true ) == FMOD_OK ) - mDescription->mConeInsideAngle = floatValue; - if( SFXFMODDevice::smFunc->FMOD_Event_GetPropertyByIndex( mHandle, FMOD_EVENTPROPERTY_3D_CONEOUTSIDEANGLE, &floatValue, true ) == FMOD_OK ) - mDescription->mConeOutsideAngle = floatValue; - if( SFXFMODDevice::smFunc->FMOD_Event_GetPropertyByIndex( mHandle, FMOD_EVENTPROPERTY_3D_CONEOUTSIDEVOLUME, &floatValue, true ) == FMOD_OK ) - mDescription->mConeOutsideVolume = floatValue; - - // Don't read out fade values as we want to leave fade-effects to - // FMOD rather than having the fading system built into SFX pick - // these values up. -} - -//----------------------------------------------------------------------------- - -SFXFMODEvent::~SFXFMODEvent() -{ -} - -//----------------------------------------------------------------------------- - -void SFXFMODEvent::initPersistFields() -{ - addGroup( "DO NOT MODIFY!!" ); - addField( "fmodGroup", TYPEID< SFXFMODEventGroup >(), Offset( mGroup, SFXFMODEvent ), "DO NOT MODIFY!!" ); - addField( "fmodName", TypeRealString, Offset( mName, SFXFMODEvent ), "DO NOT MODIFY!!" ); - addField( "fmodParameterRanges", TypePoint2F, Offset( mParameterRanges, SFXFMODEvent ), MaxNumParameters, "DO NOT MODIFY!!" ); - addField( "fmodParameterValues", TypeF32, Offset( mParameterValues, SFXFMODEvent ), MaxNumParameters, "DO NOT MODIFY!!" ); - endGroup( "DO NOT MODIFY!!" ); - - Parent::initPersistFields(); -} - -//----------------------------------------------------------------------------- - -bool SFXFMODEvent::onAdd() -{ - if( !Parent::onAdd() ) - return false; - - if( !mGroup ) - { - Con::errorf( "SFXFMODEvent::onAdd - no group set; this event was not properly constructed" ); - return false; - } - - mGroup->_addEvent( this ); - mGroup->mProject->_addEvent( this ); - - // For non-networked event datablocks, create the parameter - // instances now. - - if( isClientOnly() ) - _createParameters(); - - return true; -} - -//----------------------------------------------------------------------------- - -void SFXFMODEvent::onRemove() -{ - Parent::onRemove(); - - if( !mGroup ) - return; - - release(); - mGroup->_removeEvent( this ); -} - -//----------------------------------------------------------------------------- - -bool SFXFMODEvent::preload( bool server, String& errorStr ) -{ - if( !Parent::preload( server, errorStr ) ) - return false; - - if( !server ) - { - if( !Sim::findObject( mGroupId, mGroup ) ) - { - errorStr = String::ToString( "SFXFMODEvent - group '%i' does not exist", mGroupId ); - return false; - } - - // Create parameters. - - _createParameters(); - } - - return true; -} - -//----------------------------------------------------------------------------- - -void SFXFMODEvent::packData( BitStream* stream ) -{ - Parent::packData( stream ); - - stream->write( mName ); - stream->writeRangedS32( mGroup->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast ); - - for( U32 i = 0; i < MaxNumParameters; ++ i ) - if( stream->writeFlag( mParameters[ i ] ) ) - { - stream->write( mParameterValues[ i ] ); - stream->write( mParameterRanges[ i ].x ); - stream->write( mParameterRanges[ i ].y ); - } -} - -//----------------------------------------------------------------------------- - -void SFXFMODEvent::unpackData( BitStream* stream ) -{ - Parent::unpackData( stream ); - - stream->read( &mName ); - mGroupId = stream->readRangedS32( DataBlockObjectIdFirst, DataBlockObjectIdLast ); - - for( U32 i = 0; i < MaxNumParameters; ++ i ) - if( stream->readFlag() ) - { - stream->read( &mParameterValues[ i ] ); - stream->read( &mParameterRanges[ i ].x ); - stream->read( &mParameterRanges[ i ].y ); - } - else - { - mParameterValues[ i ] = 0.f; - mParameterRanges[ i ].x = 0.f; - mParameterRanges[ i ].y = 0.f; - } -} - -//----------------------------------------------------------------------------- - -void SFXFMODEvent::acquire() -{ - if( mHandle ) - return; - - mGroup->acquire(); - if( SFXFMODDevice::smFunc->FMOD_EventGroup_GetEvent( - mGroup->mHandle, mName.c_str(), FMOD_EVENT_INFOONLY, &mHandle ) != FMOD_OK ) - { - Con::errorf( "SFXFMODEvent::acquire() - failed to acquire event '%s'", getQualifiedName().c_str() ); - return; - } -} - -//----------------------------------------------------------------------------- - -void SFXFMODEvent::release() -{ - if( !mHandle ) - return; - - SFXFMODDevice::smFunc->FMOD_Event_Release( mHandle, true, false ); - mHandle = NULL; -} - -//----------------------------------------------------------------------------- - -String SFXFMODEvent::getQualifiedName() const -{ - return String::ToString( "%s/%s", getEventGroup()->getQualifiedName().c_str(), mName.c_str() ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODEvent::_createParameters() -{ - const String& projectFileName = getEventGroup()->getProject()->getFileName(); - const String qualifiedGroupName = getEventGroup()->getQualifiedName(); - const String description = String::ToString( "FMOD Event Parameter (%s)", projectFileName.c_str() ); - - for( U32 i = 0; i < MaxNumParameters; ++ i ) - { - StringTableEntry name = getParameter( i ); - if( !name ) - continue; - - SFXParameter* parameter = SFXParameter::find( name ); - if( !parameter ) - { - parameter = new SFXParameter(); - parameter->setInternalName( name ); - parameter->registerObject(); - - // Set up parameter. - - parameter->setChannel( SFXChannelUser0 ); - parameter->setRange( mParameterRanges[ i ] ); - parameter->setDefaultValue( mParameterValues[ i ] ); - parameter->setValue( mParameterValues[ i ] ); - parameter->setDescription( description ); - - // Set categories for easy filtering. - - static StringTableEntry sCategories = StringTable->insert( "categories" ); - parameter->setDataField( sCategories, "0", "FMOD" ); - parameter->setDataField( sCategories, "1", avar( "FMOD Project: %s", projectFileName.c_str() ) ); - parameter->setDataField( sCategories, "2", avar( "FMOD Group: %s", qualifiedGroupName.c_str() ) ); - } - } -} diff --git a/Engine/source/sfx/fmod/sfxFMODEvent.h b/Engine/source/sfx/fmod/sfxFMODEvent.h deleted file mode 100644 index 1e4c53e00..000000000 --- a/Engine/source/sfx/fmod/sfxFMODEvent.h +++ /dev/null @@ -1,135 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#ifndef _SFXFMODEVENT_H_ -#define _SFXFMODEVENT_H_ - -#ifndef _SFXTRACK_H_ - #include "sfx/sfxTrack.h" -#endif -#ifndef _CONSOLETYPES_H_ - #include "console/consoleTypes.h" -#endif -#ifndef _MPOINT2_H_ - #include "math/mPoint2.h" -#endif - -#include "fmod_event.h" - - -class SFXFMODProject; -class SFXFMODEventGroup; - - -/// An event in an FMOD Designer project. -/// -/// This class must not be manually instanced by the user. Instead, SFXFMODEvents -/// are automatically created when an SFXFMODProject is loaded. -/// -/// Be aware that as all the playback happens internally within FMOD's event system, -/// this bypasses the SFX layer and will thus not work with features that rely the -/// structures there. Namely, sound occlusion (except for FMOD's own occlusion) will -/// not work with FMOD events. -/// -/// The parameters of an FMOD event are automatically created and designed using the -/// information in the project. -/// -class SFXFMODEvent : public SFXTrack -{ - public: - - typedef SFXTrack Parent; - friend class SFXFMODEventGroup; - friend class SFXFMODEventSource; - - protected: - - /// Name of the event in the Designer project. - String mName; - - /// Event group that this event belongs to. - SFXFMODEventGroup* mGroup; - - /// Next event in the group's event chain. - SFXFMODEvent* mSibling; - - /// FMOD event handle when event is open. Client-side only. - FMOD_EVENT* mHandle; - - /// - Point2F mParameterRanges[ MaxNumParameters ]; - - /// - F32 mParameterValues[ MaxNumParameters ]; - - /// Group ID for client net sync. - S32 mGroupId; - - /// - void _createParameters(); - - public: - - /// - SFXFMODEvent(); - - /// - SFXFMODEvent( SFXFMODEventGroup* group, const String& name ); - - /// - SFXFMODEvent( SFXFMODEventGroup* group, FMOD_EVENT* handle ); - - ~SFXFMODEvent(); - - /// Create the event object on the FMOD device. - void acquire(); - - /// Release the event object on the FMOD device. - void release(); - - /// - const String& getEventName() const { return mName; } - - /// - SFXFMODEventGroup* getEventGroup() const { return mGroup; } - - /// - String getQualifiedName() const; - - /// - bool isDataLoaded() const; - - // SFXTrack. - virtual bool onAdd(); - virtual void onRemove(); - virtual bool preload( bool server, String& errorStr ); - virtual void packData( BitStream* stream ); - virtual void unpackData( BitStream* stream ); - - static void initPersistFields(); - - DECLARE_CONOBJECT( SFXFMODEvent ); - DECLARE_CATEGORY( "SFX FMOD" ); - DECLARE_DESCRIPTION( "An FMOD Designer event." ); -}; - -#endif // !_SFXFMODEVENT_H_ diff --git a/Engine/source/sfx/fmod/sfxFMODEventGroup.cpp b/Engine/source/sfx/fmod/sfxFMODEventGroup.cpp deleted file mode 100644 index a42f08bde..000000000 --- a/Engine/source/sfx/fmod/sfxFMODEventGroup.cpp +++ /dev/null @@ -1,510 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#include "sfx/fmod/sfxFMODEventGroup.h" -#include "sfx/fmod/sfxFMODDevice.h" -#include "sfx/fmod/sfxFMODEvent.h" -#include "sfx/fmod/sfxFMODProject.h" -#include "core/stream/bitStream.h" -#include "console/engineAPI.h" - - -IMPLEMENT_CO_DATABLOCK_V1( SFXFMODEventGroup ); - -ConsoleDocClass( SFXFMODEventGroup, - "@brief A group of events in an imported FMOD Designer project.\n\n" - - "" - - "@note Instances of this class \n\n" - - "@ingroup SFXFMOD\n" - "@ingroup Datablocks" -); - -//----------------------------------------------------------------------------- - -SFXFMODEventGroup::SFXFMODEventGroup() - : mProject( NULL ), - mHandle( NULL ), - mParent( NULL ), - mChildren( NULL ), - mSibling( NULL ), - mLoadCount( 0 ), - mEvents( NULL ), - mNumEvents( 0 ), - mNumGroups( 0 ), - mParentId( 0 ), - mProjectId( 0 ) -{ -} - -//----------------------------------------------------------------------------- - -SFXFMODEventGroup::SFXFMODEventGroup( SFXFMODProject* project, FMOD_EVENTGROUP* handle, SFXFMODEventGroup* parent ) - : mProject( project ), - mHandle( handle ), - mParent( parent ), - mChildren( NULL ), - mSibling( NULL ), - mLoadCount( 0 ), - mEvents( NULL ), - mNumEvents( 0 ), - mNumGroups( 0 ), - mParentId( 0 ), - mProjectId( 0 ) -{ - AssertFatal( project != NULL, "SFXFMODEventGroup::SFXFMODEventGroup - got a NULL project!" ); - AssertFatal( handle != NULL, "SFXFMODEventGroup::SFXFMODEventGroup - got a NULL group handle!" ); - - // Fetch the name. - - int index; - char* name = NULL; - - SFXFMODDevice::smFunc->FMOD_EventGroup_GetInfo( handle, &index, &name ); - - mName = name; -} - -//----------------------------------------------------------------------------- - -SFXFMODEventGroup::~SFXFMODEventGroup() -{ - AssertFatal( mEvents == NULL, "SFXFMODEventGroup::~SFXFMODEventGroup - group still has events attached" ); - AssertFatal( mChildren == NULL, "SFXFMODEventGroup::~SFXFMODEventGroup - group still has subgroups attached" ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventGroup::initPersistFields() -{ - addGroup( "DO NOT MODIFY!!" ); - addField( "fmodProject", TYPEID< SFXFMODProject >(), Offset( mProject, SFXFMODEventGroup ), "DO NOT MODIFY!!" ); - addField( "fmodGroup", TYPEID< SFXFMODEventGroup >(), Offset( mParent, SFXFMODEventGroup ), "DO NOT MODIFY!!" ); - addField( "fmodName", TypeRealString, Offset( mName, SFXFMODEventGroup ), "DO NOT MODIFY!!" ); - endGroup( "DO NOT MODIFY!!" ); - - Parent::initPersistFields(); -} - -//----------------------------------------------------------------------------- - -bool SFXFMODEventGroup::onAdd() -{ - if( !Parent::onAdd() ) - return false; - - if( !mProject ) - { - Con::errorf( "SFXFMODEventGroup - not part of a project" ); - return false; - } - - if( mParent ) - mParent->_addGroup( this ); - - mProject->_addGroup( this ); - - return true; -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventGroup::onRemove() -{ - Parent::onRemove(); - - if( !mProject ) - return; - - release(); - - while( mEvents ) - mEvents->deleteObject(); - while( mChildren ) - mChildren->deleteObject(); - - if( mParent ) - mParent->_removeGroup( this ); - - mProject->_removeGroup( this ); -} - -//----------------------------------------------------------------------------- - -bool SFXFMODEventGroup::preload( bool server, String& errorStr ) -{ - if( !Parent::preload( server, errorStr ) ) - return false; - - if( !server ) - { - if( mParentId != 0 && !Sim::findObject( mParentId, mParent ) ) - { - errorStr = String::ToString( "SFXFMODEventGroup - parent group '%i' does not exist", mParentId ); - return false; - } - if( !Sim::findObject( mProjectId, mProject ) ) - { - errorStr = String::ToString( "SFXFMODEventGroup - project '%i' does not exist", mProjectId ); - return false; - } - } - - return true; -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventGroup::packData( BitStream* stream ) -{ - Parent::packData( stream ); - - stream->write( mName ); - stream->writeRangedS32( mProject->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast ); - if( stream->writeFlag( mParent ) ) - stream->writeRangedS32( mParent->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventGroup::unpackData( BitStream* stream ) -{ - Parent::unpackData( stream ); - - stream->read( &mName ); - - mProjectId = stream->readRangedS32( DataBlockObjectIdFirst, DataBlockObjectIdLast ); - if( stream->readFlag() ) - mParentId = stream->readRangedS32( DataBlockObjectIdFirst, DataBlockObjectIdLast ); - else - mParentId = 0; -} - -//----------------------------------------------------------------------------- - -String SFXFMODEventGroup::getQualifiedName() const -{ - if( mParent ) - return String::ToString( "%s/%s", mParent->getQualifiedName().c_str(), mName.c_str() ); - else - return mName; -} - -//----------------------------------------------------------------------------- - -bool SFXFMODEventGroup::isDataLoaded() const -{ - // Check whether we or any of our parents has triggered a load. - - for( const SFXFMODEventGroup* group = this; group != NULL; group = group->mParent ) - if( group->mLoadCount > 0 ) - return true; - - return false; -} - -//----------------------------------------------------------------------------- - -bool SFXFMODEventGroup::loadData( bool samples, bool streams ) -{ - if( !mHandle ) - acquire(); - - if( !mLoadCount ) - { - FMOD_EVENT_RESOURCE resource; - if( samples && streams ) - resource = FMOD_EVENT_RESOURCE_STREAMS_AND_SAMPLES; - else if( samples ) - resource = FMOD_EVENT_RESOURCE_SAMPLES; - else if( streams ) - resource = FMOD_EVENT_RESOURCE_STREAMS; - else - return true; - - FMOD_RESULT result = SFXFMODDevice::smFunc->FMOD_EventGroup_LoadEventData( mHandle, resource, FMOD_EVENT_DEFAULT ); - if( result != FMOD_OK ) - { - Con::errorf( "SFXFMODEventGroup::loadData - could not load data: %s", FMODResultToString( result ).c_str() ); - return false; - } - - SFXFMODDevice::instance()->updateMemUsageStats(); - Con::printf( "SFXFMODProject - %s: Loaded data for group '%s'", mProject->getName(), getQualifiedName().c_str() ); - } - - mLoadCount ++; - return true; -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventGroup::freeData( bool force ) -{ - bool isLoaded = ( mLoadCount > 0 ); - - if( !isLoaded ) - isLoaded = ( mParent ? mParent->isDataLoaded() : false ); - else - { - if( force ) - mLoadCount = 0; - else - -- mLoadCount; - } - - if( !mLoadCount && isLoaded ) - { - FMOD_RESULT result = SFXFMODDevice::smFunc->FMOD_EventGroup_FreeEventData( mHandle, ( FMOD_EVENT* ) NULL, false ); - if( result != FMOD_OK ) - Con::errorf( "SFXFMODEventGroup - failed freeing event data: %s", FMODResultToString( result ).c_str() ); - - SFXFMODDevice::instance()->updateMemUsageStats(); - Con::printf( "SFXFMODProject - %s: Cleared data for group '%s'", mProject->getName(), getQualifiedName().c_str() ); - } -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventGroup::acquire( bool recursive ) -{ - // Make sure the project is acquired. - - mProject->acquire(); - - // Acquire the group. - - if( !mHandle ) - { - if( mParent ) - { - mParent->acquire(); - SFXFMODDevice::smFunc->FMOD_EventGroup_GetGroup( mParent->mHandle, mName, true, &mHandle ); - } - else - { - mProject->acquire(); - SFXFMODDevice::smFunc->FMOD_EventProject_GetGroup( mProject->mHandle, mName, true, &mHandle ); - } - } - - // Acquite events and subgroups. - - if( recursive ) - { - for( SFXFMODEvent* event = mEvents; event != NULL; event = event->mSibling ) - event->acquire(); - - for( SFXFMODEventGroup* group = mChildren; group != NULL; group = group->mSibling ) - group->acquire( true ); - } -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventGroup::release() -{ - if( !mHandle ) - return; - - // Free the event data if we still have it loaded. - - if( isDataLoaded() ) - freeData( true ); - - // Release events. - - for( SFXFMODEvent* event = mEvents; event != NULL; event = event->mSibling ) - event->release(); - - // Release children. - - for( SFXFMODEventGroup* child = mChildren; child != NULL; child = child->mSibling ) - child->release(); - - // Release our handle. - - freeData(); - mHandle = NULL; -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventGroup::_load() -{ - // Make sure we have the group open. - - if( !mHandle ) - acquire(); - - // Fetch info. - - int numEvents; - int numGroups; - - SFXFMODDevice::smFunc->FMOD_EventGroup_GetNumEvents( mHandle, &numEvents ); - SFXFMODDevice::smFunc->FMOD_EventGroup_GetNumGroups( mHandle, &numGroups ); - - // Load events. - - for( U32 i = 0; i < numEvents; ++ i ) - { - FMOD_EVENT* handle; - if( SFXFMODDevice::smFunc->FMOD_EventGroup_GetEventByIndex( mHandle, i, FMOD_EVENT_INFOONLY, &handle ) == FMOD_OK ) - { - SFXFMODEvent* event = new SFXFMODEvent( this, handle ); - if( !isClientOnly() ) - event->assignId(); - - event->registerObject( String::ToString( "%s_%s", getName(), FMODEventPathToTorqueName( event->getEventName() ).c_str() ) ); - if( isClientOnly() ) - Sim::getRootGroup()->addObject( event ); - } - } - - // Load subgroups. - - for( U32 i = 0; i < numGroups; ++ i ) - { - FMOD_EVENTGROUP* handle; - if( SFXFMODDevice::smFunc->FMOD_EventGroup_GetGroupByIndex( mHandle, i, true, &handle ) == FMOD_OK ) - { - SFXFMODEventGroup* group = new SFXFMODEventGroup( mProject, handle, this ); - if( !isClientOnly() ) - group->assignId(); - - group->registerObject( String::ToString( "%s_%s", getName(), FMODEventPathToTorqueName( group->getGroupName() ).c_str() ) ); - if( isClientOnly() ) - Sim::getRootGroup()->addObject( group ); - - group->_load(); - } - } -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventGroup::_addEvent( SFXFMODEvent* event ) -{ - event->mSibling = mEvents; - mEvents = event; - mNumEvents ++; -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventGroup::_removeEvent( SFXFMODEvent* event ) -{ - if( mEvents == event ) - { - mEvents = event->mSibling; - event->mSibling = NULL; - mNumEvents --; - } - else - { - SFXFMODEvent* p = mEvents; - while( p != NULL && p->mSibling != event ) - p = p->mSibling; - - if( p ) - { - p->mSibling = event->mSibling; - event->mSibling = NULL; - mNumEvents --; - } - } -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventGroup::_addGroup( SFXFMODEventGroup* group ) -{ - group->mSibling = mChildren; - mChildren = group; - mNumGroups ++; -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventGroup::_removeGroup( SFXFMODEventGroup* group ) -{ - if( mChildren == group ) - { - mChildren = group->mSibling; - group->mSibling = NULL; - mNumGroups --; - } - else - { - SFXFMODEventGroup* p = mChildren; - while( p != NULL && p->mSibling != group ) - p = p->mSibling; - - if( p ) - { - p->mSibling = group->mSibling; - group->mSibling = NULL; - mNumGroups --; - } - } -} - -//============================================================================= -// Console Methods. -//============================================================================= -// MARK: ---- Console Methods ---- - -//----------------------------------------------------------------------------- - -DefineEngineMethod( SFXFMODEventGroup, isDataLoaded, bool, (),, - "Test whether the resource data for this group has been loaded.\n\n" - "@return True if the resource data for this group is currently loaded.\n" ) -{ - return object->isDataLoaded(); -} - -//----------------------------------------------------------------------------- - -DefineEngineMethod( SFXFMODEventGroup, loadData, bool, ( bool loadStreams, bool loadSamples ), ( true, true ), - "Load the resource data for this group, if it has not already been loaded (either directly " - "or indirectly through a parent group).\n" - "This method works recursively and thus data for direct and indirect child groups to this group will be " - "loaded as well.\n\n" - "@param loadStreams Whether to open streams.\n" - "@param loadSamples Whether to load sample banks.\n" - "@return True if the data has been successfully loaded; false otherwise.\n\n" - "@see SFXFMODProject_resources" ) -{ - return object->loadData( loadSamples, loadStreams ); -} - -//----------------------------------------------------------------------------- - -DefineEngineMethod( SFXFMODEventGroup, freeData, void, (),, - "Release the resource data for this group and its subgroups.\n\n" - "@see SFXFMODProject_resources" ) -{ - object->freeData(); -} diff --git a/Engine/source/sfx/fmod/sfxFMODEventGroup.h b/Engine/source/sfx/fmod/sfxFMODEventGroup.h deleted file mode 100644 index 12140c2bf..000000000 --- a/Engine/source/sfx/fmod/sfxFMODEventGroup.h +++ /dev/null @@ -1,159 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#ifndef _SFXFMODEVENTGROUP_H_ -#define _SFXFMODEVENTGROUP_H_ - -#ifndef _SIMDATABLOCK_H_ - #include "console/simDatablock.h" -#endif -#ifndef _TVECTOR_H_ - #include "core/util/tVector.h" -#endif -#ifndef _CONSOLETYPES_H_ - #include "console/consoleTypes.h" -#endif - -#include "fmod_event.h" - - -class SFXFMODProject; -class SFXFMODEvent; - - -/// -class SFXFMODEventGroup : public SimDataBlock -{ - public: - - typedef SimDataBlock Parent; - friend class SFXFMODProject; - friend class SFXFMODEvent; // mHandle - friend class SFXFMODEventSource; // mHandle - - protected: - - /// - String mName; - - /// - U32 mNumEvents; - - /// - U32 mNumGroups; - - /// - SFXFMODProject* mProject; - - /// - SFXFMODEventGroup* mParent; - - /// - SFXFMODEventGroup* mChildren; - - /// - SFXFMODEventGroup* mSibling; - - /// - SFXFMODEvent* mEvents; - - /// - FMOD_EVENTGROUP* mHandle; - - /// - U32 mLoadCount; - - /// Project ID for client net sync. - S32 mParentId; - - /// Project ID for client net sync. - S32 mProjectId; - - /// - void _load(); - - /// - void _addEvent( SFXFMODEvent* event ); - - /// - void _addGroup( SFXFMODEventGroup* group ); - - /// - void _removeEvent( SFXFMODEvent* event ); - - /// - void _removeGroup( SFXFMODEventGroup* group ); - - public: - - /// - SFXFMODEventGroup(); - - /// - SFXFMODEventGroup( SFXFMODProject* project, const String& name, SFXFMODEventGroup* parent = NULL ); - - /// - SFXFMODEventGroup( SFXFMODProject* project, FMOD_EVENTGROUP* handle, SFXFMODEventGroup* parent = NULL ); - - ~SFXFMODEventGroup(); - - /// Create the event group object on the FMOD device. - void acquire( bool recursive = false ); - - /// Release the event group object on the FMOD device. - void release(); - - /// - const String& getGroupName() const { return mName; } - - /// - String getQualifiedName() const; - - /// - SFXFMODProject* getProject() const { return mProject; } - - /// Return true if the event data for this group has been loaded. - bool isDataLoaded() const; - - /// Load the event data for this group. - /// - /// @note Loading is reference-counted. - bool loadData( bool samples = true, bool streams = true ); - - /// - void freeData( bool force = false ); - - // SimDataBlock. - virtual bool onAdd(); - virtual void onRemove(); - virtual bool preload( bool server, String& errorStr ); - virtual void packData( BitStream* stream ); - virtual void unpackData( BitStream* stream ); - - static void initPersistFields(); - - DECLARE_CONOBJECT( SFXFMODEventGroup ); - DECLARE_CATEGORY( "SFX FMOD" ); - DECLARE_DESCRIPTION( "An event group in an FMOD Designer project." ); -}; - -#endif // !_SFXFMODEVENTGROUP_H_ diff --git a/Engine/source/sfx/fmod/sfxFMODEventSource.cpp b/Engine/source/sfx/fmod/sfxFMODEventSource.cpp deleted file mode 100644 index 747bcd56f..000000000 --- a/Engine/source/sfx/fmod/sfxFMODEventSource.cpp +++ /dev/null @@ -1,337 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#include "platform/platform.h" -#include "sfx/fmod/sfxFMODEventSource.h" -#include "sfx/fmod/sfxFMODEvent.h" -#include "sfx/fmod/sfxFMODEventGroup.h" -#include "sfx/fmod/sfxFMODDevice.h" -#include "sfx/sfxDescription.h" - - -IMPLEMENT_CONOBJECT( SFXFMODEventSource ); - -ConsoleDocClass( SFXFMODEventSource, - "@brief A sound source controller playing an %FMOD Designer event (SFXFMODEvent).\n\n" - - "%FMOD event sources are internally created by the sound system to play events from imported %FMOD Designer projects.\n\n" - - "@note This class cannot be instantiated directly by the user. Instead, instances of SFXFMODEventSource will be " - "implicitly created by the sound system when playing an SFXFMODEvent.\n\n" - - "@ingroup SFXFMOD\n" -); - - -//----------------------------------------------------------------------------- - -SFXFMODEventSource::SFXFMODEventSource() - : mHandle( NULL ) -{ - SFXFMODDevice::instance()->smStatNumEventSources ++; -} - -//----------------------------------------------------------------------------- - -SFXFMODEventSource::SFXFMODEventSource( SFXFMODEvent* event ) - : Parent( event ), - mHandle( NULL ) -{ - SFXFMODDevice::instance()->smStatNumEventSources ++; - - // Make sure the group has its data loaded. - - SFXFMODEventGroup* group = event->getEventGroup(); - if( !group->loadData() ) - return; - - // Create an event instance. - - if( SFXFMODDevice::smFunc->FMOD_EventGroup_GetEvent( - event->getEventGroup()->mHandle, - event->getEventName(), - FMOD_EVENT_DEFAULT, - &mHandle ) != FMOD_OK ) - { - Con::errorf( "SFXFMODEventSource::SFXFMODEventSource - failed to open event '%s'", event->getQualifiedName().c_str() ); - mHandle = NULL; - } -} - -//----------------------------------------------------------------------------- - -SFXFMODEventSource::~SFXFMODEventSource() -{ - SFXFMODDevice::instance()->smStatNumEventSources --; - - if( mHandle ) - SFXFMODDevice::smFunc->FMOD_Event_Release( mHandle, true, true ); - - if( getEvent() ) - getEvent()->getEventGroup()->freeData(); -} - -//----------------------------------------------------------------------------- - -SFXFMODEventSource* SFXFMODEventSource::create( SFXFMODEvent* event ) -{ - AssertFatal( event != NULL, "SFXFMODEventSource::create - got a NULL event!" ); - - // Create the source. - - SFXFMODEventSource* source = new SFXFMODEventSource( event ); - if( source->mHandle ) - source->registerObject(); - else - { - delete source; - source = NULL; - } - - return source; -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventSource::play( F32 fadeInTime ) -{ - if( getStatus() == SFXStatusPlaying ) - return; - - if( isPaused() ) - SFXFMODDevice::smFunc->FMOD_Event_SetPaused( mHandle, false ); - else - { - AssertFatal( getEvent()->getEventGroup()->isDataLoaded(), "SFXFMODEventSource::play() - event data for group not loaded" ); - - if( fadeInTime != -1.f ) - { - U32 fade = U32( fadeInTime * 1000.f ); - SFXFMODDevice::smFunc->FMOD_Event_SetPropertyByIndex( - mHandle, FMOD_EVENTPROPERTY_FADEIN, - &fade, true - ); - } - - FMOD_RESULT result = SFXFMODDevice::smFunc->FMOD_Event_Start( mHandle ); - if( result != FMOD_OK ) - { - Con::errorf( "SFXFMODEventSoure::play() - failed to start event: %s", FMODResultToString( result ).c_str() ); - return; - } - } - - mPlayTimer.start(); - _setStatus( SFXStatusPlaying ); - - _play(); -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventSource::stop( F32 fadeOutTime ) -{ - if( getStatus() == SFXStatusStopped ) - return; - - AssertFatal( mHandle, "SFXFMODEvent::stop() - event not acquired" ); - - bool immediate = ( fadeOutTime == 0.f ); - - FMOD_RESULT result = SFXFMODDevice::smFunc->FMOD_Event_Stop( mHandle, immediate ); - if( result != FMOD_OK ) - Con::errorf( "SFXFMODEventSource::stop() - failed to stop event: %s", FMODResultToString( result ).c_str() ); - - mPlayTimer.stop(); - _setStatus( SFXStatusStopped ); - - // Reset fade-in to default in case it got overwritten - // in play(). - - U32 fade = U32( mFadeInTime * 1000.f ); - SFXFMODDevice::smFunc->FMOD_Event_SetPropertyByIndex( - mHandle, FMOD_EVENTPROPERTY_FADEIN, - &fade, true - ); - - _stop(); -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventSource::pause( F32 fadeOutTime ) -{ - if( getStatus() != SFXStatusPlaying ) - return; - - SFXFMODDevice::smFunc->FMOD_Event_SetPaused( mHandle, true ); - - mPlayTimer.pause(); - _setStatus( SFXStatusPaused ); - - _pause(); -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventSource::setTransform( const MatrixF& transform ) -{ - Parent::setTransform( transform ); - _update3DAttributes(); -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventSource::setVelocity( const VectorF& velocity ) -{ - Parent::setVelocity( velocity ); - _update3DAttributes(); -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventSource::_update3DAttributes() -{ - FMOD_VECTOR position; - FMOD_VECTOR velocity; - FMOD_VECTOR orientation; - - Point3F direction; - getTransform().getColumn( 1, &direction ); - - TorqueVectorToFMODVector( getTransform().getPosition(), position ); - TorqueVectorToFMODVector( getVelocity(), velocity ); - TorqueVectorToFMODVector( direction, orientation ); - - SFXFMODDevice::smFunc->FMOD_Event_Set3DAttributes( mHandle, &position, &velocity, &orientation ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventSource::_updateStatus() -{ - if( mStatus == SFXStatusPlaying ) - { - if( !getEvent() ) - _setStatus( SFXStatusStopped ); - else - { - FMOD_EVENT_STATE state; - SFXFMODDevice::smFunc->FMOD_Event_GetState( mHandle, &state ); - - if( !( state & FMOD_EVENT_STATE_PLAYING ) ) - _setStatus( SFXStatusStopped ); - } - } -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventSource::_updateVolume( const MatrixF& listener ) -{ - F32 oldPreAttenuatedVolume = mPreAttenuatedVolume; - Parent::_updateVolume( listener ); - - if( oldPreAttenuatedVolume != mPreAttenuatedVolume ) - SFXFMODDevice::smFunc->FMOD_Event_SetVolume( mHandle, mPreAttenuatedVolume ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventSource::_updatePitch() -{ - F32 oldEffectivePitch = mEffectivePitch; - Parent::_updatePitch(); - - if( mEffectivePitch != oldEffectivePitch ) - SFXFMODDevice::smFunc->FMOD_Event_SetPitch( mHandle, mEffectivePitch - 1.0f, FMOD_EVENT_PITCHUNITS_RAW ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventSource::_updatePriority() -{ - //TODO - Parent::_updatePriority(); -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventSource::_setMinMaxDistance( F32 min, F32 max ) -{ - Parent::_setMinMaxDistance( min, max ); - _update3DAttributes(); -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventSource::_setFadeTimes( F32 fadeInTime, F32 fadeOutTime ) -{ - Parent::_setFadeTimes( fadeInTime, fadeOutTime ); - - U32 fadeIn = U32( mFadeInTime * 1000.f ); - SFXFMODDevice::smFunc->FMOD_Event_SetPropertyByIndex( - mHandle, FMOD_EVENTPROPERTY_FADEIN, - &fadeIn, true - ); - - U32 fadeOut = U32( mFadeOutTime * 1000.f ); - SFXFMODDevice::smFunc->FMOD_Event_SetPropertyByIndex( - mHandle, FMOD_EVENTPROPERTY_FADEOUT, - &fadeOut, true - ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventSource::_setCone( F32 innerAngle, F32 outerAngle, F32 outerVolume ) -{ - Parent::_setCone( innerAngle, outerAngle, outerVolume ); - _update3DAttributes(); -} - -//----------------------------------------------------------------------------- - -void SFXFMODEventSource::_onParameterEvent( SFXParameter* parameter, SFXParameterEvent event ) -{ - Parent::_onParameterEvent( parameter, event ); - - // If it's a value-change on a custom parameter, - // pass it along to FMOD. - - if( getEvent() - && event == SFXParameterEvent_ValueChanged - && parameter->getChannel() == SFXChannelUser0 ) - { - const char* name = parameter->getInternalName(); - - FMOD_EVENTPARAMETER* fmodParameter; - if( SFXFMODDevice::smFunc->FMOD_Event_GetParameter( mHandle, name, &fmodParameter ) != FMOD_OK ) - { - Con::errorf( "SFXFMODEventSource::_onParameterEvent - could not access parameter '%s' of event '%s'", - name, getEvent()->getQualifiedName().c_str() ); - return; - } - - SFXFMODDevice::smFunc->FMOD_EventParameter_SetValue( fmodParameter, parameter->getValue() ); - } -} diff --git a/Engine/source/sfx/fmod/sfxFMODEventSource.h b/Engine/source/sfx/fmod/sfxFMODEventSource.h deleted file mode 100644 index 0e3493592..000000000 --- a/Engine/source/sfx/fmod/sfxFMODEventSource.h +++ /dev/null @@ -1,101 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#ifndef _SFXFMODEVENTSOURCE_H_ -#define _SFXFMODEVENTSOURCE_H_ - -#ifndef _SFXSOURCE_H_ - #include "sfx/sfxSource.h" -#endif - -#include "fmod_event.h" - - -class SFXFMODEvent; - - -/// An SFXSource that controls the playback of an SFXFMODEvent. -/// -/// SFXFMODEvents can be played back directly through their console methods. -/// However, this class integrates them with the remaining SFX system and makes -/// events usable wherever SFX tracks are usable though with the important -/// distinction that there can only ever be a single source for a given event. -/// -/// Note that calling playback methods directly on an event will cause a source -/// for the event to be created if there is not already one. -/// -/// Be aware that using fade-outs in events in combination with play-once sources -/// does not work well at the moment. -/// -class SFXFMODEventSource : public SFXSource -{ - public: - - typedef SFXSource Parent; - - protected: - - /// The event instance handle for this source. - FMOD_EVENT* mHandle; - - /// - SFXFMODEventSource( SFXFMODEvent* event ); - - /// Update 3D position, velocity, and orientation from current source transform. - void _update3DAttributes(); - - // SFXSource. - virtual void _updateStatus(); - virtual void _updateVolume( const MatrixF& listener ); - virtual void _updatePitch(); - virtual void _updatePriority(); - virtual void _onParameterEvent( SFXParameter* parameter, SFXParameterEvent event ); - virtual void _setMinMaxDistance( F32 min, F32 max ); - virtual void _setCone( F32 innerAngle, F32 outerAngle, F32 outerVolume ); - virtual void _setFadeTimes( F32 fadeInTime, F32 fadeOutTime ); - - public: - - /// - SFXFMODEventSource(); - - virtual ~SFXFMODEventSource(); - - /// Return the FMOD event object that is being played back by this source. - SFXFMODEvent* getEvent() const { return ( SFXFMODEvent* ) mTrack.getPointer(); } - - /// Create a new source for the given event. - static SFXFMODEventSource* create( SFXFMODEvent* event ); - - // SFXSource. - virtual void play( F32 fadeInTime = -1.f ); // fadeInTime ignored when resuming from paused - virtual void stop( F32 fadeOutTime = -1.f ); // fadeOutTime!=0 ignored - virtual void pause( F32 fadeOutTime = -1.f ); // fadeOutTime currently ignored - virtual void setTransform( const MatrixF& transform ); - virtual void setVelocity( const VectorF& velocity ); - - DECLARE_CONOBJECT( SFXFMODEventSource ); - DECLARE_CATEGORY( "SFX FMOD" ); - DECLARE_DESCRIPTION( "An SFX source controlling the playback of an FMOD Designer event." ); -}; - -#endif // !_SFXFMODEVENTSOURCE_H_ diff --git a/Engine/source/sfx/fmod/sfxFMODPlugin.cpp b/Engine/source/sfx/fmod/sfxFMODPlugin.cpp deleted file mode 100644 index 9db0af7ff..000000000 --- a/Engine/source/sfx/fmod/sfxFMODPlugin.cpp +++ /dev/null @@ -1,37 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#include "sfx/fmod/sfxFMODPlugin.h" -#include "sfx/fmod/sfxFMODEvent.h" -#include "sfx/fmod/sfxFMODEventSource.h" - - -//----------------------------------------------------------------------------- - -SFXSource* SFXFMODPlugin::createSource( SFXTrack* track ) -{ - SFXFMODEvent* event = dynamic_cast< SFXFMODEvent* >( track ); - if( !event ) - return NULL; - - return SFXFMODEventSource::create( event ); -} diff --git a/Engine/source/sfx/fmod/sfxFMODPlugin.h b/Engine/source/sfx/fmod/sfxFMODPlugin.h deleted file mode 100644 index 488cde742..000000000 --- a/Engine/source/sfx/fmod/sfxFMODPlugin.h +++ /dev/null @@ -1,48 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#ifndef _SFXFMODPLUGIN_H_ -#define _SFXFMODPLUGIN_H_ - -#ifndef _SFXSYSTEM_H_ - #include "sfx/sfxSystem.h" -#endif - - -/// SFXSystem plugin that adds the capability to create SFXSources for -/// Designer SFXFMODEvents. -/// -/// The plugin will only be installed if an FMOD device has been created. -/// While SFXFMODEvents may be constructed without an FMOD device, trying -/// to play such an event then will result in an error. -/// -class SFXFMODPlugin : public SFXSystemPlugin -{ - public: - - typedef SFXSystemPlugin Parent; - - /// - virtual SFXSource* createSource( SFXTrack* track ); -}; - -#endif // !_SFXFMODPLUGIN_H_ diff --git a/Engine/source/sfx/fmod/sfxFMODProject.cpp b/Engine/source/sfx/fmod/sfxFMODProject.cpp deleted file mode 100644 index 1f270492c..000000000 --- a/Engine/source/sfx/fmod/sfxFMODProject.cpp +++ /dev/null @@ -1,493 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#include "sfx/fmod/sfxFMODProject.h" -#include "sfx/fmod/sfxFMODDevice.h" -#include "sfx/fmod/sfxFMODEvent.h" -#include "sfx/fmod/sfxFMODEventGroup.h" -#include "sfx/sfxDescription.h" -#include "core/stringTable.h" -#include "core/volume.h" -#include "core/util/path.h" -#include "core/stream/fileStream.h" -#include "core/stream/bitStream.h" -#include "core/util/safeDelete.h" - - -IMPLEMENT_CO_DATABLOCK_V1( SFXFMODProject ); - - -ConsoleDocClass( SFXFMODProject, - "@brief An FMOD Designer project loaded into Torque.\n\n" - - "@section SFXFMODProject_resources Resource Loading\n\n" - - "@ingroup SFXFMOD\n" - "@ingroup Datablocks" -); - - -//----------------------------------------------------------------------------- - -SFXFMODProject::SFXFMODProject() - : mHandle( NULL ), - mRootGroups( NULL ) -{ - VECTOR_SET_ASSOCIATION( mGroups ); - VECTOR_SET_ASSOCIATION( mEvents ); - - SFX->getEventSignal().notify( this, &SFXFMODProject::_onSystemEvent ); -} - -//----------------------------------------------------------------------------- - -SFXFMODProject::~SFXFMODProject() -{ - AssertFatal( mGroups.empty(), "SFXFMODProject::~SFXFMODProject - project still has groups attached" ); - AssertFatal( mEvents.empty(), "SFXFMODProject::~SFXFMODProject - project still has events attached" ); - - if( SFX ) - SFX->getEventSignal().remove( this, &SFXFMODProject::_onSystemEvent ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODProject::initPersistFields() -{ - addGroup( "FMOD" ); - - addField( "fileName", TypeStringFilename, Offset( mFileName, SFXFMODProject ), "The compiled .fev file from FMOD Designer." ); - addField( "mediaPath", TypeStringFilename, Offset( mMediaPath, SFXFMODProject ), "Path to the media files; if unset, defaults to project directory." ); - - endGroup( "FMOD" ); - - Parent::initPersistFields(); -} - -//----------------------------------------------------------------------------- - -bool SFXFMODProject::onAdd() -{ - if( !Parent::onAdd() ) - return false; - - // If this is a non-networked datablock, load the - // project data now. - - if( isClientOnly() && !_load() ) - return false; - - return true; -} - -//----------------------------------------------------------------------------- - -void SFXFMODProject::onRemove() -{ - Parent::onRemove(); - - _clear(); -} - -//----------------------------------------------------------------------------- - -bool SFXFMODProject::preload( bool server, String& errorStr ) -{ - if( !Parent::preload( server, errorStr ) ) - return false; - - if( server ) - { - if( mFileName.isEmpty() ) - { - errorStr = String::ToString( "SFXFMODProject::preload - no filename set on %i (%s)", - getId(), getName() ); - return false; - } - - if( mGroups.empty() || mEvents.empty() ) - _load(); - - release(); - } - - return true; -} - -//----------------------------------------------------------------------------- - -void SFXFMODProject::packData( BitStream* stream ) -{ - Parent::packData( stream ); - - stream->write( mFileName ); - stream->write( mMediaPath ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODProject::unpackData( BitStream* stream ) -{ - Parent::unpackData( stream ); - - stream->read( &mFileName ); - stream->read( &mMediaPath ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODProject::_onSystemEvent( SFXSystemEventType event ) -{ - switch( event ) - { - case SFXSystemEvent_DestroyDevice: - - // If the FMOD device is being destroyed, - // release all our data. - - if( SFXFMODDevice::instance() ) - release(); - - break; - - default: - break; - } -} - -//----------------------------------------------------------------------------- - -void SFXFMODProject::_clear() -{ - release(); - - for( U32 i = 0; i < mGroups.size(); ++ i ) - if( !mGroups[ i ]->isRemoved() ) - mGroups[ i ]->deleteObject(); - - mGroups.clear(); - mEvents.clear(); - - mRootGroups = NULL; -} - -//----------------------------------------------------------------------------- - -bool SFXFMODProject::_load() -{ - const Torque::Path eventScriptFileName = mFileName + ".cs"; - const Torque::Path eventScriptFileNameDSO = eventScriptFileName + ".dso"; - const bool eventScriptFileExists = Torque::FS::IsFile( eventScriptFileName ); - const bool eventScriptFileDSOExists = Torque::FS::IsFile( eventScriptFileNameDSO ); - - // Check if we need to (re-)generate the event script file. - - bool needToGenerateEventScriptFile = false; - if( ( !eventScriptFileExists && !eventScriptFileDSOExists ) - || ( Torque::FS::CompareModifiedTimes( mFileName, eventScriptFileName ) > 0 - || Torque::FS::CompareModifiedTimes( mFileName, eventScriptFileNameDSO ) > 0 ) ) - needToGenerateEventScriptFile = true; - - // If we need to generate, check if we can. - - SFXFMODDevice* fmodDevice = SFXFMODDevice::instance(); - if( needToGenerateEventScriptFile && !fmodDevice ) - { - // If we have neither FMOD nor the event scripts (even if outdated), - // there's nothing we can do. - - if( !eventScriptFileExists && !eventScriptFileDSOExists ) - { - Con::errorf( "SFXFMODProject::_load() - event script for '%s' does not exist and device is not FMOD; load this project under FMOD first", - mFileName.c_str() ); - return false; - } - - // Use the oudated versions. - - Con::warnf( "SFXMODProject::_load() - event script for '%s' is outdated and device is not FMOD; event data may not match .fev contents", - mFileName.c_str() ); - needToGenerateEventScriptFile = false; - } - - // If we don't need to regenerate, try executing the event script now. - - if( !needToGenerateEventScriptFile ) - { - if( ( eventScriptFileExists || eventScriptFileDSOExists ) - && !Con::evaluatef( "exec( \"%s\" );", eventScriptFileName.getFullPath().c_str() ) ) - { - Con::errorf( "SFXFMODProject::_load() - failed to execute event script for '%s'%s", - mFileName.c_str(), - fmodDevice != NULL ? "; trying to regenerate" : "" - ); - - if( !fmodDevice ) - return false; - - needToGenerateEventScriptFile = true; - } - else - Con::printf( "SFXFMODProject - %s: Loaded event script", getName() ); - } - - // If we need to generate the event script file, - // load the FMOD project now and then emit the file. - - if( needToGenerateEventScriptFile ) - { - // Try to load the project. - - acquire(); - - if( !mHandle ) - return false; - - // Get the project info. - - FMOD_EVENT_PROJECTINFO info; - - int numEvents; - int numGroups; - - SFXFMODDevice::smFunc->FMOD_EventProject_GetInfo( mHandle, &info ); - SFXFMODDevice::smFunc->FMOD_EventProject_GetNumEvents( mHandle, &numEvents ); - SFXFMODDevice::smFunc->FMOD_EventProject_GetNumGroups( mHandle, &numGroups ); - - Con::printf( "SFXFMODProject - %s: Loading '%s' from '%s' (index: %i, events: %i, groups: %i)", - getName(), info.name, mFileName.c_str(), info.index, numEvents, numGroups ); - - // Load the root groups. - - for( U32 i = 0; i < numGroups; ++ i ) - { - FMOD_EVENTGROUP* group; - if( SFXFMODDevice::smFunc->FMOD_EventProject_GetGroupByIndex( mHandle, i, true, &group ) == FMOD_OK ) - { - SFXFMODEventGroup* object = new SFXFMODEventGroup( this, group ); - - object->mSibling = mRootGroups; - mRootGroups = object; - - String qualifiedName = FMODEventPathToTorqueName( object->getQualifiedName() ); - - if( !isClientOnly() ) - object->assignId(); - - object->registerObject( String::ToString( "%s_%s", getName(), qualifiedName.c_str() ) ); - if( isClientOnly() ) - Sim::getRootGroup()->addObject( object ); - - object->_load(); - } - } - - // Create the event script file. - - FileStream stream; - if( !stream.open( eventScriptFileName.getFullPath(), Torque::FS::File::Write ) ) - { - Con::errorf( "SFXFMODProject::_load - could not create event script file for '%s'", mFileName.c_str() ); - return true; // Don't treat as failure. - } - - // Write a header. - - stream.writeText( String::ToString( "// This file has been auto-generated from '%s'\n", mFileName.c_str() ) ); - stream.writeText( "// Do not edit this file manually and do not move it away from the Designer file.\n\n" ); - - // Write the group objects. - - for( U32 i = 0; i < mGroups.size(); ++ i ) - { - mGroups[ i ]->write( stream, 0 ); - stream.writeText( "\n" ); - } - - // Write the event objects along with their - // SFXDescriptions. - - for( U32 i = 0; i < mEvents.size(); ++ i ) - { - mEvents[ i ]->getDescription()->write( stream, 0 ); - mEvents[ i ]->write( stream, 0 ); - stream.writeText( "\n" ); - } - - Con::printf( "SFXFMODProject - %s: Generated event script '%s'", getName(), eventScriptFileName.getFullPath().c_str() ); - } - - return true; -} - -//----------------------------------------------------------------------------- - -void SFXFMODProject::acquire( bool recursive ) -{ - // Load the project file. - - if( !mHandle ) - { - FMOD_RESULT result = SFXFMODDevice::smFunc->FMOD_EventSystem_Load( - SFXFMODDevice::smEventSystem, - mFileName.c_str(), - ( FMOD_EVENT_LOADINFO* ) 0, - &mHandle - ); - - if( result != FMOD_OK ) - { - Con::errorf( "SFXFMODProject::acquire - could not load '%s' (%s)", - mFileName.c_str(), FMODResultToString( result ).c_str() ); - mHandle = NULL; - return; - } - - Con::printf( "SFXFMODProject - %s: Opened project '%s'", getName(), mFileName.c_str() ); - - // Set the media path. - - String mediaPath; - if( !mMediaPath.isEmpty() ) - { - mediaPath = mMediaPath; - if( mediaPath[ mediaPath.length() - 1 ] != '/' ) - mediaPath += '/'; - } - else - { - // Set to project directory. - - Torque::Path path = mFileName; - if( path.getRoot().isEmpty() ) - path.setRoot( "game" ); - path.setFileName( "" ); - path.setExtension( "" ); - - mediaPath = path.getFullPath() + '/'; - } - - SFXFMODDevice::smFunc->FMOD_EventSystem_SetMediaPath( - SFXFMODDevice::smEventSystem, - mediaPath.c_str() - ); - } - - // Acquire the root groups. - - if( recursive ) - for( SFXFMODEventGroup* group = mRootGroups; group != NULL; group = group->mSibling ) - group->acquire( true ); - - SFXFMODDevice::instance()->updateMemUsageStats(); -} - -//----------------------------------------------------------------------------- - -void SFXFMODProject::release() -{ - if( !mHandle ) - return; - - Con::printf( "SFXFMODProject - %s: Closing project '%s'", - getName(), mFileName.c_str() ); - - // Clear media path. - - SFXFMODDevice::smFunc->FMOD_EventSystem_SetMediaPath( - SFXFMODDevice::smEventSystem, "" ); - - // Release the root groups. - - for( SFXFMODEventGroup* group = mRootGroups; group != NULL; group = group->mSibling ) - group->release(); - - // Release the project. - - SFXFMODDevice::smFunc->FMOD_EventProject_Release( mHandle ); - mHandle = NULL; - - SFXFMODDevice::instance()->updateMemUsageStats(); -} - -//----------------------------------------------------------------------------- - -void SFXFMODProject::_addEvent( SFXFMODEvent* event ) -{ - mEvents.push_back( event ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODProject::_addGroup( SFXFMODEventGroup* group ) -{ - mGroups.push_back( group ); -} - -//----------------------------------------------------------------------------- - -void SFXFMODProject::_removeEvent( SFXFMODEvent* event ) -{ - for( U32 i = 0; i < mEvents.size(); ++ i ) - if( mEvents[ i ] == event ) - { - mEvents.erase( i ); - break; - } -} - -//----------------------------------------------------------------------------- - -void SFXFMODProject::_removeGroup( SFXFMODEventGroup* group ) -{ - // Remove from group array. - - for( U32 i = 0; i < mGroups.size(); ++ i ) - if( mGroups[ i ] == group ) - { - mGroups.erase( i ); - break;; - } - - // Unlink if it's a root group. - - if( !group->mParent ) - { - if( group == mRootGroups ) - { - mRootGroups = group->mSibling; - group->mSibling = NULL; - } - else - { - SFXFMODEventGroup* p = mRootGroups; - while( p && p->mSibling != group ) - p = p->mSibling; - - if( p ) - { - p->mSibling = group->mSibling; - group->mSibling = NULL; - } - } - } -} diff --git a/Engine/source/sfx/fmod/sfxFMODProject.h b/Engine/source/sfx/fmod/sfxFMODProject.h deleted file mode 100644 index 0160e321b..000000000 --- a/Engine/source/sfx/fmod/sfxFMODProject.h +++ /dev/null @@ -1,162 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#ifndef _SFXFMODPROJECT_H_ -#define _SFXFMODPROJECT_H_ - -#ifndef _SIMDATABLOCK_H_ - #include "console/simDatablock.h" -#endif -#ifndef _CONSOLETYPES_H_ - #include "console/consoleTypes.h" -#endif -#ifndef _TVECTOR_H_ - #include "core/util/tVector.h" -#endif -#ifndef _SFXSYSTEM_H_ - #include "sfx/sfxSystem.h" -#endif - -#include "fmod_event.h" - - -class SFXFMODEvent; -class SFXFMODEventGroup; -class SimGroup; - - - -/// Datablock that loads an FMOD Designer project. -/// -/// All events in the project are automatically made available as SFXFMODEvent track -/// datablock instances. Each event object is automatically named by substituting -/// the slashes in its fully qualified name with underscores and preprending the project -/// name to this; event 'group1/group2/event' in the SFXFMODProject instance called -/// 'project', for example, will be available as a TorqueScript object called -/// 'project_group1_group2_event'. -/// -/// This class also works in a client-server environment where the server is -/// not running FMOD. The event objects are cached in an auto-generated TorqueScript -/// file alongside the .fev project file (x/y.fev -> x/y.fev.cs) which, when available -/// and up-to-date, does not require FMOD for the server-side objects to correctly -/// initialize. -/// -/// To establish good loading behavior and for good memory management, it is necessary to -/// wisely distribute events to groups and to manually pre-load groups. The best solution -/// probably is to have one group of common events that is loaded during game startup and -/// then have one event group for each level in the game that is only loaded for the -/// duration of its particular level. -/// -/// SFXFMODProject will propagate it's networking model to all its contents. This means -/// that if the project is a non-networked datablock, then all event groups, events, and -/// descriptions contained in the project will also be non-networked datablocks. -/// -/// It usually makes the most sense to use non-networked ("client-only") datablocks as -/// otherwise the FMOD datablocks will be purged on each mission load. -/// -/// @note Only one project's music data can ever be loaded at any one time. -/// Usually you wouldn't want more than a single SFXFMODProject instance in your game -/// data. Also, only a single media path can be set through the designer API so when -/// loading multiple projects, note that each project will set the media path to its -/// own directory. For data loading to work, all project thus need to be placed in -/// the same directory. -/// -class SFXFMODProject : public SimDataBlock -{ - public: - - typedef SimDataBlock Parent; - friend class SFXFMODEventGroup; // _addGroup - friend class SFXFMODEvent; // _addEvent - - protected: - - /// - String mFileName; - - /// - String mMediaPath; - - /// - SFXFMODEventGroup* mRootGroups; - - /// A flat list of all the groups in this projet. - Vector< SFXFMODEventGroup* > mGroups; - - /// A flat list of all the events in the project. - Vector< SFXFMODEvent* > mEvents; - - /// - FMOD_EVENTPROJECT* mHandle; - - /// - void _onSystemEvent( SFXSystemEventType event ); - - /// - void _clear(); - - /// - bool _load(); - - /// - void _addEvent( SFXFMODEvent* event ); - - /// - void _addGroup( SFXFMODEventGroup* group ); - - /// - void _removeEvent( SFXFMODEvent* event ); - - /// - void _removeGroup( SFXFMODEventGroup* group ); - - public: - - /// - SFXFMODProject(); - - virtual ~SFXFMODProject(); - - /// - void acquire( bool recursive = false ); - - /// - void release(); - - /// - const String& getFileName() const { return mFileName; } - - // SimDataBlock. - virtual bool onAdd(); - virtual void onRemove(); - virtual bool preload( bool server, String& errorStr ); - virtual void packData( BitStream* stream ); - virtual void unpackData( BitStream* stream ); - - static void initPersistFields(); - - DECLARE_CONOBJECT( SFXFMODProject ); - DECLARE_CATEGORY( "SFX FMOD" ); - DECLARE_DESCRIPTION( "An FMOD Designer project." ); -}; - -#endif // !_SFXFMODPROJECT_H_ diff --git a/Engine/source/sfx/fmod/sfxFMODProvider.cpp b/Engine/source/sfx/fmod/sfxFMODProvider.cpp deleted file mode 100644 index f38721c13..000000000 --- a/Engine/source/sfx/fmod/sfxFMODProvider.cpp +++ /dev/null @@ -1,398 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#include "sfx/sfxProvider.h" -#include "sfx/fmod/sfxFMODDevice.h" -#include "core/util/safeRelease.h" -#include "console/console.h" -#include "core/util/safeDelete.h" -#include "core/module.h" -#include "console/consoleTypes.h" - - -class SFXFMODProvider : public SFXProvider -{ -public: - - SFXFMODProvider() - : SFXProvider( "FMOD" ) - { - Con::addVariable( "$SFX::Device::fmodNumEventSources", TypeS32, &SFXFMODDevice::smStatNumEventSources, - "The current number of SFXFMODEventSource instances in the system.\n" - "This tells the number of sounds in the system that are currently playing FMOD Designer events.\n\n" - "@note Only relevant if an %FMOD sound device is used.\n\n" - "@ingroup SFXFMOD" ); - Con::addVariable( "$SFX::Device::fmodCoreMem", TypeS32, &SFXFMODDevice::smStatMemUsageCore, - "Current number of bytes allocated by the core %FMOD sound system.\n\n" - "@note Only relevant if an %FMOD sound device is used.\n\n" - "@ingroup SFXFMOD" ); - Con::addVariable( "$SFX::Device::fmodEventMem", TypeS32, &SFXFMODDevice::smStatMemUsageEvents, - "Current number of bytes allocated by the %FMOD Designer event system.\n\n" - "@note Only relevant if an %FMOD sound device is used and the FMOD event DLL is loaded.\n\n" - "@ingroup SFXFMOD" ); - - Con::addVariable( "$pref::SFX::FMOD::disableSoftware", TypeBool, &SFXFMODDevice::smPrefDisableSoftware, - "Whether to disable the %FMOD software mixer to conserve memory.\n" - "All sounds not created with SFXDescription::useHardware or using DSP effects will fail to load.\n\n" - "@note Only applies when using an %FMOD sound device.\n\n" - "@ingroup SFXFMOD" ); - Con::addVariable( "$pref::SFX::FMOD::useSoftwareHRTF", TypeBool, &SFXFMODDevice::smPrefUseSoftwareHRTF, - "Whether to enable HRTF in %FMOD's software mixer.\n" - "This will add a lowpass filter effect to the DSP effect chain of all sounds mixed in software.\n\n" - "@note Only applies when using an %FMOD sound device.\n\n" - "@ingroup SFXFMOD" ); - Con::addVariable( "$pref::SFX::FMOD::enableProfile", TypeBool, &SFXFMODDevice::smPrefEnableProfile, - "Whether to enable support for %FMOD's profiler.\n\n" - "@note Only applies when using an %FMOD sound device.\n\n" - "@ref FMOD_profiler\n\n" - "@ingroup SFXFMOD" ); - Con::addVariable( "$pref::SFX::FMOD::DSoundHRTF", TypeString, &SFXFMODDevice::smPrefDSoundHRTF, - "The type of HRTF to use for hardware-mixed 3D sounds when %FMOD is using DirectSound for sound output " - "and hardware-acceleration is not available.\n\n" - "Options are\n" - "- \"none\": simple stereo panning/doppler/attenuation\n" - "- \"light\": slightly higher quality than \"none\"\n" - "- \"full\": full quality 3D playback\n\n" - "@note Only applies when using an %FMOD sound device.\n\n" - "@ingroup SFXFMOD" ); - Con::addVariable( "$pref::SFX::FMOD::pluginPath", TypeString, &SFXFMODDevice::smPrefPluginPath, - "%Path to additional %FMOD plugins.\n\n" - "@note Only applies when using an %FMOD sound device.\n\n" - "@ingroup SFXFMOD" ); - } - virtual ~SFXFMODProvider(); - -protected: - FModFNTable mFMod; - - struct FModDeviceInfo : SFXDeviceInfo - { - FMOD_CAPS mCaps; - FMOD_SPEAKERMODE mSpeakerMode; - }; - - void init(); - - bool _createSystem(); - -public: - - SFXDevice* createDevice( const String& deviceName, bool useHardware, S32 maxBuffers ); - -}; - -MODULE_BEGIN( FMOD ) - - MODULE_INIT_BEFORE( SFX ) - MODULE_SHUTDOWN_AFTER( SFX ) - - SFXFMODProvider* mProvider; - - MODULE_INIT - { - mProvider = new SFXFMODProvider; - } - - MODULE_SHUTDOWN - { - delete mProvider; - } - -MODULE_END; - - -//------------------------------------------------------------------------------ -// Helper - -bool fmodBindFunction( DLibrary *dll, void *&fnAddress, const char* name ) -{ - if( !dll ) - return false; - - fnAddress = dll->bind( name ); - - if (!fnAddress) - Con::warnf( "FMOD Loader: DLL bind failed for %s", name ); - - return fnAddress != 0; -} - -//------------------------------------------------------------------------------ - -void SFXFMODProvider::init() -{ -#ifdef TORQUE_FMOD_STATIC - - // FMOD statically linked. - - mFMod.isLoaded = true; - #define FMOD_FUNCTION(fn_name, fn_args) \ - (*(void**)&mFMod.fn_name.fn) = &fn_name; - - #ifndef TORQUE_FMOD_NO_EVENTS - mFMod.eventIsLoaded = true; - #define FMOD_EVENT_FUNCTION(fn_name, fn_args) \ - (*(void**)&mFMod.fn_name.fn) = &fn_name; - #else - #define FMOD_EVENT_FUNCTION( fn_name, fn_args ) - #endif - - #include FMOD_FN_FILE - - #undef FMOD_FUNCTION - #undef FMOD_EVENT_FUNCTION - -#else - - // FMOD dynamically linked. - - const char* dllName; - const char* pDllName; // plugin-based DLL - const char* eventDllName; - -#ifdef _WIN64 - dllName = "fmodex64.dll"; - pDllName = "fmodexp64.dll"; - eventDllName = "fmod_event64.dll"; -#elif defined(TORQUE_OS_WIN) - dllName = "fmodex.dll"; - pDllName = "fmodexp.dll"; - eventDllName = "fmod_event.dll"; -#elif defined( TORQUE_OS_MAC ) - dllName = "libfmodex.dylib"; - pDllName = "libfmodexp.dylib"; - eventDllName = "libfmodevent.dylib"; -#else -# warning Need to set FMOD DLL filename for platform. - return; -#endif - - // Grab the functions we'll want from the fmod DLL. - mFMod.dllRef = OsLoadLibrary( dllName ); - - // Try the plugin-based version. - if( !mFMod.dllRef ) - mFMod.dllRef = OsLoadLibrary( pDllName ); - - if(!mFMod.dllRef) - { - Con::warnf( "SFXFMODProvider - Could not locate '%s' or '%s' - FMOD not available.", dllName, pDllName ); - return; - } - - mFMod.eventDllRef = OsLoadLibrary( eventDllName ); - if(!mFMod.eventDllRef) - Con::warnf( "SFXFMODProvider - Could not locate %s - FMOD Designer integration not available.", eventDllName ); - - mFMod.isLoaded = true; - mFMod.eventIsLoaded = true; - - #define FMOD_FUNCTION(fn_name, fn_args) \ - mFMod.isLoaded &= fmodBindFunction(mFMod.dllRef, *(void**)&mFMod.fn_name.fn, #fn_name); - #define FMOD_EVENT_FUNCTION(fn_name, fn_args) \ - mFMod.eventIsLoaded &= fmodBindFunction(mFMod.eventDllRef, *(void**)&mFMod.fn_name.fn, #fn_name); - - #include FMOD_FN_FILE - - #undef FMOD_FUNCTION - #undef FMOD_EVENT_FUNCTION - - if(mFMod.isLoaded == false) - { - Con::warnf("SFXFMODProvider - Could not load %s - FMOD not available.", dllName); - return; - } - if( !mFMod.eventIsLoaded && mFMod.eventDllRef ) - Con::warnf("SFXFMODProvider - Could not load %s - FMOD Designer integration not available.", eventDllName); - -#endif - - FMOD_RESULT res; - - // Create the FMOD system object. - - if( !_createSystem() ) - return; - - // Check that the Ex API version is OK. - - unsigned int version; - res = mFMod.FMOD_System_GetVersion(SFXFMODDevice::smSystem, &version); - FModAssert(res, "SFXFMODProvider - Failed to get FMOD version!"); - - Con::printf( "SFXFMODProvider - FMOD Ex API version: %x.%x.%x", - ( version & 0xffff0000 ) >> 16, - ( version & 0x0000ff00 ) >> 8, - ( version & 0x000000ff ) - ); - - if(version < FMOD_VERSION) - { - Con::warnf("SFXFMODProvider - FMOD Ex API version in DLL is too old - FMOD not available."); - return; - } - - // Check that the Designer API version is ok. - - if( mFMod.eventIsLoaded ) - { - res = mFMod.FMOD_EventSystem_GetVersion( SFXFMODDevice::smEventSystem, &version ); - FModAssert(res, "SFXFMODProvider - Failed to get FMOD version!"); - - Con::printf( "SFXFMODProvider - FMOD Designer API version: %x.%x.%x", - ( version & 0xffff0000 ) >> 16, - ( version & 0x0000ff00 ) >> 8, - ( version & 0x000000ff ) - ); - - if( version < FMOD_EVENT_VERSION ) - { - Con::errorf( "SFXFMODProvider - FMOD Designer API version in DLL is too old!" ); - return; - } - } - - // Now, enumerate our devices. - int numDrivers; - res = mFMod.FMOD_System_GetNumDrivers(SFXFMODDevice::smSystem, &numDrivers); - FModAssert(res, "SFXFMODProvider - Failed to get driver count - FMOD not available."); - - char nameBuff[256]; - - for(S32 i=0; iname = String( nameBuff ); - fmodInfo->hasHardware = caps & FMOD_CAPS_HARDWARE; - fmodInfo->maxBuffers = 32; - fmodInfo->driver = String(); - fmodInfo->mCaps = caps; - fmodInfo->mSpeakerMode = speakerMode; - - mDeviceInfo.push_back(fmodInfo); - } - - // Did we get any devices? - if ( mDeviceInfo.empty() ) - { - Con::warnf( "SFXFMODProvider - No valid devices found - FMOD not available." ); - return; - } - - // TODO: FMOD_Memory_Initialize -#ifdef TORQUE_OS_XENON - const dsize_t memSz = 5 * 1024 * 1024; - void *memBuffer = XPhysicalAlloc( memSz, MAXULONG_PTR, 0, PAGE_READWRITE ); - mFMod.FMOD_Memory_Initialize( memBuffer, memSz, FMOD_MEMORY_ALLOCCALLBACK(NULL), FMOD_MEMORY_REALLOCCALLBACK(NULL), FMOD_MEMORY_FREECALLBACK(NULL) ); -#endif - - // Wow, we made it - register the provider. - regProvider( this ); -} - -SFXFMODProvider::~SFXFMODProvider() -{ - if( SFXFMODDevice::smEventSystem ) - { - mFMod.FMOD_EventSystem_Release( SFXFMODDevice::smEventSystem ); - SFXFMODDevice::smEventSystem = NULL; - SFXFMODDevice::smSystem = NULL; - } - else if( SFXFMODDevice::smSystem ) - { - mFMod.FMOD_System_Release( SFXFMODDevice::smSystem ); - SFXFMODDevice::smSystem = NULL; - } -} - -SFXDevice* SFXFMODProvider::createDevice( const String& deviceName, bool useHardware, S32 maxBuffers ) -{ - FModDeviceInfo* info = dynamic_cast< FModDeviceInfo* > - ( _findDeviceInfo( deviceName ) ); - - if( !info ) - return NULL; - - if( !SFXFMODDevice::smSystem && !_createSystem() ) - return false; - - SFXFMODDevice* device = new SFXFMODDevice(this, &mFMod, 0, info->name ); - if( !device->_init() ) - SAFE_DELETE( device ); - - return device; -} - -bool SFXFMODProvider::_createSystem() -{ - AssertFatal( !SFXFMODDevice::smEventSystem, "SFXFMODProvider::_createSystem() - event system already created!" ); - AssertFatal( !SFXFMODDevice::smSystem, "SFXFMODProvider::_createSystem() - system already created!" ); - - if( mFMod.eventIsLoaded ) - { - FMOD_RESULT res = mFMod.FMOD_EventSystem_Create( &SFXFMODDevice::smEventSystem ); - if( res != FMOD_OK ) - { - Con::errorf( "SFXFMODProvider - could not create the FMOD event system." ); - return false; - } - - res = mFMod.FMOD_EventSystem_GetSystemObject( SFXFMODDevice::smEventSystem, &SFXFMODDevice::smSystem ); - if( res != FMOD_OK ) - { - Con::errorf( "SFXFMODProvider - could not retrieve the FMOD system object." ); - return false; - } - } - else - { - // Allocate the FMod system. - - FMOD_RESULT res = mFMod.FMOD_System_Create( &SFXFMODDevice::smSystem ); - if( res != FMOD_OK ) - { - // Failed - deal with it! - Con::errorf("SFXFMODProvider - could not create the FMOD system."); - return false; - } - } - - return true; -} diff --git a/Engine/source/sfx/fmod/sfxFMODVoice.cpp b/Engine/source/sfx/fmod/sfxFMODVoice.cpp deleted file mode 100644 index 05ace6e2b..000000000 --- a/Engine/source/sfx/fmod/sfxFMODVoice.cpp +++ /dev/null @@ -1,303 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#include "platform/platform.h" -#include "sfx/fmod/sfxFMODVoice.h" - -#include "sfx/fmod/sfxFMODBuffer.h" -#include "sfx/fmod/sfxFMODDevice.h" -#include "core/tAlgorithm.h" - - -SFXFMODVoice* SFXFMODVoice::create( SFXFMODDevice *device, - SFXFMODBuffer *buffer ) -{ - AssertFatal( device, "SFXFMODVoice::create() - Got null device!" ); - AssertFatal( buffer, "SFXFMODVoice::create() - Got null buffer!" ); - - return new SFXFMODVoice( device, buffer ); -} - -SFXFMODVoice::SFXFMODVoice( SFXFMODDevice *device, - SFXFMODBuffer *buffer ) - : Parent( buffer ), - mDevice( device ), - mChannel( NULL ) -{ - AssertFatal( device, "SFXFMODVoice::SFXFMODVoice() - No device assigned!" ); - AssertFatal( buffer, "SFXFMODVoice::SFXFMODVoice() - No buffer assigned!" ); - AssertFatal( _getBuffer()->mSound != NULL, "SFXFMODVoice::SFXFMODVoice() - No sound assigned!" ); -} - -SFXFMODVoice::~SFXFMODVoice() -{ - _stop(); -} - -SFXStatus SFXFMODVoice::_status() const -{ - if( mChannel ) - { - FMOD_BOOL isTrue = false; - SFXFMODDevice::smFunc->FMOD_Channel_GetPaused( mChannel, &isTrue ); - if ( isTrue ) - return SFXStatusPaused; - - SFXFMODDevice::smFunc->FMOD_Channel_IsPlaying( mChannel, &isTrue ); - if ( isTrue ) - return SFXStatusPlaying; - } - - SFXFMODDevice::smFunc->FMOD_Channel_Stop( mChannel ); - mChannel = NULL; - - return SFXStatusStopped; -} - -void SFXFMODVoice::_play() -{ - if( !mChannel ) - _assignChannel(); - - SFXFMODDevice::smFunc->FMOD_Channel_SetPaused( mChannel, false ); -} - -void SFXFMODVoice::_pause() -{ - if( mChannel ) - SFXFMODDevice::smFunc->FMOD_Channel_SetPaused( mChannel, true ); -} - -void SFXFMODVoice::_stop() -{ - if( mChannel ) - SFXFMODDevice::smFunc->FMOD_Channel_Stop(mChannel); - - mChannel = NULL; -} - -void SFXFMODVoice::_seek( U32 sample ) -{ - if( !mChannel ) - _assignChannel(); - - SFXFMODDevice::smFunc->FMOD_Channel_SetPosition - ( mChannel, sample, FMOD_TIMEUNIT_PCM ); -} - -bool SFXFMODVoice::_assignChannel() -{ - AssertFatal( _getBuffer()->mSound != NULL, "SFXFMODVoice::_assignChannel() - No sound assigned!" ); - - // we start playing it now in the paused state, so that we can immediately set attributes that - // depend on having a channel (position, volume, etc). According to the FMod docs - // it is ok to do this. - bool success = SFXFMODDevice::smFunc->FMOD_System_PlaySound( - SFXFMODDevice::smSystem, - FMOD_CHANNEL_FREE, - _getBuffer()->mSound, - true, - &mChannel ) == FMOD_OK; - - if( success ) - { - SFXFMODDevice::smFunc->FMOD_Channel_SetMode( mChannel, mMode ); - SFXFMODDevice::smFunc->FMOD_Channel_SetLoopCount( mChannel, mMode & FMOD_LOOP_NORMAL ? -1 : 0 ); - - if( mSetFlags.test( SET_Velocity ) ) - SFXFMODDevice::smFunc->FMOD_Channel_Set3DAttributes( mChannel, ( const FMOD_VECTOR* ) NULL, &mVelocity ); - if( mSetFlags.test( SET_MinMaxDistance ) ) - SFXFMODDevice::smFunc->FMOD_Channel_Set3DMinMaxDistance(mChannel, mMinDistance, mMaxDistance); - if( mSetFlags.test( SET_Transform ) ) - { - SFXFMODDevice::smFunc->FMOD_Channel_Set3DAttributes( mChannel, &mPosition, ( const FMOD_VECTOR* ) NULL ); - SFXFMODDevice::smFunc->FMOD_Channel_Set3DConeOrientation( mChannel, &mDirection ); - } - if( mSetFlags.test( SET_Volume ) ) - SFXFMODDevice::smFunc->FMOD_Channel_SetVolume(mChannel, mVolume); - if( mSetFlags.test( SET_Pitch ) ) - SFXFMODDevice::smFunc->FMOD_Channel_SetFrequency( mChannel, mFrequency ); - if( mSetFlags.test( SET_Cone ) ) - SFXFMODDevice::smFunc->FMOD_Channel_Set3DConeSettings( - mChannel, - mConeInnerAngle, - mConeOuterAngle, - mConeOuterVolume ); - if( mSetFlags.test( SET_Priority ) ) - SFXFMODDevice::smFunc->FMOD_Channel_SetPriority( mChannel, TorquePriorityToFMODPriority( mPriority ) ); - if( mSetFlags.test( SET_Reverb ) ) - SFXFMODDevice::smFunc->FMOD_Channel_SetReverbProperties( mChannel, &mReverb ); - } - - return success; -} - -U32 SFXFMODVoice::_tell() const -{ - if( !mChannel ) - return 0; - - U32 pos; - SFXFMODDevice::smFunc->FMOD_Channel_GetPosition( mChannel, &pos, ( FMOD_TIMEUNIT ) FMOD_TIMEUNIT_PCMBYTES ); - return _getBuffer()->getSamplePos( pos ); -} - -void SFXFMODVoice::setMinMaxDistance( F32 min, F32 max ) -{ - if ( !( _getBuffer()->mMode & FMOD_3D ) ) - return; - - mMinDistance = min; - mMaxDistance = max; - - mSetFlags.set( SET_MinMaxDistance ); - - if( mChannel ) - SFXFMODDevice::smFunc->FMOD_Channel_Set3DMinMaxDistance(mChannel, mMinDistance, mMaxDistance); -} - -void SFXFMODVoice::play( bool looping ) -{ - if( mBuffer->isStreaming() ) - looping = true; - - mMode = mDevice->get3dRollOffMode(); - mMode |= (looping ? FMOD_LOOP_NORMAL : FMOD_LOOP_OFF); - - Parent::play( looping ); -} - -void SFXFMODVoice::setVelocity( const VectorF& velocity ) -{ - if( !( _getBuffer()->mMode & FMOD_3D ) ) - return; - - // Note we have to do a handedness swap; see the - // listener update code in SFXFMODDevice for details. - mVelocity.x = velocity.x; - mVelocity.y = velocity.z; - mVelocity.z = velocity.y; - - mSetFlags.set( SET_Velocity ); - - if( mChannel ) - SFXFMODDevice::smFunc->FMOD_Channel_Set3DAttributes( mChannel, ( const FMOD_VECTOR* ) NULL, &mVelocity ); -} - -void SFXFMODVoice::setTransform( const MatrixF& transform ) -{ - if ( !( _getBuffer()->mMode & FMOD_3D ) ) - return; - - transform.getColumn( 3, (Point3F*)&mPosition ); - transform.getColumn( 1, (Point3F*)&mDirection ); - - // Note we have to do a handedness swap; see the - // listener update code in SFXFMODDevice for details. - swap( mPosition.y, mPosition.z ); - swap( mDirection.y, mDirection.z ); - - mSetFlags.set( SET_Transform ); - - if( mChannel ) - { - // This can fail safe, so don't assert if it fails. - SFXFMODDevice::smFunc->FMOD_Channel_Set3DAttributes( mChannel, &mPosition, ( const FMOD_VECTOR* ) NULL ); - SFXFMODDevice::smFunc->FMOD_Channel_Set3DConeOrientation( mChannel, &mDirection ); - } -} - -void SFXFMODVoice::setVolume( F32 volume ) -{ - mVolume = volume; - mSetFlags.set( SET_Volume ); - - if( mChannel ) - SFXFMODDevice::smFunc->FMOD_Channel_SetVolume( mChannel, volume ); -} - -void SFXFMODVoice::setPriority( F32 priority ) -{ - mPriority = priority; - mSetFlags.set( SET_Priority ); - - if( mChannel ) - SFXFMODDevice::smFunc->FMOD_Channel_SetPriority( mChannel, TorquePriorityToFMODPriority( priority ) ); -} - -void SFXFMODVoice::setPitch( F32 pitch ) -{ - // if we do not know the frequency, we cannot change the pitch - F32 frequency = _getBuffer()->getFormat().getSamplesPerSecond(); - if ( frequency == 0 ) - return; - - mFrequency = frequency * pitch; - - mSetFlags.set( SET_Pitch ); - - // Scale the original frequency by the pitch factor. - if( mChannel ) - SFXFMODDevice::smFunc->FMOD_Channel_SetFrequency(mChannel, mFrequency); -} - -void SFXFMODVoice::setCone( F32 innerAngle, F32 outerAngle, F32 outerVolume ) -{ - mConeInnerAngle = innerAngle; - mConeOuterAngle = outerAngle; - mConeOuterVolume = outerVolume; - - mSetFlags.set( SET_Cone ); - - if( mChannel ) - SFXFMODDevice::smFunc->FMOD_Channel_Set3DConeSettings( - mChannel, - mConeInnerAngle, - mConeOuterAngle, - mConeOuterVolume ); -} - -void SFXFMODVoice::setReverb( const SFXSoundReverbProperties& reverb ) -{ - dMemset( &mReverb, 0, sizeof( mReverb ) ); - - mReverb.Direct = reverb.mDirect; - mReverb.Room = reverb.mRoom; - mReverb.Flags = reverb.mFlags; - - mSetFlags.set( SET_Reverb ); - - if( mChannel ) - SFXFMODDevice::smFunc->FMOD_Channel_SetReverbProperties( mChannel, &mReverb ); -} - -bool SFXFMODVoice::isVirtual() const -{ - if( mChannel ) - { - FMOD_BOOL result; - SFXFMODDevice::smFunc->FMOD_Channel_IsVirtual( mChannel, &result ); - return result; - } - else - return false; -} diff --git a/Engine/source/sfx/fmod/sfxFMODVoice.h b/Engine/source/sfx/fmod/sfxFMODVoice.h deleted file mode 100644 index 14a5f7ced..000000000 --- a/Engine/source/sfx/fmod/sfxFMODVoice.h +++ /dev/null @@ -1,121 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - -#ifndef _SFXFMODVOICE_H_ -#define _SFXFMODVOICE_H_ - -#ifndef _SFXDEVICE_H_ - #include "sfx/sfxDevice.h" -#endif -#ifndef _SFXVOICE_H_ - #include "sfx/sfxVoice.h" -#endif -#ifndef _BITSET_H_ - #include "core/bitSet.h" -#endif - -#include "fmod.h" - -class SFXSource; -class SFXFMODBuffer; -class SFXFMODDevice; - - -class SFXFMODVoice : public SFXVoice -{ - typedef SFXVoice Parent; - friend class SFXFMODBuffer; - - protected: - - SFXFMODDevice *mDevice; - - mutable FMOD_CHANNEL *mChannel; - - enum ESettings - { - SET_MinMaxDistance = BIT( 0 ), - SET_Velocity = BIT( 1 ), - SET_Transform = BIT( 2 ), - SET_Volume = BIT( 3 ), - SET_Pitch = BIT( 4 ), - SET_Cone = BIT( 5 ), - SET_Priority = BIT( 6 ), - SET_Reverb = BIT( 7 ), - }; - - BitSet32 mSetFlags; - - FMOD_MODE mMode; - F32 mMinDistance; - F32 mMaxDistance; - F32 mVolume; - F32 mPriority; - F32 mFrequency; - F32 mConeInnerAngle; - F32 mConeOuterAngle; - F32 mConeOuterVolume; - FMOD_VECTOR mVelocity; - FMOD_VECTOR mPosition; - FMOD_VECTOR mDirection; - FMOD_REVERB_CHANNELPROPERTIES mReverb; - - /// - SFXFMODVoice( SFXFMODDevice *device, - SFXFMODBuffer *buffer ); - - // prep for playback - bool _assignChannel(); - - SFXFMODBuffer* _getBuffer() const { return ( SFXFMODBuffer* ) mBuffer.getPointer(); } - - // SFXVoice. - virtual SFXStatus _status() const; - virtual void _play(); - virtual void _pause(); - virtual void _stop(); - virtual void _seek( U32 sample ); - virtual U32 _tell() const; - - public: - - /// - static SFXFMODVoice* create( SFXFMODDevice *device, - SFXFMODBuffer *buffer ); - - /// - virtual ~SFXFMODVoice(); - - /// SFXVoice - void setMinMaxDistance( F32 min, F32 max ); - void play( bool looping ); - void setVelocity( const VectorF& velocity ); - void setTransform( const MatrixF& transform ); - void setVolume( F32 volume ); - void setPriority( F32 priority ); - void setPitch( F32 pitch ); - void setCone( F32 innerAngle, F32 outerAngle, F32 outerVolume ); - void setReverb( const SFXSoundReverbProperties& reverb ); - bool isVirtual() const; -}; - -#endif // _SFXFMODBUFFER_H_ \ No newline at end of file diff --git a/Engine/source/sfx/sfxDescription.cpp b/Engine/source/sfx/sfxDescription.cpp index f07a8f7d6..143e0a31e 100644 --- a/Engine/source/sfx/sfxDescription.cpp +++ b/Engine/source/sfx/sfxDescription.cpp @@ -247,7 +247,6 @@ void SFXDescription::initPersistFields() "If true, the sound system will try to allocate the voice for the sound directly " "on the sound hardware for mixing by the hardware mixer. Be aware that a hardware mixer " "may not provide all features available to sounds mixed in software.\n\n" - "@note This flag currently only takes effect when using FMOD.\n\n" "@note Generally, it is preferable to let sounds be mixed in software.\n\n" ); addField( "parameters", TypeSFXParameterName, Offset( mParameters, SFXDescription ), MaxNumParameters, "Names of the parameters to which sources using this description will automatically be linked.\n\n" @@ -355,7 +354,7 @@ void SFXDescription::initPersistFields() "@ref SFXSource_cones" ); addField( "rolloffFactor", TypeF32, Offset( mRolloffFactor, SFXDescription ), "Scale factor to apply to logarithmic distance attenuation curve. If -1, the global rolloff setting is used.\n\n" - "@note Per-sound rolloff is only supported on OpenAL and FMOD at the moment. With other divices, the global rolloff setting " + "@note Per-sound rolloff is only supported on OpenAL at the moment. With other divices, the global rolloff setting " "is used for all sounds.\n" "@see LevelInfo::soundDistanceModel" ); @@ -373,7 +372,6 @@ void SFXDescription::initPersistFields() "of sample data determined by this field. The greater its value, the more sample data each " "packet contains, the more work is done per packet.\n\n" "@note This field only takes effect when Torque's own sound system performs the streaming. " - "When FMOD is used, this field is ignored and streaming is performed by FMOD.\n\n" "@ref SFX_streaming" ); addField( "streamReadAhead", TypeS32, Offset( mStreamReadAhead, SFXDescription ), "Number of sample packets to read and buffer in advance.\n" @@ -382,7 +380,6 @@ void SFXDescription::initPersistFields() "device before the playback queue is running dry. Greater values thus allow for more lag " "in the streaming pipeline.\n\n" "@note This field only takes effect when Torque's own sound system performs the streaming. " - "When FMOD is used, this field is ignored and streaming is performed by FMOD.\n\n" "@ref SFX_streaming" ); endGroup( "Streaming" ); diff --git a/Engine/source/sfx/sfxDevice.h b/Engine/source/sfx/sfxDevice.h index f7dc66b77..a2389f587 100644 --- a/Engine/source/sfx/sfxDevice.h +++ b/Engine/source/sfx/sfxDevice.h @@ -63,7 +63,6 @@ class SFXDevice CAPS_Occlusion = BIT( 2 ), ///< Device has its own sound occlusion handling (SFXOcclusionManager). CAPS_DSPEffects = BIT( 3 ), ///< Device implements DSP effects (SFXDSPManager). CAPS_MultiListener = BIT( 4 ), ///< Device supports multiple listeners. - CAPS_FMODDesigner = BIT( 5 ), ///< FMOD Designer support. }; protected: diff --git a/Engine/source/sfx/sfxProfile.cpp b/Engine/source/sfx/sfxProfile.cpp index 1f7c97a2c..4cd6a8cdb 100644 --- a/Engine/source/sfx/sfxProfile.cpp +++ b/Engine/source/sfx/sfxProfile.cpp @@ -49,7 +49,7 @@ ConsoleDocClass( SFXProfile, "for it to be created. However, several of the SFX functions (sfxPlayOnce(), sfxCreateSource()) perform " "this creation internally for convenience using temporary profile objects.\n\n" - "Sound files can be in either OGG or WAV format. However, extended format support is available when using FMOD. " + "Sound files can be in either OGG or WAV format. " "See @ref SFX_formats.\n\n" "@section SFXProfile_loading Profile Loading\n\n" diff --git a/Engine/source/sfx/sfxSystem.cpp b/Engine/source/sfx/sfxSystem.cpp index 34db19902..3d793995e 100644 --- a/Engine/source/sfx/sfxSystem.cpp +++ b/Engine/source/sfx/sfxSystem.cpp @@ -158,8 +158,6 @@ ImplementEnumType( SFXChannel, "- 3: Pause\n\n" }, { SFXChannelUser0, "User0", "Channel available for custom use. By default ignored by sources.\n\n" - "@note For FMOD Designer event sources (SFXFMODEventSource), this channel is used for event parameters " - "defined in FMOD Designer and should not be used otherwise.\n\n" "@see SFXSource::onParameterValueChange" }, { SFXChannelUser1, "User1", "Channel available for custom use. By default ignored by sources.\n\n" @@ -179,7 +177,6 @@ static const U32 sDeviceCapsVoiceManagement = SFXDevice::CAPS_VoiceManagement; static const U32 sDeviceCapsOcclusion = SFXDevice::CAPS_Occlusion; static const U32 sDeviceCapsDSPEffects = SFXDevice::CAPS_DSPEffects; static const U32 sDeviceCapsMultiListener = SFXDevice::CAPS_MultiListener; -static const U32 sDeviceCapsFMODDesigner = SFXDevice::CAPS_FMODDesigner; static const U32 sDeviceInfoProvider = 0; static const U32 sDeviceInfoName = 1; @@ -253,7 +250,6 @@ SFXSystem::SFXSystem() Con::addConstant( "$SFX::DEVICE_CAPS_REVERB", TypeS32, &sDeviceCapsReverb, "Sound device capability flag indicating that the sound device supports reverb.\n\n" - "@note Currently only FMOD implements this.\n\n" "@see sfxGetDeviceInfo\n\n" "@ref SFX_reverb\n\n" "@ingroup SFX" ); @@ -261,7 +257,6 @@ SFXSystem::SFXSystem() "Sound device capability flag indicating that the sound device implements its own voice virtualization.\n\n" "For these devices, the sound system will deactivate its own voice management and leave voice " "virtualization entirely to the device.\n\n" - "@note Currently only FMOD implements this.\n\n" "@see sfxGetDeviceInfo\n\n" "@ref SFXSound_virtualization\n\n" "@ingroup SFX" ); @@ -278,16 +273,8 @@ SFXSystem::SFXSystem() "@ingroup SFX" ); Con::addConstant( "$SFX::DEVICE_CAPS_MULTILISTENER", TypeS32, &sDeviceCapsMultiListener, "Sound device capability flag indicating that the sound device supports multiple concurrent listeners.\n\n" - "@note Currently only FMOD implements this.\n\n" "@see sfxGetDeviceInfo\n\n" "@ingroup SFX" ); - Con::addConstant( "$SFX::DEVICE_CAPS_FMODDESIGNER", TypeS32, &sDeviceCapsFMODDesigner, - "Sound device capability flag indicating that the sound device supports FMOD Designer audio projects.\n\n" - "@note This is exclusive to FMOD. If the FMOD Event DLLs are in place and could be successfully loaded, this " - "flag will be set after initializating an FMOD audio device.\n\n" - "@see sfxGetDeviceInfo\n\n" - "@ref FMOD_designer\n\n" - "@ingroup SFX" ); Con::addConstant( "$SFX::DEVICE_INFO_PROVIDER", TypeS32, &sDeviceInfoProvider, "Index of sound provider field in device info string.\n\n" @@ -1241,7 +1228,7 @@ DefineEngineFunction( sfxGetAvailableDevices, const char*, (),, "@verbatim\n" "provider TAB device TAB hasHardware TAB numMaxBuffers\n" "@endverbatim\n" - "- provider: The name of the device provider (e.g. \"FMOD\").\n" + "- provider: The name of the device provider (e.g. \"OpenAL\").\n" "- device: The name of the device as returned by the device layer.\n" "- hasHardware: Whether the device supports hardware mixing or not.\n" "- numMaxBuffers: The maximum number of concurrent voices supported by the device's mixer. If this limit " @@ -1336,7 +1323,7 @@ DefineEngineFunction( sfxGetDeviceInfo, const char*, (),, "@verbatim\n" "provider TAB device TAB hasHardware TAB numMaxBuffers TAB caps\n" "@endverbatim\n" - "- provider: The name of the device provider (e.g. \"FMOD\").\n" + "- provider: The name of the device provider (e.g. \"OpenALD\").\n" "- device: The name of the device as returned by the device layer.\n" "- hasHardware: Whether the device supports hardware mixing or not.\n" "- numMaxBuffers: The maximum number of concurrent voices supported by the device's mixer. If this limit " @@ -1357,7 +1344,6 @@ DefineEngineFunction( sfxGetDeviceInfo, const char*, (),, "@see $SFX::DEVICE_CAPS_OCCLUSION\n\n" "@see $SFX::DEVICE_CAPS_DSPEFFECTS\n\n" "@see $SFX::DEVICE_CAPS_MULTILISTENER\n\n" - "@see $SFX::DEVICE_CAPS_FMODDESIGNER\n\n" "@ref SFX_devices\n" "@ingroup SFX" ) { @@ -1379,7 +1365,7 @@ static ConsoleDocFragment _sfxCreateSource1( "@param track The track the source should play.\n" "@return A new SFXSource for playback of the given track or 0 if no source could be created from the given track.\n\n" "@note Trying to create a source for a device-specific track type will fail if the currently selected device " - "does not support the type. Example: trying to create a source for an FMOD Designer event when not running FMOD.\n\n" + "does not support the type. \n\n" "@tsexample\n" "// Create and play a source from a pre-existing profile:\n" "%source = sfxCreateSource( SoundFileProfile );\n" @@ -1400,7 +1386,7 @@ static ConsoleDocFragment _sfxCreateSource2( "@param z The Z coordinate of the 3D sound position.\n" "@return A new SFXSource for playback of the given track or 0 if no source could be created from the given track.\n\n" "@note Trying to create a source for a device-specific track type will fail if the currently selected device " - "does not support the type. Example: trying to create a source for an FMOD Designer event when not running FMOD.\n\n" + "does not support the type. \n\n" "@tsexample\n" "// Create and play a source from a pre-existing profile and position it at (100, 200, 300):\n" "%source = sfxCreateSource( SoundFileProfile, 100, 200, 300 );\n" diff --git a/Engine/source/sfx/sfxTrack.cpp b/Engine/source/sfx/sfxTrack.cpp index 987650c0b..6b395fe91 100644 --- a/Engine/source/sfx/sfxTrack.cpp +++ b/Engine/source/sfx/sfxTrack.cpp @@ -39,7 +39,7 @@ ConsoleDocClass( SFXTrack, "The term \"track\" is used in the sound system to refer to any entity that can be played " "back as a sound source. These can be individual files (SFXProfile), patterns of other tracks " - "(SFXPlayList), or special sound data defined by a device layer (SFXFMODEvent).\n\n" + "(SFXPlayList).\n\n" "Any track must be paired with a SFXDescription that tells the sound system how to set up " "playback for the track.\n\n" diff --git a/Templates/BaseGame/game/core/sfx/scripts/audio.tscript b/Templates/BaseGame/game/core/sfx/scripts/audio.tscript index a5932de8f..85479a28f 100644 --- a/Templates/BaseGame/game/core/sfx/scripts/audio.tscript +++ b/Templates/BaseGame/game/core/sfx/scripts/audio.tscript @@ -216,26 +216,18 @@ function sfxCompareProvider( %providerA, %providerB ) switch$( %providerA ) { - // Always prefer FMOD over anything else. - case "FMOD": - return 1; - - // Prefer OpenAL over anything but FMOD. case "OpenAL": - if( %providerB $= "FMOD" ) - return -1; - else return 1; // choose XAudio over DirectSound case "XAudio": - if( %providerB $= "FMOD" || %providerB $= "OpenAL" ) + if( %providerB $= "OpenAL" ) return -1; else return 0; case "DirectSound": - if( %providerB !$= "FMOD" && %providerB !$= "OpenAL" && %providerB !$= "XAudio" ) + if( %providerB !$= "OpenAL" && %providerB !$= "XAudio" ) return 1; else return -1; diff --git a/Templates/BaseGame/game/data/UI/guis/guiMusicPlayer.tscript b/Templates/BaseGame/game/data/UI/guis/guiMusicPlayer.tscript index 465659017..2a302e635 100644 --- a/Templates/BaseGame/game/data/UI/guis/guiMusicPlayer.tscript +++ b/Templates/BaseGame/game/data/UI/guis/guiMusicPlayer.tscript @@ -25,7 +25,6 @@ // Preferences. $pref::GuiMusicPlayer::filePattern = "*.ogg\t*.wav"; -$pref::GuiMusicPlayer::filePatternFMOD = "*.aiff\t*.asf\t*.flac\t*.it\t*.mid\t*.mod\t*.mp2\t*.mp3\t*.ogg\t*.s3m\t*.vag\t*.wav\t*.wma\t*.xm"; $pref::GuiMusicPlayer::fadeTime = "3.0"; //--------------------------------------------------------------------------------------------- diff --git a/Templates/BaseGame/game/data/UI/guis/profiler.tscript b/Templates/BaseGame/game/data/UI/guis/profiler.tscript index 402f7b1f1..a13d7d9b5 100644 --- a/Templates/BaseGame/game/data/UI/guis/profiler.tscript +++ b/Templates/BaseGame/game/data/UI/guis/profiler.tscript @@ -192,8 +192,7 @@ function sfxMetricsCallback() { return " | SFX |" @ " Sounds: " @ $SFX::numSounds @ - " Lists: " @ ( $SFX::numSources - $SFX::numSounds - $SFX::Device::fmodNumEventSource ) @ - " Events: " @ $SFX::fmodNumEventSources @ + " Lists: " @ ( $SFX::numSources - $SFX::numSounds ) @ " Playing: " @ $SFX::numPlaying @ " Culled: " @ $SFX::numCulled @ " Voices: " @ $SFX::numVoices @ diff --git a/Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript b/Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript index 4980dd3c2..ca9373416 100644 --- a/Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript +++ b/Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript @@ -223,11 +223,7 @@ function DatablockEditorPlugin::isExcludedDatablockType( %this, %className ) case "SimDatablock": return true; case "SFXTrack": // Abstract. - return true; - case "SFXFMODEvent": // Internally created. - return true; - case "SFXFMODEventGroup": // Internally created. - return true; + return true; } return false; } @@ -754,8 +750,7 @@ function DatablockEditorPlugin::canBeClientSideDatablock( %className ) "SFXAmbience" or "SFXEnvironment" or "SFXState" or - "SFXDescription" or - "SFXFMODProject": + "SFXDescription": return true; default: diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/AddFMODProjectDlg,EditorGuiGroup.asset.taml b/Templates/BaseGame/game/tools/worldEditor/gui/AddFMODProjectDlg,EditorGuiGroup.asset.taml deleted file mode 100644 index a38ac0145..000000000 --- a/Templates/BaseGame/game/tools/worldEditor/gui/AddFMODProjectDlg,EditorGuiGroup.asset.taml +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/AddFMODProjectDlg.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/AddFMODProjectDlg.ed.gui deleted file mode 100644 index b7bc1d86b..000000000 --- a/Templates/BaseGame/game/tools/worldEditor/gui/AddFMODProjectDlg.ed.gui +++ /dev/null @@ -1,284 +0,0 @@ -//--- OBJECT WRITE BEGIN --- -$guiContent = new GuiControl(AddFMODProjectDlg,EditorGuiGroup) { - isContainer = "1"; - Profile = "ToolsGuiOverlayProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "0 0"; - Extent = "1024 768"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - canSaveDynamicFields = "1"; - - new GuiWindowCtrl() { - resizeWidth = "0"; - resizeHeight = "0"; - canMove = "1"; - canClose = "1"; - canMinimize = "0"; - canMaximize = "0"; - minSize = "50 50"; - closeCommand = "AddFMODProjectDlg.onCancel();"; - EdgeSnap = "1"; - text = "Add FMOD Designer Audio"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - isContainer = "1"; - Profile = "ToolsGuiWindowProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "361 196"; - Extent = "303 236"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - canSaveDynamicFields = "0"; - internalName = "window"; - - new GuiBitmapBorderCtrl() { - isContainer = "1"; - Profile = "ToolsGuiGroupBorderProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "5 26"; - Extent = "291 160"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - canSaveDynamicFields = "0"; - - new GuiTextCtrl() { - text = "Path to the compiled event file (.fev):"; - maxLength = "1024"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - isContainer = "0"; - Profile = "ToolsGuiAutoSizeTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "8 51"; - Extent = "176 17"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - canSaveDynamicFields = "0"; - }; - new GuiTextEditCtrl() { - historySize = "0"; - password = "0"; - tabComplete = "0"; - sinkAllKeyEvents = "0"; - passwordMask = "•"; - maxLength = "1024"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextEditProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "7 72"; - Extent = "254 17"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - internalName = "fileNameField"; - canSaveDynamicFields = "0"; - }; - new GuiTextEditCtrl() { - historySize = "0"; - password = "0"; - tabComplete = "0"; - sinkAllKeyEvents = "0"; - passwordMask = "•"; - maxLength = "1024"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextEditProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "7 127"; - Extent = "254 17"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - internalName = "mediaPathField"; - canSaveDynamicFields = "0"; - }; - new GuiTextCtrl() { - text = "Name for the SFXFMODProject object:"; - maxLength = "1024"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - isContainer = "0"; - Profile = "ToolsGuiAutoSizeTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "8 10"; - Extent = "189 17"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - canSaveDynamicFields = "0"; - }; - new GuiTextEditCtrl() { - historySize = "0"; - password = "0"; - tabComplete = "0"; - sinkAllKeyEvents = "0"; - passwordMask = "•"; - maxLength = "1024"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextEditProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "7 30"; - Extent = "277 17"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - internalName = "projectNameField"; - canSaveDynamicFields = "0"; - }; - new GuiMLTextCtrl() { - lineSpacing = "2"; - allowColorChars = "0"; - maxChars = "-1"; - text = "Path to the project\'s media files (leave empty if files are in same directory as the project file):"; - useURLMouseCursor = "0"; - isContainer = "0"; - Profile = "ToolsGuiMLTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "8 96"; - Extent = "276 26"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - canSaveDynamicFields = "0"; - }; - new GuiButtonCtrl() { - text = "..."; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "266 72"; - Extent = "18 17"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - canSaveDynamicFields = "0"; - command = "AddFMODProjectDlg.onSelectFile();"; - }; - new GuiButtonCtrl() { - text = "..."; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "266 127"; - Extent = "18 17"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - canSaveDynamicFields = "0"; - command = "AddFMODProjectDlg.onSelectMediaPath();"; - }; - }; - new GuiButtonCtrl() { - text = "Cancel"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "206 196"; - Extent = "90 30"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "AddFMODProjectDlg.onCancel();"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - canSaveDynamicFields = "0"; - }; - new GuiButtonCtrl() { - text = "OK"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "112 196"; - Extent = "90 30"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "AddFMODProjectDlg.onOK();"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - canSaveDynamicFields = "0"; - }; - }; -}; -//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/tools/worldEditor/main.tscript b/Templates/BaseGame/game/tools/worldEditor/main.tscript index fed24607e..0d975d380 100644 --- a/Templates/BaseGame/game/tools/worldEditor/main.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/main.tscript @@ -40,7 +40,6 @@ function initializeWorldEditor() exec("./gui/ManageBookmarksWindow.ed.gui"); exec("./gui/ManageSFXParametersWindow.ed.gui" ); exec("./gui/TimeAdjustGui.ed.gui"); - exec("./gui/AddFMODProjectDlg.ed.gui"); exec("./gui/SelectObjectsWindow.ed.gui"); exec("./gui/ProceduralTerrainPainterGui.gui" ); exec("tools/gui/renderTargetVisualizer.ed.gui"); @@ -65,7 +64,6 @@ function initializeWorldEditor() exec("./scripts/EditorChooseLevelGui.ed." @ $TorqueScriptFileExtension); exec("./scripts/cameraBookmarks.ed." @ $TorqueScriptFileExtension); exec("./scripts/ManageSFXParametersWindow.ed." @ $TorqueScriptFileExtension); - exec("./scripts/AddFMODProjectDlg.ed." @ $TorqueScriptFileExtension); exec("./scripts/SelectObjectsWindow.ed." @ $TorqueScriptFileExtension); exec("./scripts/cameraCommands.ed." @ $TorqueScriptFileExtension); exec("./scripts/probeBake.ed." @ $TorqueScriptFileExtension); diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/AddFMODProjectDlg.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/AddFMODProjectDlg.ed.tscript deleted file mode 100644 index 1a2494ae1..000000000 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/AddFMODProjectDlg.ed.tscript +++ /dev/null @@ -1,253 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- - - - -//============================================================================= -// AddFMODProjectDlg. -//============================================================================= - -//----------------------------------------------------------------------------- - -function AddFMODProjectDlg::show( %this ) -{ - if( $platform $= "macos" ) - { - %fmodex = "libfmodex.dylib"; - %fmodevent = "libfmodevent.dylib"; - } - else - { - %fmodex = "fmodex.dll"; - %fmodevent = "fmod_event.dll"; - } - - // Make sure we have FMOD running. - - if( getField( sfxGetDeviceInfo(), $SFX::DEVICE_INFO_PROVIDER ) !$= "FMOD" ) - { - toolsMessageBoxOK( "Error", - "You do not currently have FMOD selected as your sound system." NL - "" NL - "To install FMOD, place the FMOD DLLs (" @ %fmodex @ " and " @ %fmodevent @ ")" SPC - "in your game/ folder alongside your game executable" SPC - "and restart Torque." NL - "" NL - "To select FMOD as your sound system, choose it as the sound provider in" SPC - "the audio tab of the Game Options dialog." - ); - - return; - } - - // Make sure we have the FMOD Event DLL loaded. - - %deviceCaps = getField( sfxGetDeviceInfo(), $SFX::DEVICE_INFO_CAPS ); - if( !( %deviceCaps & $SFX::DEVICE_CAPS_FMODDESIGNER ) ) - { - toolsMessageBoxOK( "Error", - "You do not have the requisite FMOD Event DLL in place." NL - "" NL - "Please copy " @ %fmodevent @ " into your game/ folder and restart Torque." - ); - return; - } - - // Show it. - - Canvas.pushDialog( %this, 0, true ); -} - -//----------------------------------------------------------------------------- - -function AddFMODProjectDlg::onWake( %this ) -{ - %this.persistenceMgr = new PersistenceManager(); -} - -//----------------------------------------------------------------------------- - -function AddFMODProjectDlg::onSleep( %this ) -{ - %this.persistenceMgr.delete(); -} - -//----------------------------------------------------------------------------- - -function AddFMODProjectDlg::onCancel( %this ) -{ - Canvas.popDialog( %this ); -} - -//----------------------------------------------------------------------------- - -function AddFMODProjectDlg::onOK( %this ) -{ - %objName = %this-->projectNameField.getText(); - %fileName = %this-->fileNameField.getText(); - %mediaPath = %this-->mediaPathField.getText(); - - // Make sure the object name is valid. - if( !Editor::validateObjectName( %objName, true )) - return; - - // Make sure the .fev file exists. - - if( %fileName $= "" ) - { - toolsMessageBoxOK( "Error", - "Please enter a project file name." - ); - return; - } - if( !isFile( %fileName ) ) - { - toolsMessageBoxOK( "Error", - "'" @ %fileName @ "' is not a valid file." - ); - return; - } - - // Make sure the media path exists. - - if( !isDirectory( %mediaPath ) ) - { - toolsMessageBoxOK( "Error", - "'" @ %mediaPath @ "' is not a valid directory." - ); - return; - } - - // If an event script exists from a previous instantiation, - // delete it first. - - %eventFileName = %fileName @ "." @ $TorqueScriptFileExtension; - if( isFile( %eventFileName ) ) - fileDelete( %eventFileName ); - - // Create the FMOD project object. - - pushInstantGroup(); - eval( "new SFXFMODProject( " @ %objName @ ") {" NL - "fileName = \"" @ %fileName @ "\";" NL - "mediaPath = \"" @ %mediaPath @ "\";" NL - "};" ); - popInstantGroup(); - - if( !isObject( %objName ) ) - { - toolsMessageBoxOK( "Error", - "Failed to create the object. Please take a look at the log for details." - ); - return; - } - else - { - // Save the object. - - %objName.setFileName( "scripts/client/audioData." @ $TorqueScriptFileExtension ); - %this.persistenceMgr.setDirty( %objName ); - %this.persistenceMgr.saveDirty(); - } - - Canvas.popDialog( %this ); - - // Trigger a reinit on the datablock editor, just in case. - - if( isObject( DatablockEditorPlugin ) ) - DatablockEditorPlugin.populateTrees(); -} - -//----------------------------------------------------------------------------- - -function AddFMODProjectDlg::onSelectFile( %this ) -{ - if( $pref::WorldEditor::AddFMODProjectDlg::lastPath $= "" ) - $pref::WorldEditor::AddFMODProjectDlg::lastPath = getMainDotCsDir(); - - %dlg = new OpenFileDialog() - { - Title = "Select Compiled FMOD Designer Event File..."; - Filters = "Compiled Event Files (*.fev)|*.fev|All Files (*.*)|*.*|"; - DefaultPath = $pref::WorldEditor::AddFMODProjectDlg::lastPath; - DefaultFile = fileName( %this-->fileNameField.getText() ); - MustExit = true; - ChangePath = false; - }; - - %ret = %dlg.execute(); - if( %ret ) - { - %file = %dlg.fileName; - $pref::WorldEditor::AddFMODProjectDlg::lastPath = filePath( %file ); - } - - %dlg.delete(); - - if( !%ret ) - return; - - %file = makeRelativePath( %file, getMainDotCsDir() ); - %this-->fileNameField.setText( %file ); - - if( %this-->projectNameField.getText() $= "" ) - { - %projectName = "fmod" @ fileBase( %file ); - if( isValidObjectName( %projectName ) ) - %this-->projectNameField.setText( %projectName ); - } -} - -//----------------------------------------------------------------------------- - -function AddFMODProjectDlg::onSelectMediaPath( %this ) -{ - %defaultPath = %this-->mediaPathField.getText(); - if( %defaultPath $= "" ) - { - %defaultPath = filePath( %this-->fileNameField.getText() ); - if( %defaultPath $= "" ) - %defaultPath = getMainDotCsDir(); - else - %defaultPath = makeFullPath( %defaultPath ); - } - - %dlg = new OpenFolderDialog() - { - Title = "Select Media Path..."; - DefaultPath = %defaultPath; - MustExit = true; - ChangePath = false; - }; - - %ret = %dlg.execute(); - if( %ret ) - %file = %dlg.fileName; - - %dlg.delete(); - - if( !%ret ) - return; - - %file = makeRelativePath( %file, getMainDotCsDir() ); - %this-->mediaPathField.setText( %file ); -} diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/menus.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/menus.ed.tscript index 6e8348948..21eaea05a 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/menus.ed.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/menus.ed.tscript @@ -167,10 +167,7 @@ function EditorGui::buildMenus(%this) //item[6] = "Import Texture Data..." TAB "" TAB "Texture::import();"; //item[7] = "-"; //item[8] = "Export Terraform Data..." TAB "" TAB "Heightfield::saveBitmap(\"\");"; - - %fileMenu.appendItem( "-" ); - %fileMenu.appendItem( "Add FMOD Designer Audio..." TAB "" TAB "AddFMODProjectDlg.show();" ); - + %fileMenu.appendItem("-"); %fileMenu.appendItem("Play Level" TAB "F11" TAB "Editor.close(ProjectSettings.value(\"UI/playGUIName\"));"); diff --git a/Tools/CMake/torque3d.cmake b/Tools/CMake/torque3d.cmake index 982050b4a..987a094b8 100644 --- a/Tools/CMake/torque3d.cmake +++ b/Tools/CMake/torque3d.cmake @@ -41,8 +41,6 @@ if(UNIX) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif() -# TODO: fmod support - ############################################################################### # modules ############################################################################### From efb98d420dbff15f9f828e01c1ec49cdec59a332 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 11 Sep 2021 16:26:48 -0400 Subject: [PATCH 069/399] Fix local variable being eval'd in materialEditor --- .../tools/materialEditor/scripts/materialEditor.ed.tscript | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript b/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript index 18197d09a..7f3fb2d43 100644 --- a/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript +++ b/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript @@ -1120,8 +1120,7 @@ function MaterialEditorGui::updateActiveMaterial(%this, %propertyField, %value, %action.isSlider = %isSlider; %action.onMouseUp = %onMouseUp; %action.newValue = %value; - eval( "%action.oldValue = " @ MaterialEditorGui.currentMaterial @ "." @ %propertyField @ ";"); - %action.oldValue = "\"" @ %action.oldValue @ "\""; + %action.oldValue = "\"" @ MaterialEditorGui.currentMaterial.getFieldValue(%propertyField) @ "\""; MaterialEditorGui.submitUndo( %action ); } From 97584a9838144e1e58957e312a590646c18ce443 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 11 Sep 2021 17:07:20 -0500 Subject: [PATCH 070/399] Fixes initial indexing of the tool palette widgets --- .../gui/ToolsPaletteGroups/init.tscript | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/init.tscript b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/init.tscript index b6640e8fd..ff69e6a23 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/init.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsPaletteGroups/init.tscript @@ -30,16 +30,13 @@ function EWToolsPaletteWindow::loadToolsPalettes() exec( %file ); %paletteGroup = 0; - // TODO - %paletteId = 0; - - %i = %paletteId.getCount(); + %i = $paletteId.getCount(); for( ; %i != 0; %i--) { - %paletteId.getObject(0).visible = 0; - %paletteId.getObject(0).groupNum = %paletteGroup; - %paletteId.getObject(0).paletteName = %paletteId.getName(); - ToolsPaletteArray.addGuiControl(%paletteId.getObject(0)); + $paletteId.getObject(0).visible = 0; + $paletteId.getObject(0).groupNum = %paletteGroup; + $paletteId.getObject(0).paletteName = $paletteId.getName(); + ToolsPaletteArray.addGuiControl($paletteId.getObject(0)); } %paletteGroup++; } @@ -52,16 +49,13 @@ function EWToolsPaletteWindow::loadToolsPalettes() exec( %file ); %paletteGroup = 0; - // TODO - %paletteId = 0; - - %i = %paletteId.getCount(); + %i = $paletteId.getCount(); for( ; %i != 0; %i--) { - %paletteId.getObject(0).visible = 0; - %paletteId.getObject(0).groupNum = %paletteGroup; - %paletteId.getObject(0).paletteName = %paletteId.getName(); - ToolsPaletteArray.addGuiControl(%paletteId.getObject(0)); + $paletteId.getObject(0).visible = 0; + $paletteId.getObject(0).groupNum = %paletteGroup; + $paletteId.getObject(0).paletteName = $paletteId.getName(); + ToolsPaletteArray.addGuiControl($paletteId.getObject(0)); } %paletteGroup++; } From 3bfb9a320a6f82945831d3dc17b4c59377473eae Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 11 Sep 2021 17:13:23 -0500 Subject: [PATCH 071/399] Updates Prototyping module. Reorganizes primitive shapes, adds some vehicle shapes, adds datablocks for prototyping wheeled, hover and flying vehicles. --- .../Prototyping/Materials/Glass.asset.taml | 1 + .../data/Prototyping/Materials/Glass.tscript | 192 +++++++ .../game/data/Prototyping/Prototyping.tscript | 4 + .../data/Prototyping/datablocks/car.tscript | 220 +++++++ .../data/Prototyping/datablocks/flier.tscript | 147 +++++ .../Prototyping/datablocks/hoverboat.tscript | 67 +++ .../game/data/Prototyping/scripts/car.tscript | 20 + .../data/Prototyping/scripts/flier.tscript | 19 + .../{ => Primitives}/ConePrimitive.asset.taml | 0 .../shapes/{ => Primitives}/ConePrimitive.fbx | Bin .../{ => Primitives}/ConePrimitive.tscript | 0 .../{ => Primitives}/CubePrimitive.asset.taml | 0 .../shapes/{ => Primitives}/CubePrimitive.fbx | Bin .../{ => Primitives}/CubePrimitive.tscript | 0 .../CylinderPrimitive.asset.taml | 0 .../{ => Primitives}/CylinderPrimitive.fbx | Bin .../CylinderPrimitive.tscript | 0 .../SpherePrimitive.asset.taml | 0 .../{ => Primitives}/SpherePrimitive.fbx | Bin .../{ => Primitives}/SpherePrimitive.tscript | 0 .../TorusPrimitive.asset.taml | 0 .../{ => Primitives}/TorusPrimitive.fbx | Bin .../{ => Primitives}/TorusPrimitive.tscript | 0 .../{ => Primitives}/TubePrimitive.asset.taml | 0 .../shapes/{ => Primitives}/TubePrimitive.fbx | Bin .../{ => Primitives}/TubePrimitive.tscript | 0 .../shapes/Vehicles/Car.asset.taml | 1 + .../data/Prototyping/shapes/Vehicles/car.dae | 537 ++++++++++++++++++ .../Prototyping/shapes/Vehicles/car.tscript | 11 + .../shapes/Vehicles/carwheel.asset.taml | 1 + .../Prototyping/shapes/Vehicles/carwheel.dae | 140 +++++ .../shapes/Vehicles/carwheel.tscript | 11 + .../shapes/Vehicles/flier.asset.taml | 1 + .../Prototyping/shapes/Vehicles/flier.dae | 253 +++++++++ .../Prototyping/shapes/Vehicles/flier.tscript | 11 + .../shapes/Vehicles/hoverboat.asset.taml | 1 + .../Prototyping/shapes/Vehicles/hoverboat.dae | 156 +++++ .../shapes/Vehicles/hoverboat.tscript | 11 + .../data/Prototyping/shapes/materials.tscript | 8 - 39 files changed, 1804 insertions(+), 8 deletions(-) create mode 100644 Templates/BaseGame/game/data/Prototyping/Materials/Glass.asset.taml create mode 100644 Templates/BaseGame/game/data/Prototyping/Materials/Glass.tscript create mode 100644 Templates/BaseGame/game/data/Prototyping/datablocks/car.tscript create mode 100644 Templates/BaseGame/game/data/Prototyping/datablocks/flier.tscript create mode 100644 Templates/BaseGame/game/data/Prototyping/datablocks/hoverboat.tscript create mode 100644 Templates/BaseGame/game/data/Prototyping/scripts/car.tscript create mode 100644 Templates/BaseGame/game/data/Prototyping/scripts/flier.tscript rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/ConePrimitive.asset.taml (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/ConePrimitive.fbx (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/ConePrimitive.tscript (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/CubePrimitive.asset.taml (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/CubePrimitive.fbx (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/CubePrimitive.tscript (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/CylinderPrimitive.asset.taml (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/CylinderPrimitive.fbx (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/CylinderPrimitive.tscript (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/SpherePrimitive.asset.taml (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/SpherePrimitive.fbx (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/SpherePrimitive.tscript (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/TorusPrimitive.asset.taml (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/TorusPrimitive.fbx (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/TorusPrimitive.tscript (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/TubePrimitive.asset.taml (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/TubePrimitive.fbx (100%) rename Templates/BaseGame/game/data/Prototyping/shapes/{ => Primitives}/TubePrimitive.tscript (100%) create mode 100644 Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/Car.asset.taml create mode 100644 Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/car.dae create mode 100644 Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/car.tscript create mode 100644 Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/carwheel.asset.taml create mode 100644 Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/carwheel.dae create mode 100644 Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/carwheel.tscript create mode 100644 Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/flier.asset.taml create mode 100644 Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/flier.dae create mode 100644 Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/flier.tscript create mode 100644 Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/hoverboat.asset.taml create mode 100644 Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/hoverboat.dae create mode 100644 Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/hoverboat.tscript delete mode 100644 Templates/BaseGame/game/data/Prototyping/shapes/materials.tscript diff --git a/Templates/BaseGame/game/data/Prototyping/Materials/Glass.asset.taml b/Templates/BaseGame/game/data/Prototyping/Materials/Glass.asset.taml new file mode 100644 index 000000000..cc68824b9 --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/Materials/Glass.asset.taml @@ -0,0 +1 @@ + diff --git a/Templates/BaseGame/game/data/Prototyping/Materials/Glass.tscript b/Templates/BaseGame/game/data/Prototyping/Materials/Glass.tscript new file mode 100644 index 000000000..a3d239a75 --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/Materials/Glass.tscript @@ -0,0 +1,192 @@ +//--- OBJECT WRITE BEGIN --- +new Material(Glass) { + diffuseColor[0] = "1 1 1 1"; + diffuseColor[1] = "1 1 1 1"; + diffuseColor[2] = "1 1 1 1"; + diffuseColor[3] = "1 1 1 1"; + diffuseMapSRGB[0] = "1"; + diffuseMapSRGB[1] = "1"; + diffuseMapSRGB[2] = "1"; + diffuseMapSRGB[3] = "1"; + detailScale[0] = "2 2"; + detailScale[1] = "2 2"; + detailScale[2] = "2 2"; + detailScale[3] = "2 2"; + detailNormalMapStrength[0] = "1"; + detailNormalMapStrength[1] = "1"; + detailNormalMapStrength[2] = "1"; + detailNormalMapStrength[3] = "1"; + roughness[0] = "1"; + roughness[1] = "1"; + roughness[2] = "1"; + roughness[3] = "1"; + metalness[0] = "0"; + metalness[1] = "0"; + metalness[2] = "0"; + metalness[3] = "0"; + glowMul[0] = "0"; + glowMul[1] = "0"; + glowMul[2] = "0"; + glowMul[3] = "0"; + accuEnabled[0] = "0"; + accuEnabled[1] = "0"; + accuEnabled[2] = "0"; + accuEnabled[3] = "0"; + accuScale[0] = "1"; + accuScale[1] = "1"; + accuScale[2] = "1"; + accuScale[3] = "1"; + accuDirection[0] = "1"; + accuDirection[1] = "1"; + accuDirection[2] = "1"; + accuDirection[3] = "1"; + accuStrength[0] = "0.6"; + accuStrength[1] = "0.6"; + accuStrength[2] = "0.6"; + accuStrength[3] = "0.6"; + accuCoverage[0] = "0.9"; + accuCoverage[1] = "0.9"; + accuCoverage[2] = "0.9"; + accuCoverage[3] = "0.9"; + accuSpecular[0] = "16"; + accuSpecular[1] = "16"; + accuSpecular[2] = "16"; + accuSpecular[3] = "16"; + isSRGB[0] = "0"; + isSRGB[1] = "0"; + isSRGB[2] = "0"; + isSRGB[3] = "0"; + invertRoughness[0] = "0"; + invertRoughness[1] = "0"; + invertRoughness[2] = "0"; + invertRoughness[3] = "0"; + roughnessChan[0] = "0"; + roughnessChan[1] = "0"; + roughnessChan[2] = "0"; + roughnessChan[3] = "0"; + AOChan[0] = "1"; + AOChan[1] = "1"; + AOChan[2] = "1"; + AOChan[3] = "1"; + metalChan[0] = "2"; + metalChan[1] = "2"; + metalChan[2] = "2"; + metalChan[3] = "2"; + glow[0] = "0"; + glow[1] = "0"; + glow[2] = "0"; + glow[3] = "0"; + parallaxScale[0] = "0"; + parallaxScale[1] = "0"; + parallaxScale[2] = "0"; + parallaxScale[3] = "0"; + useAnisotropic[0] = "1"; + useAnisotropic[1] = "1"; + useAnisotropic[2] = "1"; + useAnisotropic[3] = "1"; + vertLit[0] = "0"; + vertLit[1] = "0"; + vertLit[2] = "0"; + vertLit[3] = "0"; + vertColor[0] = "0"; + vertColor[1] = "0"; + vertColor[2] = "0"; + vertColor[3] = "0"; + minnaertConstant[0] = "-1"; + minnaertConstant[1] = "-1"; + minnaertConstant[2] = "-1"; + minnaertConstant[3] = "-1"; + subSurface[0] = "0"; + subSurface[1] = "0"; + subSurface[2] = "0"; + subSurface[3] = "0"; + subSurfaceColor[0] = "1 0.2 0.2 1"; + subSurfaceColor[1] = "1 0.2 0.2 1"; + subSurfaceColor[2] = "1 0.2 0.2 1"; + subSurfaceColor[3] = "1 0.2 0.2 1"; + subSurfaceRolloff[0] = "0.2"; + subSurfaceRolloff[1] = "0.2"; + subSurfaceRolloff[2] = "0.2"; + subSurfaceRolloff[3] = "0.2"; + emissive[0] = "0"; + emissive[1] = "0"; + emissive[2] = "0"; + emissive[3] = "0"; + doubleSided = "0"; + animFlags[0] = "0x00000000"; + animFlags[1] = "0x00000000"; + animFlags[2] = "0x00000000"; + animFlags[3] = "0x00000000"; + scrollDir[0] = "0 0"; + scrollDir[1] = "0 0"; + scrollDir[2] = "0 0"; + scrollDir[3] = "0 0"; + scrollSpeed[0] = "0"; + scrollSpeed[1] = "0"; + scrollSpeed[2] = "0"; + scrollSpeed[3] = "0"; + rotSpeed[0] = "0"; + rotSpeed[1] = "0"; + rotSpeed[2] = "0"; + rotSpeed[3] = "0"; + rotPivotOffset[0] = "0 0"; + rotPivotOffset[1] = "0 0"; + rotPivotOffset[2] = "0 0"; + rotPivotOffset[3] = "0 0"; + waveType[0] = "Sin"; + waveType[1] = "Sin"; + waveType[2] = "Sin"; + waveType[3] = "Sin"; + waveFreq[0] = "0"; + waveFreq[1] = "0"; + waveFreq[2] = "0"; + waveFreq[3] = "0"; + waveAmp[0] = "0"; + waveAmp[1] = "0"; + waveAmp[2] = "0"; + waveAmp[3] = "0"; + sequenceFramePerSec[0] = "0"; + sequenceFramePerSec[1] = "0"; + sequenceFramePerSec[2] = "0"; + sequenceFramePerSec[3] = "0"; + sequenceSegmentSize[0] = "0"; + sequenceSegmentSize[1] = "0"; + sequenceSegmentSize[2] = "0"; + sequenceSegmentSize[3] = "0"; + cellIndex[0] = "0 0"; + cellIndex[1] = "0 0"; + cellIndex[2] = "0 0"; + cellIndex[3] = "0 0"; + cellLayout[0] = "0 0"; + cellLayout[1] = "0 0"; + cellLayout[2] = "0 0"; + cellLayout[3] = "0 0"; + cellSize[0] = "0"; + cellSize[1] = "0"; + cellSize[2] = "0"; + cellSize[3] = "0"; + bumpAtlas[0] = "0"; + bumpAtlas[1] = "0"; + bumpAtlas[2] = "0"; + bumpAtlas[3] = "0"; + castShadows = "1"; + planarReflection = "0"; + translucent = "1"; + translucentBlendOp = "PreMul"; + translucentZWrite = "0"; + alphaTest = "0"; + alphaRef = "1"; + dynamicCubemap = "0"; + showFootprints = "1"; + showDust = "0"; + effectColor[0] = "0 0 0 0"; + effectColor[1] = "0 0 0 0"; + footstepSoundId = "-1"; + impactSoundId = "-1"; + ImpactFXIndex = "-1"; + canSave = "1"; + canSaveDynamicFields = "1"; + DiffuseMapAsset[0] = "Prototyping:WaterBlue_ALBEDO"; + originalAssetName = "Glass"; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/Prototyping/Prototyping.tscript b/Templates/BaseGame/game/data/Prototyping/Prototyping.tscript index e9a1eff28..73a1dc447 100644 --- a/Templates/BaseGame/game/data/Prototyping/Prototyping.tscript +++ b/Templates/BaseGame/game/data/Prototyping/Prototyping.tscript @@ -9,11 +9,15 @@ function Prototyping::onDestroy(%this) //This is called when the server is initially set up by the game application function Prototyping::initServer(%this) { + %this.queueExec("./scripts/car"); } //This is called when the server is created for an actual game/map to be played function Prototyping::onCreateGameServer(%this) { + %this.registerDatablock("./datablocks/hoverboat.tscript"); + %this.registerDatablock("./datablocks/car.tscript"); + %this.registerDatablock("./datablocks/flier.tscript"); } //This is called when the server is shut down due to the game/map being exited diff --git a/Templates/BaseGame/game/data/Prototyping/datablocks/car.tscript b/Templates/BaseGame/game/data/Prototyping/datablocks/car.tscript new file mode 100644 index 000000000..2a22e8bba --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/datablocks/car.tscript @@ -0,0 +1,220 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- +/* +datablock SFXProfile(cheetahEngine) +{ + preload = "1"; + description = "AudioCloseLoop3D"; + fileName = "data/FPSGameplay/sound/cheetah/cheetah_engine.ogg"; +}; + +datablock SFXProfile(cheetahSqueal) +{ + preload = "1"; + description = "AudioDefault3D"; + fileName = "data/FPSGameplay/sound/cheetah/cheetah_squeal.ogg"; +}; + +datablock SFXProfile(hardImpact) +{ + preload = "1"; + description = "AudioDefault3D"; + fileName = "data/FPSGameplay/sound/cheetah/hardImpact.ogg"; +}; + +datablock SFXProfile(softImpact) +{ + preload = "1"; + description = "AudioDefault3D"; + fileName = "data/FPSGameplay/sound/cheetah/softImpact.ogg"; +}; + +datablock SFXProfile(DirtKickup) +{ + preload = "1"; + description = "AudioDefault3D"; + fileName = "data/FPSGameplay/sound/cheetah/softImpact.ogg"; +}; + +datablock SFXProfile(CheetahTurretFireSound) +{ + //filename = "data/FPSGameplay/sound/cheetah/turret_firing.wav"; + filename = "data/FPSGameplay/sound/turret/wpn_turret_fire.wav"; + description = BulletFireDesc; + preload = true; +}; + +datablock ParticleData(CheetahTireParticle) +{ + textureName = "data/FPSGameplay/art/particles/dustParticle"; + dragCoefficient = "1.99902"; + gravityCoefficient = "-0.100122"; + inheritedVelFactor = "0.0998043"; + constantAcceleration = 0.0; + lifetimeMS = 1000; + lifetimeVarianceMS = 400; + colors[0] = "0.456693 0.354331 0.259843 1"; + colors[1] = "0.456693 0.456693 0.354331 0"; + sizes[0] = "0.997986"; + sizes[1] = "3.99805"; + sizes[2] = "1.0"; + sizes[3] = "1.0"; + times[0] = "0.0"; + times[1] = "1"; + times[2] = "1"; + times[3] = "1"; +}; + +datablock ParticleEmitterData(CheetahTireEmitter) +{ + ejectionPeriodMS = 20; + periodVarianceMS = 10; + ejectionVelocity = "14.57"; + velocityVariance = 1.0; + ejectionOffset = 0.0; + thetaMin = 0; + thetaMax = 60; + phiReferenceVel = 0; + phiVariance = 360; + overrideAdvance = false; + particles = "CheetahTireParticle"; + blendStyle = "ADDITIVE"; +};*/ + +//----------------------------------------------------------------------------- +// Information extacted from the shape. +// +// Wheel Sequences +// spring# Wheel spring motion: time 0 = wheel fully extended, +// the hub must be displaced, but not directly animated +// as it will be rotated in code. +// Other Sequences +// steering Wheel steering: time 0 = full right, 0.5 = center +// breakLight Break light, time 0 = off, 1 = breaking +// +// Wheel Nodes +// hub# Wheel hub, the hub must be in it's upper position +// from which the springs are mounted. +// +// The steering and animation sequences are optional. +// The center of the shape acts as the center of mass for the car. + +//----------------------------------------------------------------------------- +datablock WheeledVehicleTire(CarTire) +{ + // Tires act as springs and generate lateral and longitudinal + // forces to move the vehicle. These distortion/spring forces + // are what convert wheel angular velocity into forces that + // act on the rigid body. + shapeAsset = "Prototyping:carwheel"; + staticFriction = 4.2; + kineticFriction = "1"; + + // Spring that generates lateral tire forces + lateralForce = 18000; + lateralDamping = 6000; + lateralRelaxation = 1; + + // Spring that generates longitudinal tire forces + longitudinalForce = 18000; + longitudinalDamping = 4000; + longitudinalRelaxation = 1; + radius = "0.609998"; +}; + +datablock WheeledVehicleSpring(CarSpring) +{ + // Wheel suspension properties + length = 0.5; // Suspension travel + force = 2800; // Spring force + damping = 3600; // Spring damping + antiSwayForce = 3; // Lateral anti-sway force +}; + +datablock WheeledVehicleData(Car) +{ + category = "Vehicles"; + emap = 1; + + mountPose[0] = sitting; + numMountPoints = 6; + + useEyePoint = true; // Use the vehicle's camera node rather than the player's + + maxSteeringAngle = 0.585; // Maximum steering angle, should match animation + + // 3rd person camera settings + cameraRoll = false; // Roll the camera with the vehicle + cameraMaxDist = 7.8; // Far distance from vehicle + cameraOffset = 1.0; // Vertical offset from camera mount point + cameraLag = "0.3"; // Velocity lag of camera + cameraDecay = 1.25; // Decay per sec. rate of velocity lag + + // Rigid Body + mass = "400"; + massCenter = "0 0.5 0"; // Center of mass for rigid body + massBox = "0 0 0"; // Size of box used for moment of inertia, + // if zero it defaults to object bounding box + drag = 0.6; // Drag coefficient + bodyFriction = 0.6; + bodyRestitution = 0.4; + minImpactSpeed = 5; // Impacts over this invoke the script callback + softImpactSpeed = 5; // Play SoftImpact Sound + hardImpactSpeed = 15; // Play HardImpact Sound + integration = 8; // Physics integration: TickSec/Rate + collisionTol = "0.1"; // Collision distance tolerance + contactTol = "0.4"; // Contact velocity tolerance + + // Engine + engineTorque = 4300; // Engine power + engineBrake = "5000"; // Braking when throttle is 0 + brakeTorque = "10000"; // When brakes are applied + maxWheelSpeed = 50; // Engine scale by current speed / max speed + + // Energy + maxEnergy = 100; + jetForce = 3000; + minJetEnergy = 30; + jetEnergyDrain = 2; + + // Sounds + //engineSound = cheetahEngine; + //squealSound = cheetahSqueal; + //softImpactSound = softImpact; + //hardImpactSound = hardImpact; + + // Dynamic fields accessed via script + nameTag = 'Cheetah'; + maxDismountSpeed = 10; + maxMountSpeed = 5; + mountPose0 = "sitting"; + // tireEmitter = "CheetahTireEmitter"; + // dustEmitter = "CheetahTireEmitter"; + dustHeight = "1"; + + // Mount slots + turretSlot = 1; + rightBrakeSlot = 2; + leftBrakeSlot = 3; + dragForce = "0.01"; + ShapeAsset = "Prototyping:car"; +}; diff --git a/Templates/BaseGame/game/data/Prototyping/datablocks/flier.tscript b/Templates/BaseGame/game/data/Prototyping/datablocks/flier.tscript new file mode 100644 index 000000000..06820acad --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/datablocks/flier.tscript @@ -0,0 +1,147 @@ +//Flying Vehicle +//--------------------------------------------------------------------------------------- +datablock FlyingVehicleData(Flier) +{ + spawnOffset = "0 0 2"; + category = "Vehicles"; + shapeAsset = "Prototyping:flier"; + multipassenger = false; + computeCRC = true; + + //debrisShapeName = "~/data/shapes/vehicles/Drone/flyer.dts"; + //debris = DroneShapeDebris; + //renderWhenDestroyed = false; + + drag = 0.15; + density = 3.0; + + mountPose[0] = sitting; + numMountPoints = 1; + isProtectedMountPoint[0] = true; + cameraMaxDist = 0.5; + cameraOffset = 4.5; + cameraLag = 0.0; + cameraRoll = true; // Roll the camera with the vehicle + + + + // explosion = DroneVehicleExplosion; + explosionDamage = 10.5; + explosionRadius = 15.0; + + maxDamage = 50.40; + destroyedLevel = 50.40; + + isShielded = true; + energyPerDamagePoint = 160; + maxEnergy = 280; // Afterburner and any energy weapon pool + rechargeRate = 0.8; + + minDrag = 30; // Linear Drag (eventually slows you down when not thrusting...constant drag) + rotationalDrag = 10; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag) + + maxAutoSpeed = 10; // Autostabilizer kicks in when less than this speed. (meters/second) + autoAngularForce = 200; // Angular stabilizer force (this force levels you out when autostabilizer kicks in) + autoLinearForce = 200; // Linear stabilzer force (this slows you down when autostabilizer kicks in) + autoInputDamping = 0.95; // Dampen control input so you don't` whack out at very slow speeds + integration = 6; // Physics integration: TickSec/Rate + collisionTol = 0.2; // Collision distance tolerance + contactTol = 0.1; + + // Maneuvering + maxSteeringAngle = 3; // Max radiens you can rotate the wheel. Smaller number is more maneuverable. + horizontalSurfaceForce = 6; // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning) + verticalSurfaceForce = 4; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.) + maneuveringForce = 2400; // Horizontal jets (W,S,D,A key thrust) + steeringForce = 50; // Steering jets (force applied when you move the mouse) + steeringRollForce = 10; // Steering jets (how much you heel over when you turn) + rollForce = 80; // Auto-roll (self-correction to right you after you roll/invert) + hoverHeight = 45; // Height off the ground at rest + createHoverHeight = 45; // Height off the ground when created + maxForwardSpeed = 60; // speed in which forward thrust force is no longer applied (meters/second) + + // Turbo Jet + jetForce = 3000; // Afterburner thrust (this is in addition to normal thrust) + minJetEnergy = 28; // Afterburner can't be used if below this threshhold. + jetEnergyDrain = 2.8; // Energy use of the afterburners (low number is less drain...can be fractional) // Auto stabilize speed + vertThrustMultiple = 3.0; + + // Rigid body + mass = 30; // Mass of the vehicle + bodyFriction = 0; // Don't mess with this. + bodyRestitution = 1.0; // When you hit the ground, how much you rebound. (between 0 and 1) + minRollSpeed = 2000; // Don't mess with this. + softImpactSpeed = 3; // Sound hooks. This is the soft hit. + hardImpactSpeed = 15; // Sound hooks. This is the hard hit. + + // Ground Impact Damage (uses DamageType::Ground) + minImpactSpeed = 10; // If hit ground at speed above this then it's an impact. Meters/second + speedDamageScale = 0.06; + + // Object Impact Damage (uses DamageType::Impact) + collDamageThresholdVel = 23.0; + collDamageMultiplier = 0.02; + + // + minTrailSpeed = 15; // The speed your contrail shows up at. + //trailEmitter = DroneContrailEmitter; + //forwardJetEmitter = DroneJetEmitter; + //downJetEmitter = DroneJetEmitter; + + // + //jetSound = DroneThrustSound; + //engineSound = DroneEngineSound; + //softImpactSound = DroneSoftImpactSound; + //hardImpactSound = DroneHardImpactSound; + // + //softSplashSoundVelocity = 10.0; + //mediumSplashSoundVelocity = 15.0; + //hardSplashSoundVelocity = 20.0; + //exitSplashSoundVelocity = 10.0; + + //exitingWater = DroneExitWaterMediumSound; + //impactWaterEasy = DroneImpactWaterSoftSound; + //impactWaterMedium = DroneImpactWaterMediumSound; + //impactWaterHard = DroneImpactWaterMediumSound; + //waterWakeSound = DroneWakeMediumSplashSound; + +// dustEmitter = VehicleLiftoffDustEmitter; + + triggerDustHeight = 4.0; + dustHeight = 1.0; + +// damageEmitter[0] = LightDamageSmoke; + +// damageEmitter[1] = HeavyDamageSmoke; + +// damageEmitter[2] = DamageBubbles; + + damageEmitterOffset[0] = "0.0 -3.0 0.0 "; + damageLevelTolerance[0] = 0.3; + damageLevelTolerance[1] = 0.7; + numDmgEmitterAreas = 3; + + // + //max[RocketAmmo] = 1000; + + minMountDist = 2; + + //splashEmitter[0] = VehicleFoamDropletsEmitter; + //splashEmitter[1] = VehicleFoamEmitter; + + //shieldImpact = VehicleShieldImpact; + + //cmdCategory = "Tactical"; + //cmdIcon = CMDFlyingScoutIcon; + //cmdMiniIconName = "commander/MiniIcons/com_scout_grey"; + //targetNameTag = 'Drone'; + //targetTypeTag = 'FlyingVehicle'; + //sensorData = AWACPulseSensor; + //sensorRadius = AWACPulseSensor.detectRadius; + //sensorColor = "255 194 9"; + + checkRadius = 5.5; + observeParameters = "0 0 0"; + + shieldEffectScale = "0.937 1.125 0.60"; +}; diff --git a/Templates/BaseGame/game/data/Prototyping/datablocks/hoverboat.tscript b/Templates/BaseGame/game/data/Prototyping/datablocks/hoverboat.tscript new file mode 100644 index 000000000..cd5afd471 --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/datablocks/hoverboat.tscript @@ -0,0 +1,67 @@ +datablock HoverVehicleData(hoverboat) +{ + spawnOffset = "0 0 1"; + + floatingGravMag = 55.5; + ShapeAsset = "Prototyping:hoverboat"; + category = "Vehicles"; + emap = 1; + + category = "Vehicle"; + + + drag = 0.2; + density = 0.3; + hoverHeight = 3; // Height off the ground at rest + createHoverHeight = 3; + integration = 4; // Physics integration: TickSec/Rate + collisionTol = 0.3; // Collision distance tolerance + contactTol = 0.2; // Contact velocity tolerance + + cameraMaxDist = "4.23615"; + cameraOffset = 5.7; + cameraLag = 5.5; + + explosionDamage = 0.5; + explosionRadius = 5; + + rechargeRate = 0.7; + energyPerDamagePoint = 75; + maxEnergy = 650; + minJetEnergy = 165; + jetEnergyDrain = 1.3; + + // Rigid Body + mass = "2"; + bodyFriction = 0.1; + bodyRestitution = 0.3; + softImpactSpeed = 20; // Play SoftImpact Sound + hardImpactSpeed = 28; // Play HardImpact Sound + + + dragForce = 1.0; + // dragForce = 25 / 45.0; + vertFactor = 0.8; + floatingThrustFactor = 0.5; + + mainThrustForce = "20"; + reverseThrustForce = "10"; + strafeThrustForce = "25"; + turboFactor = 1.5; + + brakingForce = "20"; + brakingActivationSpeed = 30; + + stabLenMin = "1.5"; //was 3 + stabLenMax = "2.5"; //was 4 + stabSpringConstant = "25"; + stabDampingConstant = 28; + + gyroDrag = 18; // 16 + //gyroForce = 50; + normalForce = "30"; + restorativeForce = "19000"; + steeringForce = "30"; + rollForce = "0"; + pitchForce = 30; +}; diff --git a/Templates/BaseGame/game/data/Prototyping/scripts/car.tscript b/Templates/BaseGame/game/data/Prototyping/scripts/car.tscript new file mode 100644 index 000000000..8b37727fc --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/scripts/car.tscript @@ -0,0 +1,20 @@ +function Car::onAdd(%this, %obj) +{ + Parent::onAdd(%this, %obj); + + %obj.setWheelTire(0,CarTire); + %obj.setWheelTire(1,CarTire); + %obj.setWheelTire(2,CarTire); + %obj.setWheelTire(3,CarTire); + + // Setup the car with some tires & springs + for (%i = %obj.getWheelCount() - 1; %i >= 0; %i--) + { + %obj.setWheelPowered(%i, true); + %obj.setWheelSpring(%i, CarSpring); + } + + // Steer with the front tires + %obj.setWheelSteering(0, 1); + %obj.setWheelSteering(1, 1); +} \ No newline at end of file diff --git a/Templates/BaseGame/game/data/Prototyping/scripts/flier.tscript b/Templates/BaseGame/game/data/Prototyping/scripts/flier.tscript new file mode 100644 index 000000000..32b29a652 --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/scripts/flier.tscript @@ -0,0 +1,19 @@ +function Flier::onDamage(%this, %obj, %delta) +{ + Parent::onDamage(%this, %obj); + %currentDamage = %obj.getDamageLevel(); + if(%currentDamage > %obj.destroyedLevel) + { + if(%obj.getDamageState() !$= "Destroyed") + { + if(%obj.respawnTime !$= "") + %obj.marker.schedule = %obj.marker.data.schedule(%obj.respawnTime, "respawn", %obj.marker); + %obj.setDamageState(Destroyed); + } + } + else + { + if(%obj.getDamageState() !$= "Enabled") + %obj.setDamageState(Enabled); + } +} \ No newline at end of file diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/ConePrimitive.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/ConePrimitive.asset.taml similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/ConePrimitive.asset.taml rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/ConePrimitive.asset.taml diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/ConePrimitive.fbx b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/ConePrimitive.fbx similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/ConePrimitive.fbx rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/ConePrimitive.fbx diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/ConePrimitive.tscript b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/ConePrimitive.tscript similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/ConePrimitive.tscript rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/ConePrimitive.tscript diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/CubePrimitive.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/CubePrimitive.asset.taml similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/CubePrimitive.asset.taml rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/CubePrimitive.asset.taml diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/CubePrimitive.fbx b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/CubePrimitive.fbx similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/CubePrimitive.fbx rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/CubePrimitive.fbx diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/CubePrimitive.tscript b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/CubePrimitive.tscript similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/CubePrimitive.tscript rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/CubePrimitive.tscript diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/CylinderPrimitive.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/CylinderPrimitive.asset.taml similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/CylinderPrimitive.asset.taml rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/CylinderPrimitive.asset.taml diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/CylinderPrimitive.fbx b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/CylinderPrimitive.fbx similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/CylinderPrimitive.fbx rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/CylinderPrimitive.fbx diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/CylinderPrimitive.tscript b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/CylinderPrimitive.tscript similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/CylinderPrimitive.tscript rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/CylinderPrimitive.tscript diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/SpherePrimitive.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/SpherePrimitive.asset.taml similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/SpherePrimitive.asset.taml rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/SpherePrimitive.asset.taml diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/SpherePrimitive.fbx b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/SpherePrimitive.fbx similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/SpherePrimitive.fbx rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/SpherePrimitive.fbx diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/SpherePrimitive.tscript b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/SpherePrimitive.tscript similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/SpherePrimitive.tscript rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/SpherePrimitive.tscript diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/TorusPrimitive.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/TorusPrimitive.asset.taml similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/TorusPrimitive.asset.taml rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/TorusPrimitive.asset.taml diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/TorusPrimitive.fbx b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/TorusPrimitive.fbx similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/TorusPrimitive.fbx rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/TorusPrimitive.fbx diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/TorusPrimitive.tscript b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/TorusPrimitive.tscript similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/TorusPrimitive.tscript rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/TorusPrimitive.tscript diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/TubePrimitive.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/TubePrimitive.asset.taml similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/TubePrimitive.asset.taml rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/TubePrimitive.asset.taml diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/TubePrimitive.fbx b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/TubePrimitive.fbx similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/TubePrimitive.fbx rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/TubePrimitive.fbx diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/TubePrimitive.tscript b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/TubePrimitive.tscript similarity index 100% rename from Templates/BaseGame/game/data/Prototyping/shapes/TubePrimitive.tscript rename to Templates/BaseGame/game/data/Prototyping/shapes/Primitives/TubePrimitive.tscript diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/Car.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/Car.asset.taml new file mode 100644 index 000000000..a41260bc3 --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/Car.asset.taml @@ -0,0 +1 @@ + diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/car.dae b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/car.dae new file mode 100644 index 000000000..b4dc919f7 --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/car.dae @@ -0,0 +1,537 @@ + + + + + Blender User + Blender 2.90.0 commit date:2020-08-31, commit time:11:26, hash:0330d1af29c0 + + 2021-09-11T16:03:37 + 2021-09-11T16:03:37 + + Z_UP + + + + + + 0 0 0 + + + + + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 25 + 45 + 0.15 + 0 + 1 + 2 + 0.04999995 + 40 + 1 + 3 + 512 + 3 + 1 + 0 + 0.25 + 0.25 + 0.25 + + + + + + + + + + + 0 0 0 1 + + + 0.8 0.8 0.8 1 + + + 1.45 + + + + + + + + + + + + + + + + + -1.3 -2.60617 0.8404262 -1.033334 -2.60617 0.8404262 -1.3 -2.605922 0.8423042 -1.03396 -2.605922 0.8423042 -1.258669 -2.954252 0.6404263 -1.258669 -2.954252 0.8404263 -1.273205 -2.9325 0.6404263 -1.273205 -2.9325 0.8404263 -1.241421 -2.973922 0.6404263 -1.221752 -2.99117 0.6404263 -1.241421 -2.973922 0.8404263 -1.221752 -2.99117 0.8404263 -1.273205 -2.9325 0.6404263 -1.273205 -2.9325 0.8404263 -1.284775 -2.909036 0.6404263 -1.284775 -2.909036 0.8404263 -1.3 0.6074998 0.4404257 -1.3 0.6074998 0.6404257 -1.3 0.7874998 0.4404256 -1.3 0.6340779 0.8423037 -1.3 0.7119999 1.030426 -1.3 0.7874998 0.6404257 -1.3 0.8359559 1.19197 -1.3 0.8079439 0.7957177 -1.3 0.8678839 0.9404256 -1.3 0.9975 1.315926 -1.3 0.9632359 1.06469 -1.3 1.0875 1.160042 -1.3 1.185622 1.393848 -1.3 1.232208 1.219982 -1.3 1.3875 1.420426 -1.3 1.3875 1.240426 -1.3 1.542792 1.219982 -1.3 1.589378 1.393848 -1.3 1.6875 1.160042 -1.3 1.7775 1.315925 -1.3 1.811764 1.064689 -1.3 1.939044 1.191969 -1.3 1.907116 0.9404255 -1.3 1.967056 0.7957175 -1.3 2.063 1.030425 -1.3 1.9875 0.6404255 -1.3 1.9875 0.4404255 -1.3 2.14117 0.8404255 -1.3 2.3675 0.4404254 -1.3 2.140922 0.8423035 -1.3 2.3675 0.8404254 1.241422 -2.973922 0.6404263 1.25867 -2.954252 0.6404263 1.241422 -2.973922 0.8404263 1.25867 -2.954252 0.8404263 -1.241421 -2.973922 0.6404263 -1.241421 -2.973922 0.8404263 -1.258669 -2.954252 0.6404263 -1.258669 -2.954252 0.8404263 1.1 -3.0325 0.6404263 1.126106 -3.03079 0.6404263 1.1 -3.0325 0.8404263 1.126106 -3.03079 0.8404263 1.151764 -3.025686 0.6404263 1.176536 -3.017276 0.6404263 1.151764 -3.025686 0.8404263 1.176536 -3.017276 0.8404263 -1.1 -3.0325 0.6404263 1.1 -3.0325 0.6404263 -1.1 -3.0325 0.8404263 1.1 -3.0325 0.8404263 1.298288 -2.858606 0.6404263 1.3 -2.8325 0.6404263 1.298288 -2.858606 0.8404263 1.3 -2.8325 0.8404263 -1.176535 -3.017276 0.6404263 -1.151764 -3.025686 0.6404263 -1.176535 -3.017276 0.8404263 -1.151764 -3.025686 0.8404263 -1.2 -3.005704 0.6404263 -1.176535 -3.017276 0.6404263 -1.2 -3.005704 0.8404263 -1.176535 -3.017276 0.8404263 1.221753 -2.99117 0.6404263 1.241422 -2.973922 0.6404263 1.221753 -2.99117 0.8404263 1.241422 -2.973922 0.8404263 1.200001 -3.005704 0.6404263 1.221753 -2.99117 0.6404263 1.200001 -3.005704 0.8404263 1.221753 -2.99117 0.8404263 1.126106 -3.03079 0.6404263 1.151764 -3.025686 0.6404263 1.126106 -3.03079 0.8404263 1.151764 -3.025686 0.8404263 -1.151764 -3.025686 0.6404263 -1.126106 -3.03079 0.6404263 -1.151764 -3.025686 0.8404263 -1.126106 -3.03079 0.8404263 1.284776 -2.909036 0.6404263 1.293186 -2.884264 0.6404263 1.284776 -2.909036 0.8404263 1.293186 -2.884264 0.8404263 -1.221752 -2.99117 0.6404263 -1.2 -3.005704 0.6404263 -1.221752 -2.99117 0.8404263 -1.2 -3.005704 0.8404263 -1.298287 -2.858606 0.6404263 -1.298287 -2.858606 0.8404263 -1.299999 -2.8325 0.6404263 -1.299999 -2.8325 0.8404263 1.273206 -2.9325 0.6404263 1.284776 -2.909036 0.6404263 1.273206 -2.9325 0.8404263 1.284776 -2.909036 0.8404263 1.3 -2.8325 0.8404263 1.3 -2.8325 0.6404263 1.3 -2.60617 0.8404262 1.3 -2.4525 0.6404262 1.3 -2.605922 0.8423042 1.3 -2.528 1.030426 1.3 -2.404044 1.19197 1.3 -2.432056 0.7957182 1.3 -2.372116 0.9404262 1.3 -2.2425 1.315926 1.3 -2.276764 1.06469 1.3 -2.1525 1.160042 1.3 -2.054378 1.393848 1.3 -2.007792 1.219982 1.3 -1.8525 1.420426 1.3 -1.8525 1.240426 1.3 -1.650622 1.393848 1.3 -1.697208 1.219982 1.3 -1.5525 1.160042 1.3 -1.4625 1.315926 1.3 -1.428236 1.06469 1.3 -1.300956 1.19197 1.3 -1.332884 0.940426 1.3 -1.272944 0.795718 1.3 -1.177 1.030426 1.3 -1.2525 0.640426 1.3 -1.2525 0.440426 1.3 -1.0725 0.4404259 1.3 -1.099078 0.842304 1.3 -1.0725 0.640426 1.176536 -3.017276 0.6404263 1.200001 -3.005704 0.6404263 1.176536 -3.017276 0.8404263 1.200001 -3.005704 0.8404263 -1.126106 -3.03079 0.6404263 -1.1 -3.0325 0.6404263 -1.126106 -3.03079 0.8404263 -1.1 -3.0325 0.8404263 1.25867 -2.954252 0.6404263 1.273206 -2.9325 0.6404263 1.25867 -2.954252 0.8404263 1.273206 -2.9325 0.8404263 -1.293185 -2.884264 0.6404263 -1.293185 -2.884264 0.8404263 -1.298287 -2.858606 0.6404263 -1.298287 -2.858606 0.8404263 1.293186 -2.884264 0.6404263 1.298288 -2.858606 0.6404263 1.293186 -2.884264 0.8404263 1.298288 -2.858606 0.8404263 -1.284775 -2.909036 0.6404263 -1.284775 -2.909036 0.8404263 -1.293185 -2.884264 0.6404263 -1.293185 -2.884264 0.8404263 1.1 2.055326 1.040426 1.096666 2.063 1.030425 1.1 2.3675 1.040425 1.03396 2.140922 0.8423035 1.033334 2.14117 0.8404255 1.033334 2.300834 0.8404254 1.033334 -2.899166 0.8404263 1.033334 -2.60617 0.8404262 1.1 -2.8325 1.040426 1.03396 -2.605922 0.8423042 1.096666 -2.528 1.030426 1.1 -2.520326 1.040426 -1.1 1.7775 1.315925 -1.1 1.939044 1.191969 -1.3 1.7775 1.315925 -1.3 1.939044 1.191969 -1.1 -1.650622 1.393848 -1.1 -1.4625 1.315926 -1.3 -1.650622 1.393848 -1.3 -1.4625 1.315926 1.3 1.6875 1.160042 1.3 1.542792 1.219982 0.6499997 1.6875 1.160042 0.6499997 1.542792 1.219982 1.3 0.9975004 1.315926 1.3 1.185622 1.393848 1.1 0.9975003 1.315926 1.1 1.185622 1.393848 1.3 -1.650622 1.393848 1.3 -1.4625 1.315926 1.1 -1.650622 1.393848 1.1 -1.4625 1.315926 1.3 -2.404044 1.19197 1.3 -2.2425 1.315926 1.1 -2.404044 1.19197 1.1 -2.2425 1.315926 1.3 0.6340782 0.8423037 1.3 0.7120003 1.030426 1.03396 0.6340782 0.8423037 1.096666 0.7120003 1.030426 1.3 1.907116 0.9404255 1.3 1.811764 1.064689 0.6499997 1.907116 0.9404255 0.6499997 1.811764 1.064689 1.096666 -1.177 1.030426 1.1 -1.184674 1.040426 1.3 -1.177 1.030426 1.3 -1.300956 1.19197 1.1 -1.300956 1.19197 1.3 0.7875002 0.4404256 0.6499999 0.7875001 0.4404256 1.3 0.7875002 0.6404257 0.6499999 0.7875001 0.6404257 -1.1 -1.4625 1.315926 -1.1 -1.300956 1.19197 -1.3 -1.4625 1.315926 -1.3 -1.300956 1.19197 1.3 0.8359563 1.19197 1.3 0.9975004 1.315926 1.1 0.8359563 1.19197 1.1 0.9975003 1.315926 1.3 1.811764 1.064689 1.3 1.6875 1.160042 0.6499997 1.811764 1.064689 0.6499997 1.6875 1.160042 1.3 -1.4625 1.315926 1.3 -1.300956 1.19197 1.1 -1.4625 1.315926 1.1 -1.300956 1.19197 1.3 1.185622 1.393848 1.3 1.3875 1.420426 1.1 1.185622 1.393848 1.1 1.3875 1.420426 1.3 1.3875 1.420426 1.3 1.589378 1.393848 1.1 1.3875 1.420426 1.1 1.589378 1.393848 1.3 1.7775 1.315925 1.3 1.939044 1.191969 1.1 1.7775 1.315925 1.1 1.939044 1.191969 -1.1 -1.8525 1.420426 -1.1 -1.650622 1.393848 -1.3 -1.8525 1.420426 -1.3 -1.650622 1.393848 1.3 1.0875 1.160042 1.3 0.9632363 1.06469 0.6499998 1.0875 1.160042 0.6499999 0.9632362 1.06469 1.3 -1.8525 1.420426 1.3 -1.650622 1.393848 1.1 -1.8525 1.420426 1.1 -1.650622 1.393848 1.3 1.542792 1.219982 1.3 1.3875 1.240426 0.6499997 1.542792 1.219982 0.6499998 1.3875 1.240426 1.3 1.232208 1.219982 1.3 1.0875 1.160042 0.6499998 1.232208 1.219982 0.6499998 1.0875 1.160042 -1.3 0.6340779 0.8423037 -1.03396 0.6340779 0.8423037 -1.3 0.7119999 1.030426 -1.096666 0.712 1.030426 1.3 -2.2425 1.315926 1.3 -2.054378 1.393848 1.1 -2.2425 1.315926 1.1 -2.054378 1.393848 1.3 0.7875002 0.6404257 0.6499999 0.7875001 0.6404257 1.3 0.8079442 0.7957177 0.6499999 0.8079442 0.7957177 -1.033334 -2.899166 0.8404263 -1.1 -2.8325 1.040426 -1.033334 -2.60617 0.8404262 -1.03396 -2.605922 0.8423042 -1.096666 -2.528 1.030426 -1.1 -2.520326 1.040426 -1.03396 -1.099078 0.842304 -1.3 -1.099078 0.842304 -1.096666 -1.177 1.030426 -1.3 -1.177 1.030426 1.3 2.140922 0.8423035 1.03396 2.140922 0.8423035 1.3 2.063 1.030425 1.096666 2.063 1.030425 -1.3 2.140922 0.8423035 -1.3 2.063 1.030425 -1.03396 2.140922 0.8423035 -1.096666 2.063 1.030425 -1.1 0.8359559 1.19197 -1.1 0.9975 1.315926 -1.3 0.8359559 1.19197 -1.3 0.9975 1.315926 -1.1 -2.054378 1.393848 -1.1 -1.8525 1.420426 -1.3 -2.054378 1.393848 -1.3 -1.8525 1.420426 1.3 0.8079442 0.7957177 0.6499999 0.8079442 0.7957177 1.3 0.8678843 0.9404256 0.6499999 0.8678842 0.9404256 -1.3 -2.605922 0.8423042 -1.03396 -2.605922 0.8423042 -1.3 -2.528 1.030426 -1.096666 -2.528 1.030426 -1.3 0.6074998 0.6404257 -0.9666661 0.6074999 0.6404257 -1.3 0.6340779 0.8423037 -1.03396 0.6340779 0.8423037 1.3 1.9875 0.6404255 1.3 1.967056 0.7957175 0.6499997 1.9875 0.6404255 0.6499997 1.967056 0.7957175 1.03396 -1.099078 0.842304 1.096666 -1.177 1.030426 1.3 -1.099078 0.842304 1.3 -1.177 1.030426 -1.3 -2.528 1.030426 -1.096666 -2.528 1.030426 -1.3 -2.404044 1.19197 -1.1 -2.520326 1.040426 -1.1 -2.404044 1.19197 0.9666662 -1.0725 0.640426 1.03396 -1.099078 0.842304 1.3 -1.0725 0.640426 1.3 -1.099078 0.842304 -1.1 1.185622 1.393848 -1.1 1.3875 1.420426 -1.3 1.185622 1.393848 -1.3 1.3875 1.420426 1.096666 2.063 1.030425 1.1 2.055326 1.040426 1.3 2.063 1.030425 1.3 1.939044 1.191969 1.1 1.939044 1.191969 1.096666 0.7120003 1.030426 1.3 0.7120003 1.030426 1.1 0.7196742 1.040426 1.3 0.8359563 1.19197 1.1 0.8359563 1.19197 0.9666659 0.6075002 0.6404257 1.3 0.6075003 0.6404257 1.03396 0.6340782 0.8423037 1.3 0.6340782 0.8423037 -1.1 1.589378 1.393848 -1.1 1.7775 1.315925 -1.3 1.589378 1.393848 -1.3 1.7775 1.315925 -1.096666 -1.177 1.030426 -1.3 -1.177 1.030426 -1.1 -1.184674 1.040426 -1.3 -1.300956 1.19197 -1.1 -1.300956 1.19197 -1.096666 2.063 1.030425 -1.3 2.063 1.030425 -1.1 2.055326 1.040426 -1.3 1.939044 1.191969 -1.1 1.939044 1.191969 1.3 -2.054378 1.393848 1.3 -1.8525 1.420426 1.1 -2.054378 1.393848 1.1 -1.8525 1.420426 -1.1 1.3875 1.420426 -1.1 1.589378 1.393848 -1.3 1.3875 1.420426 -1.3 1.589378 1.393848 1.033334 -2.60617 0.8404262 1.3 -2.60617 0.8404262 1.03396 -2.605922 0.8423042 1.3 -2.605922 0.8423042 1.3 0.8678843 0.9404256 0.6499999 0.8678842 0.9404256 1.3 0.9632363 1.06469 0.6499999 0.9632362 1.06469 -1.1 -2.2425 1.315926 -1.1 -2.054378 1.393848 -1.3 -2.2425 1.315926 -1.3 -2.054378 1.393848 1.3 -2.605922 0.8423042 1.3 -2.528 1.030426 1.03396 -2.605922 0.8423042 1.096666 -2.528 1.030426 -0.9666658 -1.0725 0.640426 -1.3 -1.0725 0.640426 -1.03396 -1.099078 0.842304 -1.3 -1.099078 0.842304 -1.096666 0.712 1.030426 -1.1 0.7196739 1.040426 -1.3 0.7119999 1.030426 -1.3 0.8359559 1.19197 -1.1 0.8359559 1.19197 -1.1 0.9975 1.315926 -1.1 1.185622 1.393848 -1.3 0.9975 1.315926 -1.3 1.185622 1.393848 1.3 1.967056 0.7957175 1.3 1.907116 0.9404255 0.6499997 1.967056 0.7957175 0.6499997 1.907116 0.9404255 1.3 -2.528 1.030426 1.3 -2.404044 1.19197 1.096666 -2.528 1.030426 1.1 -2.520326 1.040426 1.1 -2.404044 1.19197 -1.293186 2.419264 0.4404254 -1.293186 2.419264 0.8404254 -1.284776 2.444036 0.4404254 -1.284776 2.444036 0.8404254 -1.284776 2.444036 0.4404254 -1.284776 2.444036 0.8404254 -1.273206 2.4675 0.4404254 -1.273206 2.4675 0.8404254 -1.273206 2.4675 0.4404254 -1.273206 2.4675 0.8404254 -1.25867 2.489252 0.4404254 -1.25867 2.489252 0.8404254 -1.221752 2.52617 0.4404254 -1.241422 2.508922 0.4404254 -1.221752 2.52617 0.8404254 -1.241422 2.508922 0.8404254 1.25867 2.489252 0.8404254 1.25867 2.489252 0.4404254 1.241422 2.508922 0.8404254 1.241422 2.508922 0.4404254 1.126106 2.565788 0.4404253 1.1 2.5675 0.4404253 1.126106 2.565788 0.8404254 1.1 2.5675 0.8404254 -1.25867 2.489252 0.4404254 -1.25867 2.489252 0.8404254 -1.241422 2.508922 0.4404254 -1.241422 2.508922 0.8404254 -1.298288 2.393606 0.4404254 -1.298288 2.393606 0.8404254 -1.293186 2.419264 0.4404254 -1.293186 2.419264 0.8404254 -1.3 2.3675 0.4404254 -1.3 2.3675 0.8404254 -1.298288 2.393606 0.4404254 -1.298288 2.393606 0.8404254 1.1 2.5675 0.4404253 -1.1 2.5675 0.4404253 1.1 2.5675 0.8404254 -1.1 2.5675 0.8404254 1.3 2.3675 0.8404254 1.3 2.3675 0.4404254 1.298288 2.393606 0.8404254 1.298288 2.393606 0.4404254 1.293186 2.419264 0.8404254 1.293186 2.419264 0.4404254 1.284776 2.444036 0.8404254 1.284776 2.444036 0.4404254 1.273206 2.4675 0.8404254 1.273206 2.4675 0.4404254 1.25867 2.489252 0.8404254 1.25867 2.489252 0.4404254 1.3 1.589378 1.393848 1.3 1.7775 1.315925 1.1 1.589378 1.393848 1.1 1.7775 1.315925 1.033334 2.300834 0.8404254 -1.033334 2.300834 0.8404254 1.1 2.3675 1.040425 -1.1 2.3675 1.040425 0.6999996 2.3675 1.040425 -0.7000004 2.3675 1.040425 -1.033334 2.14117 0.8404255 -1.033334 2.300834 0.8404254 -1.3 2.14117 0.8404255 -1.1 2.5675 0.8404254 -1.126106 2.565788 0.8404254 -1.151764 2.560686 0.8404254 -1.176536 2.552276 0.8404254 -1.2 2.540706 0.8404254 -1.221752 2.52617 0.8404254 -1.241422 2.508922 0.8404254 -1.25867 2.489252 0.8404254 -1.273206 2.4675 0.8404254 -1.284776 2.444036 0.8404254 -1.293186 2.419264 0.8404254 -1.298288 2.393606 0.8404254 -1.3 2.3675 0.8404254 1.033334 2.300834 0.8404254 1.1 2.5675 0.8404254 1.033334 2.14117 0.8404255 1.126106 2.565788 0.8404254 1.151764 2.560686 0.8404254 1.176536 2.552276 0.8404254 1.2 2.540706 0.8404254 1.221752 2.52617 0.8404254 1.241422 2.508922 0.8404254 1.25867 2.489252 0.8404254 1.273206 2.4675 0.8404254 1.284776 2.444036 0.8404254 1.293186 2.419264 0.8404254 1.298288 2.393606 0.8404254 1.3 2.3675 0.8404254 1.3 2.14117 0.8404255 1.151764 2.560686 0.4404253 1.126106 2.565788 0.4404253 1.151764 2.560686 0.8404254 1.126106 2.565788 0.8404254 1.176536 2.552276 0.4404253 1.151764 2.560686 0.4404253 1.176536 2.552276 0.8404254 1.151764 2.560686 0.8404254 -1.151764 2.560686 0.4404253 -1.176536 2.552276 0.4404253 -1.151764 2.560686 0.8404254 -1.176536 2.552276 0.8404254 -1.176536 2.552276 0.4404253 -1.2 2.540706 0.4404253 -1.176536 2.552276 0.8404254 -1.2 2.540706 0.8404254 -1.033334 2.14117 0.8404255 -1.3 2.14117 0.8404255 -1.03396 2.140922 0.8423035 -1.3 2.140922 0.8423035 -1.126106 2.565788 0.4404253 -1.151764 2.560686 0.4404253 -1.126106 2.565788 0.8404254 -1.151764 2.560686 0.8404254 -1.1 -2.404044 1.19197 -1.1 -2.2425 1.315926 -1.3 -2.404044 1.19197 -1.3 -2.2425 1.315926 1.221752 2.52617 0.4404254 1.2 2.540706 0.4404253 1.221752 2.52617 0.8404254 1.2 2.540706 0.8404254 -1.1 2.055326 1.040426 -1.1 2.3675 1.040425 -1.096666 2.063 1.030425 -1.03396 2.140922 0.8423035 -1.033334 2.14117 0.8404255 -1.033334 2.300834 0.8404254 1.284776 2.444036 0.8404254 1.284776 2.444036 0.4404254 1.273206 2.4675 0.8404254 1.273206 2.4675 0.4404254 1.3 2.14117 0.8404255 1.033334 2.14117 0.8404255 1.3 2.140922 0.8423035 1.03396 2.140922 0.8423035 1.298288 2.393606 0.8404254 1.298288 2.393606 0.4404254 1.293186 2.419264 0.8404254 1.293186 2.419264 0.4404254 1.241422 2.508922 0.4404254 1.221752 2.52617 0.4404254 1.241422 2.508922 0.8404254 1.221752 2.52617 0.8404254 -1.1 2.5675 0.4404253 -1.126106 2.565788 0.4404253 -1.1 2.5675 0.8404254 -1.126106 2.565788 0.8404254 -1.3 1.9875 0.4404255 -0.6500003 1.9875 0.4404255 -1.3 1.9875 0.6404255 -0.6500003 1.9875 0.6404255 -1.2 2.540706 0.4404253 -1.221752 2.52617 0.4404254 -1.2 2.540706 0.8404254 -1.221752 2.52617 0.8404254 1.2 2.540706 0.4404253 1.176536 2.552276 0.4404253 1.2 2.540706 0.8404254 1.176536 2.552276 0.8404254 1.3 1.3875 1.240426 1.3 1.232208 1.219982 0.6499998 1.3875 1.240426 0.6499998 1.232208 1.219982 -1.3 1.9875 0.6404255 -0.6500003 1.9875 0.6404255 -1.3 1.967056 0.7957175 -0.6500003 1.967056 0.7957175 -0.6500001 0.7874999 0.4404256 -1.3 0.7874998 0.4404256 -0.6500001 0.7874999 0.6404257 -1.3 0.7874998 0.6404257 -0.6500002 1.3875 1.240426 -0.6500002 1.232208 1.219982 -1.3 1.3875 1.240426 -1.3 1.232208 1.219982 -0.6500002 1.232208 1.219982 -0.6500002 1.0875 1.160042 -1.3 1.232208 1.219982 -1.3 1.0875 1.160042 -1.3 1.907116 0.9404255 -0.6500003 1.907116 0.9404255 -1.3 1.811764 1.064689 -0.6500002 1.811764 1.064689 -0.6500001 0.7874999 0.6404257 -1.3 0.7874998 0.6404257 -0.6500001 0.8079439 0.7957177 -1.3 0.8079439 0.7957177 -0.6500001 0.867884 0.9404256 -1.3 0.8678839 0.9404256 -0.6500001 0.963236 1.06469 -1.3 0.9632359 1.06469 -0.6500001 0.8079439 0.7957177 -1.3 0.8079439 0.7957177 -0.6500001 0.867884 0.9404256 -1.3 0.8678839 0.9404256 -0.6500002 1.0875 1.160042 -0.6500001 0.963236 1.06469 -1.3 1.0875 1.160042 -1.3 0.9632359 1.06469 -0.6500002 1.811764 1.064689 -0.6500002 1.6875 1.160042 -1.3 1.811764 1.064689 -1.3 1.6875 1.160042 -0.6500002 1.542792 1.219982 -0.6500002 1.3875 1.240426 -1.3 1.542792 1.219982 -1.3 1.3875 1.240426 -1.3 1.967056 0.7957175 -0.6500003 1.967056 0.7957175 -1.3 1.907116 0.9404255 -0.6500003 1.907116 0.9404255 -0.6500002 1.6875 1.160042 -0.6500002 1.542792 1.219982 -1.3 1.6875 1.160042 -1.3 1.542792 1.219982 -0.6500001 0.7874999 0.4404256 -0.6500001 0.7874999 0.6404257 -0.6500003 1.9875 0.4404255 -0.6500001 0.8079439 0.7957177 -0.6500001 0.867884 0.9404256 -0.6500001 0.963236 1.06469 -0.6500002 1.0875 1.160042 -0.6500002 1.232208 1.219982 -0.6500002 1.3875 1.240426 -0.6500002 1.542792 1.219982 -0.6500002 1.6875 1.160042 -0.6500002 1.811764 1.064689 -0.6500003 1.907116 0.9404255 -0.6500003 1.967056 0.7957175 -0.6500003 1.9875 0.6404255 0.6499999 0.7875001 0.6404257 0.6499999 0.7875001 0.4404256 0.6499999 0.8079442 0.7957177 0.6499997 1.9875 0.4404255 0.6499999 0.8678842 0.9404256 0.6499999 0.9632362 1.06469 0.6499998 1.0875 1.160042 0.6499998 1.232208 1.219982 0.6499998 1.3875 1.240426 0.6499997 1.542792 1.219982 0.6499997 1.6875 1.160042 0.6499997 1.811764 1.064689 0.6499997 1.907116 0.9404255 0.6499997 1.967056 0.7957175 0.6499997 1.9875 0.6404255 0.6499997 1.9875 0.4404255 1.3 1.9875 0.4404255 0.6499997 1.9875 0.6404255 1.3 1.9875 0.6404255 1.1 -3.0325 0.8404263 1.033334 -2.899166 0.8404263 -1.1 -3.0325 0.8404263 -1.033334 -2.899166 0.8404263 -1.033334 -2.60617 0.8404262 -1.3 -2.60617 0.8404262 -1.126106 -3.03079 0.8404263 -1.151764 -3.025686 0.8404263 -1.176535 -3.017276 0.8404263 -1.2 -3.005704 0.8404263 -1.221752 -2.99117 0.8404263 -1.241421 -2.973922 0.8404263 -1.258669 -2.954252 0.8404263 -1.273205 -2.9325 0.8404263 -1.284775 -2.909036 0.8404263 -1.293185 -2.884264 0.8404263 -1.298287 -2.858606 0.8404263 -1.299999 -2.8325 0.8404263 1.3 -2.8325 0.8404263 1.3 -2.60617 0.8404262 1.298288 -2.858606 0.8404263 1.033334 -2.60617 0.8404262 1.293186 -2.884264 0.8404263 1.284776 -2.909036 0.8404263 1.273206 -2.9325 0.8404263 1.25867 -2.954252 0.8404263 1.241422 -2.973922 0.8404263 1.221753 -2.99117 0.8404263 1.200001 -3.005704 0.8404263 1.176536 -3.017276 0.8404263 1.151764 -3.025686 0.8404263 1.126106 -3.03079 0.8404263 -1.033334 -2.899166 0.8404263 1.033334 -2.899166 0.8404263 -1.1 -2.8325 1.040426 1.1 -2.8325 1.040426 -0.5999996 -2.8325 1.040426 0.6000005 -2.8325 1.040426 -0.5999996 -2.8325 1.040426 0.6000005 -2.8325 1.040426 -0.5999996 -2.8325 1.240426 0.6000005 -2.8325 1.240426 1.3 0.7875002 0.4404256 1.3 0.6075002 0.4404257 0.6499999 0.7875001 0.4404256 0.9666659 0.6075001 0.4404257 0.6500002 -1.2525 0.440426 0.6500003 -2.4525 0.4404262 -0.6499996 -2.4525 0.4404262 -0.6499998 -1.2525 0.440426 0.9666662 -1.0725 0.4404259 1.3 -1.0725 0.4404259 1.3 -1.2525 0.440426 -0.6500003 1.9875 0.4404255 -1.1 2.5675 0.4404253 0.6499997 1.9875 0.4404255 1.1 2.5675 0.4404253 1.126106 2.565788 0.4404253 1.151764 2.560686 0.4404253 1.176536 2.552276 0.4404253 1.2 2.540706 0.4404253 1.221752 2.52617 0.4404254 1.241422 2.508922 0.4404254 1.25867 2.489252 0.4404254 1.273206 2.4675 0.4404254 1.284776 2.444036 0.4404254 1.293186 2.419264 0.4404254 1.298288 2.393606 0.4404254 1.3 2.3675 0.4404254 1.3 1.9875 0.4404255 -1.3 1.9875 0.4404255 -1.126106 2.565788 0.4404253 -1.151764 2.560686 0.4404253 -1.176536 2.552276 0.4404253 -1.2 2.540706 0.4404253 -1.221752 2.52617 0.4404254 -1.241422 2.508922 0.4404254 -1.25867 2.489252 0.4404254 -1.273206 2.4675 0.4404254 -1.284776 2.444036 0.4404254 -1.293186 2.419264 0.4404254 -1.298288 2.393606 0.4404254 -1.3 2.3675 0.4404254 -0.6500001 0.7874999 0.4404256 -0.9666658 -1.0725 0.4404259 -0.9666661 0.6074999 0.4404257 -1.3 0.7874998 0.4404256 -1.3 0.6074998 0.4404257 -1.3 -1.2525 0.440426 -1.3 -1.0725 0.4404259 -1.3 -1.2525 0.440426 -0.6499998 -1.2525 0.440426 -1.3 -1.2525 0.640426 -0.6499998 -1.2525 0.640426 1.3 -2.1525 1.160042 1.3 -2.276764 1.06469 0.6500003 -2.1525 1.160042 0.6500003 -2.276764 1.06469 1.3 -1.272944 0.795718 1.3 -1.332884 0.940426 0.6500002 -1.272944 0.795718 0.6500002 -1.332884 0.940426 1.3 -1.8525 1.240426 1.3 -2.007792 1.219982 0.6500003 -1.8525 1.240426 0.6500003 -2.007792 1.219982 1.3 -1.332884 0.940426 1.3 -1.428236 1.06469 0.6500002 -1.332884 0.940426 0.6500002 -1.428236 1.06469 1.3 -1.5525 1.160042 1.3 -1.697208 1.219982 0.6500002 -1.5525 1.160042 0.6500002 -1.697208 1.219982 1.3 -2.432056 0.7957182 0.6500003 -2.432056 0.7957182 1.3 -2.372116 0.9404262 0.6500003 -2.372116 0.9404262 1.3 -2.372116 0.9404262 0.6500003 -2.372116 0.9404262 1.3 -2.276764 1.06469 0.6500003 -2.276764 1.06469 1.3 -1.428236 1.06469 1.3 -1.5525 1.160042 0.6500002 -1.428236 1.06469 0.6500002 -1.5525 1.160042 1.3 -2.007792 1.219982 1.3 -2.1525 1.160042 0.6500003 -2.007792 1.219982 0.6500003 -2.1525 1.160042 1.3 -1.2525 0.640426 1.3 -1.272944 0.795718 0.6500002 -1.2525 0.640426 0.6500002 -1.272944 0.795718 1.3 -2.4525 0.6404262 0.6500003 -2.4525 0.6404262 1.3 -2.432056 0.7957182 0.6500003 -2.432056 0.7957182 1.3 -1.697208 1.219982 1.3 -1.8525 1.240426 0.6500002 -1.697208 1.219982 0.6500003 -1.8525 1.240426 -1.3 -1.2525 0.640426 -0.6499998 -1.2525 0.640426 -1.3 -1.272944 0.795718 -0.6499998 -1.272944 0.795718 -0.6499997 -2.007792 1.219982 -0.6499996 -2.1525 1.160042 -1.3 -2.007792 1.219982 -1.3 -2.1525 1.160042 -0.6499996 -2.4525 0.6404262 -1.3 -2.4525 0.6404262 -0.6499996 -2.432056 0.7957182 -1.3 -2.432056 0.7957182 -0.6499997 -1.428236 1.06469 -0.6499997 -1.5525 1.160042 -1.3 -1.428236 1.06469 -1.3 -1.5525 1.160042 -0.6499996 -2.432056 0.7957182 -1.3 -2.432056 0.7957182 -0.6499996 -2.372116 0.9404262 -1.3 -2.372116 0.9404262 -0.6499996 -2.4525 0.4404262 -0.6499996 -2.4525 0.6404262 -0.6499998 -1.2525 0.440426 -0.6499996 -2.432056 0.7957182 -0.6499996 -2.372116 0.9404262 -0.6499996 -2.276764 1.06469 -0.6499996 -2.1525 1.160042 -0.6499997 -2.007792 1.219982 -0.6499997 -1.8525 1.240426 -0.6499997 -1.697208 1.219982 -0.6499997 -1.5525 1.160042 -0.6499997 -1.428236 1.06469 -0.6499997 -1.332884 0.940426 -0.6499998 -1.272944 0.795718 -0.6499998 -1.2525 0.640426 -1.3 -1.272944 0.795718 -0.6499998 -1.272944 0.795718 -1.3 -1.332884 0.940426 -0.6499997 -1.332884 0.940426 -0.6499997 -1.697208 1.219982 -0.6499997 -1.8525 1.240426 -1.3 -1.697208 1.219982 -1.3 -1.8525 1.240426 -0.6499997 -1.332884 0.940426 -0.6499997 -1.428236 1.06469 -1.3 -1.332884 0.940426 -1.3 -1.428236 1.06469 -0.6499996 -2.1525 1.160042 -0.6499996 -2.276764 1.06469 -1.3 -2.1525 1.160042 -1.3 -2.276764 1.06469 -0.6499997 -1.5525 1.160042 -0.6499997 -1.697208 1.219982 -1.3 -1.5525 1.160042 -1.3 -1.697208 1.219982 0.6500002 -1.2525 0.440426 1.3 -1.2525 0.440426 0.6500002 -1.2525 0.640426 1.3 -1.2525 0.640426 0.6500003 -2.4525 0.6404262 0.6500003 -2.4525 0.4404262 0.6500003 -2.432056 0.7957182 0.6500002 -1.2525 0.440426 0.6500003 -2.372116 0.9404262 0.6500003 -2.276764 1.06469 0.6500003 -2.1525 1.160042 0.6500003 -2.007792 1.219982 0.6500003 -1.8525 1.240426 0.6500002 -1.697208 1.219982 0.6500002 -1.5525 1.160042 0.6500002 -1.428236 1.06469 0.6500002 -1.332884 0.940426 0.6500002 -1.272944 0.795718 0.6500002 -1.2525 0.640426 -0.6499997 -1.8525 1.240426 -0.6499997 -2.007792 1.219982 -1.3 -1.8525 1.240426 -1.3 -2.007792 1.219982 -0.6499996 -2.372116 0.9404262 -1.3 -2.372116 0.9404262 -0.6499996 -2.276764 1.06469 -1.3 -2.276764 1.06469 -0.6499996 -2.4525 0.4404262 0.6500003 -2.4525 0.4404262 -0.6499996 -2.4525 0.6404262 0.6500003 -2.4525 0.6404262 1.3 -2.8325 0.6404263 1.298288 -2.858606 0.6404263 1.3 -2.4525 0.6404262 0.6500003 -2.4525 0.6404262 1.293186 -2.884264 0.6404263 1.284776 -2.909036 0.6404263 1.273206 -2.9325 0.6404263 1.25867 -2.954252 0.6404263 1.241422 -2.973922 0.6404263 1.221753 -2.99117 0.6404263 1.200001 -3.005704 0.6404263 1.176536 -3.017276 0.6404263 1.151764 -3.025686 0.6404263 1.126106 -3.03079 0.6404263 1.1 -3.0325 0.6404263 -1.1 -3.0325 0.6404263 -0.6499996 -2.4525 0.6404262 -1.3 -2.4525 0.6404262 -1.126106 -3.03079 0.6404263 -1.151764 -3.025686 0.6404263 -1.176535 -3.017276 0.6404263 -1.2 -3.005704 0.6404263 -1.221752 -2.99117 0.6404263 -1.241421 -2.973922 0.6404263 -1.258669 -2.954252 0.6404263 -1.273205 -2.9325 0.6404263 -1.284775 -2.909036 0.6404263 -1.293185 -2.884264 0.6404263 -1.298287 -2.858606 0.6404263 -1.299999 -2.8325 0.6404263 0.6999996 2.3675 1.040425 -0.7000004 2.3675 1.040425 0.6999996 2.3675 1.240425 -0.7000004 2.3675 1.240425 0.77604 0.4333043 2.000426 -0.7760401 0.4333041 2.000426 0.7360399 0.2733044 2.120426 -0.7360401 0.2733041 2.120426 1.3 0.7120003 1.030426 1.3 0.7875002 0.6404257 1.3 0.8359563 1.19197 1.3 0.8079442 0.7957177 1.3 0.8678843 0.9404256 1.3 0.9975004 1.315926 1.3 0.9632363 1.06469 1.3 1.0875 1.160042 1.3 1.185622 1.393848 1.3 1.232208 1.219982 1.3 1.3875 1.420426 1.3 1.3875 1.240426 1.3 1.589378 1.393848 1.3 1.542792 1.219982 1.3 1.6875 1.160042 1.3 1.7775 1.315925 1.3 1.811764 1.064689 1.3 1.939044 1.191969 1.3 1.907116 0.9404255 1.3 1.967056 0.7957175 1.3 2.063 1.030425 1.3 1.9875 0.6404255 1.3 1.9875 0.4404255 1.3 2.14117 0.8404255 1.3 2.3675 0.4404254 1.3 2.140922 0.8423035 1.3 2.3675 0.8404254 1.3 0.6075003 0.6404257 1.3 0.6075002 0.4404257 1.3 0.6340782 0.8423037 1.3 0.7875002 0.4404256 1.3 -1.0725 0.4404259 1.3 -1.0725 0.640426 0.9666662 -1.0725 0.4404259 0.9666662 -1.0725 0.640426 1.3 0.6075002 0.4404257 0.9666659 0.6075001 0.4404257 1.3 0.6075003 0.6404257 0.9666659 0.6075002 0.6404257 -1.299999 -2.8325 0.6404263 -1.299999 -2.8325 0.8404263 -1.3 -2.4525 0.6404262 -1.3 -2.60617 0.8404262 -1.3 -2.605922 0.8423042 -1.3 -2.528 1.030426 -1.3 -2.404044 1.19197 -1.3 -2.432056 0.7957182 -1.3 -2.372116 0.9404262 -1.3 -2.2425 1.315926 -1.3 -2.276764 1.06469 -1.3 -2.1525 1.160042 -1.3 -2.054378 1.393848 -1.3 -2.007792 1.219982 -1.3 -1.8525 1.420426 -1.3 -1.8525 1.240426 -1.3 -1.697208 1.219982 -1.3 -1.650622 1.393848 -1.3 -1.5525 1.160042 -1.3 -1.4625 1.315926 -1.3 -1.428236 1.06469 -1.3 -1.300956 1.19197 -1.3 -1.332884 0.940426 -1.3 -1.272944 0.795718 -1.3 -1.177 1.030426 -1.3 -1.2525 0.640426 -1.3 -1.2525 0.440426 -1.3 -1.0725 0.4404259 -1.3 -1.099078 0.842304 -1.3 -1.0725 0.640426 -0.9666661 0.6074999 0.4404257 -1.3 0.6074998 0.4404257 -0.9666661 0.6074999 0.6404257 -1.3 0.6074998 0.6404257 -0.9666658 -1.0725 0.4404259 -0.9666658 -1.0725 0.640426 -1.3 -1.0725 0.4404259 -1.3 -1.0725 0.640426 1.1 -1.184674 1.040426 1.096666 -1.177 1.030426 1.1 -1.0725 1.040426 1.03396 -1.099078 0.842304 0.9666662 -1.0725 0.640426 1.1 0.6075003 1.040426 0.9666659 0.6075002 0.6404257 1.03396 0.6340782 0.8423037 1.096666 0.7120003 1.030426 1.1 0.7196742 1.040426 -1.1 -1.184674 1.040426 -1.1 -1.0725 1.040426 -1.096666 -1.177 1.030426 -1.03396 -1.099078 0.842304 -0.9666658 -1.0725 0.640426 -0.9666661 0.6074999 0.6404257 -1.1 0.6075 1.040426 -1.03396 0.6340779 0.8423037 -1.096666 0.712 1.030426 -1.1 0.7196739 1.040426 0.9000003 -2.097922 2.240426 0.9705103 -2.097922 2.028894 0.9000002 -1.697921 2.240426 -0.9705097 -2.097922 2.028894 -0.8999997 -2.097922 2.240426 -0.8999997 -1.697922 2.240426 -0.9705097 -2.097922 2.028894 0.9705103 -2.097922 2.028894 -0.8999997 -2.097922 2.240426 0.9000003 -2.097922 2.240426 0.9000003 -2.097922 2.240426 0.9000002 -1.697921 2.240426 -0.8999997 -2.097922 2.240426 -0.8999997 -1.697922 2.240426 1.3 0.9133043 1.440426 1.1 0.9133043 1.440426 1.3 0.9133044 1.640426 1.1 0.9133043 1.640426 1.3 0.7133044 1.640426 1.3 0.9133044 1.640426 1.1 0.7133044 1.640426 1.1 0.9133043 1.640426 0.9 0.1133044 2.240426 -0.9 0.1133041 2.240426 1.3 0.9133043 1.440426 1.3 0.7133044 1.440426 1.1 0.9133043 1.440426 1.1 0.7133044 1.440426 1.1 0.9133043 1.640426 0.8960399 0.9133043 1.640426 0.9 0.1133044 2.240426 -0.9 0.1133041 2.240426 0.77604 0.4333043 2.000426 -0.8960402 0.913304 1.640426 -1.1 0.913304 1.640426 -1.1 0.913304 1.440426 -1.1 0.713304 1.440426 -1.3 0.9133039 1.440426 -1.3 0.7133039 1.440426 -1.1 -2.8325 1.640426 -1.037668 -2.4789 1.82742 -1.1 -0.9923101 1.640426 -0.9632458 -0.9923099 2.05069 -0.9 0.1133041 2.240426 -0.963246 0.04379606 2.05069 -1.1 0.590814 1.640426 -1.1 0.713304 1.640426 -1.1 0.913304 1.640426 -1.1 0.713304 1.640426 -1.1 0.913304 1.640426 -1.3 0.713304 1.640426 -1.3 0.913304 1.640426 -1.1 0.913304 1.440426 -1.3 0.9133039 1.440426 -1.1 0.913304 1.640426 -1.3 0.913304 1.640426 -1.3 0.7133039 1.440426 -1.3 0.713304 1.640426 -1.3 0.9133039 1.440426 -1.3 0.913304 1.640426 1.3 0.7133044 1.640426 1.3 0.7133044 1.440426 1.3 0.9133044 1.640426 1.3 0.9133043 1.440426 0.9632462 -0.9923097 2.05069 0.9 0.1133044 2.240426 0.963246 0.04379636 2.05069 1.1 0.5908144 1.640426 1.1 0.7133044 1.640426 1.1 0.9133043 1.640426 1.1 -0.9923097 1.640426 1.037668 -2.4789 1.82742 1.1 -2.8325 1.640426 1.1 0.9133043 1.640426 1.1 2.3675 1.240425 0.8960399 0.9133043 1.640426 0.6999996 2.3675 1.240425 -0.8960402 0.913304 1.640426 -0.7000004 2.3675 1.240425 -1.1 2.3675 1.240425 -1.1 0.913304 1.640426 1.1 0.9133043 1.440426 1.1 1.3875 1.420426 1.1 0.9133043 1.640426 1.1 1.589378 1.393848 1.1 2.3675 1.240425 1.1 1.185622 1.393848 1.1 0.9975003 1.315926 1.1 1.7775 1.315925 1.1 1.939044 1.191969 1.1 2.055326 1.040426 1.1 2.3675 1.040425 1.1 0.8359563 1.19197 1.1 0.7196742 1.040426 1.1 0.7133044 1.440426 1.1 0.6075003 1.040426 1.1 0.7133044 1.640426 1.1 0.5908144 1.640426 1.1 -0.9923097 1.640426 1.1 -1.0725 1.040426 1.1 -1.184674 1.040426 1.1 -1.300956 1.19197 1.1 -1.4625 1.315926 1.1 -1.650622 1.393848 1.1 -1.8525 1.420426 1.1 -2.054378 1.393848 1.1 -2.8325 1.640426 1.1 -2.2425 1.315926 1.1 -2.8325 1.040426 1.1 -2.404044 1.19197 1.1 -2.520326 1.040426 -1.1 0.6075 1.040426 -1.1 0.713304 1.440426 -1.1 0.7196739 1.040426 -1.1 0.913304 1.440426 -1.1 0.8359559 1.19197 -1.1 0.9975 1.315926 -1.1 0.913304 1.640426 -1.1 1.185622 1.393848 -1.1 1.3875 1.420426 -1.1 1.589378 1.393848 -1.1 2.3675 1.240425 -1.1 1.7775 1.315925 -1.1 1.939044 1.191969 -1.1 2.055326 1.040426 -1.1 2.3675 1.040425 -1.1 0.713304 1.640426 -1.1 0.590814 1.640426 -1.1 -0.9923101 1.640426 -1.1 -1.0725 1.040426 -1.1 -1.184674 1.040426 -1.1 -1.300956 1.19197 -1.1 -1.4625 1.315926 -1.1 -1.650622 1.393848 -1.1 -1.8525 1.420426 -1.1 -2.054378 1.393848 -1.1 -2.8325 1.640426 -1.1 -2.2425 1.315926 -1.1 -2.404044 1.19197 -1.1 -2.520326 1.040426 -1.1 -2.8325 1.040426 1.3 -1.0725 1.040426 1.3 0.6075003 1.040426 1.1 -1.0725 1.040426 1.1 0.6075003 1.040426 0.9666662 -1.0725 1.040426 0.9666659 0.6075003 1.040426 1.3 -1.0725 1.040426 1.3 0.6075003 1.040426 1.3 0.6075003 0.6404257 0.9666662 -1.0725 1.040426 1.1 -1.0725 1.040426 1.3 -1.0725 1.040426 1.3 0.6075003 1.040426 0.9666659 0.6075003 1.040426 1.1 0.6075003 1.040426 -1.1 -1.0725 1.040426 -1.1 0.6075 1.040426 -1.3 -1.0725 1.040426 -1.3 0.6074999 1.040426 -0.9666661 0.6075 1.040426 -0.9666658 -1.0725 1.040426 -1.3 -1.0725 1.040426 -1.3 0.6074999 1.040426 -1.3 0.6074999 1.040426 -0.9666661 0.6075 1.040426 -1.1 0.6075 1.040426 -0.9666658 -1.0725 1.040426 -1.1 -1.0725 1.040426 -1.3 -1.0725 1.040426 0.9666662 -1.0725 1.040426 0.9666659 0.6075003 1.040426 0.9666662 -1.0725 0.640426 0.9666659 0.6075002 0.6404257 -0.9666658 -1.0725 0.640426 -0.9666661 0.6074999 0.6404257 -0.9666658 -1.0725 1.040426 -0.9666661 0.6075 1.040426 0.8688344 -2.8325 1.640426 0.8688344 -2.4789 1.82742 -0.8688336 -2.8325 1.640426 -0.8688337 -2.4789 1.82742 -0.9705097 -2.097922 2.028894 0.9705103 -2.097922 2.028894 1.037668 -2.4789 1.82742 -1.037668 -2.4789 1.82742 -1.1 -2.8325 1.040426 -1.1 -2.8325 1.640426 -0.8688336 -2.8325 1.640426 0.8688344 -2.8325 1.640426 1.1 -2.8325 1.640426 1.1 -2.8325 1.040426 -1.1 2.3675 1.040425 -1.1 2.3675 1.240425 1.1 2.3675 1.040425 1.1 2.3675 1.240425 1.1 0.7133044 1.440426 1.3 0.7133044 1.440426 1.1 0.7133044 1.640426 1.3 0.7133044 1.640426 1.1 0.7133044 1.640426 1.3 0.7133044 1.440426 -1.3 0.7133039 1.440426 -1.1 0.713304 1.440426 -1.3 0.713304 1.640426 -1.1 0.713304 1.640426 -1.3 0.713304 1.640426 -1.1 0.713304 1.440426 1.1 -2.8325 1.640426 -1.1 -2.8325 1.640426 + + + + + + + + + + 0 -0.991388 0.1309581 0 -0.9914082 0.1308042 -0.83143 -0.5556295 0 -0.6593081 -0.751873 0 -0.8968917 -0.4422504 0 -1 -1.65569e-6 0 -1 1.43096e-6 0 -1 -1.98097e-6 0 -1 0 0 -1 1.96912e-6 0 -1 -3.02592e-6 0 -1 -8.20144e-7 -1.52829e-7 -1 0 0 -1 1.06618e-6 0 -1 -1.64029e-6 0 -1 0 0 -1 3.02597e-6 -1.23726e-7 -1 -1.97154e-6 -1.54115e-7 -1 0 -1.77504e-7 -1 -1.31676e-6 0 0.751873 -0.6593081 0 -0.751873 -0.6593081 0 0.06534206 -0.9978629 0 0.3214601 -0.9469232 0 2.16744e-7 -1 2.16744e-6 0 -1 0 0.997857 -0.0654332 0 -0.3214601 -0.9469232 0 -0.4423117 -0.8968614 0 0.6593081 -0.751873 0 0.5555732 -0.8314677 0 0.1950772 -0.9807879 0 0.1951066 -0.9807821 0 -0.1951066 -0.9807821 0 -0.1950772 -0.9807879 0 0.9469232 -0.3214601 0 0.946914 -0.3214874 0 -0.5555732 -0.8314677 0 -0.5555591 -0.8314771 0 -0.555538 -0.8314912 0 -0.997857 -0.0654332 0 0.8968917 -0.4422504 0 1 0 0 1 7.84272e-7 2.41039e-7 1 -8.20137e-7 0 1 1.64029e-6 1.52829e-7 1 1.64027e-6 0 1 1.1225e-6 0 1 4.53005e-6 1.20401e-7 1 -2.24263e-5 0 0.4423117 -0.8968614 0 -0.06534206 -0.9978629 0 0.83143 -0.5556295 0 0.8314442 -0.5556084 0 -0.9807996 -0.1950185 0 0.9807996 -0.1950185 0 -0.9469232 -0.3214601 0 0.9486647 -5.66029e-7 -0.3162837 0.9486853 -2.49558e-6 -0.3162218 0.9486774 0 -0.3162456 0.9486843 0 -0.3162249 0.9486845 9.64962e-7 -0.3162243 0.9486833 0 -0.3162277 0.9486847 2.43471e-6 -0.3162235 0.9486662 0 -0.3162791 0 0.6087679 0.7933484 0 0.3826816 0.9238803 0 -0.3826816 -0.9238803 0 -0.3826816 0.9238803 0 -0.6087679 0.7933484 0 -0.9238803 0.3826816 0 -0.7933484 -0.6087679 0 0.7933223 0.6088019 0 0.7933484 0.6087679 0 1 0 0 -0.6087679 -0.7933484 0 -0.1305003 0.9914484 0 0.1305003 0.9914484 0 0.1305303 0.9914444 0 0.6087679 -0.7933484 0 -0.1305003 -0.9914484 0 0.3826816 -0.9238803 0 0.9914484 -0.1305003 -0.9486842 0 -0.3162251 -0.9487012 -5.95656e-5 -0.3161742 -0.9486851 1.94777e-6 -0.3162227 -0.9486666 0 -0.3162781 0 0.9238803 0.3826816 0 0.9238803 -0.3826816 0 -0.9914444 0.1305303 0 -0.9914484 0.1305003 0 -0.9914484 -0.1305003 0 -0.7933484 0.6087679 3.05193e-5 -0.7933484 0.6087679 0 0.9914444 0.1305303 0 -0.7933337 0.6087871 0 0.7933337 0.6087871 0 -0.9914202 0.1307142 0 -0.9913801 0.1310182 0 0.7933484 -0.6087679 0 0.9914484 0.1305003 0 -0.7933223 0.6088019 0 -0.9238803 -0.3826816 -3.05194e-5 -0.7933223 0.6088019 -0.9469232 0.3214601 0 -0.946914 0.3214874 0 -0.8968917 0.4422504 0 -0.83143 0.5556295 0 -0.8314442 0.5556084 0 -0.6593081 0.751873 0 0.751873 0.6593081 0 0.0654332 0.997857 0 -0.751873 0.6593081 0 -0.9807996 0.1950185 0 -0.997857 0.0654332 0 -2.16744e-7 1 0 0 1 -1.08372e-6 0.997857 0.0654332 0 0.9469232 0.3214601 0 0.83143 0.5556295 0 0 0.948685 -0.3162227 0 0.9486847 -0.3162238 0 0 1 6.99962e-7 3.73312e-7 1 -3.64532e-7 2.4302e-7 1 5.52544e-6 2.88496e-7 1 0 3.05631e-7 1 -6.51738e-6 3.22899e-7 1 0 3.40376e-7 1 0 3.58298e-7 1 0 3.76781e-7 1 0 3.9611e-7 1 0 4.16477e-7 1 -1.89405e-5 4.38283e-7 1 0 4.6201e-7 1 0 4.889e-7 1 0 5.26742e-7 1 0 2.23518e-7 1 0 2.23518e-7 1 0 3.73311e-7 1 0 2.76779e-7 1 0 2.69055e-7 1 5.23388e-6 2.59309e-7 1 0 2.47466e-7 1 0 2.33327e-7 1 0 2.16656e-7 1 0 1.9702e-7 1 0 1.73958e-7 1 6.33826e-6 1.46667e-7 1 0 0 1 0 0 1 0 0 1 0 5.26706e-7 1 0.1950185 0.9807996 0 0.3214601 0.9469232 0 -0.3214601 0.9469232 0 -0.4422504 0.8968917 0 0 0.991388 0.1309581 0 0.9914082 0.1308042 -0.1950185 0.9807996 0 0.5556295 0.83143 0 0.5556084 0.8314442 0 -0.9486647 0 -0.316284 -0.9486851 -2.28254e-6 -0.3162227 -0.9486774 5.95678e-5 -0.3162456 -0.9486843 -8.8539e-7 -0.3162249 0.8968917 0.4422504 0 0 0.9914162 0.1307442 0 0.9913801 0.1310182 0.9807996 0.1950185 0 0.6593081 0.751873 0 -0.0654332 0.997857 0 0 -1 0 -0.5556084 0.8314442 0 -0.5556295 0.83143 0 0.4422504 0.8968917 0 0 0.1305003 -0.9914484 -1 -2.48353e-7 0 -1 -1.56493e-7 0 -1 -1.55231e-7 0 -1 -3.19076e-7 0 -1 0 -2.21587e-7 -1 -3.77053e-7 0 -1 0 1.35621e-7 -1 0 -1.54068e-7 -1 0 0 -1 0 1.21788e-7 -1 -1.58157e-6 -1.27133e-7 -1 -3.25036e-6 0 1 2.09703e-7 0 1 3.10461e-7 0 1 3.19076e-7 0 1 3.40133e-7 2.21587e-7 1 -3.77053e-7 0 1 0 -1.35621e-7 1 0 1.54068e-7 1 0 0 1 0 -1.21788e-7 1 1.58157e-6 1.27133e-7 1 -3.25037e-6 0 0 4.47034e-7 1 0 4.47032e-7 1 2.28862e-6 2.03431e-7 1 0 2.79618e-7 1 0 2.88479e-7 1 0 3.05647e-7 1 6.51733e-6 3.22894e-7 1 -7.25337e-6 3.40386e-7 1 0 3.58293e-7 1 -9.57767e-6 3.76781e-7 1 1.14828e-5 3.96113e-7 1 -1.43256e-5 -1.75604e-7 1 0 2.19141e-7 1 0 2.31006e-7 1 0 2.44462e-7 1 0 2.63337e-7 1 0 2.6337e-7 1 0 2.36118e-7 1 0 0 1 0 0 1 0 0 1 5.98358e-6 1.52227e-6 1 -5.71141e-6 1.9702e-7 1 5.50734e-6 2.16659e-7 1 0 2.33334e-7 1 0 2.47462e-7 1 0 2.59306e-7 1 0 2.69048e-7 1 0 2.76785e-7 1 -3.05151e-6 2.03431e-7 1 0 -0.9486844 0.3162247 0 -0.9486835 0.3162275 0 0 -1 1.98682e-7 -1 0 -1.2736e-7 -1.65568e-7 -1 2.48353e-7 -1.65569e-7 -1 2.99869e-7 -1.60699e-7 -1 -0.9995504 0 0.02998632 0 -1.65568e-7 -1 1.52832e-7 -1.73847e-7 -1 0 -1.59655e-7 -1 0 -1.65568e-7 -1 0 -1.65569e-7 -1 0 -1.5637e-7 -1 -1.1141e-6 -3.48158e-7 -1 0 -1.49012e-7 -1 0 -2.05533e-7 -1 3.74588e-6 -1.95581e-7 -1 -3.45204e-6 -1.77144e-7 -1 0 -1.60328e-7 -1 0 -1.44602e-7 -1 1.48801e-6 -9.47872e-7 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 -2.35282e-7 -1 1.58103e-7 -2.05533e-7 -1 -4.02758e-6 -2.10287e-7 -1 0 -2.19253e-7 -1 0 -2.27994e-7 -1 0 -2.36574e-7 -1 -2.81693e-6 0 -1 0 -1.90202e-7 -1 0 -1.96666e-7 -1 0 -2.03239e-7 -1 0 -2.10043e-7 -1 0 -2.17169e-7 -1 1.46951e-5 -2.2493e-7 -1 0 -2.35264e-7 -1 0.9995504 -2.38311e-7 0.02998644 -2.76802e-7 -1.60699e-7 -1 0 -1.59655e-7 -1 -1.2736e-7 -1.65569e-7 -1 2.48352e-7 -1.65568e-7 -1 0 -1.65568e-7 -1 0 -1.65569e-7 -1 -1 -1.55231e-7 0 -1 -3.19076e-7 0 -1 0 1.26799e-7 -1 -3.77053e-7 -1.75661e-7 -1 0 1.35621e-7 -1 0 -1.54068e-7 -1 0 1.50805e-7 -1 -3.25037e-6 0 1 7.28887e-6 0 1 1.39802e-7 0 1 3.10461e-7 0 1 0 0 1 3.40133e-7 -1.26799e-7 1 0 1.7566e-7 1 0 -1.35621e-7 1 0 1.54068e-7 1 0 -1.50805e-7 1 0 0 1.83399e-7 -1 1.83399e-6 -9.16219e-5 -1.56864e-7 -1 0 -1.46771e-7 -1 0 0 -1 0 0 -1 -2.95417e-6 0 -1 0 0 -1 2.88967e-6 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 -3.74616e-6 0 -1 0 0 -1 0 0 -1 4.02748e-6 0 -1 0 0 -1 0 0 -1 0 0 -1 0 -1.22546e-7 -1 0 -1.26803e-7 -1 -7.60138e-6 -1.3111e-7 -1 0 -1.35493e-7 -1 1.21027e-5 -1.40028e-7 -1 0 -1.44779e-7 -1 0 -1.49954e-7 -1 9.1623e-5 -1.56844e-7 -1 -1.70299e-7 1 0 0 0.6 0.8000001 -2.02451e-7 0.5999997 0.8000003 1 2.13236e-6 0 1 1.64029e-6 1.52829e-7 1 -1.06618e-6 0 1 0 0 1 3.02597e-6 1.23726e-7 1 -1.97154e-6 1.54115e-7 1 7.84272e-7 1.77504e-7 1 2.98954e-4 0 1 -1.98097e-6 0 1 7.89465e-6 0 3.57627e-7 -1 0 3.57627e-7 -1 0 -1.78813e-7 1 0 -1.78814e-7 1 0 -1 -1.31676e-6 -4.04695e-7 -1 -8.20145e-7 -1.52828e-7 -1 -2.13235e-6 0 -1 -1.06618e-6 0 -1 1.64027e-6 0 -1 -3.02597e-6 0 -1 1.1225e-6 0 -1 -9.06009e-6 -1.20399e-7 -1.78814e-7 1 0 0 -1 8.94068e-7 0.9486661 3.15042e-6 -0.3162794 0.9486841 -7.00324e-6 -0.3162255 0.948683 3.7232e-5 -0.3162289 0.948683 0 -0.316229 0.9486829 1.68291e-7 -0.316229 0.9486824 -3.7232e-5 -0.3162304 0.9486846 6.91678e-6 -0.3162238 0.9486648 0 -0.3162835 -0.9486657 -1.57521e-6 -0.3162804 -0.9486849 -5.79281e-6 -0.3162231 -0.9486824 3.45725e-5 -0.3162307 -0.9486829 -1.68291e-7 -0.3162292 -0.9486829 -1.68291e-7 -0.3162294 -0.948683 -3.72322e-5 -0.3162286 -0.9486846 6.91678e-6 -0.3162239 -0.9486648 -1.57523e-6 -0.3162835 0.9486839 0 0.316226 -0.9486842 0 0.3162251 2.45663e-7 -1 0 1.32455e-7 -1 1.25234e-6 -2.98023e-7 1 0 0 1.31634e-7 1 0 1.31634e-7 1 0 0.5999999 0.8000001 -1.46118e-6 0.6000003 0.7999999 -3.31137e-7 0.6000005 0.7999998 0 -0.8944273 -0.4472137 0 0.6000005 0.7999997 -1.46119e-6 0.6000001 0.8000001 9.74123e-7 0.6000001 0.8 0 0.6 0.8 -0.9486823 -2.46492e-7 0.316231 -0.9486833 -5.33811e-7 0.3162279 -0.9486836 -1.01686e-6 0.316227 -0.9486837 -1.56265e-6 0.3162267 -0.9486827 0 0.31623 -0.9486828 -1.43819e-7 0.3162295 -0.9486825 3.6328e-6 0.3162301 -0.9486832 0 0.3162283 -0.9486833 0 0.3162282 -2.98024e-7 1 0 0.9486823 1.64542e-7 0.3162307 0.9486826 2.87638e-7 0.3162301 0.9486826 2.77803e-6 0.3162299 0.9486831 0 0.3162284 0.9486835 0 0.3162273 0.9486838 -1.17199e-6 0.3162263 0.9486836 -7.26327e-7 0.316227 0.9486832 -1.52518e-7 0.3162282 0.9486821 1.64328e-7 0.3162313 0 0.2652159 0.9641891 0 0.2652159 0.9641891 -2.2583e-7 0.2652159 0.9641891 0 0.265216 0.9641891 1.55012e-6 0.2652158 0.9641891 1 -3.14241e-7 0 1 0 -7.56545e-7 1 0 -1.38015e-7 1 2.23865e-7 1.9508e-6 1 2.48502e-7 0 1 9.38037e-7 7.05862e-7 1 7.33598e-7 3.16022e-7 1 0 -5.27376e-7 1 -1.95113e-6 0 1 1.255e-7 0 1 0 0 1 0 -1.42032e-7 1 6.02549e-7 1.40131e-7 1 0 1.73955e-7 1 6.10179e-7 2.29576e-7 1 4.42992e-7 3.57721e-7 1 2.76573e-6 -3.64143e-6 1 1.3136e-7 1.2983e-7 1 0 -2.0955e-7 1 3.36749e-7 0 1 0 -6.72671e-7 1 0 -2.93014e-7 -1 -1.95113e-6 0 -1 1.76982e-6 0 -1 0 -5.6936e-7 -1 0 7.56544e-7 -1 -6.76224e-7 1.38014e-7 -1 0 -7.05863e-7 -1 -4.89064e-7 -3.16021e-7 -1 0 5.27376e-7 -1 -1.255e-7 0 -1 0 0 -1 0 1.42032e-7 -1 -6.0255e-7 -1.40131e-7 -1 0 -1.73956e-7 -1 -6.10179e-7 -2.29576e-7 -1 0 -3.57722e-7 -1 0 3.64143e-6 -1 -1.3136e-7 -1.2983e-7 -1 0 2.0955e-7 -1 0 1.5338e-7 -1 0 0 -1 -1.27289e-6 0 0 1.41916e-7 1 7.09579e-7 1.41916e-7 1 0 1.41916e-7 1 0 1.41916e-7 1 1 1.77395e-7 0 1 7.09579e-7 0 1 0 0 0.09950375 0.9950373 0 3.57627e-7 -1 0 0 -1 -1.11758e-6 -1.78814e-7 1 -2.23517e-7 -1.78814e-7 1 -2.23517e-7 2.12873e-7 -1.59655e-7 -1 0 -1.59655e-7 -1 7.09579e-7 1.41916e-7 1 0 1.41916e-7 1 2.12873e-7 -1.59655e-7 -1 0 -1.59655e-7 -1 -1 0 0 -1 -1.77395e-7 0 -1 -1.77395e-7 0 -1.78814e-7 1 -2.23517e-7 8.94066e-7 -1 -2.23516e-6 -1 -1.77395e-7 0 1 0 0 1 1.77395e-7 0 0 -0.4674859 0.8840006 0 -0.4674842 0.8840015 1.59183e-7 -0.4674893 0.8839988 0 -0.4674881 0.8839995 1.63833e-6 -0.4674879 0.8839995 0 -0.4674884 0.8839992 1.98682e-7 -1 9.93411e-7 1.37206e-7 -1 1.71508e-7 1.03137e-6 -1 -2.57843e-6 1.58946e-7 -1 0 2.98023e-7 -1 7.45058e-7 2.98023e-7 -1 7.45058e-7 0.9486837 1.33025e-7 0.3162267 0.9486839 3.48243e-7 0.3162262 -0.9486837 0 0.3162265 -0.9486836 -2.66051e-7 0.3162268 0 0.6000002 0.8 -1.2801e-7 0.6000002 0.7999999 0 -0.4674846 0.8840013 0 -0.4674857 0.8840007 0 -0.4674851 0.884001 0 -0.4674854 0.8840009 + + + + + + + + + + 25.59055 0.936891 20.34121 0.936891 25.59055 0.974195 20.35354 0.974195 25.59055 0.974195 20.34121 0.936891 -35.69321 3.937008 -35.69321 7.874016 -35.17822 3.937008 -35.17822 7.874016 -35.17822 3.937008 -35.69321 7.874016 -21.10233 3.937008 -21.61732 3.937008 -21.10233 7.874016 -21.61732 7.874016 -21.10233 7.874016 -21.61732 3.937008 -41.8798 3.937008 -41.8798 7.874016 -41.36482 3.937008 -41.36482 7.874016 -41.36482 3.937008 -41.8798 7.874016 10.62992 0 10.62992 3.937008 14.17323 0 11.15311 7.911001 14.17323 0 10.62992 3.937008 12.68701 11.61417 14.17323 0 11.15311 7.911001 14.17323 3.937008 14.17323 0 12.68701 11.61417 15.1271 14.79416 14.17323 3.937008 12.68701 11.61417 14.57568 6.993926 14.17323 3.937008 15.1271 14.79416 15.75561 9.84252 14.57568 6.993926 15.1271 14.79416 18.30709 17.23425 15.75561 9.84252 15.1271 14.79416 17.6326 12.28866 15.75561 9.84252 18.30709 17.23425 20.07874 14.16565 17.6326 12.28866 18.30709 17.23425 22.01026 18.76815 20.07874 14.16565 18.30709 17.23425 22.92733 15.34558 20.07874 14.16565 22.01026 18.76815 25.98425 19.29134 22.92733 15.34558 22.01026 18.76815 25.98425 15.74803 22.92733 15.34558 25.98425 19.29134 29.04117 15.34558 25.98425 15.74803 25.98425 19.29134 29.95825 18.76815 29.04117 15.34558 25.98425 19.29134 31.88977 14.16565 29.04117 15.34558 29.95825 18.76815 33.66142 17.23425 31.88977 14.16565 29.95825 18.76815 34.33591 12.28866 31.88977 14.16565 33.66142 17.23425 36.8414 14.79416 34.33591 12.28866 33.66142 17.23425 36.21289 9.84252 34.33591 12.28866 36.8414 14.79416 37.39282 6.993926 36.21289 9.84252 36.8414 14.79416 39.28149 11.61417 37.39282 6.993926 36.8414 14.79416 37.79528 3.937008 37.39282 6.993926 39.28149 11.61417 37.79528 0 37.79528 3.937008 39.28149 11.61417 40.82027 7.874016 37.79528 0 39.28149 11.61417 45.27559 0 37.79528 0 40.82027 7.874016 40.81539 7.911001 40.82027 7.874016 39.28149 11.61417 45.27559 7.874016 45.27559 0 40.82027 7.874016 28.90031 3.937008 28.38533 3.937008 28.90031 7.874016 28.38533 7.874016 28.90031 7.874016 28.38533 3.937008 -28.90031 3.937008 -28.90031 7.874016 -28.38533 3.937008 -28.38533 7.874016 -28.38533 3.937008 -28.90031 7.874016 -17.61604 3.937008 -18.13103 3.937008 -17.61604 7.874016 -18.13103 7.874016 -17.61604 7.874016 -18.13103 3.937008 -1.897009 3.937008 -2.411994 3.937008 -1.897009 7.874016 -2.411994 7.874016 -1.897009 7.874016 -2.411994 3.937008 21.65354 3.937008 -21.65354 3.937008 21.65354 7.874016 -21.65354 7.874016 21.65354 7.874016 -21.65354 3.937008 55.80567 3.937008 55.29068 3.937008 55.80567 7.874016 55.29068 7.874016 55.80567 7.874016 55.29068 3.937008 2.411994 3.937008 1.897009 3.937008 2.411994 7.874016 1.897009 7.874016 2.411994 7.874016 1.897009 3.937008 -5.570798 3.937008 -6.085783 3.937008 -5.570798 7.874016 -6.085783 7.874016 -5.570798 7.874016 -6.085783 3.937008 21.61732 3.937008 21.10233 3.937008 21.61732 7.874016 21.10233 7.874016 21.61732 7.874016 21.10233 3.937008 13.96885 3.937008 13.45387 3.937008 13.96885 7.874016 13.45387 7.874016 13.96885 7.874016 13.45387 3.937008 -9.842939 3.937008 -10.35792 3.937008 -9.842939 7.874016 -10.35792 7.874016 -9.842939 7.874016 -10.35792 3.937008 10.35792 3.937008 9.842939 3.937008 10.35792 7.874016 9.842939 7.874016 10.35792 7.874016 9.842939 3.937008 47.35422 3.937008 46.83924 3.937008 47.35422 7.874016 46.83924 7.874016 47.35422 7.874016 46.83924 3.937008 -13.45387 3.937008 -13.96885 3.937008 -13.45387 7.874016 -13.96885 7.874016 -13.45387 7.874016 -13.96885 3.937008 -55.80567 3.937008 -55.80567 7.874016 -55.29068 3.937008 -55.29068 7.874016 -55.29068 3.937008 -55.80567 7.874016 41.8798 3.937008 41.36482 3.937008 41.8798 7.874016 41.36482 7.874016 41.8798 7.874016 41.36482 3.937008 57.08661 7.874016 57.08661 3.937008 52.63129 7.874016 49.6063 3.937008 52.63129 7.874016 57.08661 3.937008 52.62642 7.911001 52.63129 7.874016 49.6063 3.937008 51.09252 11.61417 52.62642 7.911001 49.6063 3.937008 48.65243 14.79416 51.09252 11.61417 49.6063 3.937008 49.20384 6.993926 48.65243 14.79416 49.6063 3.937008 48.02392 9.84252 48.65243 14.79416 49.20384 6.993926 45.47244 17.23425 48.65243 14.79416 48.02392 9.84252 46.14693 12.28866 45.47244 17.23425 48.02392 9.84252 43.70079 14.16565 45.47244 17.23425 46.14693 12.28866 41.76927 18.76815 45.47244 17.23425 43.70079 14.16565 40.85219 15.34558 41.76927 18.76815 43.70079 14.16565 37.79528 19.29134 41.76927 18.76815 40.85219 15.34558 37.79528 15.74803 37.79528 19.29134 40.85219 15.34558 33.82128 18.76815 37.79528 19.29134 37.79528 15.74803 34.73836 15.34558 33.82128 18.76815 37.79528 15.74803 31.88977 14.16565 33.82128 18.76815 34.73836 15.34558 30.11811 17.23425 33.82128 18.76815 31.88977 14.16565 29.44362 12.28866 30.11811 17.23425 31.88977 14.16565 26.93812 14.79416 30.11811 17.23425 29.44362 12.28866 27.56663 9.84252 26.93812 14.79416 29.44362 12.28866 26.3867 6.993926 26.93812 14.79416 27.56663 9.84252 24.49804 11.61417 26.93812 14.79416 26.3867 6.993926 25.98425 3.937008 24.49804 11.61417 26.3867 6.993926 25.98425 0 24.49804 11.61417 25.98425 3.937008 22.44095 0 24.49804 11.61417 25.98425 0 22.96413 7.911001 24.49804 11.61417 22.44095 0 22.44095 3.937008 22.96413 7.911001 22.44095 0 6.085783 3.937008 5.570798 3.937008 6.085783 7.874016 5.570798 7.874016 6.085783 7.874016 5.570798 3.937008 18.13103 3.937008 17.61604 3.937008 18.13103 7.874016 17.61604 7.874016 18.13103 7.874016 17.61604 3.937008 35.69321 3.937008 35.17822 3.937008 35.69321 7.874016 35.17822 7.874016 35.69321 7.874016 35.17822 3.937008 -52.02281 3.937008 -52.02281 7.874016 -51.50782 3.937008 -51.50782 7.874016 -51.50782 3.937008 -52.02281 7.874016 52.02281 3.937008 51.50782 3.937008 52.02281 7.874016 51.50782 7.874016 52.02281 7.874016 51.50782 3.937008 -47.35422 3.937008 -47.35422 7.874016 -46.83924 3.937008 -46.83924 7.874016 -46.83924 3.937008 -47.35422 7.874016 -39.13044 18.05237 -39.28149 17.84487 -45.27559 18.05237 -40.81539 13.94139 -45.27559 18.05237 -39.28149 17.84487 -40.82027 13.9024 -45.27559 18.05237 -40.81539 13.94139 -43.96325 13.9024 -45.27559 18.05237 -40.82027 13.9024 58.39895 13.9024 52.63129 13.9024 57.08661 18.05237 52.62642 13.94139 57.08661 18.05237 52.63129 13.9024 51.09252 17.84487 57.08661 18.05237 52.62642 13.94139 50.94147 18.05237 57.08661 18.05237 51.09252 17.84487 -21.65354 -16.21385 -21.65354 -20.22214 -25.59055 -16.21385 -25.59055 -20.22214 -25.59055 -16.21385 -21.65354 -20.22214 -21.65354 38.42905 -21.65354 34.42077 -25.59055 38.42905 -25.59055 34.42077 -25.59055 38.42905 -21.65354 34.42077 -25.59055 -24.04134 -25.59055 -20.95804 -12.79528 -24.04134 -12.79528 -20.95804 -12.79528 -24.04134 -25.59055 -20.95804 -25.59055 23.50881 -25.59055 27.51709 -21.65354 23.50881 -21.65354 27.51709 -21.65354 23.50881 -25.59055 27.51709 25.59055 38.42905 25.59055 34.42077 21.65354 38.42905 21.65354 34.42077 21.65354 38.42905 25.59055 34.42077 -25.59055 -29.59245 -25.59055 -25.58417 -21.65354 -29.59245 -21.65354 -25.58417 -21.65354 -29.59245 -25.59055 -25.58417 -25.59055 11.57692 -25.59055 15.58521 -20.35354 11.57692 -21.58793 15.58521 -20.35354 11.57692 -25.59055 15.58521 -25.59055 -14.23642 -25.59055 -11.15312 -12.79528 -14.23642 -12.79528 -11.15312 -12.79528 -14.23642 -25.59055 -11.15312 21.58793 24.1276 21.65354 24.37573 25.59055 24.1276 25.59055 28.13589 25.59055 24.1276 21.65354 24.37573 21.65354 28.13589 25.59055 28.13589 21.65354 24.37573 25.59055 0 12.79528 0 25.59055 3.937008 12.79528 3.937008 25.59055 3.937008 12.79528 0 -21.65354 34.38585 -21.65354 30.37756 -25.59055 34.38585 -25.59055 30.37756 -25.59055 34.38585 -21.65354 30.37756 -25.59055 21.00725 -25.59055 25.01553 -21.65354 21.00725 -21.65354 25.01553 -21.65354 21.00725 -25.59055 25.01553 -25.59055 -19.75964 -25.59055 -16.67635 -12.79528 -19.75964 -12.79528 -16.67635 -12.79528 -19.75964 -25.59055 -16.67635 25.59055 34.38585 25.59055 30.37756 21.65354 34.38585 21.65354 30.37756 21.65354 34.38585 25.59055 30.37756 -25.59055 24.27169 -25.59055 28.27998 -21.65354 24.27169 -21.65354 28.27998 -21.65354 24.27169 -25.59055 28.27998 25.59055 -23.24393 25.59055 -27.25221 21.65354 -23.24393 21.65354 -27.25221 21.65354 -23.24393 25.59055 -27.25221 25.59055 -16.21385 25.59055 -20.22214 21.65354 -16.21385 21.65354 -20.22214 21.65354 -16.21385 25.59055 -20.22214 -21.65354 39.98995 -21.65354 35.98167 -25.59055 39.98995 -25.59055 35.98167 -25.59055 39.98995 -21.65354 35.98167 25.59055 24.55304 25.59055 21.46974 12.79528 24.55304 12.79528 21.46974 12.79528 24.55304 25.59055 21.46974 25.59055 39.98995 25.59055 35.98167 21.65354 39.98995 21.65354 35.98167 21.65354 39.98995 25.59055 35.98167 -25.59055 -26.78972 -25.59055 -23.70643 -12.79528 -26.78972 -12.79528 -23.70643 -12.79528 -26.78972 -25.59055 -23.70643 25.59055 27.05459 25.59055 23.9713 12.79528 27.05459 12.79528 23.9713 12.79528 27.05459 25.59055 23.9713 25.59055 11.57692 20.35354 11.57692 25.59055 15.58521 21.58793 15.58521 25.59055 15.58521 20.35354 11.57692 -25.59055 -35.41579 -25.59055 -31.40751 -21.65354 -35.41579 -21.65354 -31.40751 -21.65354 -35.41579 -25.59055 -31.40751 25.59055 5.753304 12.79528 5.753304 25.59055 8.8366 12.79528 8.8366 25.59055 8.8366 12.79528 5.753304 -58.39895 13.9024 -57.08661 18.05237 -52.63129 13.9024 -52.62642 13.94139 -52.63129 13.9024 -57.08661 18.05237 -51.09252 17.84487 -52.62642 13.94139 -57.08661 18.05237 -50.94147 18.05237 -51.09252 17.84487 -57.08661 18.05237 -20.35354 16.0968 -25.59055 16.0968 -21.58793 20.10509 -25.59055 20.10509 -21.58793 20.10509 -25.59055 16.0968 25.59055 -8.310564 20.35354 -8.310564 25.59055 -4.302279 21.58793 -4.302279 25.59055 -4.302279 20.35354 -8.310564 -25.59055 -8.310564 -25.59055 -4.302279 -20.35354 -8.310564 -21.58793 -4.302279 -20.35354 -8.310564 -25.59055 -4.302279 21.65354 21.00725 21.65354 25.01553 25.59055 21.00725 25.59055 25.01553 25.59055 21.00725 21.65354 25.01553 21.65354 -38.96219 21.65354 -34.95391 25.59055 -38.96219 25.59055 -34.95391 25.59055 -38.96219 21.65354 -34.95391 25.59055 12.03942 12.79528 12.03942 25.59055 15.12271 12.79528 15.12271 25.59055 15.12271 12.79528 12.03942 25.59055 -12.83045 20.35354 -12.83045 25.59055 -8.822163 21.58793 -8.822163 25.59055 -8.822163 20.35354 -12.83045 25.59055 5.290809 19.02887 5.290809 25.59055 9.299095 20.35354 9.299095 25.59055 9.299095 19.02887 5.290809 -25.59055 -1.029947 -25.59055 2.053349 -12.79528 -1.029947 -12.79528 2.053349 -12.79528 -1.029947 -25.59055 2.053349 20.35354 16.0968 21.58793 20.10509 25.59055 16.0968 25.59055 20.10509 25.59055 16.0968 21.58793 20.10509 25.59055 -21.88901 21.58793 -21.88901 25.59055 -17.88073 21.65354 -21.64089 25.59055 -17.88073 21.58793 -21.88901 21.65354 -17.88073 25.59055 -17.88073 21.65354 -21.64089 19.02887 6.832458 20.35354 10.84074 25.59055 6.832458 25.59055 10.84074 25.59055 6.832458 20.35354 10.84074 21.65354 24.27169 21.65354 28.27998 25.59055 24.27169 25.59055 28.27998 25.59055 24.27169 21.65354 28.27998 21.58793 -14.69891 21.65354 -14.45079 25.59055 -14.69891 25.59055 -10.69063 25.59055 -14.69891 21.65354 -14.45079 21.65354 -10.69063 25.59055 -10.69063 21.65354 -14.45079 -21.58793 16.93751 -25.59055 16.93751 -21.65354 17.18563 -25.59055 20.94579 -21.65354 17.18563 -25.59055 16.93751 -21.65354 20.94579 -21.65354 17.18563 -25.59055 20.94579 -19.02887 5.290809 -25.59055 5.290809 -20.35354 9.299095 -25.59055 9.299095 -20.35354 9.299095 -25.59055 5.290809 -21.65354 -20.49555 -21.65354 -24.50383 -25.59055 -20.49555 -25.59055 -24.50383 -25.59055 -20.49555 -21.65354 -24.50383 -21.58793 24.1276 -25.59055 24.1276 -21.65354 24.37573 -25.59055 28.13589 -21.65354 24.37573 -25.59055 24.1276 -21.65354 28.13589 -21.65354 24.37573 -25.59055 28.13589 -21.58793 -14.69891 -25.59055 -14.69891 -21.65354 -14.45079 -25.59055 -10.69063 -21.65354 -14.45079 -25.59055 -14.69891 -21.65354 -10.69063 -21.65354 -14.45079 -25.59055 -10.69063 -25.59055 -38.96219 -25.59055 -34.95391 -21.65354 -38.96219 -21.65354 -34.95391 -21.65354 -38.96219 -25.59055 -34.95391 -21.65354 -23.24393 -21.65354 -27.25221 -25.59055 -23.24393 -25.59055 -27.25221 -25.59055 -23.24393 -21.65354 -27.25221 -20.34121 0.936891 -25.59055 0.936891 -20.35354 0.974195 -25.59055 0.974195 -20.35354 0.974195 -25.59055 0.936891 25.59055 17.4 12.79528 17.4 25.59055 20.4833 12.79528 20.4833 25.59055 20.4833 12.79528 17.4 21.65354 -35.41579 21.65354 -31.40751 25.59055 -35.41579 25.59055 -31.40751 25.59055 -35.41579 21.65354 -31.40751 -25.59055 -12.83045 -25.59055 -8.822163 -20.35354 -12.83045 -21.58793 -8.822163 -20.35354 -12.83045 -25.59055 -8.822163 -19.02887 6.832458 -25.59055 6.832458 -20.35354 10.84074 -25.59055 10.84074 -20.35354 10.84074 -25.59055 6.832458 21.58793 16.93751 21.65354 17.18563 25.59055 16.93751 25.59055 20.94579 25.59055 16.93751 21.65354 17.18563 21.65354 20.94579 25.59055 20.94579 21.65354 17.18563 21.65354 23.50881 21.65354 27.51709 25.59055 23.50881 25.59055 27.51709 25.59055 23.50881 21.65354 27.51709 -25.59055 -7.84807 -25.59055 -4.764774 -12.79528 -7.84807 -12.79528 -4.764774 -12.79528 -7.84807 -25.59055 -4.764774 -25.59055 -21.88901 -25.59055 -17.88073 -21.58793 -21.88901 -21.65354 -21.64089 -21.58793 -21.88901 -25.59055 -17.88073 -21.65354 -17.88073 -21.65354 -21.64089 -25.59055 -17.88073 35.65502 0 35.65502 7.874016 36.17001 0 36.17001 7.874016 36.17001 0 35.65502 7.874016 30.77183 0 30.77183 7.874016 31.28682 0 31.28682 7.874016 31.28682 0 30.77183 7.874016 25.35772 0 25.35772 7.874016 25.8727 0 25.8727 7.874016 25.8727 0 25.35772 7.874016 13.82977 0 13.31478 0 13.82977 7.874016 13.31478 7.874016 13.82977 7.874016 13.31478 0 -19.50532 7.874016 -19.50532 0 -20.02031 7.874016 -20.02031 0 -20.02031 7.874016 -19.50532 0 18.90351 0 18.38852 0 18.90351 7.874016 18.38852 7.874016 18.90351 7.874016 18.38852 0 19.50532 0 19.50532 7.874016 20.02031 0 20.02031 7.874016 20.02031 0 19.50532 7.874016 39.92374 0 39.92374 7.874016 40.43873 0 40.43873 7.874016 40.43873 0 39.92374 7.874016 43.50495 0 43.50495 7.874016 44.01993 0 44.01993 7.874016 44.01993 0 43.50495 7.874016 21.65354 0 -21.65354 0 21.65354 7.874016 -21.65354 7.874016 21.65354 7.874016 -21.65354 0 -43.50495 7.874016 -43.50495 0 -44.01993 7.874016 -44.01993 0 -44.01993 7.874016 -43.50495 0 -35.65502 7.874016 -35.65502 0 -36.17001 7.874016 -36.17001 0 -36.17001 7.874016 -35.65502 0 -25.35772 7.874016 -25.35772 0 -25.8727 7.874016 -25.8727 0 -25.8727 7.874016 -25.35772 0 25.59055 -20.49555 25.59055 -24.50383 21.65354 -20.49555 21.65354 -24.50383 21.65354 -20.49555 25.59055 -24.50383 20.34121 21.37235 -20.34121 21.37235 21.65354 25.52232 -21.65354 25.52232 21.65354 25.52232 -20.34121 21.37235 13.77953 25.52232 21.65354 25.52232 -21.65354 25.52232 -13.77953 25.52232 13.77953 25.52232 -21.65354 25.52232 20.34121 40.82027 20.34121 43.96325 25.59055 40.82027 21.65354 49.2126 25.59055 40.82027 20.34121 43.96325 22.16742 49.17892 25.59055 40.82027 21.65354 49.2126 22.67252 49.07845 25.59055 40.82027 22.16742 49.17892 23.16017 48.91291 25.59055 40.82027 22.67252 49.07845 23.62205 48.68514 25.59055 40.82027 23.16017 48.91291 24.05024 48.39903 25.59055 40.82027 23.62205 48.68514 24.43743 48.05947 25.59055 40.82027 24.05024 48.39903 24.77698 47.67229 25.59055 40.82027 24.43743 48.05947 25.06309 47.24409 25.59055 40.82027 24.77698 47.67229 25.29086 46.78222 25.59055 40.82027 25.06309 47.24409 25.4564 46.29456 25.59055 40.82027 25.29086 46.78222 25.55687 45.78947 25.59055 40.82027 25.4564 46.29456 25.59055 45.27559 25.59055 40.82027 25.55687 45.78947 20.34121 43.96325 -20.34121 43.96325 21.65354 49.2126 21.65354 49.2126 -20.34121 43.96325 -21.65354 49.2126 -20.34121 43.96325 -20.34121 40.82027 -21.65354 49.2126 -21.65354 49.2126 -20.34121 40.82027 -22.16742 49.17892 -22.16742 49.17892 -20.34121 40.82027 -22.67252 49.07845 -22.67252 49.07845 -20.34121 40.82027 -23.16017 48.91291 -23.16017 48.91291 -20.34121 40.82027 -23.62205 48.68514 -23.62205 48.68514 -20.34121 40.82027 -24.05024 48.39903 -24.05024 48.39903 -20.34121 40.82027 -24.43743 48.05947 -24.43743 48.05947 -20.34121 40.82027 -24.77698 47.67229 -24.77698 47.67229 -20.34121 40.82027 -25.06309 47.24409 -25.06309 47.24409 -20.34121 40.82027 -25.29086 46.78222 -25.29086 46.78222 -20.34121 40.82027 -25.4564 46.29456 -25.4564 46.29456 -20.34121 40.82027 -25.55687 45.78947 -25.55687 45.78947 -20.34121 40.82027 -25.59055 45.27559 -25.59055 40.82027 -25.59055 45.27559 -20.34121 40.82027 12.66214 0 12.14715 0 12.66214 7.874016 12.14715 7.874016 12.66214 7.874016 12.14715 0 6.208524 0 5.693538 0 6.208524 7.874016 5.693538 7.874016 6.208524 7.874016 5.693538 0 -5.693538 0 -6.208524 0 -5.693538 7.874016 -6.208524 7.874016 -5.693538 7.874016 -6.208524 0 0.861902 0 0.346916 0 0.861902 7.874016 0.346916 7.874016 0.861902 7.874016 0.346916 0 -20.34121 2.478539 -25.59055 2.478539 -20.35354 2.515843 -25.59055 2.515843 -20.35354 2.515843 -25.59055 2.478539 -12.14715 0 -12.66214 0 -12.14715 7.874016 -12.66214 7.874016 -12.14715 7.874016 -12.66214 0 21.65354 -29.59245 21.65354 -25.58417 25.59055 -29.59245 25.59055 -25.58417 25.59055 -29.59245 21.65354 -25.58417 -6.892015 0 -7.407 0 -6.892015 7.874016 -7.407 7.874016 -6.892015 7.874016 -7.407 0 39.13044 18.05237 45.27559 18.05237 39.28149 17.84487 40.81539 13.94139 39.28149 17.84487 45.27559 18.05237 40.82027 13.9024 40.81539 13.94139 45.27559 18.05237 43.96325 13.9024 40.82027 13.9024 45.27559 18.05237 -30.77183 7.874016 -30.77183 0 -31.28682 7.874016 -31.28682 0 -31.28682 7.874016 -30.77183 0 25.59055 2.478539 20.34121 2.478539 25.59055 2.515843 20.35354 2.515843 25.59055 2.515843 20.34121 2.478539 -39.92374 7.874016 -39.92374 0 -40.43873 7.874016 -40.43873 0 -40.43873 7.874016 -39.92374 0 -13.31478 0 -13.82977 0 -13.31478 7.874016 -13.82977 7.874016 -13.31478 7.874016 -13.82977 0 -18.38852 0 -18.90351 0 -18.38852 7.874016 -18.90351 7.874016 -18.38852 7.874016 -18.90351 0 25.59055 0 12.79528 0 25.59055 3.937008 12.79528 3.937008 25.59055 3.937008 12.79528 0 7.407 0 6.892015 0 7.407 7.874016 6.892015 7.874016 7.407 7.874016 6.892015 0 -0.346916 0 -0.861902 0 -0.346916 7.874016 -0.861902 7.874016 -0.346916 7.874016 -0.861902 0 25.59055 27.81748 25.59055 24.73419 12.79528 27.81748 12.79528 24.73419 12.79528 27.81748 25.59055 24.73419 25.59055 -1.029947 12.79528 -1.029947 25.59055 2.053349 12.79528 2.053349 25.59055 2.053349 12.79528 -1.029947 -12.79528 0 -25.59055 0 -12.79528 3.937008 -25.59055 3.937008 -12.79528 3.937008 -25.59055 0 -12.79528 27.81748 -12.79528 24.73419 -25.59055 27.81748 -25.59055 24.73419 -25.59055 27.81748 -12.79528 24.73419 -12.79528 27.05459 -12.79528 23.9713 -25.59055 27.05459 -25.59055 23.9713 -25.59055 27.05459 -12.79528 23.9713 25.59055 -14.23642 12.79528 -14.23642 25.59055 -11.15312 12.79528 -11.15312 25.59055 -11.15312 12.79528 -14.23642 -12.79528 5.753304 -25.59055 5.753304 -12.79528 8.8366 -25.59055 8.8366 -12.79528 8.8366 -25.59055 5.753304 -12.79528 17.4 -25.59055 17.4 -12.79528 20.4833 -25.59055 20.4833 -12.79528 20.4833 -25.59055 17.4 -12.79528 12.03942 -25.59055 12.03942 -12.79528 15.12271 -25.59055 15.12271 -12.79528 15.12271 -25.59055 12.03942 -12.79528 24.55304 -12.79528 21.46974 -25.59055 24.55304 -25.59055 21.46974 -25.59055 24.55304 -12.79528 21.46974 12.79528 -19.75964 12.79528 -16.67635 25.59055 -19.75964 25.59055 -16.67635 25.59055 -19.75964 12.79528 -16.67635 12.79528 -26.78972 12.79528 -23.70643 25.59055 -26.78972 25.59055 -23.70643 25.59055 -26.78972 12.79528 -23.70643 25.59055 -7.84807 12.79528 -7.84807 25.59055 -4.764774 12.79528 -4.764774 25.59055 -4.764774 12.79528 -7.84807 12.79528 -24.04134 12.79528 -20.95804 25.59055 -24.04134 25.59055 -20.95804 25.59055 -24.04134 12.79528 -20.95804 14.17323 0 14.17323 3.937008 37.79528 0 14.57568 6.993926 37.79528 0 14.17323 3.937008 15.75561 9.84252 37.79528 0 14.57568 6.993926 17.6326 12.28866 37.79528 0 15.75561 9.84252 20.07874 14.16565 37.79528 0 17.6326 12.28866 22.92733 15.34558 37.79528 0 20.07874 14.16565 25.98425 15.74803 37.79528 0 22.92733 15.34558 29.04117 15.34558 37.79528 0 25.98425 15.74803 31.88977 14.16565 37.79528 0 29.04117 15.34558 34.33591 12.28866 37.79528 0 31.88977 14.16565 36.21289 9.84252 37.79528 0 34.33591 12.28866 37.39282 6.993926 37.79528 0 36.21289 9.84252 37.79528 3.937008 37.79528 0 37.39282 6.993926 -14.17323 3.937008 -14.17323 0 -14.57568 6.993926 -37.79528 0 -14.57568 6.993926 -14.17323 0 -15.75561 9.84252 -14.57568 6.993926 -37.79528 0 -17.6326 12.28866 -15.75561 9.84252 -37.79528 0 -20.07874 14.16565 -17.6326 12.28866 -37.79528 0 -22.92733 15.34558 -20.07874 14.16565 -37.79528 0 -25.98425 15.74803 -22.92733 15.34558 -37.79528 0 -29.04117 15.34558 -25.98425 15.74803 -37.79528 0 -31.88977 14.16565 -29.04117 15.34558 -37.79528 0 -34.33591 12.28866 -31.88977 14.16565 -37.79528 0 -36.21289 9.84252 -34.33591 12.28866 -37.79528 0 -37.39282 6.993926 -36.21289 9.84252 -37.79528 0 -37.79528 3.937008 -37.39282 6.993926 -37.79528 0 -12.79528 0 -25.59055 0 -12.79528 3.937008 -25.59055 3.937008 -12.79528 3.937008 -25.59055 0 -21.65354 -61.02362 -20.34121 -58.39895 21.65354 -61.02362 20.34121 -58.39895 21.65354 -61.02362 -20.34121 -58.39895 20.34121 -52.63129 21.65354 -61.02362 20.34121 -58.39895 25.59055 -52.63129 21.65354 -61.02362 20.34121 -52.63129 22.16742 -60.98994 21.65354 -61.02362 25.59055 -52.63129 22.67252 -60.88947 22.16742 -60.98994 25.59055 -52.63129 23.16017 -60.72393 22.67252 -60.88947 25.59055 -52.63129 23.62205 -60.49616 23.16017 -60.72393 25.59055 -52.63129 24.05024 -60.21005 23.62205 -60.49616 25.59055 -52.63129 24.43743 -59.8705 24.05024 -60.21005 25.59055 -52.63129 24.77698 -59.48331 24.43743 -59.8705 25.59055 -52.63129 25.06309 -59.05512 24.77698 -59.48331 25.59055 -52.63129 25.29086 -58.59324 25.06309 -59.05512 25.59055 -52.63129 25.4564 -58.10559 25.29086 -58.59324 25.59055 -52.63129 25.55687 -57.60049 25.4564 -58.10559 25.59055 -52.63129 25.59055 -57.08661 25.55687 -57.60049 25.59055 -52.63129 -25.59055 -57.08661 -25.59055 -52.63129 -25.55687 -57.60049 -20.34121 -52.63129 -25.55687 -57.60049 -25.59055 -52.63129 -25.4564 -58.10559 -25.55687 -57.60049 -20.34121 -52.63129 -25.29086 -58.59324 -25.4564 -58.10559 -20.34121 -52.63129 -25.06309 -59.05512 -25.29086 -58.59324 -20.34121 -52.63129 -24.77698 -59.48331 -25.06309 -59.05512 -20.34121 -52.63129 -24.43743 -59.8705 -24.77698 -59.48331 -20.34121 -52.63129 -24.05024 -60.21005 -24.43743 -59.8705 -20.34121 -52.63129 -23.62205 -60.49616 -24.05024 -60.21005 -20.34121 -52.63129 -23.16017 -60.72393 -23.62205 -60.49616 -20.34121 -52.63129 -22.67252 -60.88947 -23.16017 -60.72393 -20.34121 -52.63129 -22.16742 -60.98994 -22.67252 -60.88947 -20.34121 -52.63129 -21.65354 -61.02362 -22.16742 -60.98994 -20.34121 -52.63129 -20.34121 -58.39895 -21.65354 -61.02362 -20.34121 -52.63129 20.34121 -10.99742 -20.34121 -10.99742 21.65354 -6.847452 -21.65354 -6.847452 21.65354 -6.847452 -20.34121 -10.99742 11.81102 -6.847452 21.65354 -6.847452 -21.65354 -6.847452 -11.81102 -6.847452 11.81102 -6.847452 -21.65354 -6.847452 11.81102 11.81102 -11.81102 11.81102 11.81102 15.74803 -11.81102 15.74803 11.81102 15.74803 -11.81102 11.81102 25.59055 14.17323 25.59055 10.62992 12.79528 14.17323 19.02887 10.62992 12.79528 14.17323 25.59055 10.62992 12.79528 -25.98425 12.79528 14.17323 19.02887 10.62992 12.79528 -49.6063 12.79528 14.17323 12.79528 -25.98425 -12.79528 -49.6063 12.79528 14.17323 12.79528 -49.6063 -12.79528 -25.98425 12.79528 14.17323 -12.79528 -49.6063 19.02887 10.62992 19.02887 -22.44095 12.79528 -25.98425 19.02887 -22.44095 25.59055 -22.44095 12.79528 -25.98425 25.59055 -25.98425 12.79528 -25.98425 25.59055 -22.44095 -12.79528 -25.98425 -12.79528 37.79528 12.79528 14.17323 -12.79528 37.79528 -21.65354 49.2126 12.79528 14.17323 12.79528 14.17323 -21.65354 49.2126 12.79528 37.79528 -21.65354 49.2126 21.65354 49.2126 12.79528 37.79528 21.65354 49.2126 22.16742 49.17892 12.79528 37.79528 22.16742 49.17892 22.67252 49.07845 12.79528 37.79528 22.67252 49.07845 23.16017 48.91291 12.79528 37.79528 23.16017 48.91291 23.62205 48.68514 12.79528 37.79528 23.62205 48.68514 24.05024 48.39903 12.79528 37.79528 24.05024 48.39903 24.43743 48.05947 12.79528 37.79528 24.43743 48.05947 24.77698 47.67229 12.79528 37.79528 24.77698 47.67229 25.06309 47.24409 12.79528 37.79528 25.06309 47.24409 25.29086 46.78222 12.79528 37.79528 25.29086 46.78222 25.4564 46.29456 12.79528 37.79528 25.4564 46.29456 25.55687 45.78947 12.79528 37.79528 25.55687 45.78947 25.59055 45.27559 12.79528 37.79528 25.59055 37.79528 12.79528 37.79528 25.59055 45.27559 -25.59055 37.79528 -21.65354 49.2126 -12.79528 37.79528 -22.16742 49.17892 -21.65354 49.2126 -25.59055 37.79528 -22.67252 49.07845 -22.16742 49.17892 -25.59055 37.79528 -23.16017 48.91291 -22.67252 49.07845 -25.59055 37.79528 -23.62205 48.68514 -23.16017 48.91291 -25.59055 37.79528 -24.05024 48.39903 -23.62205 48.68514 -25.59055 37.79528 -24.43743 48.05947 -24.05024 48.39903 -25.59055 37.79528 -24.77698 47.67229 -24.43743 48.05947 -25.59055 37.79528 -25.06309 47.24409 -24.77698 47.67229 -25.59055 37.79528 -25.29086 46.78222 -25.06309 47.24409 -25.59055 37.79528 -25.4564 46.29456 -25.29086 46.78222 -25.59055 37.79528 -25.55687 45.78947 -25.4564 46.29456 -25.59055 37.79528 -25.59055 45.27559 -25.55687 45.78947 -25.59055 37.79528 -12.79528 37.79528 -12.79528 -25.98425 -12.79528 14.17323 -12.79528 14.17323 -12.79528 -25.98425 -19.02887 -22.44095 -19.02887 -22.44095 -19.02887 10.62992 -12.79528 14.17323 -25.59055 14.17323 -12.79528 14.17323 -19.02887 10.62992 -25.59055 10.62992 -25.59055 14.17323 -19.02887 10.62992 -25.59055 -25.98425 -19.02887 -22.44095 -12.79528 -25.98425 -25.59055 -22.44095 -19.02887 -22.44095 -25.59055 -25.98425 25.59055 0 12.79528 0 25.59055 3.937008 12.79528 3.937008 25.59055 3.937008 12.79528 0 25.59055 -26.04666 25.59055 -29.12996 12.79528 -26.04666 12.79528 -29.12996 12.79528 -26.04666 25.59055 -29.12996 -25.59055 16.5593 -25.59055 19.6426 -12.79528 16.5593 -12.79528 19.6426 -12.79528 16.5593 -25.59055 19.6426 25.59055 -35.4164 25.59055 -38.4997 12.79528 -35.4164 12.79528 -38.4997 12.79528 -35.4164 25.59055 -38.4997 -25.59055 24.5901 -25.59055 27.67339 -12.79528 24.5901 -12.79528 27.67339 -12.79528 24.5901 -25.59055 27.67339 -25.59055 34.88326 -25.59055 37.96656 -12.79528 34.88326 -12.79528 37.96656 -12.79528 34.88326 -25.59055 37.96656 25.59055 -12.36795 12.79528 -12.36795 25.59055 -9.284657 12.79528 -9.284657 25.59055 -9.284657 12.79528 -12.36795 25.59055 -21.42652 12.79528 -21.42652 25.59055 -18.34322 12.79528 -18.34322 25.59055 -18.34322 12.79528 -21.42652 -25.59055 30.84006 -25.59055 33.92335 -12.79528 30.84006 -12.79528 33.92335 -12.79528 30.84006 -25.59055 33.92335 25.59055 -31.87001 25.59055 -34.9533 12.79528 -31.87001 12.79528 -34.9533 12.79528 -31.87001 25.59055 -34.9533 -25.59055 7.294952 -25.59055 10.37825 -12.79528 7.294952 -12.79528 10.37825 -12.79528 7.294952 -25.59055 10.37825 25.59055 -2.571595 12.79528 -2.571595 25.59055 0.511701 12.79528 0.511701 25.59055 0.511701 12.79528 -2.571595 -25.59055 36.44417 -25.59055 39.52746 -12.79528 36.44417 -12.79528 39.52746 -12.79528 36.44417 -25.59055 39.52746 25.59055 7.294952 12.79528 7.294952 25.59055 10.37825 12.79528 10.37825 25.59055 10.37825 12.79528 7.294952 -12.79528 -31.87001 -12.79528 -34.9533 -25.59055 -31.87001 -25.59055 -34.9533 -25.59055 -31.87001 -12.79528 -34.9533 -12.79528 -2.571595 -25.59055 -2.571595 -12.79528 0.511701 -25.59055 0.511701 -12.79528 0.511701 -25.59055 -2.571595 12.79528 30.84006 12.79528 33.92335 25.59055 30.84006 25.59055 33.92335 25.59055 30.84006 12.79528 33.92335 -12.79528 -12.36795 -25.59055 -12.36795 -12.79528 -9.284657 -25.59055 -9.284657 -12.79528 -9.284657 -25.59055 -12.36795 -49.6063 0 -49.6063 3.937008 -25.98425 0 -49.20384 6.993926 -25.98425 0 -49.6063 3.937008 -48.02392 9.84252 -25.98425 0 -49.20384 6.993926 -46.14693 12.28866 -25.98425 0 -48.02392 9.84252 -43.70079 14.16565 -25.98425 0 -46.14693 12.28866 -40.85219 15.34558 -25.98425 0 -43.70079 14.16565 -37.79528 15.74803 -25.98425 0 -40.85219 15.34558 -34.73836 15.34558 -25.98425 0 -37.79528 15.74803 -31.88977 14.16565 -25.98425 0 -34.73836 15.34558 -29.44362 12.28866 -25.98425 0 -31.88977 14.16565 -27.56663 9.84252 -25.98425 0 -29.44362 12.28866 -26.3867 6.993926 -25.98425 0 -27.56663 9.84252 -25.98425 3.937008 -25.98425 0 -26.3867 6.993926 25.59055 16.5593 12.79528 16.5593 25.59055 19.6426 12.79528 19.6426 25.59055 19.6426 12.79528 16.5593 12.79528 36.44417 12.79528 39.52746 25.59055 36.44417 25.59055 39.52746 25.59055 36.44417 12.79528 39.52746 12.79528 24.5901 12.79528 27.67339 25.59055 24.5901 25.59055 27.67339 25.59055 24.5901 12.79528 27.67339 -12.79528 -26.04666 -12.79528 -29.12996 -25.59055 -26.04666 -25.59055 -29.12996 -25.59055 -26.04666 -12.79528 -29.12996 12.79528 34.88326 12.79528 37.96656 25.59055 34.88326 25.59055 37.96656 25.59055 34.88326 12.79528 37.96656 -12.79528 0 -25.59055 0 -12.79528 3.937008 -25.59055 3.937008 -12.79528 3.937008 -25.59055 0 49.6063 3.937008 49.6063 0 49.20384 6.993926 25.98425 0 49.20384 6.993926 49.6063 0 48.02392 9.84252 49.20384 6.993926 25.98425 0 46.14693 12.28866 48.02392 9.84252 25.98425 0 43.70079 14.16565 46.14693 12.28866 25.98425 0 40.85219 15.34558 43.70079 14.16565 25.98425 0 37.79528 15.74803 40.85219 15.34558 25.98425 0 34.73836 15.34558 37.79528 15.74803 25.98425 0 31.88977 14.16565 34.73836 15.34558 25.98425 0 29.44362 12.28866 31.88977 14.16565 25.98425 0 27.56663 9.84252 29.44362 12.28866 25.98425 0 26.3867 6.993926 27.56663 9.84252 25.98425 0 25.98425 3.937008 26.3867 6.993926 25.98425 0 -12.79528 -35.4164 -12.79528 -38.4997 -25.59055 -35.4164 -25.59055 -38.4997 -25.59055 -35.4164 -12.79528 -38.4997 -12.79528 -21.42652 -25.59055 -21.42652 -12.79528 -18.34322 -25.59055 -18.34322 -12.79528 -18.34322 -25.59055 -21.42652 12.79528 0 -12.79528 0 12.79528 3.937008 -12.79528 3.937008 12.79528 3.937008 -12.79528 0 25.59055 -57.08661 25.55687 -57.60049 25.59055 -49.6063 12.79528 -49.6063 25.59055 -49.6063 25.55687 -57.60049 25.4564 -58.10559 12.79528 -49.6063 25.55687 -57.60049 25.29086 -58.59324 12.79528 -49.6063 25.4564 -58.10559 25.06309 -59.05512 12.79528 -49.6063 25.29086 -58.59324 24.77698 -59.48331 12.79528 -49.6063 25.06309 -59.05512 24.43743 -59.8705 12.79528 -49.6063 24.77698 -59.48331 24.05024 -60.21005 12.79528 -49.6063 24.43743 -59.8705 23.62205 -60.49616 12.79528 -49.6063 24.05024 -60.21005 23.16017 -60.72393 12.79528 -49.6063 23.62205 -60.49616 22.67252 -60.88947 12.79528 -49.6063 23.16017 -60.72393 22.16742 -60.98994 12.79528 -49.6063 22.67252 -60.88947 21.65354 -61.02362 12.79528 -49.6063 22.16742 -60.98994 -21.65354 -61.02362 12.79528 -49.6063 21.65354 -61.02362 -12.79528 -49.6063 12.79528 -49.6063 -21.65354 -61.02362 -25.59055 -49.6063 -12.79528 -49.6063 -21.65354 -61.02362 -22.16742 -60.98994 -25.59055 -49.6063 -21.65354 -61.02362 -22.67252 -60.88947 -25.59055 -49.6063 -22.16742 -60.98994 -23.16017 -60.72393 -25.59055 -49.6063 -22.67252 -60.88947 -23.62205 -60.49616 -25.59055 -49.6063 -23.16017 -60.72393 -24.05024 -60.21005 -25.59055 -49.6063 -23.62205 -60.49616 -24.43743 -59.8705 -25.59055 -49.6063 -24.05024 -60.21005 -24.77698 -59.48331 -25.59055 -49.6063 -24.43743 -59.8705 -25.06309 -59.05512 -25.59055 -49.6063 -24.77698 -59.48331 -25.29086 -58.59324 -25.59055 -49.6063 -25.06309 -59.05512 -25.4564 -58.10559 -25.59055 -49.6063 -25.29086 -58.59324 -25.55687 -57.60049 -25.59055 -49.6063 -25.4564 -58.10559 -25.59055 -57.08661 -25.59055 -49.6063 -25.55687 -57.60049 13.77953 11.81102 -13.77953 11.81102 13.77953 15.74803 -13.77953 15.74803 13.77953 15.74803 -13.77953 11.81102 15.27636 12.6645 -15.27636 12.6645 14.48896 16.60151 -14.48896 16.60151 14.48896 16.60151 -15.27636 12.6645 -12.68701 11.61417 -14.17323 3.937008 -15.1271 14.79416 -14.57568 6.993926 -15.1271 14.79416 -14.17323 3.937008 -15.75561 9.84252 -15.1271 14.79416 -14.57568 6.993926 -18.30709 17.23425 -15.1271 14.79416 -15.75561 9.84252 -17.6326 12.28866 -18.30709 17.23425 -15.75561 9.84252 -20.07874 14.16565 -18.30709 17.23425 -17.6326 12.28866 -22.01026 18.76815 -18.30709 17.23425 -20.07874 14.16565 -22.92733 15.34558 -22.01026 18.76815 -20.07874 14.16565 -25.98425 19.29134 -22.01026 18.76815 -22.92733 15.34558 -25.98425 15.74803 -25.98425 19.29134 -22.92733 15.34558 -29.95825 18.76815 -25.98425 19.29134 -25.98425 15.74803 -29.04117 15.34558 -29.95825 18.76815 -25.98425 15.74803 -31.88977 14.16565 -29.95825 18.76815 -29.04117 15.34558 -33.66142 17.23425 -29.95825 18.76815 -31.88977 14.16565 -34.33591 12.28866 -33.66142 17.23425 -31.88977 14.16565 -36.8414 14.79416 -33.66142 17.23425 -34.33591 12.28866 -36.21289 9.84252 -36.8414 14.79416 -34.33591 12.28866 -37.39282 6.993926 -36.8414 14.79416 -36.21289 9.84252 -39.28149 11.61417 -36.8414 14.79416 -37.39282 6.993926 -37.79528 3.937008 -39.28149 11.61417 -37.39282 6.993926 -37.79528 0 -39.28149 11.61417 -37.79528 3.937008 -40.82027 7.874016 -39.28149 11.61417 -37.79528 0 -45.27559 0 -40.82027 7.874016 -37.79528 0 -40.81539 7.911001 -39.28149 11.61417 -40.82027 7.874016 -45.27559 7.874016 -40.82027 7.874016 -45.27559 0 -10.62992 3.937008 -10.62992 0 -11.15311 7.911001 -14.17323 0 -11.15311 7.911001 -10.62992 0 -12.68701 11.61417 -11.15311 7.911001 -14.17323 0 -14.17323 3.937008 -12.68701 11.61417 -14.17323 0 -25.59055 0 -25.59055 3.937008 -19.02887 0 -19.02887 3.937008 -19.02887 0 -25.59055 3.937008 25.59055 0 19.02887 0 25.59055 3.937008 19.02887 3.937008 25.59055 3.937008 19.02887 0 -57.08661 3.937008 -57.08661 7.874016 -49.6063 3.937008 -52.63129 7.874016 -49.6063 3.937008 -57.08661 7.874016 -52.62642 7.911001 -49.6063 3.937008 -52.63129 7.874016 -51.09252 11.61417 -49.6063 3.937008 -52.62642 7.911001 -48.65243 14.79416 -49.6063 3.937008 -51.09252 11.61417 -49.20384 6.993926 -49.6063 3.937008 -48.65243 14.79416 -48.02392 9.84252 -49.20384 6.993926 -48.65243 14.79416 -45.47244 17.23425 -48.02392 9.84252 -48.65243 14.79416 -46.14693 12.28866 -48.02392 9.84252 -45.47244 17.23425 -43.70079 14.16565 -46.14693 12.28866 -45.47244 17.23425 -41.76927 18.76815 -43.70079 14.16565 -45.47244 17.23425 -40.85219 15.34558 -43.70079 14.16565 -41.76927 18.76815 -37.79528 19.29134 -40.85219 15.34558 -41.76927 18.76815 -37.79528 15.74803 -40.85219 15.34558 -37.79528 19.29134 -34.73836 15.34558 -37.79528 15.74803 -37.79528 19.29134 -33.82128 18.76815 -34.73836 15.34558 -37.79528 19.29134 -31.88977 14.16565 -34.73836 15.34558 -33.82128 18.76815 -30.11811 17.23425 -31.88977 14.16565 -33.82128 18.76815 -29.44362 12.28866 -31.88977 14.16565 -30.11811 17.23425 -26.93812 14.79416 -29.44362 12.28866 -30.11811 17.23425 -27.56663 9.84252 -29.44362 12.28866 -26.93812 14.79416 -26.3867 6.993926 -27.56663 9.84252 -26.93812 14.79416 -24.49804 11.61417 -26.3867 6.993926 -26.93812 14.79416 -25.98425 3.937008 -26.3867 6.993926 -24.49804 11.61417 -25.98425 0 -25.98425 3.937008 -24.49804 11.61417 -22.44095 0 -25.98425 0 -24.49804 11.61417 -22.96413 7.911001 -22.44095 0 -24.49804 11.61417 -22.44095 3.937008 -22.44095 0 -22.96413 7.911001 -19.02887 0 -25.59055 0 -19.02887 3.937008 -25.59055 3.937008 -19.02887 3.937008 -25.59055 0 19.02887 0 19.02887 3.937008 25.59055 0 25.59055 3.937008 25.59055 0 19.02887 3.937008 24.64908 18.05237 24.49804 17.84487 22.44095 18.05237 22.96413 13.94139 22.44095 18.05237 24.49804 17.84487 22.44095 9.752431 22.44095 18.05237 22.96413 13.94139 -10.62992 18.05237 22.44095 18.05237 22.44095 9.752431 -10.62992 9.752431 -10.62992 18.05237 22.44095 9.752431 -11.15311 13.94139 -10.62992 18.05237 -10.62992 9.752431 -12.68701 17.84487 -10.62992 18.05237 -11.15311 13.94139 -12.83806 18.05237 -10.62992 18.05237 -12.68701 17.84487 -24.64908 18.05237 -22.44095 18.05237 -24.49804 17.84487 -22.96413 13.94139 -24.49804 17.84487 -22.44095 18.05237 -22.44095 9.752431 -22.96413 13.94139 -22.44095 18.05237 10.62992 9.752431 -22.44095 9.752431 -22.44095 18.05237 10.62992 18.05237 10.62992 9.752431 -22.44095 18.05237 11.15311 13.94139 10.62992 9.752431 10.62992 18.05237 12.68701 17.84487 11.15311 13.94139 10.62992 18.05237 12.83806 18.05237 12.68701 17.84487 10.62992 18.05237 42.62643 28.0123 42.62643 23.62303 34.75241 28.0123 -42.62643 23.62303 -42.62643 28.0123 -34.75241 28.0123 19.10454 31.26904 -19.10454 31.26904 17.71654 35.43307 -17.71654 35.43307 17.71654 35.43307 -19.10454 31.26904 -17.71654 -42.62643 -17.71654 -34.75241 17.71654 -42.62643 17.71654 -34.75241 17.71654 -42.62643 -17.71654 -34.75241 25.59055 19.68504 21.65354 19.68504 25.59055 23.62205 21.65354 23.62205 25.59055 23.62205 21.65354 19.68504 -25.59055 12.71269 -25.59055 16.6497 -21.65354 12.71269 -21.65354 16.6497 -21.65354 12.71269 -25.59055 16.6497 -17.71654 -34.75241 -17.71654 0.901662 17.71654 -34.75241 17.71654 0.901662 17.71654 -34.75241 -17.71654 0.901662 25.59055 16.6497 25.59055 12.71269 21.65354 16.6497 21.65354 12.71269 21.65354 16.6497 25.59055 12.71269 21.65354 0.853473 17.63857 0.853473 17.71654 20.53851 14.48896 16.60151 17.71654 20.53851 17.63857 0.853473 -17.71654 20.53851 17.71654 20.53851 14.48896 16.60151 15.27636 12.6645 14.48896 16.60151 17.63857 0.853473 -14.48896 16.60151 -17.71654 20.53851 14.48896 16.60151 -15.27636 12.6645 -17.71654 20.53851 -14.48896 16.60151 -17.63857 0.853473 -17.71654 20.53851 -15.27636 12.6645 -21.65354 0.853473 -17.71654 20.53851 -17.63857 0.853473 -21.65354 16.6497 -21.65354 12.71269 -25.59055 16.6497 -25.59055 12.71269 -25.59055 16.6497 -21.65354 12.71269 -57.08661 15.56239 -50.12598 19.44251 -20.86239 15.56239 -42.62643 23.62303 -20.86239 15.56239 -50.12598 19.44251 -34.75241 28.0123 -20.86239 15.56239 -42.62643 23.62303 -20.86239 24.0753 -20.86239 15.56239 -34.75241 28.0123 0.901662 28.0123 -20.86239 24.0753 -34.75241 28.0123 -0.466608 24.0753 -20.86239 24.0753 0.901662 28.0123 10.30146 15.56239 -0.466608 24.0753 0.901662 28.0123 12.71269 15.56239 10.30146 15.56239 0.901662 28.0123 16.6497 15.56239 12.71269 15.56239 0.901662 28.0123 21.65354 12.71269 21.65354 16.6497 25.59055 12.71269 25.59055 16.6497 25.59055 12.71269 21.65354 16.6497 -21.65354 19.68504 -25.59055 19.68504 -21.65354 23.62205 -25.59055 23.62205 -21.65354 23.62205 -25.59055 19.68504 12.71269 19.68504 12.71269 23.62205 16.6497 19.68504 16.6497 23.62205 16.6497 19.68504 12.71269 23.62205 -12.71269 23.62205 -12.71269 19.68504 -16.6497 23.62205 -16.6497 19.68504 -16.6497 23.62205 -12.71269 19.68504 34.75241 28.0123 20.86239 24.0753 -0.901662 28.0123 0.466608 24.0753 -0.901662 28.0123 20.86239 24.0753 -10.30146 15.56239 -0.901662 28.0123 0.466608 24.0753 -12.71269 15.56239 -0.901662 28.0123 -10.30146 15.56239 -16.6497 15.56239 -0.901662 28.0123 -12.71269 15.56239 20.86239 24.0753 34.75241 28.0123 20.86239 15.56239 34.75241 28.0123 42.62643 23.62303 20.86239 15.56239 42.62643 23.62303 50.12598 19.44251 20.86239 15.56239 57.08661 15.56239 20.86239 15.56239 50.12598 19.44251 21.65354 -9.788514 21.65354 -39.4776 17.63857 -9.788514 13.77953 -39.4776 17.63857 -9.788514 21.65354 -39.4776 -17.63857 -9.788514 17.63857 -9.788514 13.77953 -39.4776 -13.77953 -39.4776 -17.63857 -9.788514 13.77953 -39.4776 -21.65354 -39.4776 -17.63857 -9.788514 -13.77953 -39.4776 -21.65354 -9.788514 -17.63857 -9.788514 -21.65354 -39.4776 -16.6497 19.68504 -25.98425 19.29134 -16.6497 23.62205 -29.95825 18.76815 -16.6497 23.62205 -25.98425 19.29134 -45.27559 15.74803 -16.6497 23.62205 -29.95825 18.76815 -22.01026 18.76815 -25.98425 19.29134 -16.6497 19.68504 -18.30709 17.23425 -22.01026 18.76815 -16.6497 19.68504 -33.66142 17.23425 -45.27559 15.74803 -29.95825 18.76815 -36.8414 14.79416 -45.27559 15.74803 -33.66142 17.23425 -39.13044 11.81102 -45.27559 15.74803 -36.8414 14.79416 -45.27559 11.81102 -45.27559 15.74803 -39.13044 11.81102 -18.30709 17.23425 -16.6497 19.68504 -15.1271 14.79416 -15.1271 14.79416 -16.6497 19.68504 -12.83806 11.81102 -16.6497 19.68504 -12.71269 19.68504 -12.83806 11.81102 -12.83806 11.81102 -12.71269 19.68504 -10.62992 11.81102 -12.71269 19.68504 -12.71269 23.62205 -10.62992 11.81102 -12.71269 23.62205 -10.30146 23.62205 -10.62992 11.81102 -10.30146 23.62205 20.86239 23.62205 -10.62992 11.81102 -10.62992 11.81102 20.86239 23.62205 22.44095 11.81102 22.44095 11.81102 20.86239 23.62205 24.64908 11.81102 24.64908 11.81102 20.86239 23.62205 26.93812 14.79416 26.93812 14.79416 20.86239 23.62205 30.11811 17.23425 30.11811 17.23425 20.86239 23.62205 33.82128 18.76815 33.82128 18.76815 20.86239 23.62205 37.79528 19.29134 37.79528 19.29134 20.86239 23.62205 41.76927 18.76815 20.86239 23.62205 57.08661 23.62205 41.76927 18.76815 41.76927 18.76815 57.08661 23.62205 45.47244 17.23425 57.08661 11.81102 45.47244 17.23425 57.08661 23.62205 48.65243 14.79416 45.47244 17.23425 57.08661 11.81102 50.94147 11.81102 48.65243 14.79416 57.08661 11.81102 10.62992 11.81102 12.71269 19.68504 12.83806 11.81102 16.6497 19.68504 12.83806 11.81102 12.71269 19.68504 15.1271 14.79416 12.83806 11.81102 16.6497 19.68504 18.30709 17.23425 15.1271 14.79416 16.6497 19.68504 16.6497 23.62205 18.30709 17.23425 16.6497 19.68504 22.01026 18.76815 18.30709 17.23425 16.6497 23.62205 25.98425 19.29134 22.01026 18.76815 16.6497 23.62205 29.95825 18.76815 25.98425 19.29134 16.6497 23.62205 45.27559 15.74803 29.95825 18.76815 16.6497 23.62205 33.66142 17.23425 29.95825 18.76815 45.27559 15.74803 36.8414 14.79416 33.66142 17.23425 45.27559 15.74803 39.13044 11.81102 36.8414 14.79416 45.27559 15.74803 45.27559 11.81102 39.13044 11.81102 45.27559 15.74803 12.71269 19.68504 10.62992 11.81102 12.71269 23.62205 12.71269 23.62205 10.62992 11.81102 10.30146 23.62205 10.30146 23.62205 10.62992 11.81102 -20.86239 23.62205 10.62992 11.81102 -22.44095 11.81102 -20.86239 23.62205 -22.44095 11.81102 -24.64908 11.81102 -20.86239 23.62205 -24.64908 11.81102 -26.93812 14.79416 -20.86239 23.62205 -26.93812 14.79416 -30.11811 17.23425 -20.86239 23.62205 -30.11811 17.23425 -33.82128 18.76815 -20.86239 23.62205 -33.82128 18.76815 -37.79528 19.29134 -20.86239 23.62205 -37.79528 19.29134 -41.76927 18.76815 -20.86239 23.62205 -20.86239 23.62205 -41.76927 18.76815 -57.08661 23.62205 -41.76927 18.76815 -45.47244 17.23425 -57.08661 23.62205 -45.47244 17.23425 -48.65243 14.79416 -57.08661 23.62205 -48.65243 14.79416 -50.94147 11.81102 -57.08661 23.62205 -57.08661 11.81102 -57.08661 23.62205 -50.94147 11.81102 -25.59055 -22.44095 -25.59055 10.62992 -21.65354 -22.44095 -21.65354 10.62992 -21.65354 -22.44095 -25.59055 10.62992 -21.65354 -22.44095 -21.65354 10.62992 -19.02887 -22.44095 -19.02887 10.62992 -19.02887 -22.44095 -21.65354 10.62992 22.44095 11.81102 22.44095 3.937008 -10.62992 11.81102 22.44095 0 -10.62992 11.81102 22.44095 3.937008 -10.62992 0 -10.62992 11.81102 22.44095 0 -10.62992 3.937008 -10.62992 11.81102 -10.62992 0 -19.02887 3.937008 -25.59055 3.937008 -19.02887 11.81102 -21.65354 11.81102 -19.02887 11.81102 -25.59055 3.937008 -25.59055 11.81102 -21.65354 11.81102 -25.59055 3.937008 25.59055 3.937008 19.02887 3.937008 25.59055 11.81102 19.02887 11.81102 25.59055 11.81102 19.02887 3.937008 21.65354 11.81102 25.59055 11.81102 19.02887 11.81102 25.59055 -22.44095 19.02887 -22.44095 25.59055 10.62992 19.02887 10.62992 25.59055 10.62992 19.02887 -22.44095 21.65354 -22.44095 21.65354 10.62992 25.59055 -22.44095 25.59055 10.62992 25.59055 -22.44095 21.65354 10.62992 21.65354 10.62992 21.65354 -22.44095 19.02887 10.62992 19.02887 -22.44095 19.02887 10.62992 21.65354 -22.44095 -19.02887 -22.44095 -25.59055 -22.44095 -19.02887 10.62992 -25.59055 10.62992 -19.02887 10.62992 -25.59055 -22.44095 -22.44095 0 -22.44095 3.937008 10.62992 0 -22.44095 11.81102 10.62992 0 -22.44095 3.937008 10.62992 3.937008 10.62992 0 -22.44095 11.81102 10.62992 11.81102 10.62992 3.937008 -22.44095 11.81102 -25.59055 3.937008 -25.59055 11.81102 -19.02887 3.937008 -19.02887 11.81102 -19.02887 3.937008 -25.59055 11.81102 -21.65354 11.81102 -19.02887 11.81102 -25.59055 11.81102 19.02887 3.937008 19.02887 11.81102 25.59055 3.937008 21.65354 11.81102 25.59055 3.937008 19.02887 11.81102 25.59055 11.81102 25.59055 3.937008 21.65354 11.81102 -22.44095 11.81102 10.62992 11.81102 -22.44095 3.937008 10.62992 3.937008 -22.44095 3.937008 10.62992 11.81102 22.44095 3.937008 -10.62992 3.937008 22.44095 11.81102 -10.62992 11.81102 22.44095 11.81102 -10.62992 3.937008 -17.10304 -39.42158 -17.10304 -31.54756 17.10304 -39.42158 17.10304 -39.42158 -17.10304 -31.54756 17.10304 -31.54756 17.10304 -31.54756 -17.10304 -31.54756 19.10454 -23.0639 19.10454 -23.0639 -17.10304 -31.54756 -19.10454 -23.0639 -20.42654 -31.54756 -19.10454 -23.0639 -17.10304 -31.54756 20.42654 -31.54756 17.10304 -31.54756 19.10454 -23.0639 21.65354 11.81102 11.81102 11.81102 21.65354 23.62205 11.81102 15.74803 21.65354 23.62205 11.81102 11.81102 -11.81102 15.74803 21.65354 23.62205 11.81102 15.74803 17.10304 23.62205 21.65354 23.62205 -11.81102 15.74803 17.10304 23.62205 -11.81102 15.74803 -17.10304 23.62205 -17.10304 23.62205 -11.81102 15.74803 -21.65354 23.62205 -21.65354 23.62205 -11.81102 15.74803 -21.65354 11.81102 -11.81102 11.81102 -21.65354 11.81102 -11.81102 15.74803 -13.77953 11.81102 -21.65354 11.81102 -13.77953 15.74803 -21.65354 15.74803 -13.77953 15.74803 -21.65354 11.81102 21.65354 11.81102 13.77953 11.81102 21.65354 15.74803 13.77953 15.74803 21.65354 15.74803 13.77953 11.81102 -21.65354 16.6497 -21.65354 12.71269 -25.59055 16.6497 -21.65354 16.6497 -21.65354 12.71269 -25.59055 16.6497 -21.65354 0.853473 -17.71654 20.53851 -17.63857 0.853473 -21.65354 0.853473 -17.71654 20.53851 -17.63857 0.853473 20.86239 24.0753 20.86239 15.56239 0.466608 24.0753 -10.30146 15.56239 0.466608 24.0753 20.86239 15.56239 -20.86239 15.56239 -20.86239 24.0753 10.30146 15.56239 -0.466608 24.0753 10.30146 15.56239 -20.86239 24.0753 17.63857 0.853473 -17.63857 0.853473 15.27636 12.6645 -15.27636 12.6645 15.27636 12.6645 -17.63857 0.853473 -21.65354 -39.42158 -20.42654 -31.54756 -17.10304 -39.42158 -17.10304 -31.54756 -17.10304 -39.42158 -20.42654 -31.54756 17.10304 -39.42158 17.10304 -31.54756 21.65354 -39.42158 20.42654 -31.54756 21.65354 -39.42158 17.10304 -31.54756 + + + + + + + + + + + + + + +

0 0 0 1 1 1 2 0 2 3 1 3 2 0 4 1 1 5 4 2 6 5 2 7 6 2 8 7 2 9 6 2 10 5 2 11 8 3 12 9 3 13 10 3 14 11 3 15 10 3 16 9 3 17 12 4 18 13 4 19 14 4 20 15 4 21 14 4 22 13 4 23 16 5 24 17 5 25 18 5 26 19 6 27 18 6 28 17 6 29 20 7 30 18 7 31 19 7 32 21 8 33 18 8 34 20 8 35 22 9 36 21 9 37 20 9 38 23 8 39 21 8 40 22 8 41 24 8 42 23 8 43 22 8 44 25 8 45 24 8 46 22 8 47 26 10 48 24 10 49 25 10 50 27 8 51 26 8 52 25 8 53 28 8 54 27 8 55 25 8 56 29 8 57 27 8 58 28 8 59 30 11 60 29 11 61 28 11 62 31 12 63 29 12 64 30 12 65 32 13 66 31 13 67 30 13 68 33 14 69 32 14 70 30 14 71 34 8 72 32 8 73 33 8 74 35 8 75 34 8 76 33 8 77 36 8 78 34 8 79 35 8 80 37 8 81 36 8 82 35 8 83 38 8 84 36 8 85 37 8 86 39 8 87 38 8 88 37 8 89 40 15 90 39 15 91 37 15 92 41 16 93 39 16 94 40 16 95 42 8 96 41 8 97 40 8 98 43 17 99 42 17 100 40 17 101 44 18 102 42 18 103 43 18 104 45 8 105 43 8 106 40 8 107 46 19 108 44 19 109 43 19 110 47 20 111 48 20 112 49 20 113 50 20 114 49 20 115 48 20 116 51 21 117 52 21 118 53 21 119 54 21 120 53 21 121 52 21 122 55 22 123 56 22 124 57 22 125 58 22 126 57 22 127 56 22 128 59 23 129 60 23 130 61 23 131 62 23 132 61 23 133 60 23 134 63 24 135 64 24 136 65 24 137 66 25 138 65 25 139 64 25 140 67 26 141 68 26 142 69 26 143 70 26 144 69 26 145 68 26 146 71 27 147 72 27 148 73 27 149 74 27 150 73 27 151 72 27 152 75 28 153 76 28 154 77 28 155 78 28 156 77 28 157 76 28 158 79 29 159 80 29 160 81 29 161 82 29 162 81 29 163 80 29 164 83 30 165 84 30 166 85 30 167 86 30 168 85 30 169 84 30 170 87 31 171 88 31 172 89 32 173 90 32 174 89 32 175 88 31 176 91 33 177 92 33 178 93 34 179 94 34 180 93 34 181 92 33 182 95 35 183 96 35 184 97 36 185 98 36 186 97 36 187 96 35 188 99 37 189 100 37 190 101 38 191 102 39 192 101 38 193 100 37 194 103 40 195 104 40 196 105 40 197 106 40 198 105 40 199 104 40 200 107 41 201 108 41 202 109 41 203 110 41 204 109 41 205 108 41 206 111 42 207 112 42 208 113 42 209 114 43 210 113 43 211 112 43 212 115 42 213 113 42 214 114 42 215 116 42 216 115 42 217 114 42 218 117 42 219 116 42 220 114 42 221 118 42 222 117 42 223 114 42 224 119 42 225 117 42 226 118 42 227 120 42 228 117 42 229 119 42 230 121 42 231 120 42 232 119 42 233 122 42 234 120 42 235 121 42 236 123 44 237 120 44 238 122 44 239 124 42 240 123 42 241 122 42 242 125 45 243 123 45 244 124 45 245 126 42 246 125 42 247 124 42 248 127 42 249 125 42 250 126 42 251 128 42 252 127 42 253 126 42 254 129 42 255 127 42 256 128 42 257 130 42 258 127 42 259 129 42 260 131 42 261 130 42 262 129 42 263 132 46 264 130 46 265 131 46 266 133 42 267 132 42 268 131 42 269 134 42 270 132 42 271 133 42 272 135 42 273 132 42 274 134 42 275 136 42 276 135 42 277 134 42 278 137 42 279 135 42 280 136 42 281 138 47 282 135 47 283 137 47 284 139 48 285 135 48 286 138 48 287 140 49 288 139 49 289 138 49 290 141 50 291 142 50 292 143 50 293 144 50 294 143 50 295 142 50 296 145 51 297 146 51 298 147 51 299 148 51 300 147 51 301 146 51 302 149 52 303 150 52 304 151 53 305 152 53 306 151 53 307 150 52 308 153 54 309 154 54 310 155 54 311 156 54 312 155 54 313 154 54 314 157 55 315 158 55 316 159 55 317 160 55 318 159 55 319 158 55 320 161 56 321 162 56 322 163 56 323 164 56 324 163 56 325 162 56 326 165 57 327 166 57 328 167 57 329 168 58 330 167 58 331 166 58 332 169 59 333 167 59 334 168 59 335 170 60 336 167 60 337 169 60 338 171 61 339 172 61 340 173 61 341 174 62 342 173 62 343 172 62 344 175 63 345 173 63 346 174 63 347 176 64 348 173 64 349 175 64 350 177 65 351 178 65 352 179 65 353 180 65 354 179 65 355 178 65 356 181 66 357 182 66 358 183 66 359 184 66 360 183 66 361 182 66 362 185 67 363 186 67 364 187 67 365 188 67 366 187 67 367 186 67 368 189 68 369 190 68 370 191 68 371 192 68 372 191 68 373 190 68 374 193 66 375 194 66 376 195 66 377 196 66 378 195 66 379 194 66 380 197 69 381 198 69 382 199 69 383 200 69 384 199 69 385 198 69 386 201 70 387 202 70 388 203 70 389 204 70 390 203 70 391 202 70 392 205 71 393 206 71 394 207 71 395 208 71 396 207 71 397 206 71 398 209 72 399 210 73 400 211 73 401 212 73 402 211 73 403 210 73 404 213 73 405 212 73 406 210 73 407 214 74 408 215 74 409 216 74 410 217 74 411 216 74 412 215 74 413 218 65 414 219 65 415 220 65 416 221 65 417 220 65 418 219 65 419 222 69 420 223 69 421 224 69 422 225 69 423 224 69 424 223 69 425 226 75 426 227 75 427 228 75 428 229 75 429 228 75 430 227 75 431 230 65 432 231 65 433 232 65 434 233 65 435 232 65 436 231 65 437 234 76 438 235 76 439 236 76 440 237 76 441 236 76 442 235 76 443 238 77 444 239 77 445 240 77 446 241 77 447 240 77 448 239 77 449 242 65 450 243 65 451 244 65 452 245 65 453 244 65 454 243 65 455 246 78 456 247 78 457 248 78 458 249 78 459 248 78 460 247 78 461 250 79 462 251 79 463 252 79 464 253 79 465 252 79 466 251 79 467 254 78 468 255 78 469 256 78 470 257 77 471 256 78 472 255 78 473 258 80 474 259 80 475 260 80 476 261 80 477 260 80 478 259 80 479 262 81 480 263 81 481 264 81 482 265 81 483 264 81 484 263 81 485 266 70 486 267 70 487 268 70 488 269 70 489 268 70 490 267 70 491 270 68 492 271 68 493 272 68 494 273 68 495 272 68 496 271 68 497 274 82 498 275 82 499 276 82 500 277 82 501 276 82 502 275 82 503 278 83 504 279 83 505 280 83 506 281 84 507 280 84 508 279 84 509 282 85 510 281 85 511 279 85 512 283 86 513 282 86 514 279 86 515 284 87 516 285 87 517 286 87 518 287 87 519 286 87 520 285 87 521 288 87 522 289 87 523 290 87 524 291 87 525 290 87 526 289 87 527 292 87 528 293 87 529 294 87 530 295 87 531 294 87 532 293 87 533 296 69 534 297 69 535 298 69 536 299 69 537 298 69 538 297 69 539 300 76 540 301 76 541 302 76 542 303 76 543 302 76 544 301 76 545 304 88 546 305 88 547 306 88 548 307 88 549 306 88 550 305 88 551 308 70 552 309 70 553 310 70 554 311 70 555 310 70 556 309 70 557 312 89 558 313 90 559 314 90 560 315 90 561 314 90 562 313 90 563 316 91 564 317 91 565 318 91 566 319 91 567 318 91 568 317 91 569 320 87 570 321 87 571 322 87 572 323 87 573 322 87 574 321 87 575 324 92 576 325 92 577 326 92 578 327 93 579 326 92 580 325 92 581 328 92 582 326 92 583 327 93 584 329 94 585 330 94 586 331 94 587 332 94 588 331 94 589 330 94 590 333 76 591 334 76 592 335 76 593 336 76 594 335 76 595 334 76 596 337 72 597 338 73 598 339 73 599 340 73 600 339 73 601 338 73 602 341 73 603 340 73 604 338 73 605 342 95 606 343 92 607 344 92 608 345 92 609 344 92 610 343 92 611 346 92 612 344 92 613 345 92 614 347 90 615 348 90 616 349 90 617 350 90 618 349 90 619 348 90 620 351 66 621 352 66 622 353 66 623 354 66 624 353 66 625 352 66 626 355 96 627 356 73 628 357 73 629 358 73 630 357 73 631 356 73 632 359 73 633 357 73 634 358 73 635 360 72 636 361 73 637 362 96 638 363 73 639 362 96 640 361 73 641 364 73 642 362 96 643 363 73 644 365 76 645 366 76 646 367 76 647 368 76 648 367 76 649 366 76 650 369 77 651 370 77 652 371 77 653 372 77 654 371 77 655 370 77 656 373 97 657 374 98 658 375 97 659 376 98 660 375 97 661 374 98 662 377 99 663 378 99 664 379 99 665 380 99 666 379 99 667 378 99 668 381 68 669 382 68 670 383 68 671 384 68 672 383 68 673 382 68 674 385 70 675 386 70 676 387 70 677 388 70 678 387 70 679 386 70 680 389 94 681 390 100 682 391 94 683 392 100 684 391 94 685 390 100 686 393 101 687 394 92 688 395 92 689 396 92 690 395 92 691 394 92 692 397 92 693 396 92 694 394 92 695 398 68 696 399 68 697 400 68 698 401 68 699 400 68 700 399 68 701 402 102 702 403 102 703 404 102 704 405 102 705 404 102 706 403 102 707 406 92 708 407 92 709 408 92 710 409 103 711 408 92 712 407 92 713 410 92 714 409 103 715 407 92 716 411 104 717 412 105 718 413 104 719 414 105 720 413 104 721 412 105 722 415 106 723 416 106 724 417 106 725 418 106 726 417 106 727 416 106 728 419 107 729 420 108 730 421 107 731 422 108 732 421 107 733 420 108 734 423 109 735 424 109 736 425 109 737 426 109 738 425 109 739 424 109 740 427 110 741 428 110 742 429 110 743 430 110 744 429 110 745 428 110 746 431 111 747 432 111 748 433 111 749 434 111 750 433 111 751 432 111 752 435 112 753 436 112 754 437 112 755 438 112 756 437 112 757 436 112 758 439 113 759 440 113 760 441 113 761 442 113 762 441 113 763 440 113 764 443 114 765 444 114 766 445 114 767 446 114 768 445 114 769 444 114 770 447 115 771 448 115 772 449 115 773 450 116 774 449 116 775 448 116 776 451 117 777 452 117 778 453 117 779 454 117 780 453 117 781 452 117 782 455 118 783 456 118 784 457 118 785 458 118 786 457 118 787 456 118 788 459 119 789 460 119 790 461 119 791 462 119 792 461 119 793 460 119 794 463 66 795 464 66 796 465 66 797 466 66 798 465 66 799 464 66 800 467 120 801 468 120 802 469 120 803 470 121 804 469 121 805 468 121 806 471 122 807 469 122 808 470 122 809 472 122 810 471 122 811 470 122 812 473 123 813 474 123 814 475 123 815 476 124 816 475 124 817 474 124 818 477 125 819 475 125 820 476 125 821 478 126 822 475 126 823 477 126 824 479 127 825 475 127 826 478 127 827 480 128 828 475 128 829 479 128 830 481 129 831 475 129 832 480 129 833 482 130 834 475 130 835 481 130 836 483 131 837 475 131 838 482 131 839 484 132 840 475 132 841 483 132 842 485 133 843 475 133 844 484 133 845 486 134 846 475 134 847 485 134 848 487 135 849 475 135 850 486 135 851 488 136 852 475 136 853 487 136 854 474 137 855 489 137 856 476 137 857 476 138 858 489 138 859 490 138 860 489 139 861 491 139 862 490 139 863 490 140 864 491 140 865 492 140 866 492 141 867 491 141 868 493 141 869 493 142 870 491 142 871 494 142 872 494 143 873 491 143 874 495 143 875 495 144 876 491 144 877 496 144 878 496 145 879 491 145 880 497 145 881 497 146 882 491 146 883 498 146 884 498 147 885 491 147 886 499 147 887 499 148 888 491 148 889 500 148 890 500 149 891 491 149 892 501 149 893 501 150 894 491 150 895 502 150 896 502 151 897 491 151 898 503 151 899 504 152 900 503 152 901 491 152 902 505 153 903 506 153 904 507 153 905 508 153 906 507 153 907 506 153 908 509 154 909 510 154 910 511 154 911 512 154 912 511 154 913 510 154 914 513 155 915 514 155 916 515 155 917 516 155 918 515 155 919 514 155 920 517 156 921 518 156 922 519 156 923 520 156 924 519 156 925 518 156 926 521 157 927 522 158 928 523 157 929 524 158 930 523 157 931 522 158 932 525 159 933 526 159 934 527 159 935 528 159 936 527 159 937 526 159 938 529 69 939 530 69 940 531 69 941 532 69 942 531 69 943 530 69 944 533 160 945 534 160 946 535 161 947 536 161 948 535 161 949 534 160 950 537 162 951 538 162 952 539 162 953 540 163 954 539 163 955 538 163 956 541 164 957 540 164 958 538 164 959 542 165 960 541 165 961 538 165 962 543 166 963 544 166 964 545 166 965 546 166 966 545 166 967 544 166 968 547 167 969 548 168 970 549 167 971 550 168 972 549 167 973 548 168 974 551 169 975 552 169 976 553 169 977 554 169 978 553 169 979 552 169 980 555 170 981 556 170 982 557 170 983 558 170 984 557 170 985 556 170 986 559 171 987 560 171 988 561 171 989 562 171 990 561 171 991 560 171 992 563 172 993 564 172 994 565 172 995 566 172 996 565 172 997 564 172 998 567 173 999 568 173 1000 569 174 1001 570 174 1002 569 174 1003 568 173 1004 571 175 1005 572 175 1006 573 175 1007 574 175 1008 573 175 1009 572 175 1010 575 176 1011 576 176 1012 577 176 1013 578 176 1014 577 176 1015 576 176 1016 579 91 1017 580 91 1018 581 91 1019 582 91 1020 581 91 1021 580 91 1022 583 74 1023 584 74 1024 585 74 1025 586 74 1026 585 74 1027 584 74 1028 587 176 1029 588 176 1030 589 176 1031 590 176 1032 589 176 1033 588 176 1034 591 81 1035 592 81 1036 593 81 1037 594 81 1038 593 81 1039 592 81 1040 595 71 1041 596 71 1042 597 71 1043 598 71 1044 597 71 1045 596 71 1046 599 82 1047 600 82 1048 601 82 1049 602 82 1050 601 82 1051 600 82 1052 603 99 1053 604 99 1054 605 99 1055 606 99 1056 605 99 1057 604 99 1058 607 88 1059 608 88 1060 609 88 1061 610 88 1062 609 88 1063 608 88 1064 611 79 1065 612 79 1066 613 79 1067 614 79 1068 613 79 1069 612 79 1070 615 75 1071 616 75 1072 617 75 1073 618 75 1074 617 75 1075 616 75 1076 619 80 1077 620 80 1078 621 80 1079 622 80 1080 621 80 1081 620 80 1082 623 102 1083 624 102 1084 625 102 1085 626 102 1086 625 102 1087 624 102 1088 627 67 1089 628 67 1090 629 67 1091 630 67 1092 629 67 1093 628 67 1094 631 177 1095 632 177 1096 633 177 1097 634 178 1098 633 178 1099 632 178 1100 635 179 1101 633 179 1102 634 179 1103 636 180 1104 633 180 1105 635 180 1106 637 181 1107 633 181 1108 636 181 1109 638 182 1110 633 182 1111 637 182 1112 639 183 1113 633 183 1114 638 183 1115 640 184 1116 633 184 1117 639 184 1118 641 185 1119 633 185 1120 640 185 1121 642 186 1122 633 186 1123 641 186 1124 643 187 1125 633 187 1126 642 187 1127 644 188 1128 633 188 1129 643 188 1130 645 8 1131 633 8 1132 644 8 1133 646 42 1134 647 42 1135 648 42 1136 649 189 1137 648 189 1138 647 189 1139 650 190 1140 648 190 1141 649 190 1142 651 191 1143 650 191 1144 649 191 1145 652 192 1146 651 192 1147 649 192 1148 653 193 1149 652 193 1150 649 193 1151 654 194 1152 653 194 1153 649 194 1154 655 195 1155 654 195 1156 649 195 1157 656 196 1158 655 196 1159 649 196 1160 657 197 1161 656 197 1162 649 197 1163 658 198 1164 657 198 1165 649 198 1166 659 199 1167 658 199 1168 649 199 1169 660 42 1170 659 42 1171 649 42 1172 661 172 1173 662 172 1174 663 172 1175 664 172 1176 663 172 1177 662 172 1178 665 200 1179 666 200 1180 667 200 1181 668 201 1182 667 201 1183 666 201 1184 669 202 1185 667 202 1186 668 202 1187 670 203 1188 667 203 1189 669 203 1190 671 204 1191 667 204 1192 670 204 1193 672 205 1194 671 205 1195 670 205 1196 673 206 1197 672 206 1198 670 206 1199 674 207 1200 673 207 1201 670 207 1202 675 208 1203 674 208 1204 670 208 1205 676 209 1206 675 209 1207 670 209 1208 677 210 1209 676 210 1210 670 210 1211 678 211 1212 677 211 1213 670 211 1214 679 212 1215 678 212 1216 670 212 1217 680 213 1218 679 213 1219 670 213 1220 681 214 1221 680 214 1222 670 214 1223 682 215 1224 681 215 1225 670 215 1226 683 216 1227 684 216 1228 685 216 1229 686 217 1230 685 217 1231 684 217 1232 687 218 1233 685 218 1234 686 218 1235 688 219 1236 687 219 1237 686 219 1238 689 220 1239 688 220 1240 686 220 1241 690 221 1242 689 221 1243 686 221 1244 691 222 1245 690 222 1246 686 222 1247 692 223 1248 691 223 1249 686 223 1250 693 224 1251 692 224 1252 686 224 1253 694 225 1254 693 225 1255 686 225 1256 695 226 1257 694 226 1258 686 226 1259 696 227 1260 695 227 1261 686 227 1262 665 228 1263 696 228 1264 686 228 1265 666 229 1266 665 229 1267 686 229 1268 697 230 1269 698 230 1270 699 230 1271 700 231 1272 699 231 1273 698 231 1274 701 122 1275 699 122 1276 700 122 1277 702 232 1278 701 232 1279 700 232 1280 703 233 1281 704 233 1282 705 233 1283 706 233 1284 705 233 1285 704 233 1286 707 234 1287 708 234 1288 709 234 1289 710 235 1290 709 235 1291 708 235 1292 711 236 1293 709 236 1294 710 236 1295 712 237 1296 709 237 1297 711 237 1298 713 238 1299 709 238 1300 712 238 1301 714 239 1302 709 239 1303 713 239 1304 710 240 1305 715 240 1306 711 240 1307 715 241 1308 716 241 1309 711 241 1310 717 242 1311 711 242 1312 716 242 1313 714 243 1314 718 243 1315 709 243 1316 718 244 1317 719 244 1318 709 244 1319 709 245 1320 719 245 1321 720 245 1322 719 246 1323 721 246 1324 720 246 1325 721 247 1326 722 247 1327 720 247 1328 722 248 1329 723 248 1330 720 248 1331 723 249 1332 724 249 1333 720 249 1334 724 250 1335 725 250 1336 720 250 1337 725 251 1338 726 251 1339 720 251 1340 726 252 1341 727 252 1342 720 252 1343 727 253 1344 728 253 1345 720 253 1346 728 254 1347 729 254 1348 720 254 1349 729 255 1350 730 255 1351 720 255 1352 730 256 1353 731 256 1354 720 256 1355 731 257 1356 732 257 1357 720 257 1358 732 258 1359 733 258 1360 720 258 1361 734 259 1362 720 259 1363 733 259 1364 735 260 1365 719 260 1366 718 260 1367 736 261 1368 719 261 1369 735 261 1370 737 262 1371 736 262 1372 735 262 1373 738 263 1374 737 263 1375 735 263 1376 739 264 1377 738 264 1378 735 264 1379 740 265 1380 739 265 1381 735 265 1382 741 266 1383 740 266 1384 735 266 1385 742 267 1386 741 267 1387 735 267 1388 743 268 1389 742 268 1390 735 268 1391 744 269 1392 743 269 1393 735 269 1394 745 270 1395 744 270 1396 735 270 1397 746 271 1398 745 271 1399 735 271 1400 747 272 1401 746 272 1402 735 272 1403 718 273 1404 714 273 1405 748 273 1406 748 274 1407 714 274 1408 749 274 1409 749 275 1410 750 275 1411 748 275 1412 751 276 1413 748 276 1414 750 276 1415 752 277 1416 751 277 1417 750 277 1418 753 278 1419 749 278 1420 714 278 1421 754 279 1422 749 279 1423 753 279 1424 755 172 1425 756 172 1426 757 172 1427 758 172 1428 757 172 1429 756 172 1430 759 79 1431 760 79 1432 761 79 1433 762 79 1434 761 79 1435 760 79 1436 763 102 1437 764 102 1438 765 102 1439 766 102 1440 765 102 1441 764 102 1442 767 176 1443 768 176 1444 769 176 1445 770 176 1446 769 176 1447 768 176 1448 771 71 1449 772 71 1450 773 71 1451 774 71 1452 773 71 1453 772 71 1454 775 67 1455 776 67 1456 777 67 1457 778 67 1458 777 67 1459 776 67 1460 779 88 1461 780 88 1462 781 88 1463 782 88 1464 781 88 1465 780 88 1466 783 99 1467 784 99 1468 785 99 1469 786 99 1470 785 99 1471 784 99 1472 787 75 1473 788 75 1474 789 75 1475 790 75 1476 789 75 1477 788 75 1478 791 81 1479 792 81 1480 793 81 1481 794 81 1482 793 81 1483 792 81 1484 795 91 1485 796 91 1486 797 91 1487 798 91 1488 797 91 1489 796 91 1490 799 82 1491 800 82 1492 801 82 1493 802 82 1494 801 82 1495 800 82 1496 803 80 1497 804 80 1498 805 80 1499 806 80 1500 805 80 1501 804 80 1502 807 91 1503 808 91 1504 809 91 1505 810 91 1506 809 91 1507 808 91 1508 811 81 1509 812 81 1510 813 81 1511 814 81 1512 813 81 1513 812 81 1514 815 82 1515 816 82 1516 817 82 1517 818 82 1518 817 82 1519 816 82 1520 819 75 1521 820 75 1522 821 75 1523 822 75 1524 821 75 1525 820 75 1526 823 88 1527 824 88 1528 825 88 1529 826 88 1530 825 88 1531 824 88 1532 827 177 1533 828 177 1534 829 177 1535 830 178 1536 829 178 1537 828 178 1538 831 280 1539 829 280 1540 830 280 1541 832 281 1542 829 281 1543 831 281 1544 833 282 1545 829 282 1546 832 282 1547 834 283 1548 829 283 1549 833 283 1550 835 284 1551 829 284 1552 834 284 1553 836 285 1554 829 285 1555 835 285 1556 837 185 1557 829 185 1558 836 185 1559 838 186 1560 829 186 1561 837 186 1562 839 286 1563 829 286 1564 838 286 1565 840 287 1566 829 287 1567 839 287 1568 841 8 1569 829 8 1570 840 8 1571 842 102 1572 843 102 1573 844 102 1574 845 102 1575 844 102 1576 843 102 1577 846 80 1578 847 80 1579 848 80 1580 849 80 1581 848 80 1582 847 80 1583 850 71 1584 851 71 1585 852 71 1586 853 71 1587 852 71 1588 851 71 1589 854 79 1590 855 79 1591 856 79 1592 857 79 1593 856 79 1594 855 79 1595 858 67 1596 859 67 1597 860 67 1598 861 67 1599 860 67 1600 859 67 1601 862 172 1602 863 172 1603 864 172 1604 865 172 1605 864 172 1606 863 172 1607 866 288 1608 867 288 1609 868 288 1610 869 289 1611 868 289 1612 867 289 1613 870 290 1614 868 290 1615 869 290 1616 871 291 1617 870 291 1618 869 291 1619 872 292 1620 871 292 1621 869 292 1622 873 293 1623 872 293 1624 869 293 1625 874 294 1626 873 294 1627 869 294 1628 875 295 1629 874 295 1630 869 295 1631 876 196 1632 875 196 1633 869 196 1634 877 197 1635 876 197 1636 869 197 1637 878 296 1638 877 296 1639 869 296 1640 879 297 1641 878 297 1642 869 297 1643 880 42 1644 879 42 1645 869 42 1646 881 176 1647 882 176 1648 883 176 1649 884 176 1650 883 176 1651 882 176 1652 885 99 1653 886 99 1654 887 99 1655 888 99 1656 887 99 1657 886 99 1658 889 172 1659 890 172 1660 891 172 1661 892 298 1662 891 298 1663 890 298 1664 893 299 1665 894 299 1666 895 299 1667 896 300 1668 895 300 1669 894 300 1670 897 301 1671 896 301 1672 894 301 1673 898 302 1674 896 302 1675 897 302 1676 899 303 1677 896 303 1678 898 303 1679 900 304 1680 896 304 1681 899 304 1682 901 305 1683 896 305 1684 900 305 1685 902 306 1686 896 306 1687 901 306 1688 903 307 1689 896 307 1690 902 307 1691 904 308 1692 896 308 1693 903 308 1694 905 309 1695 896 309 1696 904 309 1697 906 310 1698 896 310 1699 905 310 1700 907 311 1701 896 311 1702 906 311 1703 908 312 1704 896 312 1705 907 312 1706 909 313 1707 896 313 1708 908 313 1709 910 313 1710 909 313 1711 908 313 1712 911 314 1713 910 314 1714 908 314 1715 912 315 1716 910 315 1717 911 315 1718 913 316 1719 910 316 1720 912 316 1721 914 317 1722 910 317 1723 913 317 1724 915 318 1725 910 318 1726 914 318 1727 916 319 1728 910 319 1729 915 319 1730 917 320 1731 910 320 1732 916 320 1733 918 321 1734 910 321 1735 917 321 1736 919 322 1737 910 322 1738 918 322 1739 920 323 1740 910 323 1741 919 323 1742 921 324 1743 910 324 1744 920 324 1745 922 325 1746 910 325 1747 921 325 1748 923 326 1749 924 326 1750 925 326 1751 926 326 1752 925 326 1753 924 326 1754 927 327 1755 928 327 1756 929 327 1757 930 328 1758 929 328 1759 928 328 1760 931 42 1761 932 42 1762 933 42 1763 934 42 1764 933 42 1765 932 42 1766 935 42 1767 933 42 1768 934 42 1769 936 42 1770 933 42 1771 935 42 1772 937 42 1773 936 42 1774 935 42 1775 938 329 1776 936 329 1777 937 329 1778 939 42 1779 936 42 1780 938 42 1781 940 42 1782 939 42 1783 938 42 1784 941 330 1785 939 330 1786 940 330 1787 942 42 1788 941 42 1789 940 42 1790 943 42 1791 941 42 1792 942 42 1793 944 42 1794 943 42 1795 942 42 1796 945 42 1797 943 42 1798 944 42 1799 946 42 1800 943 42 1801 945 42 1802 947 331 1803 946 331 1804 945 331 1805 948 42 1806 946 42 1807 947 42 1808 949 42 1809 948 42 1810 947 42 1811 950 42 1812 948 42 1813 949 42 1814 951 332 1815 948 332 1816 950 332 1817 952 333 1818 951 333 1819 950 333 1820 953 42 1821 951 42 1822 952 42 1823 954 334 1824 951 334 1825 953 334 1826 955 335 1827 954 335 1828 953 335 1829 956 336 1830 951 336 1831 954 336 1832 957 42 1833 954 42 1834 955 42 1835 958 42 1836 959 42 1837 960 42 1838 961 42 1839 960 42 1840 959 42 1841 931 337 1842 960 337 1843 961 337 1844 932 338 1845 931 338 1846 961 338 1847 962 339 1848 963 339 1849 964 339 1850 965 340 1851 964 340 1852 963 340 1853 966 341 1854 967 341 1855 968 341 1856 969 342 1857 968 342 1858 967 342 1859 970 8 1860 971 8 1861 972 8 1862 973 343 1863 972 343 1864 971 343 1865 974 8 1866 972 8 1867 973 8 1868 975 8 1869 972 8 1870 974 8 1871 976 8 1872 972 8 1873 975 8 1874 977 8 1875 972 8 1876 976 8 1877 978 8 1878 977 8 1879 976 8 1880 979 8 1881 978 8 1882 976 8 1883 980 10 1884 978 10 1885 979 10 1886 981 8 1887 980 8 1888 979 8 1889 982 8 1890 981 8 1891 979 8 1892 983 8 1893 981 8 1894 982 8 1895 984 344 1896 983 344 1897 982 344 1898 985 345 1899 983 345 1900 984 345 1901 986 13 1902 985 13 1903 984 13 1904 987 8 1905 986 8 1906 984 8 1907 988 8 1908 986 8 1909 987 8 1910 989 8 1911 988 8 1912 987 8 1913 990 346 1914 988 346 1915 989 346 1916 991 347 1917 990 347 1918 989 347 1919 992 8 1920 990 8 1921 991 8 1922 993 8 1923 992 8 1924 991 8 1925 994 8 1926 993 8 1927 991 8 1928 995 348 1929 993 348 1930 994 348 1931 996 8 1932 995 8 1933 994 8 1934 997 349 1935 996 349 1936 994 349 1937 998 350 1938 997 350 1939 994 350 1940 999 8 1941 997 8 1942 998 8 1943 1000 341 1944 1001 341 1945 1002 341 1946 1003 351 1947 1002 351 1948 1001 351 1949 1004 339 1950 1005 339 1951 1006 339 1952 1007 352 1953 1006 352 1954 1005 352 1955 1008 353 1956 1009 353 1957 1010 353 1958 1011 354 1959 1010 354 1960 1009 354 1961 1012 355 1962 1010 355 1963 1011 355 1964 1013 356 1965 1010 356 1966 1012 356 1967 1014 357 1968 1013 357 1969 1012 357 1970 1015 358 1971 1013 358 1972 1014 358 1973 1016 359 1974 1013 359 1975 1015 359 1976 1017 360 1977 1013 360 1978 1016 360 1979 1018 361 1980 1019 361 1981 1020 361 1982 1021 362 1983 1020 362 1984 1019 362 1985 1022 363 1986 1021 363 1987 1019 363 1988 1023 364 1989 1022 364 1990 1019 364 1991 1024 365 1992 1023 365 1993 1019 365 1994 1025 366 1995 1023 366 1996 1024 366 1997 1026 367 1998 1025 367 1999 1024 367 2000 1027 368 2001 1026 368 2002 1024 368 2003 1028 369 2004 1029 369 2005 1030 369 2006 1031 370 2007 1032 370 2008 1033 370 2009 1034 371 2010 1035 371 2011 1036 371 2012 1037 372 2013 1036 372 2014 1035 372 2015 1038 122 2016 1039 122 2017 1040 122 2018 1041 122 2019 1040 122 2020 1039 122 2021 1042 74 2022 1043 74 2023 1044 74 2024 1045 373 2025 1044 373 2026 1043 373 2027 1046 122 2028 1047 122 2029 1048 122 2030 1049 122 2031 1048 122 2032 1047 122 2033 1039 374 2034 1050 374 2035 1041 374 2036 1051 375 2037 1041 375 2038 1050 375 2039 1052 232 2040 1053 232 2041 1054 232 2042 1055 232 2043 1054 232 2044 1053 232 2045 1056 376 2046 1057 376 2047 1058 376 2048 929 377 2049 1058 377 2050 1057 377 2051 1059 378 2052 1058 378 2053 929 378 2054 1060 379 2055 929 379 2056 1057 379 2057 930 380 2058 1059 380 2059 929 380 2060 928 381 2061 1059 381 2062 930 381 2063 1061 382 2064 1059 382 2065 928 382 2066 1062 383 2067 1059 383 2068 1061 383 2069 1063 232 2070 1064 232 2071 1065 232 2072 1066 232 2073 1065 232 2074 1064 232 2075 1067 384 2076 1068 384 2077 1069 384 2078 1031 385 2079 1069 385 2080 1068 385 2081 1033 386 2082 1069 386 2083 1031 386 2084 1070 387 2085 1069 387 2086 1033 387 2087 1071 388 2088 1070 388 2089 1033 388 2090 1072 389 2091 1070 389 2092 1071 389 2093 1073 390 2094 1072 390 2095 1071 390 2096 1074 391 2097 1073 391 2098 1071 391 2099 1075 392 2100 1074 392 2101 1071 392 2102 1076 122 2103 1077 122 2104 1078 122 2105 1079 122 2106 1078 122 2107 1077 122 2108 1080 393 2109 1081 393 2110 1082 393 2111 1083 74 2112 1082 74 2113 1081 74 2114 1084 8 2115 1085 8 2116 1086 8 2117 1087 8 2118 1086 8 2119 1085 8 2120 1088 42 2121 1089 42 2122 1090 42 2123 1091 42 2124 1090 42 2125 1089 42 2126 1030 394 2127 1092 394 2128 1093 394 2129 1094 395 2130 1093 395 2131 1092 395 2132 1095 396 2133 1093 396 2134 1094 396 2135 1096 397 2136 1093 397 2137 1095 397 2138 1097 398 2139 1093 398 2140 1096 398 2141 1092 399 2142 1030 399 2143 1098 399 2144 1030 400 2145 1029 400 2146 1098 400 2147 1029 401 2148 1099 401 2149 1098 401 2150 1100 402 2151 1098 402 2152 1099 402 2153 1101 403 2154 1102 403 2155 1103 403 2156 1104 404 2157 1103 404 2158 1102 404 2159 1105 403 2160 1103 403 2161 1104 403 2162 1106 405 2163 1105 405 2164 1104 405 2165 1107 406 2166 1105 406 2167 1106 406 2168 1108 407 2169 1105 407 2170 1107 407 2171 1109 408 2172 1110 408 2173 1111 408 2174 1112 409 2175 1111 409 2176 1110 409 2177 1113 410 2178 1111 410 2179 1112 410 2180 1114 411 2181 1110 411 2182 1109 411 2183 1115 412 2184 1114 412 2185 1109 412 2186 1116 413 2187 1113 413 2188 1112 413 2189 1117 414 2190 1113 414 2191 1116 414 2192 1118 415 2193 1113 415 2194 1117 415 2195 1119 42 2196 1113 42 2197 1118 42 2198 1115 416 2199 1109 416 2200 1120 416 2201 1120 42 2202 1109 42 2203 1121 42 2204 1109 42 2205 1122 42 2206 1121 42 2207 1121 42 2208 1122 42 2209 1123 42 2210 1122 42 2211 1124 42 2212 1123 42 2213 1124 42 2214 1125 42 2215 1123 42 2216 1125 417 2217 1126 417 2218 1123 417 2219 1123 418 2220 1126 418 2221 1127 418 2222 1127 419 2223 1126 419 2224 1128 419 2225 1128 420 2226 1126 420 2227 1129 420 2228 1129 421 2229 1126 421 2230 1130 421 2231 1130 422 2232 1126 422 2233 1131 422 2234 1131 423 2235 1126 423 2236 1132 423 2237 1132 424 2238 1126 424 2239 1133 424 2240 1126 425 2241 1134 425 2242 1133 425 2243 1133 426 2244 1134 426 2245 1135 426 2246 1136 427 2247 1135 427 2248 1134 427 2249 1137 428 2250 1135 428 2251 1136 428 2252 1138 429 2253 1137 429 2254 1136 429 2255 1139 8 2256 1140 8 2257 1141 8 2258 1142 8 2259 1141 8 2260 1140 8 2261 1143 8 2262 1141 8 2263 1142 8 2264 1144 430 2265 1143 430 2266 1142 430 2267 1145 431 2268 1144 431 2269 1142 431 2270 1146 8 2271 1144 8 2272 1145 8 2273 1147 432 2274 1146 432 2275 1145 432 2276 1148 433 2277 1147 433 2278 1145 433 2279 1149 434 2280 1148 434 2281 1145 434 2282 1150 435 2283 1148 435 2284 1149 435 2285 1151 436 2286 1150 436 2287 1149 436 2288 1152 437 2289 1151 437 2290 1149 437 2291 1153 8 2292 1152 8 2293 1149 8 2294 1140 8 2295 1139 8 2296 1154 8 2297 1154 8 2298 1139 8 2299 1155 8 2300 1155 438 2301 1139 438 2302 1156 438 2303 1139 439 2304 1157 439 2305 1156 439 2306 1157 440 2307 1158 440 2308 1156 440 2309 1158 441 2310 1159 441 2311 1156 441 2312 1159 442 2313 1160 442 2314 1156 442 2315 1160 443 2316 1161 443 2317 1156 443 2318 1161 444 2319 1162 444 2320 1156 444 2321 1162 445 2322 1163 445 2323 1156 445 2324 1156 446 2325 1163 446 2326 1164 446 2327 1163 447 2328 1165 447 2329 1164 447 2330 1165 448 2331 1166 448 2332 1164 448 2333 1166 449 2334 1167 449 2335 1164 449 2336 1168 450 2337 1164 450 2338 1167 450 2339 1169 451 2340 1170 451 2341 1171 451 2342 1172 452 2343 1171 452 2344 1170 452 2345 1171 453 2346 1172 453 2347 1173 453 2348 1174 454 2349 1173 454 2350 1172 454 2351 1175 455 2352 140 455 2353 1176 455 2354 138 456 2355 1176 456 2356 140 456 2357 959 457 2358 1176 457 2359 138 457 2360 1177 458 2361 1176 458 2362 959 458 2363 965 459 2364 963 459 2365 1178 459 2366 1179 460 2367 1178 460 2368 963 460 2369 1180 172 2370 1179 172 2371 963 172 2372 968 461 2373 969 461 2374 1181 461 2375 1182 462 2376 1181 462 2377 969 462 2378 1183 122 2379 1181 122 2380 1182 122 2381 716 463 2382 715 463 2383 708 463 2384 710 464 2385 708 464 2386 715 464 2387 1184 454 2388 1185 454 2389 1186 454 2390 1187 465 2391 1186 465 2392 1185 465 2393 1185 454 2394 1184 454 2395 1188 454 2396 1189 466 2397 1188 466 2398 1184 466 2399 749 467 2400 754 467 2401 750 467 2402 752 468 2403 750 468 2404 754 468 2405 997 469 2406 999 469 2407 16 469 2408 1190 470 2409 16 470 2410 999 470 2411 17 8 2412 16 8 2413 1190 8 2414 1191 471 2415 17 471 2416 1190 471 2417 1003 462 2418 1192 462 2419 1002 462 2420 1193 472 2421 1002 472 2422 1192 472 2423 1194 122 2424 1193 122 2425 1192 122 2426 1005 352 2427 1195 352 2428 1007 352 2429 1196 473 2430 1007 473 2431 1195 473 2432 1197 172 2433 1007 172 2434 1196 172 2435 1198 474 2436 1199 474 2437 1200 474 2438 1201 471 2439 1200 471 2440 1199 471 2441 1202 475 2442 1203 475 2443 1204 475 2444 1205 476 2445 1204 476 2446 1203 476 2447 1206 477 2448 1207 477 2449 1208 477 2450 1208 478 2451 1207 478 2452 1209 478 2453 1209 479 2454 1207 479 2455 1210 479 2456 1210 480 2457 1207 480 2458 1211 480 2459 1212 481 2460 1211 481 2461 1207 481 2462 1213 482 2463 1209 482 2464 1210 482 2465 1214 172 2466 703 172 2467 1215 172 2468 705 172 2469 1215 172 2470 703 172 2471 706 483 2472 1215 483 2473 705 483 2474 1216 172 2475 1215 172 2476 706 172 2477 1216 484 2478 706 484 2479 1217 484 2480 1217 485 2481 706 485 2482 1218 485 2483 1218 486 2484 706 486 2485 1219 486 2486 704 172 2487 1219 172 2488 706 172 2489 924 74 2490 1220 74 2491 926 74 2492 1221 74 2493 926 74 2494 1220 74 2495 1222 74 2496 923 74 2497 1223 74 2498 925 74 2499 1223 74 2500 923 74 2501 1224 172 2502 1225 172 2503 1226 172 2504 1227 487 2505 1228 487 2506 1229 487 2507 1230 488 2508 1231 488 2509 1232 488 2510 1233 172 2511 1234 172 2512 1235 172 2513 1092 489 2514 1098 489 2515 1094 489 2516 1095 490 2517 1094 490 2518 1098 490 2519 1069 491 2520 1070 491 2521 1073 491 2522 1072 492 2523 1073 492 2524 1070 492 2525 1057 493 2526 1061 493 2527 927 493 2528 928 494 2529 927 494 2530 1061 494 2531 1236 495 2532 1212 495 2533 1206 495 2534 1207 496 2535 1206 496 2536 1212 496 2537 1208 497 2538 1209 497 2539 1237 497 2540 1213 498 2541 1237 498 2542 1209 498 2543

+ + + + + + + 0.8897584 -0.463859 0.8003035 1.315013 1.497067 -1 0.8897584 -1.703711 0.8242678 1.315013 -2.658771 -1 -0.8897584 -0.463859 0.8003035 -1.315013 1.497067 -1 -0.8897584 -1.703711 0.8242678 -1.315013 -2.658771 -1 -0.9862595 -3.305811 -0.790426 -0.9862595 -3.142889 0.209574 0.9862595 -3.142889 0.209574 0.9862595 -3.305811 -0.790426 0.9862595 2.32828 -0.8612616 -0.9862595 2.32828 -0.8612616 0.9862595 2.32828 -0.2650246 -0.9862595 2.32828 -0.2650246 1.292753 0.4100483 -0.002020597 1.319143 -2.045174 0.1720353 -1.292753 0.4100483 -0.002020597 -1.319143 -2.045174 0.1720356 + + + + + + + + + + 0 0.01932471 0.9998133 0 -0.3081364 -0.9513423 -0.8727803 0.04384464 0.4861401 0 0 -1 0.8727804 0.04384464 0.4861401 0 0.3564792 0.9343033 0 -0.9869868 0.1608016 0 -0.3927869 0.9196295 0.7623983 -0.21027 0.611993 -0.9482683 -0.2826182 0.1446174 0 1 0 0.9578633 0.1833587 0.2210829 -0.7659848 0.2058865 0.6089976 0 0.1646333 -0.9863549 0.9997513 0 0.02229923 0.7659848 0.2058864 0.6089976 0.898351 -0.4335622 0.07063674 -0.9997514 0 0.02229923 -0.9299094 0.3677889 0 -0.7623982 -0.2102699 0.6119932 0 -0.3081364 -0.9513422 -0.8377318 0.01055276 0.54598 0.8377319 0.01055288 0.5459798 0 0.3564792 0.9343032 0 -0.3927869 0.9196295 -0.898351 -0.4335622 0.07063674 0.9299094 0.3677889 0 0 0.1646333 -0.9863548 0.9999098 0.01012217 -0.008822977 0.9482683 -0.2826185 0.1446174 -0.9999099 0.010122 -0.008822977 -0.9578633 0.1833587 0.2210829 + + + + + + + + + + 0.875 0.5 0.625 0.75 0.625 0.5 0.375 0.75 0.125 0.75 0.125 0.75 0.5356172 0 0.625 0.25 0.5135849 0.25 0.375 0.5 0.125 0.75 0.125 0.5 0.625 0.5 0.5356172 0.75 0.5135849 0.5 0.625 0.5 0.875 0.5 0.875 0.5 0.625 0.75 0.375 1 0.375 0.75 0.875 0.75 0.625 0.75 0.625 0.75 0.5356172 0.75 0.625 0.75 0.625 0.75 0.375 0 0.625 0 0.5356172 0 0.625 0.25 0.375 0.5 0.375 0.25 0.375 0.5 0.625 0.5 0.5135849 0.5 0.5135849 0.25 0.625 0.25 0.625 0.25 0.125 0.5 0.375 0.5 0.375 0.5 0.5135849 0.5 0.375 0.75 0.375 0.5 0.625 0.5 0.5135849 0.5 0.625 0.5 0.375 0.75 0.625 0.75 0.375 0.75 0.375 0 0.5135849 0.25 0.375 0.25 0.375 0.25 0.625 0.25 0.375 0.25 0.625 0 0.5356172 0 0.625 0 0.875 0.5 0.875 0.75 0.625 0.75 0.375 0.75 0.375 0.75 0.125 0.75 0.5356172 0 0.625 0 0.625 0.25 0.375 0.5 0.375 0.75 0.125 0.75 0.625 0.5 0.625 0.75 0.5356172 0.75 0.625 0.5 0.625 0.5 0.875 0.5 0.625 0.75 0.625 1 0.375 1 0.875 0.75 0.875 0.75 0.625 0.75 0.375 0 0.375 0 0.625 0 0.625 0.25 0.625 0.5 0.375 0.5 0.375 0.5 0.375 0.5 0.625 0.5 0.125 0.5 0.125 0.5 0.375 0.5 0.5135849 0.5 0.5356172 0.75 0.375 0.75 0.375 0.75 0.5356172 0.75 0.625 0.75 0.375 0 0.5356172 0 0.5135849 0.25 0.375 0.25 0.5135849 0.25 0.625 0.25 + + + + + + + + + + + + + + +

4 0 0 2 0 1 0 0 2 3 1 3 8 1 4 7 1 5 19 2 6 4 2 7 18 2 8 1 3 9 7 3 10 5 3 11 0 4 12 17 4 13 16 4 14 0 5 15 15 5 16 4 5 17 10 6 18 8 6 19 11 6 20 6 7 21 10 7 22 2 7 23 17 8 24 2 8 25 10 8 26 7 9 27 9 9 28 19 9 29 15 10 30 12 10 31 13 10 32 1 11 33 14 11 34 16 11 35 18 12 36 4 12 37 15 12 38 5 13 39 12 13 40 1 13 41 16 14 42 3 14 43 1 14 44 0 15 45 16 15 46 14 15 47 3 16 48 10 16 49 11 16 50 7 17 51 18 17 52 5 17 53 5 18 54 15 18 55 13 18 56 6 19 57 19 19 58 9 19 59 4 0 60 6 0 61 2 0 62 3 20 63 11 20 64 8 20 65 19 21 66 6 21 67 4 21 68 1 3 69 3 3 70 7 3 71 0 22 72 2 22 73 17 22 74 0 23 75 14 23 76 15 23 77 10 6 78 9 6 79 8 6 80 6 24 81 9 24 82 10 24 83 7 25 84 8 25 85 9 25 86 15 10 87 14 10 88 12 10 89 1 26 90 12 26 91 14 26 92 5 27 93 13 27 94 12 27 95 16 28 96 17 28 97 3 28 98 3 29 99 17 29 100 10 29 101 7 30 102 19 30 103 18 30 104 5 31 105 18 31 106 15 31 107

+
+
+
+ + + + + + + 0.04166662 0.08333331 0.125 0.1666666 0.2083333 0.25 0.2916666 0.3333333 0.375 0.4166666 0.4583333 0.5 0.5416667 0.5833333 0.625 0.6666667 0.7083333 0.75 0.7916667 0.8333333 0.875 0.9166667 0.9583333 1 1.041667 1.083333 1.125 1.166667 1.208333 1.25 1.291667 1.333333 1.375 1.416667 1.458333 1.5 1.541667 1.583333 1.625 1.666667 1.708333 1.75 1.791667 1.833333 1.875 1.916667 1.958333 2 2.041667 2.083333 2.125 2.166667 2.208333 2.25 2.291667 2.333333 2.375 2.416667 2.458333 2.5 2.541667 2.583333 2.625 2.666667 2.708333 2.75 2.791667 2.833333 2.875 2.916667 2.958333 3 3.041667 3.083333 3.125 3.166667 3.208333 3.25 3.291667 3.333333 3.375 3.416667 3.458333 3.5 3.541667 3.583333 3.625 3.666667 3.708333 3.75 3.791667 3.833333 3.875 3.916667 3.958333 4 4.041666 4.083333 4.125 4.166666 4.208333 4.25 4.291666 4.333333 4.375 4.416666 4.458333 4.5 4.541666 4.583333 4.625 4.666666 4.708333 4.75 4.791666 4.833333 4.875 4.916666 4.958333 5 5.041666 5.083333 5.125 5.166666 5.208333 5.25 5.291666 5.333333 5.375 5.416666 5.458333 5.5 5.541666 5.583333 5.625 5.666666 5.708333 5.75 5.791666 5.833333 5.875 5.916666 5.958333 6 6.041666 6.083333 6.125 6.166666 6.208333 6.25 6.291666 6.333333 6.375 6.416666 6.458333 6.5 6.541666 6.583333 6.625 6.666666 6.708333 6.75 6.791666 6.833333 6.875 6.916666 6.958333 7 7.041666 7.083333 7.125 7.166666 7.208333 7.25 7.291666 7.333333 7.375 7.416666 7.458333 7.5 7.541666 7.583333 7.625 7.666666 7.708333 7.75 7.791666 7.833333 7.875 7.916666 7.958333 8 8.041667 8.083333 8.125 8.166667 8.208333 8.25 8.291667 8.333333 8.375 8.416667 8.458333 8.5 8.541667 8.583333 8.625 8.666667 8.708333 8.75 8.791667 8.833333 8.875 8.916667 8.958333 9 9.041667 9.083333 9.125 9.166667 9.208333 9.25 9.291667 9.333333 9.375 9.416667 9.458333 9.5 9.541667 9.583333 9.625 9.666667 9.708333 9.75 9.791667 9.833333 9.875 9.916667 9.958333 10 10.04167 10.08333 10.125 10.16667 10.20833 10.25 10.29167 10.33333 10.375 10.41667 + + + + + + + + 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.6380447 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.6380447 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.6380447 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.6380447 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.6380447 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.6380447 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.6380447 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 1 2.69074e-14 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.78547e-9 -0.9999892 0.004656792 0.9881917 0 0 0 1 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + 0.04166662 0.08333331 0.125 0.1666666 0.2083333 0.25 0.2916666 0.3333333 0.375 0.4166666 0.4583333 0.5 0.5416667 0.5833333 0.625 0.6666667 0.7083333 0.75 0.7916667 0.8333333 0.875 0.9166667 0.9583333 1 1.041667 1.083333 1.125 1.166667 1.208333 1.25 1.291667 1.333333 1.375 1.416667 1.458333 1.5 1.541667 1.583333 1.625 1.666667 1.708333 1.75 1.791667 1.833333 1.875 1.916667 1.958333 2 2.041667 2.083333 2.125 2.166667 2.208333 2.25 2.291667 2.333333 2.375 2.416667 2.458333 2.5 2.541667 2.583333 2.625 2.666667 2.708333 2.75 2.791667 2.833333 2.875 2.916667 2.958333 3 3.041667 3.083333 3.125 3.166667 3.208333 3.25 3.291667 3.333333 3.375 3.416667 3.458333 3.5 3.541667 3.583333 3.625 3.666667 3.708333 3.75 3.791667 3.833333 3.875 3.916667 3.958333 4 4.041666 4.083333 4.125 4.166666 4.208333 4.25 4.291666 4.333333 4.375 4.416666 4.458333 4.5 4.541666 4.583333 4.625 4.666666 4.708333 4.75 4.791666 4.833333 4.875 4.916666 4.958333 5 5.041666 5.083333 5.125 5.166666 5.208333 5.25 5.291666 5.333333 5.375 5.416666 5.458333 5.5 5.541666 5.583333 5.625 5.666666 5.708333 5.75 5.791666 5.833333 5.875 5.916666 5.958333 6 6.041666 6.083333 6.125 6.166666 6.208333 6.25 6.291666 6.333333 6.375 6.416666 6.458333 6.5 6.541666 6.583333 6.625 6.666666 6.708333 6.75 6.791666 6.833333 6.875 6.916666 6.958333 7 7.041666 7.083333 7.125 7.166666 7.208333 7.25 7.291666 7.333333 7.375 7.416666 7.458333 7.5 7.541666 7.583333 7.625 7.666666 7.708333 7.75 7.791666 7.833333 7.875 7.916666 7.958333 8 8.041667 8.083333 8.125 8.166667 8.208333 8.25 8.291667 8.333333 8.375 8.416667 8.458333 8.5 8.541667 8.583333 8.625 8.666667 8.708333 8.75 8.791667 8.833333 8.875 8.916667 8.958333 9 9.041667 9.083333 9.125 9.166667 9.208333 9.25 9.291667 9.333333 9.375 9.416667 9.458333 9.5 9.541667 9.583333 9.625 9.666667 9.708333 9.75 9.791667 9.833333 9.875 9.916667 9.958333 10 10.04167 10.08333 10.125 10.16667 10.20833 10.25 10.29167 10.33333 10.375 10.41667 + + + + + + + + 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 0.8568032 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 0.8568032 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 0.8568032 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 0.8568032 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 0.8568032 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 0.8568032 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 0.8568032 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 1 -1.04361e-14 2.38419e-7 -1.013585 -2.38395e-7 0.01410433 0.9999006 -1.82486 -3.36275e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + 0.04166662 0.08333331 0.125 0.1666666 0.2083333 0.25 0.2916666 0.3333333 0.375 0.4166666 0.4583333 0.5 0.5416667 0.5833333 0.625 0.6666667 0.7083333 0.75 0.7916667 0.8333333 0.875 0.9166667 0.9583333 1 1.041667 1.083333 1.125 1.166667 1.208333 1.25 1.291667 1.333333 1.375 1.416667 1.458333 1.5 1.541667 1.583333 1.625 1.666667 1.708333 1.75 1.791667 1.833333 1.875 1.916667 1.958333 2 2.041667 2.083333 2.125 2.166667 2.208333 2.25 2.291667 2.333333 2.375 2.416667 2.458333 2.5 2.541667 2.583333 2.625 2.666667 2.708333 2.75 2.791667 2.833333 2.875 2.916667 2.958333 3 3.041667 3.083333 3.125 3.166667 3.208333 3.25 3.291667 3.333333 3.375 3.416667 3.458333 3.5 3.541667 3.583333 3.625 3.666667 3.708333 3.75 3.791667 3.833333 3.875 3.916667 3.958333 4 4.041666 4.083333 4.125 4.166666 4.208333 4.25 4.291666 4.333333 4.375 4.416666 4.458333 4.5 4.541666 4.583333 4.625 4.666666 4.708333 4.75 4.791666 4.833333 4.875 4.916666 4.958333 5 5.041666 5.083333 5.125 5.166666 5.208333 5.25 5.291666 5.333333 5.375 5.416666 5.458333 5.5 5.541666 5.583333 5.625 5.666666 5.708333 5.75 5.791666 5.833333 5.875 5.916666 5.958333 6 6.041666 6.083333 6.125 6.166666 6.208333 6.25 6.291666 6.333333 6.375 6.416666 6.458333 6.5 6.541666 6.583333 6.625 6.666666 6.708333 6.75 6.791666 6.833333 6.875 6.916666 6.958333 7 7.041666 7.083333 7.125 7.166666 7.208333 7.25 7.291666 7.333333 7.375 7.416666 7.458333 7.5 7.541666 7.583333 7.625 7.666666 7.708333 7.75 7.791666 7.833333 7.875 7.916666 7.958333 8 8.041667 8.083333 8.125 8.166667 8.208333 8.25 8.291667 8.333333 8.375 8.416667 8.458333 8.5 8.541667 8.583333 8.625 8.666667 8.708333 8.75 8.791667 8.833333 8.875 8.916667 8.958333 9 9.041667 9.083333 9.125 9.166667 9.208333 9.25 9.291667 9.333333 9.375 9.416667 9.458333 9.5 9.541667 9.583333 9.625 9.666667 9.708333 9.75 9.791667 9.833333 9.875 9.916667 9.958333 10 10.04167 10.08333 10.125 10.16667 10.20833 10.25 10.29167 10.33333 10.375 10.41667 + + + + + + + + 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 0.8520589 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 0.8520589 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 0.8520589 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 0.8520589 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 0.8520589 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 0.8520589 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 0.8520589 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + 0.04166662 0.08333331 0.125 0.1666666 0.2083333 0.25 0.2916666 0.3333333 0.375 0.4166666 0.4583333 0.5 0.5416667 0.5833333 0.625 0.6666667 0.7083333 0.75 0.7916667 0.8333333 0.875 0.9166667 0.9583333 1 1.041667 1.083333 1.125 1.166667 1.208333 1.25 1.291667 1.333333 1.375 1.416667 1.458333 1.5 1.541667 1.583333 1.625 1.666667 1.708333 1.75 1.791667 1.833333 1.875 1.916667 1.958333 2 2.041667 2.083333 2.125 2.166667 2.208333 2.25 2.291667 2.333333 2.375 2.416667 2.458333 2.5 2.541667 2.583333 2.625 2.666667 2.708333 2.75 2.791667 2.833333 2.875 2.916667 2.958333 3 3.041667 3.083333 3.125 3.166667 3.208333 3.25 3.291667 3.333333 3.375 3.416667 3.458333 3.5 3.541667 3.583333 3.625 3.666667 3.708333 3.75 3.791667 3.833333 3.875 3.916667 3.958333 4 4.041666 4.083333 4.125 4.166666 4.208333 4.25 4.291666 4.333333 4.375 4.416666 4.458333 4.5 4.541666 4.583333 4.625 4.666666 4.708333 4.75 4.791666 4.833333 4.875 4.916666 4.958333 5 5.041666 5.083333 5.125 5.166666 5.208333 5.25 5.291666 5.333333 5.375 5.416666 5.458333 5.5 5.541666 5.583333 5.625 5.666666 5.708333 5.75 5.791666 5.833333 5.875 5.916666 5.958333 6 6.041666 6.083333 6.125 6.166666 6.208333 6.25 6.291666 6.333333 6.375 6.416666 6.458333 6.5 6.541666 6.583333 6.625 6.666666 6.708333 6.75 6.791666 6.833333 6.875 6.916666 6.958333 7 7.041666 7.083333 7.125 7.166666 7.208333 7.25 7.291666 7.333333 7.375 7.416666 7.458333 7.5 7.541666 7.583333 7.625 7.666666 7.708333 7.75 7.791666 7.833333 7.875 7.916666 7.958333 8 8.041667 8.083333 8.125 8.166667 8.208333 8.25 8.291667 8.333333 8.375 8.416667 8.458333 8.5 8.541667 8.583333 8.625 8.666667 8.708333 8.75 8.791667 8.833333 8.875 8.916667 8.958333 9 9.041667 9.083333 9.125 9.166667 9.208333 9.25 9.291667 9.333333 9.375 9.416667 9.458333 9.5 9.541667 9.583333 9.625 9.666667 9.708333 9.75 9.791667 9.833333 9.875 9.916667 9.958333 10 10.04167 10.08333 10.125 10.16667 10.20833 10.25 10.29167 10.33333 10.375 10.41667 + + + + + + + + 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.635203 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.635203 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.635203 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.635203 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.635203 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.635203 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.635203 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 1 1.65979e-14 -1.42109e-14 0.9832793 7.10543e-15 0.00465621 0.9999892 1.432958 1.50435e-14 -0.9999892 0.004656196 0.9881967 0 0 0 1 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + + + 0.04166662 0.08333331 0.125 0.1666666 0.2083333 0.25 0.2916666 0.3333333 0.375 0.4166666 0.4583333 0.5 0.5416667 0.5833333 0.625 0.6666667 0.7083333 0.75 0.7916667 0.8333333 0.875 0.9166667 0.9583333 1 1.041667 1.083333 1.125 1.166667 1.208333 1.25 1.291667 1.333333 1.375 1.416667 1.458333 1.5 1.541667 1.583333 1.625 1.666667 1.708333 1.75 1.791667 1.833333 1.875 1.916667 1.958333 2 2.041667 2.083333 2.125 2.166667 2.208333 2.25 2.291667 2.333333 2.375 2.416667 2.458333 2.5 2.541667 2.583333 2.625 2.666667 2.708333 2.75 2.791667 2.833333 2.875 2.916667 2.958333 3 3.041667 3.083333 3.125 3.166667 3.208333 3.25 3.291667 3.333333 3.375 3.416667 3.458333 3.5 3.541667 3.583333 3.625 3.666667 3.708333 3.75 3.791667 3.833333 3.875 3.916667 3.958333 4 4.041666 4.083333 4.125 4.166666 4.208333 4.25 4.291666 4.333333 4.375 4.416666 4.458333 4.5 4.541666 4.583333 4.625 4.666666 4.708333 4.75 4.791666 4.833333 4.875 4.916666 4.958333 5 5.041666 5.083333 5.125 5.166666 5.208333 5.25 5.291666 5.333333 5.375 5.416666 5.458333 5.5 5.541666 5.583333 5.625 5.666666 5.708333 5.75 5.791666 5.833333 5.875 5.916666 5.958333 6 6.041666 6.083333 6.125 6.166666 6.208333 6.25 6.291666 6.333333 6.375 6.416666 6.458333 6.5 6.541666 6.583333 6.625 6.666666 6.708333 6.75 6.791666 6.833333 6.875 6.916666 6.958333 7 7.041666 7.083333 7.125 7.166666 7.208333 7.25 7.291666 7.333333 7.375 7.416666 7.458333 7.5 7.541666 7.583333 7.625 7.666666 7.708333 7.75 7.791666 7.833333 7.875 7.916666 7.958333 8 8.041667 8.083333 8.125 8.166667 8.208333 8.25 8.291667 8.333333 8.375 8.416667 8.458333 8.5 8.541667 8.583333 8.625 8.666667 8.708333 8.75 8.791667 8.833333 8.875 8.916667 8.958333 9 9.041667 9.083333 9.125 9.166667 9.208333 9.25 9.291667 9.333333 9.375 9.416667 9.458333 9.5 9.541667 9.583333 9.625 9.666667 9.708333 9.75 9.791667 9.833333 9.875 9.916667 9.958333 10 10.04167 10.08333 10.125 10.16667 10.20833 10.25 10.29167 10.33333 10.375 10.41667 + + + + + + + + 1 0 0 0.08639416 0 1 0 -5.181648 0 0 1 3.878492 0 0 0 1 1 0 0 0.08641761 0 1 0 -5.182283 0 0 1 3.878672 0 0 0 1 1 0 0 0.08645652 0 1 0 -5.183338 0 0 1 3.87897 0 0 0 1 1 0 0 0.08651079 0 1 0 -5.184808 0 0 1 3.879387 0 0 0 1 1 0 0 0.08658028 0 1 0 -5.186691 0 0 1 3.87992 0 0 0 1 1 0 0 0.08666487 0 1 0 -5.188984 0 0 1 3.880569 0 0 0 1 1 0 0 0.08676443 0 1 0 -5.191681 0 0 1 3.881333 0 0 0 1 1 0 0 0.08687884 0 1 0 -5.194782 0 0 1 3.882211 0 0 0 1 1 0 0 0.08700795 0 1 0 -5.198281 0 0 1 3.883202 0 0 0 1 1 0 0 0.08715168 0 1 0 -5.202176 0 0 1 3.884305 0 0 0 1 1 0 0 0.08730987 0 1 0 -5.206463 0 0 1 3.88552 0 0 0 1 1 0 0 0.08748239 0 1 0 -5.211138 0 0 1 3.886843 0 0 0 1 1 0 0 0.08766914 0 1 0 -5.216199 0 0 1 3.888277 0 0 0 1 1 0 0 0.08786998 0 1 0 -5.221642 0 0 1 3.889818 0 0 0 1 1 0 0 0.08808479 0 1 0 -5.227463 0 0 1 3.891466 0 0 0 1 1 0 0 0.08831342 0 1 0 -5.233659 0 0 1 3.893221 0 0 0 1 1 0 0 0.08855578 0 1 0 -5.240227 0 0 1 3.895081 0 0 0 1 1 0 0 0.08881173 0 1 0 -5.247163 0 0 1 3.897046 0 0 0 1 1 0 0 0.08908112 0 1 0 -5.254463 0 0 1 3.899113 0 0 0 1 1 0 0 0.08936387 0 1 0 -5.262125 0 0 1 3.901283 0 0 0 1 1 0 0 0.08965982 0 1 0 -5.270146 0 0 1 3.903554 0 0 0 1 1 0 0 0.08996885 0 1 0 -5.278521 0 0 1 3.905926 0 0 0 1 1 0 0 0.09029085 0 1 0 -5.287247 0 0 1 3.908397 0 0 0 1 1 0 0 0.09062567 0 1 0 -5.29632 0 0 1 3.910967 0 0 0 1 1 0 0 0.09097321 0 1 0 -5.305738 0 0 1 3.913634 0 0 0 1 1 0 0 0.09133332 0 1 0 -5.315497 0 0 1 3.916398 0 0 0 1 1 0 0 0.0917059 0 1 0 -5.325594 0 0 1 3.919257 0 0 0 1 1 0 0 0.09209079 0 1 0 -5.336025 0 0 1 3.922211 0 0 0 1 1 0 0 0.0924879 0 1 0 -5.346786 0 0 1 3.925258 0 0 0 1 1 0 0 0.09289708 0 1 0 -5.357874 0 0 1 3.928399 0 0 0 1 1 0 0 0.09331821 0 1 0 -5.369287 0 0 1 3.931631 0 0 0 1 1 0 0 0.09375118 0 1 0 -5.381021 0 0 1 3.934953 0 0 0 1 1 0 0 0.09419583 0 1 0 -5.39307 0 0 1 3.938366 0 0 0 1 1 0 0 0.09465206 0 1 0 -5.405435 0 0 1 3.941867 0 0 0 1 1 0 0 0.09511975 0 1 0 -5.418108 0 0 1 3.945457 0 0 0 1 1 0 0 0.09559876 0 1 0 -5.431089 0 0 1 3.949133 0 0 0 1 1 0 0 0.09608896 0 1 0 -5.444374 0 0 1 3.952895 0 0 0 1 1 0 0 0.09659024 0 1 0 -5.457958 0 0 1 3.956742 0 0 0 1 1 0 0 0.09710246 0 1 0 -5.471839 0 0 1 3.960673 0 0 0 1 1 0 0 0.0976255 0 1 0 -5.486014 0 0 1 3.964687 0 0 0 1 1 0 0 0.09815924 0 1 0 -5.500477 0 0 1 3.968783 0 0 0 1 1 0 0 0.09870355 0 1 0 -5.515228 0 0 1 3.972961 0 0 0 1 1 0 0 0.09925829 0 1 0 -5.530262 0 0 1 3.977218 0 0 0 1 1 0 0 0.09982336 0 1 0 -5.545575 0 0 1 3.981555 0 0 0 1 1 0 0 0.1003986 0 1 0 -5.561164 0 0 1 3.98597 0 0 0 1 1 0 0 0.1009839 0 1 0 -5.577025 0 0 1 3.990462 0 0 0 1 1 0 0 0.1015792 0 1 0 -5.593157 0 0 1 3.99503 0 0 0 1 1 0 0 0.1021843 0 1 0 -5.609554 0 0 1 3.999673 0 0 0 1 1 0 0 0.102799 0 1 0 -5.626214 0 0 1 4.004391 0 0 0 1 1 0 0 0.1034233 0 1 0 -5.643133 0 0 1 4.009183 0 0 0 1 1 0 0 0.1040571 0 1 0 -5.660307 0 0 1 4.014047 0 0 0 1 1 0 0 0.1047001 0 1 0 -5.677734 0 0 1 4.018982 0 0 0 1 1 0 0 0.1053524 0 1 0 -5.69541 0 0 1 4.023987 0 0 0 1 1 0 0 0.1060137 0 1 0 -5.713331 0 0 1 4.029063 0 0 0 1 1 0 0 0.106684 0 1 0 -5.731495 0 0 1 4.034207 0 0 0 1 1 0 0 0.107363 0 1 0 -5.749897 0 0 1 4.039418 0 0 0 1 1 0 0 0.1080507 0 1 0 -5.768534 0 0 1 4.044696 0 0 0 1 1 0 0 0.108747 0 1 0 -5.787403 0 0 1 4.05004 0 0 0 1 1 0 0 0.1094517 0 1 0 -5.8065 0 0 1 4.055448 0 0 0 1 1 0 0 0.1101647 0 1 0 -5.825823 0 0 1 4.06092 0 0 0 1 1 0 0 0.1108859 0 1 0 -5.845367 0 0 1 4.066455 0 0 0 1 1 0 0 0.1116152 0 1 0 -5.865129 0 0 1 4.072052 0 0 0 1 1 0 0 0.1123524 0 1 0 -5.885107 0 0 1 4.077709 0 0 0 1 1 0 0 0.1130973 0 1 0 -5.905295 0 0 1 4.083426 0 0 0 1 1 0 0 0.11385 0 1 0 -5.925692 0 0 1 4.089203 0 0 0 1 1 0 0 0.1146102 0 1 0 -5.946293 0 0 1 4.095037 0 0 0 1 1 0 0 0.1153778 0 1 0 -5.967095 0 0 1 4.100928 0 0 0 1 1 0 0 0.1161527 0 1 0 -5.988095 0 0 1 4.106875 0 0 0 1 1 0 0 0.1169348 0 1 0 -6.00929 0 0 1 4.112877 0 0 0 1 1 0 0 0.1177239 0 1 0 -6.030674 0 0 1 4.118934 0 0 0 1 1 0 0 0.11852 0 1 0 -6.052248 0 0 1 4.125043 0 0 0 1 1 0 0 0.1193228 0 1 0 -6.074005 0 0 1 4.131205 0 0 0 1 1 0 0 0.1201323 0 1 0 -6.095942 0 0 1 4.137417 0 0 0 1 1 0 0 0.1209484 0 1 0 -6.118057 0 0 1 4.14368 0 0 0 1 1 0 0 0.1217709 0 1 0 -6.140346 0 0 1 4.149992 0 0 0 1 1 0 0 0.1225996 0 1 0 -6.162806 0 0 1 4.156353 0 0 0 1 1 0 0 0.1234346 0 1 0 -6.185431 0 0 1 4.16276 0 0 0 1 1 0 0 0.1242755 0 1 0 -6.208221 0 0 1 4.169214 0 0 0 1 1 0 0 0.1251224 0 1 0 -6.231172 0 0 1 4.175714 0 0 0 1 1 0 0 0.1259751 0 1 0 -6.254279 0 0 1 4.182257 0 0 0 1 1 0 0 0.1268334 0 1 0 -6.277539 0 0 1 4.188845 0 0 0 1 1 0 0 0.1276973 0 1 0 -6.30095 0 0 1 4.195474 0 0 0 1 1 0 0 0.1285666 0 1 0 -6.324507 0 0 1 4.202146 0 0 0 1 1 0 0 0.1294411 0 1 0 -6.348207 0 0 1 4.208858 0 0 0 1 1 0 0 0.1303208 0 1 0 -6.372047 0 0 1 4.215609 0 0 0 1 1 0 0 0.1312056 0 1 0 -6.396024 0 0 1 4.222399 0 0 0 1 1 0 0 0.1320952 0 1 0 -6.420133 0 0 1 4.229227 0 0 0 1 1 0 0 0.1329897 0 1 0 -6.444372 0 0 1 4.236091 0 0 0 1 1 0 0 0.1338888 0 1 0 -6.468737 0 0 1 4.242991 0 0 0 1 1 0 0 0.1347924 0 1 0 -6.493225 0 0 1 4.249926 0 0 0 1 1 0 0 0.1357004 0 1 0 -6.517832 0 0 1 4.256895 0 0 0 1 1 0 0 0.1366127 0 1 0 -6.542555 0 0 1 4.263897 0 0 0 1 1 0 0 0.1375292 0 1 0 -6.567391 0 0 1 4.27093 0 0 0 1 1 0 0 0.1384496 0 1 0 -6.592336 0 0 1 4.277994 0 0 0 1 1 0 0 0.139374 0 1 0 -6.617386 0 0 1 4.285089 0 0 0 1 1 0 0 0.1403022 0 1 0 -6.642539 0 0 1 4.292212 0 0 0 1 1 0 0 0.141234 0 1 0 -6.66779 0 0 1 4.299363 0 0 0 1 1 0 0 0.1421693 0 1 0 -6.693137 0 0 1 4.306541 0 0 0 1 1 0 0 0.143108 0 1 0 -6.718577 0 0 1 4.313745 0 0 0 1 1 0 0 0.14405 0 1 0 -6.744104 0 0 1 4.320974 0 0 0 1 1 0 0 0.1449952 0 1 0 -6.769717 0 0 1 4.328228 0 0 0 1 1 0 0 0.1459433 0 1 0 -6.795412 0 0 1 4.335505 0 0 0 1 1 0 0 0.1468944 0 1 0 -6.821186 0 0 1 4.342803 0 0 0 1 1 0 0 0.1478482 0 1 0 -6.847034 0 0 1 4.350124 0 0 0 1 1 0 0 0.1488047 0 1 0 -6.872954 0 0 1 4.357464 0 0 0 1 1 0 0 0.1497636 0 1 0 -6.898942 0 0 1 4.364824 0 0 0 1 1 0 0 0.150725 0 1 0 -6.924994 0 0 1 4.372202 0 0 0 1 1 0 0 0.1516887 0 1 0 -6.951108 0 0 1 4.379598 0 0 0 1 1 0 0 0.1526544 0 1 0 -6.977281 0 0 1 4.38701 0 0 0 1 1 0 0 0.1536222 0 1 0 -7.003508 0 0 1 4.394436 0 0 0 1 1 0 0 0.1545919 0 1 0 -7.029785 0 0 1 4.401879 0 0 0 1 1 0 0 0.1555633 0 1 0 -7.056111 0 0 1 4.409334 0 0 0 1 1 0 0 0.1565364 0 1 0 -7.082481 0 0 1 4.416802 0 0 0 1 1 0 0 0.157511 0 1 0 -7.108892 0 0 1 4.424281 0 0 0 1 1 0 0 0.1584869 0 1 0 -7.13534 0 0 1 4.431771 0 0 0 1 1 0 0 0.1594642 0 1 0 -7.161822 0 0 1 4.439271 0 0 0 1 1 0 0 0.1604425 0 1 0 -7.188335 0 0 1 4.446779 0 0 0 1 1 0 0 0.1614219 0 1 0 -7.214876 0 0 1 4.454296 0 0 0 1 1 0 0 0.1624021 0 1 0 -7.24144 0 0 1 4.461818 0 0 0 1 1 0 0 0.1633831 0 1 0 -7.268025 0 0 1 4.469347 0 0 0 1 1 0 0 0.1643647 0 1 0 -7.294626 0 0 1 4.476881 0 0 0 1 1 0 0 0.1653469 0 1 0 -7.321242 0 0 1 4.484418 0 0 0 1 1 0 0 0.1663294 0 1 0 -7.347868 0 0 1 4.491959 0 0 0 1 1 0 0 0.1673121 0 1 0 -7.3745 0 0 1 4.499501 0 0 0 1 1 0 0 0.168295 0 1 0 -7.401136 0 0 1 4.507044 0 0 0 1 1 0 0 0.1692779 0 1 0 -7.427772 0 0 1 4.514587 0 0 0 1 1 0 0 0.1702606 0 1 0 -7.454403 0 0 1 4.522129 0 0 0 1 1 0 0 0.1712432 0 1 0 -7.48103 0 0 1 4.52967 0 0 0 1 1 0 0 0.1722253 0 1 0 -7.507646 0 0 1 4.537207 0 0 0 1 1 0 0 0.1732069 0 1 0 -7.534247 0 0 1 4.54474 0 0 0 1 1 0 0 0.1741879 0 1 0 -7.560832 0 0 1 4.552269 0 0 0 1 1 0 0 0.1751681 0 1 0 -7.587396 0 0 1 4.559792 0 0 0 1 1 0 0 0.1761475 0 1 0 -7.613936 0 0 1 4.567308 0 0 0 1 1 0 0 0.1771258 0 1 0 -7.64045 0 0 1 4.574816 0 0 0 1 1 0 0 0.1781031 0 1 0 -7.666932 0 0 1 4.582316 0 0 0 1 1 0 0 0.179079 0 1 0 -7.69338 0 0 1 4.589807 0 0 0 1 1 0 0 0.1800536 0 1 0 -7.719791 0 0 1 4.597286 0 0 0 1 1 0 0 0.1810267 0 1 0 -7.746161 0 0 1 4.604754 0 0 0 1 1 0 0 0.1819981 0 1 0 -7.772487 0 0 1 4.612209 0 0 0 1 1 0 0 0.1829678 0 1 0 -7.798764 0 0 1 4.619651 0 0 0 1 1 0 0 0.1839356 0 1 0 -7.82499 0 0 1 4.627078 0 0 0 1 1 0 0 0.1849014 0 1 0 -7.851163 0 0 1 4.63449 0 0 0 1 1 0 0 0.185865 0 1 0 -7.877277 0 0 1 4.641885 0 0 0 1 1 0 0 0.1868264 0 1 0 -7.90333 0 0 1 4.649263 0 0 0 1 1 0 0 0.1877854 0 1 0 -7.929318 0 0 1 4.656623 0 0 0 1 1 0 0 0.1887418 0 1 0 -7.955237 0 0 1 4.663964 0 0 0 1 1 0 0 0.1896956 0 1 0 -7.981087 0 0 1 4.671284 0 0 0 1 1 0 0 0.1906467 0 1 0 -8.00686 0 0 1 4.678583 0 0 0 1 1 0 0 0.1915948 0 1 0 -8.032555 0 0 1 4.685859 0 0 0 1 1 0 0 0.19254 0 1 0 -8.058167 0 0 1 4.693113 0 0 0 1 1 0 0 0.193482 0 1 0 -8.083694 0 0 1 4.700342 0 0 0 1 1 0 0 0.1944207 0 1 0 -8.109135 0 0 1 4.707546 0 0 0 1 1 0 0 0.195356 0 1 0 -8.134481 0 0 1 4.714725 0 0 0 1 1 0 0 0.1962878 0 1 0 -8.159733 0 0 1 4.721876 0 0 0 1 1 0 0 0.197216 0 1 0 -8.184885 0 0 1 4.728999 0 0 0 1 1 0 0 0.1981404 0 1 0 -8.209936 0 0 1 4.736094 0 0 0 1 1 0 0 0.1990608 0 1 0 -8.23488 0 0 1 4.743157 0 0 0 1 1 0 0 0.1999773 0 1 0 -8.259716 0 0 1 4.750191 0 0 0 1 1 0 0 0.2008896 0 1 0 -8.28444 0 0 1 4.757193 0 0 0 1 1 0 0 0.2017976 0 1 0 -8.309047 0 0 1 4.764161 0 0 0 1 1 0 0 0.2027012 0 1 0 -8.333534 0 0 1 4.771096 0 0 0 1 1 0 0 0.2036003 0 1 0 -8.3579 0 0 1 4.777997 0 0 0 1 1 0 0 0.2044948 0 1 0 -8.382139 0 0 1 4.784861 0 0 0 1 1 0 0 0.2053844 0 1 0 -8.406248 0 0 1 4.791688 0 0 0 1 1 0 0 0.2062692 0 1 0 -8.430225 0 0 1 4.798478 0 0 0 1 1 0 0 0.2071489 0 1 0 -8.454065 0 0 1 4.80523 0 0 0 1 1 0 0 0.2080234 0 1 0 -8.477766 0 0 1 4.811942 0 0 0 1 1 0 0 0.2088927 0 1 0 -8.501322 0 0 1 4.818613 0 0 0 1 1 0 0 0.2097566 0 1 0 -8.524733 0 0 1 4.825243 0 0 0 1 1 0 0 0.2106149 0 1 0 -8.547993 0 0 1 4.831831 0 0 0 1 1 0 0 0.2114676 0 1 0 -8.5711 0 0 1 4.838374 0 0 0 1 1 0 0 0.2123145 0 1 0 -8.59405 0 0 1 4.844873 0 0 0 1 1 0 0 0.2131554 0 1 0 -8.61684 0 0 1 4.851327 0 0 0 1 1 0 0 0.2139904 0 1 0 -8.639466 0 0 1 4.857735 0 0 0 1 1 0 0 0.2148191 0 1 0 -8.661926 0 0 1 4.864096 0 0 0 1 1 0 0 0.2156416 0 1 0 -8.684215 0 0 1 4.870408 0 0 0 1 1 0 0 0.2164577 0 1 0 -8.706329 0 0 1 4.87667 0 0 0 1 1 0 0 0.2172672 0 1 0 -8.728268 0 0 1 4.882884 0 0 0 1 1 0 0 0.21807 0 1 0 -8.750024 0 0 1 4.889044 0 0 0 1 1 0 0 0.2188661 0 1 0 -8.771597 0 0 1 4.895154 0 0 0 1 1 0 0 0.2196552 0 1 0 -8.792982 0 0 1 4.90121 0 0 0 1 1 0 0 0.2204373 0 1 0 -8.814177 0 0 1 4.907212 0 0 0 1 1 0 0 0.2212122 0 1 0 -8.835176 0 0 1 4.913159 0 0 0 1 1 0 0 0.2219798 0 1 0 -8.855978 0 0 1 4.91905 0 0 0 1 1 0 0 0.22274 0 1 0 -8.87658 0 0 1 4.924885 0 0 0 1 1 0 0 0.2234927 0 1 0 -8.896976 0 0 1 4.930661 0 0 0 1 1 0 0 0.2242376 0 1 0 -8.917165 0 0 1 4.936378 0 0 0 1 1 0 0 0.2249748 0 1 0 -8.937141 0 0 1 4.942036 0 0 0 1 1 0 0 0.2257041 0 1 0 -8.956904 0 0 1 4.947632 0 0 0 1 1 0 0 0.2264253 0 1 0 -8.976449 0 0 1 4.953167 0 0 0 1 1 0 0 0.2271383 0 1 0 -8.99577 0 0 1 4.958639 0 0 0 1 1 0 0 0.227843 0 1 0 -9.014869 0 0 1 4.964047 0 0 0 1 1 0 0 0.2285393 0 1 0 -9.033737 0 0 1 4.969391 0 0 0 1 1 0 0 0.229227 0 1 0 -9.052376 0 0 1 4.974669 0 0 0 1 1 0 0 0.229906 0 1 0 -9.070778 0 0 1 4.979881 0 0 0 1 1 0 0 0.2305763 0 1 0 -9.088941 0 0 1 4.985025 0 0 0 1 1 0 0 0.2312376 0 1 0 -9.106861 0 0 1 4.9901 0 0 0 1 1 0 0 0.2318899 0 1 0 -9.124537 0 0 1 4.995106 0 0 0 1 1 0 0 0.2325329 0 1 0 -9.141963 0 0 1 5.000041 0 0 0 1 1 0 0 0.2331667 0 1 0 -9.159138 0 0 1 5.004905 0 0 0 1 1 0 0 0.233791 0 1 0 -9.176058 0 0 1 5.009696 0 0 0 1 1 0 0 0.2344057 0 1 0 -9.192719 0 0 1 5.014414 0 0 0 1 1 0 0 0.2350108 0 1 0 -9.209115 0 0 1 5.019058 0 0 0 1 1 0 0 0.2356061 0 1 0 -9.225245 0 0 1 5.023626 0 0 0 1 1 0 0 0.2361914 0 1 0 -9.241108 0 0 1 5.028118 0 0 0 1 1 0 0 0.2367667 0 1 0 -9.256697 0 0 1 5.032533 0 0 0 1 1 0 0 0.2373317 0 1 0 -9.27201 0 0 1 5.036869 0 0 0 1 1 0 0 0.2378865 0 1 0 -9.287045 0 0 1 5.041127 0 0 0 1 1 0 0 0.2384308 0 1 0 -9.301794 0 0 1 5.045304 0 0 0 1 1 0 0 0.2389645 0 1 0 -9.316257 0 0 1 5.0494 0 0 0 1 1 0 0 0.2394875 0 1 0 -9.330433 0 0 1 5.053414 0 0 0 1 1 0 0 0.2399998 0 1 0 -9.344314 0 0 1 5.057345 0 0 0 1 1 0 0 0.240501 0 1 0 -9.357897 0 0 1 5.061193 0 0 0 1 1 0 0 0.2409912 0 1 0 -9.371181 0 0 1 5.064955 0 0 0 1 1 0 0 0.2414702 0 1 0 -9.384163 0 0 1 5.06863 0 0 0 1 1 0 0 0.2419379 0 1 0 -9.396837 0 0 1 5.07222 0 0 0 1 1 0 0 0.2423941 0 1 0 -9.409201 0 0 1 5.075721 0 0 0 1 1 0 0 0.2428388 0 1 0 -9.421251 0 0 1 5.079134 0 0 0 1 1 0 0 0.2432718 0 1 0 -9.432983 0 0 1 5.082457 0 0 0 1 1 0 0 0.2436929 0 1 0 -9.444397 0 0 1 5.085689 0 0 0 1 1 0 0 0.2441021 0 1 0 -9.455485 0 0 1 5.088829 0 0 0 1 1 0 0 0.2444992 0 1 0 -9.466248 0 0 1 5.091877 0 0 0 1 1 0 0 0.2448841 0 1 0 -9.476678 0 0 1 5.094831 0 0 0 1 1 0 0 0.2452567 0 1 0 -9.486773 0 0 1 5.09769 0 0 0 1 1 0 0 0.2456168 0 1 0 -9.496534 0 0 1 5.100453 0 0 0 1 1 0 0 0.2459643 0 1 0 -9.505951 0 0 1 5.103121 0 0 0 1 1 0 0 0.2462992 0 1 0 -9.515026 0 0 1 5.10569 0 0 0 1 1 0 0 0.2466211 0 1 0 -9.52375 0 0 1 5.108161 0 0 0 1 1 0 0 0.2469302 0 1 0 -9.532126 0 0 1 5.110533 0 0 0 1 1 0 0 0.2472261 0 1 0 -9.540146 0 0 1 5.112804 0 0 0 1 1 0 0 0.2475089 0 1 0 -9.547808 0 0 1 5.114974 0 0 0 1 1 0 0 0.2477783 0 1 0 -9.555109 0 0 1 5.117043 0 0 0 1 1 0 0 0.2480342 0 1 0 -9.562044 0 0 1 5.119006 0 0 0 1 1 0 0 0.2482765 0 1 0 -9.568613 0 0 1 5.120866 0 0 0 1 1 0 0 0.2485052 0 1 0 -9.574808 0 0 1 5.122622 0 0 0 1 1 0 0 0.24872 0 1 0 -9.580629 0 0 1 5.124269 0 0 0 1 1 0 0 0.2489208 0 1 0 -9.586072 0 0 1 5.125811 0 0 0 1 1 0 0 0.2491076 0 1 0 -9.591133 0 0 1 5.127244 0 0 0 1 1 0 0 0.2492801 0 1 0 -9.595808 0 0 1 5.128568 0 0 0 1 1 0 0 0.2494383 0 1 0 -9.600096 0 0 1 5.129782 0 0 0 1 1 0 0 0.249582 0 1 0 -9.603991 0 0 1 5.130885 0 0 0 1 1 0 0 0.2497111 0 1 0 -9.607489 0 0 1 5.131876 0 0 0 1 1 0 0 0.2498256 0 1 0 -9.61059 0 0 1 5.132754 0 0 0 1 1 0 0 0.2499251 0 1 0 -9.613289 0 0 1 5.133518 0 0 0 1 1 0 0 0.2500097 0 1 0 -9.61558 0 0 1 5.134167 0 0 0 1 1 0 0 0.2500792 0 1 0 -9.617464 0 0 1 5.134701 0 0 0 1 1 0 0 0.2501335 0 1 0 -9.618934 0 0 1 5.135117 0 0 0 1 1 0 0 0.2501723 0 1 0 -9.619989 0 0 1 5.135416 0 0 0 1 1 0 0 0.2501958 0 1 0 -9.620625 0 0 1 5.135595 0 0 0 1 1 0 0 0.2502037 0 1 0 -9.620836 0 0 1 5.135656 0 0 0 1 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + + + 0.04166662 0.08333331 0.125 0.1666666 0.2083333 0.25 0.2916666 0.3333333 0.375 0.4166666 0.4583333 0.5 0.5416667 0.5833333 0.625 0.6666667 0.7083333 0.75 0.7916667 0.8333333 0.875 0.9166667 0.9583333 1 1.041667 1.083333 1.125 1.166667 1.208333 1.25 1.291667 1.333333 1.375 1.416667 1.458333 1.5 1.541667 1.583333 1.625 1.666667 1.708333 1.75 1.791667 1.833333 1.875 1.916667 1.958333 2 2.041667 2.083333 2.125 2.166667 2.208333 2.25 2.291667 2.333333 2.375 2.416667 2.458333 2.5 2.541667 2.583333 2.625 2.666667 2.708333 2.75 2.791667 2.833333 2.875 2.916667 2.958333 3 3.041667 3.083333 3.125 3.166667 3.208333 3.25 3.291667 3.333333 3.375 3.416667 3.458333 3.5 3.541667 3.583333 3.625 3.666667 3.708333 3.75 3.791667 3.833333 3.875 3.916667 3.958333 4 4.041666 4.083333 4.125 4.166666 4.208333 4.25 4.291666 4.333333 4.375 4.416666 4.458333 4.5 4.541666 4.583333 4.625 4.666666 4.708333 4.75 4.791666 4.833333 4.875 4.916666 4.958333 5 5.041666 5.083333 5.125 5.166666 5.208333 5.25 5.291666 5.333333 5.375 5.416666 5.458333 5.5 5.541666 5.583333 5.625 5.666666 5.708333 5.75 5.791666 5.833333 5.875 5.916666 5.958333 6 6.041666 6.083333 6.125 6.166666 6.208333 6.25 6.291666 6.333333 6.375 6.416666 6.458333 6.5 6.541666 6.583333 6.625 6.666666 6.708333 6.75 6.791666 6.833333 6.875 6.916666 6.958333 7 7.041666 7.083333 7.125 7.166666 7.208333 7.25 7.291666 7.333333 7.375 7.416666 7.458333 7.5 7.541666 7.583333 7.625 7.666666 7.708333 7.75 7.791666 7.833333 7.875 7.916666 7.958333 8 8.041667 8.083333 8.125 8.166667 8.208333 8.25 8.291667 8.333333 8.375 8.416667 8.458333 8.5 8.541667 8.583333 8.625 8.666667 8.708333 8.75 8.791667 8.833333 8.875 8.916667 8.958333 9 9.041667 9.083333 9.125 9.166667 9.208333 9.25 9.291667 9.333333 9.375 9.416667 9.458333 9.5 9.541667 9.583333 9.625 9.666667 9.708333 9.75 9.791667 9.833333 9.875 9.916667 9.958333 10 10.04167 10.08333 10.125 10.16667 10.20833 10.25 10.29167 10.33333 10.375 10.41667 + + + + + + + + 1 0 0 0.09937604 0 1 0 -5.24674 0 0 1 3.877148 0 0 0 1 1 0 0 0.09939948 0 1 0 -5.247375 0 0 1 3.877328 0 0 0 1 1 0 0 0.0994384 0 1 0 -5.24843 0 0 1 3.877626 0 0 0 1 1 0 0 0.09949267 0 1 0 -5.249901 0 0 1 3.878043 0 0 0 1 1 0 0 0.09956216 0 1 0 -5.251784 0 0 1 3.878576 0 0 0 1 1 0 0 0.09964675 0 1 0 -5.254076 0 0 1 3.879225 0 0 0 1 1 0 0 0.09974631 0 1 0 -5.256774 0 0 1 3.879989 0 0 0 1 1 0 0 0.09986071 0 1 0 -5.259875 0 0 1 3.880867 0 0 0 1 1 0 0 0.09998983 0 1 0 -5.263374 0 0 1 3.881858 0 0 0 1 1 0 0 0.1001336 0 1 0 -5.267268 0 0 1 3.882961 0 0 0 1 1 0 0 0.1002917 0 1 0 -5.271555 0 0 1 3.884176 0 0 0 1 1 0 0 0.1004643 0 1 0 -5.276231 0 0 1 3.885499 0 0 0 1 1 0 0 0.100651 0 1 0 -5.281292 0 0 1 3.886933 0 0 0 1 1 0 0 0.1008519 0 1 0 -5.286734 0 0 1 3.888474 0 0 0 1 1 0 0 0.1010667 0 1 0 -5.292555 0 0 1 3.890122 0 0 0 1 1 0 0 0.1012953 0 1 0 -5.298751 0 0 1 3.891877 0 0 0 1 1 0 0 0.1015377 0 1 0 -5.305319 0 0 1 3.893737 0 0 0 1 1 0 0 0.1017936 0 1 0 -5.312255 0 0 1 3.895702 0 0 0 1 1 0 0 0.102063 0 1 0 -5.319556 0 0 1 3.897769 0 0 0 1 1 0 0 0.1023457 0 1 0 -5.327218 0 0 1 3.899939 0 0 0 1 1 0 0 0.1026417 0 1 0 -5.335238 0 0 1 3.90221 0 0 0 1 1 0 0 0.1029507 0 1 0 -5.343613 0 0 1 3.904582 0 0 0 1 1 0 0 0.1032727 0 1 0 -5.352339 0 0 1 3.907053 0 0 0 1 1 0 0 0.1036076 0 1 0 -5.361413 0 0 1 3.909623 0 0 0 1 1 0 0 0.1039551 0 1 0 -5.370831 0 0 1 3.91229 0 0 0 1 1 0 0 0.1043152 0 1 0 -5.38059 0 0 1 3.915054 0 0 0 1 1 0 0 0.1046878 0 1 0 -5.390687 0 0 1 3.917913 0 0 0 1 1 0 0 0.1050727 0 1 0 -5.401117 0 0 1 3.920867 0 0 0 1 1 0 0 0.1054698 0 1 0 -5.411879 0 0 1 3.923914 0 0 0 1 1 0 0 0.105879 0 1 0 -5.422967 0 0 1 3.927055 0 0 0 1 1 0 0 0.1063001 0 1 0 -5.43438 0 0 1 3.930287 0 0 0 1 1 0 0 0.1067331 0 1 0 -5.446113 0 0 1 3.933609 0 0 0 1 1 0 0 0.1071777 0 1 0 -5.458163 0 0 1 3.937022 0 0 0 1 1 0 0 0.1076339 0 1 0 -5.470527 0 0 1 3.940523 0 0 0 1 1 0 0 0.1081016 0 1 0 -5.483201 0 0 1 3.944113 0 0 0 1 1 0 0 0.1085806 0 1 0 -5.496182 0 0 1 3.947789 0 0 0 1 1 0 0 0.1090708 0 1 0 -5.509466 0 0 1 3.951551 0 0 0 1 1 0 0 0.1095721 0 1 0 -5.523051 0 0 1 3.955398 0 0 0 1 1 0 0 0.1100843 0 1 0 -5.536932 0 0 1 3.959329 0 0 0 1 1 0 0 0.1106074 0 1 0 -5.551106 0 0 1 3.963343 0 0 0 1 1 0 0 0.1111411 0 1 0 -5.56557 0 0 1 3.967439 0 0 0 1 1 0 0 0.1116854 0 1 0 -5.580321 0 0 1 3.971617 0 0 0 1 1 0 0 0.1122402 0 1 0 -5.595354 0 0 1 3.975874 0 0 0 1 1 0 0 0.1128052 0 1 0 -5.610667 0 0 1 3.980211 0 0 0 1 1 0 0 0.1133805 0 1 0 -5.626256 0 0 1 3.984626 0 0 0 1 1 0 0 0.1139658 0 1 0 -5.642118 0 0 1 3.989117 0 0 0 1 1 0 0 0.1145611 0 1 0 -5.658249 0 0 1 3.993686 0 0 0 1 1 0 0 0.1151661 0 1 0 -5.674646 0 0 1 3.99833 0 0 0 1 1 0 0 0.1157809 0 1 0 -5.691307 0 0 1 4.003047 0 0 0 1 1 0 0 0.1164052 0 1 0 -5.708225 0 0 1 4.007839 0 0 0 1 1 0 0 0.117039 0 1 0 -5.7254 0 0 1 4.012702 0 0 0 1 1 0 0 0.117682 0 1 0 -5.742826 0 0 1 4.017638 0 0 0 1 1 0 0 0.1183343 0 1 0 -5.760502 0 0 1 4.022644 0 0 0 1 1 0 0 0.1189956 0 1 0 -5.778424 0 0 1 4.027719 0 0 0 1 1 0 0 0.1196658 0 1 0 -5.796587 0 0 1 4.032863 0 0 0 1 1 0 0 0.1203449 0 1 0 -5.814989 0 0 1 4.038074 0 0 0 1 1 0 0 0.1210326 0 1 0 -5.833627 0 0 1 4.043352 0 0 0 1 1 0 0 0.1217289 0 1 0 -5.852495 0 0 1 4.048696 0 0 0 1 1 0 0 0.1224336 0 1 0 -5.871593 0 0 1 4.054104 0 0 0 1 1 0 0 0.1231466 0 1 0 -5.890915 0 0 1 4.059577 0 0 0 1 1 0 0 0.1238678 0 1 0 -5.91046 0 0 1 4.065111 0 0 0 1 1 0 0 0.1245971 0 1 0 -5.930222 0 0 1 4.070708 0 0 0 1 1 0 0 0.1253342 0 1 0 -5.9502 0 0 1 4.076365 0 0 0 1 1 0 0 0.1260792 0 1 0 -5.970388 0 0 1 4.082083 0 0 0 1 1 0 0 0.1268319 0 1 0 -5.990784 0 0 1 4.087859 0 0 0 1 1 0 0 0.127592 0 1 0 -6.011385 0 0 1 4.093693 0 0 0 1 1 0 0 0.1283597 0 1 0 -6.032188 0 0 1 4.099584 0 0 0 1 1 0 0 0.1291346 0 1 0 -6.053188 0 0 1 4.105531 0 0 0 1 1 0 0 0.1299167 0 1 0 -6.074382 0 0 1 4.111534 0 0 0 1 1 0 0 0.1307058 0 1 0 -6.095767 0 0 1 4.117589 0 0 0 1 1 0 0 0.1315019 0 1 0 -6.11734 0 0 1 4.123699 0 0 0 1 1 0 0 0.1323047 0 1 0 -6.139097 0 0 1 4.12986 0 0 0 1 1 0 0 0.1331142 0 1 0 -6.161035 0 0 1 4.136073 0 0 0 1 1 0 0 0.1339303 0 1 0 -6.18315 0 0 1 4.142336 0 0 0 1 1 0 0 0.1347528 0 1 0 -6.205438 0 0 1 4.148648 0 0 0 1 1 0 0 0.1355815 0 1 0 -6.227898 0 0 1 4.155008 0 0 0 1 1 0 0 0.1364165 0 1 0 -6.250524 0 0 1 4.161417 0 0 0 1 1 0 0 0.1372574 0 1 0 -6.273314 0 0 1 4.167871 0 0 0 1 1 0 0 0.1381043 0 1 0 -6.296264 0 0 1 4.174369 0 0 0 1 1 0 0 0.1389569 0 1 0 -6.319371 0 0 1 4.180913 0 0 0 1 1 0 0 0.1398153 0 1 0 -6.342631 0 0 1 4.1875 0 0 0 1 1 0 0 0.1406792 0 1 0 -6.366042 0 0 1 4.19413 0 0 0 1 1 0 0 0.1415484 0 1 0 -6.389599 0 0 1 4.200802 0 0 0 1 1 0 0 0.142423 0 1 0 -6.4133 0 0 1 4.207514 0 0 0 1 1 0 0 0.1433027 0 1 0 -6.43714 0 0 1 4.214265 0 0 0 1 1 0 0 0.1441875 0 1 0 -6.461116 0 0 1 4.221056 0 0 0 1 1 0 0 0.1450771 0 1 0 -6.485226 0 0 1 4.227883 0 0 0 1 1 0 0 0.1459716 0 1 0 -6.509465 0 0 1 4.234747 0 0 0 1 1 0 0 0.1468706 0 1 0 -6.53383 0 0 1 4.241648 0 0 0 1 1 0 0 0.1477743 0 1 0 -6.558317 0 0 1 4.248582 0 0 0 1 1 0 0 0.1486823 0 1 0 -6.582925 0 0 1 4.255551 0 0 0 1 1 0 0 0.1495946 0 1 0 -6.607648 0 0 1 4.262553 0 0 0 1 1 0 0 0.1505111 0 1 0 -6.632483 0 0 1 4.269586 0 0 0 1 1 0 0 0.1514315 0 1 0 -6.657428 0 0 1 4.27665 0 0 0 1 1 0 0 0.1523559 0 1 0 -6.682478 0 0 1 4.283744 0 0 0 1 1 0 0 0.1532841 0 1 0 -6.707631 0 0 1 4.290867 0 0 0 1 1 0 0 0.1542159 0 1 0 -6.732882 0 0 1 4.298018 0 0 0 1 1 0 0 0.1551512 0 1 0 -6.75823 0 0 1 4.305197 0 0 0 1 1 0 0 0.1560899 0 1 0 -6.783669 0 0 1 4.312401 0 0 0 1 1 0 0 0.1570319 0 1 0 -6.809197 0 0 1 4.31963 0 0 0 1 1 0 0 0.157977 0 1 0 -6.83481 0 0 1 4.326884 0 0 0 1 1 0 0 0.1589252 0 1 0 -6.860505 0 0 1 4.334161 0 0 0 1 1 0 0 0.1598763 0 1 0 -6.886278 0 0 1 4.34146 0 0 0 1 1 0 0 0.1608301 0 1 0 -6.912126 0 0 1 4.34878 0 0 0 1 1 0 0 0.1617866 0 1 0 -6.938046 0 0 1 4.356121 0 0 0 1 1 0 0 0.1627455 0 1 0 -6.964035 0 0 1 4.36348 0 0 0 1 1 0 0 0.1637069 0 1 0 -6.990087 0 0 1 4.370858 0 0 0 1 1 0 0 0.1646705 0 1 0 -7.016201 0 0 1 4.378253 0 0 0 1 1 0 0 0.1656363 0 1 0 -7.042373 0 0 1 4.385665 0 0 0 1 1 0 0 0.1666041 0 1 0 -7.0686 0 0 1 4.393093 0 0 0 1 1 0 0 0.1675738 0 1 0 -7.094878 0 0 1 4.400535 0 0 0 1 1 0 0 0.1685452 0 1 0 -7.121203 0 0 1 4.40799 0 0 0 1 1 0 0 0.1695183 0 1 0 -7.147573 0 0 1 4.415458 0 0 0 1 1 0 0 0.1704929 0 1 0 -7.173984 0 0 1 4.422937 0 0 0 1 1 0 0 0.1714688 0 1 0 -7.200432 0 0 1 4.430428 0 0 0 1 1 0 0 0.172446 0 1 0 -7.226915 0 0 1 4.437927 0 0 0 1 1 0 0 0.1734244 0 1 0 -7.253428 0 0 1 4.445436 0 0 0 1 1 0 0 0.1744037 0 1 0 -7.279969 0 0 1 4.452951 0 0 0 1 1 0 0 0.175384 0 1 0 -7.306533 0 0 1 4.460474 0 0 0 1 1 0 0 0.176365 0 1 0 -7.333117 0 0 1 4.468003 0 0 0 1 1 0 0 0.1773466 0 1 0 -7.359719 0 0 1 4.475536 0 0 0 1 1 0 0 0.1783288 0 1 0 -7.386335 0 0 1 4.483074 0 0 0 1 1 0 0 0.1793112 0 1 0 -7.41296 0 0 1 4.490614 0 0 0 1 1 0 0 0.180294 0 1 0 -7.439592 0 0 1 4.498157 0 0 0 1 1 0 0 0.1812769 0 1 0 -7.466228 0 0 1 4.5057 0 0 0 1 1 0 0 0.1822598 0 1 0 -7.492864 0 0 1 4.513243 0 0 0 1 1 0 0 0.1832425 0 1 0 -7.519496 0 0 1 4.520785 0 0 0 1 1 0 0 0.184225 0 1 0 -7.546122 0 0 1 4.528326 0 0 0 1 1 0 0 0.1852072 0 1 0 -7.572738 0 0 1 4.535863 0 0 0 1 1 0 0 0.1861888 0 1 0 -7.59934 0 0 1 4.543396 0 0 0 1 1 0 0 0.1871698 0 1 0 -7.625924 0 0 1 4.550925 0 0 0 1 1 0 0 0.18815 0 1 0 -7.652489 0 0 1 4.558448 0 0 0 1 1 0 0 0.1891294 0 1 0 -7.679029 0 0 1 4.565964 0 0 0 1 1 0 0 0.1901077 0 1 0 -7.705542 0 0 1 4.573473 0 0 0 1 1 0 0 0.191085 0 1 0 -7.732024 0 0 1 4.580972 0 0 0 1 1 0 0 0.1920609 0 1 0 -7.758472 0 0 1 4.588462 0 0 0 1 1 0 0 0.1930355 0 1 0 -7.784883 0 0 1 4.595942 0 0 0 1 1 0 0 0.1940086 0 1 0 -7.811254 0 0 1 4.60341 0 0 0 1 1 0 0 0.19498 0 1 0 -7.837579 0 0 1 4.610865 0 0 0 1 1 0 0 0.1959497 0 1 0 -7.863856 0 0 1 4.618307 0 0 0 1 1 0 0 0.1969174 0 1 0 -7.890082 0 0 1 4.625734 0 0 0 1 1 0 0 0.1978832 0 1 0 -7.916255 0 0 1 4.633146 0 0 0 1 1 0 0 0.1988469 0 1 0 -7.942369 0 0 1 4.640541 0 0 0 1 1 0 0 0.1998082 0 1 0 -7.968422 0 0 1 4.647919 0 0 0 1 1 0 0 0.2007672 0 1 0 -7.994411 0 0 1 4.655279 0 0 0 1 1 0 0 0.2017237 0 1 0 -8.02033 0 0 1 4.66262 0 0 0 1 1 0 0 0.2026775 0 1 0 -8.046179 0 0 1 4.66994 0 0 0 1 1 0 0 0.2036286 0 1 0 -8.071953 0 0 1 4.677238 0 0 0 1 1 0 0 0.2045767 0 1 0 -8.097647 0 0 1 4.684515 0 0 0 1 1 0 0 0.2055218 0 1 0 -8.12326 0 0 1 4.691769 0 0 0 1 1 0 0 0.2064638 0 1 0 -8.148787 0 0 1 4.698998 0 0 0 1 1 0 0 0.2074026 0 1 0 -8.174227 0 0 1 4.706203 0 0 0 1 1 0 0 0.2083379 0 1 0 -8.199574 0 0 1 4.713381 0 0 0 1 1 0 0 0.2092697 0 1 0 -8.224825 0 0 1 4.720532 0 0 0 1 1 0 0 0.2101979 0 1 0 -8.249977 0 0 1 4.727655 0 0 0 1 1 0 0 0.2111222 0 1 0 -8.275028 0 0 1 4.734749 0 0 0 1 1 0 0 0.2120427 0 1 0 -8.299973 0 0 1 4.741814 0 0 0 1 1 0 0 0.2129592 0 1 0 -8.324808 0 0 1 4.748847 0 0 0 1 1 0 0 0.2138715 0 1 0 -8.349532 0 0 1 4.755848 0 0 0 1 1 0 0 0.2147795 0 1 0 -8.374139 0 0 1 4.762817 0 0 0 1 1 0 0 0.2156831 0 1 0 -8.398626 0 0 1 4.769752 0 0 0 1 1 0 0 0.2165822 0 1 0 -8.422992 0 0 1 4.776652 0 0 0 1 1 0 0 0.2174767 0 1 0 -8.447231 0 0 1 4.783517 0 0 0 1 1 0 0 0.2183663 0 1 0 -8.47134 0 0 1 4.790344 0 0 0 1 1 0 0 0.219251 0 1 0 -8.495317 0 0 1 4.797134 0 0 0 1 1 0 0 0.2201308 0 1 0 -8.519157 0 0 1 4.803885 0 0 0 1 1 0 0 0.2210053 0 1 0 -8.542858 0 0 1 4.810598 0 0 0 1 1 0 0 0.2218746 0 1 0 -8.566414 0 0 1 4.817269 0 0 0 1 1 0 0 0.2227385 0 1 0 -8.589825 0 0 1 4.823899 0 0 0 1 1 0 0 0.2235968 0 1 0 -8.613085 0 0 1 4.830486 0 0 0 1 1 0 0 0.2244495 0 1 0 -8.636192 0 0 1 4.83703 0 0 0 1 1 0 0 0.2252963 0 1 0 -8.659142 0 0 1 4.843529 0 0 0 1 1 0 0 0.2261373 0 1 0 -8.681932 0 0 1 4.849983 0 0 0 1 1 0 0 0.2269723 0 1 0 -8.704558 0 0 1 4.856391 0 0 0 1 1 0 0 0.227801 0 1 0 -8.727018 0 0 1 4.862751 0 0 0 1 1 0 0 0.2286235 0 1 0 -8.749307 0 0 1 4.869063 0 0 0 1 1 0 0 0.2294396 0 1 0 -8.771421 0 0 1 4.875327 0 0 0 1 1 0 0 0.2302491 0 1 0 -8.79336 0 0 1 4.881539 0 0 0 1 1 0 0 0.2310519 0 1 0 -8.815116 0 0 1 4.8877 0 0 0 1 1 0 0 0.231848 0 1 0 -8.836689 0 0 1 4.89381 0 0 0 1 1 0 0 0.2326371 0 1 0 -8.858073 0 0 1 4.899866 0 0 0 1 1 0 0 0.2334192 0 1 0 -8.879269 0 0 1 4.905868 0 0 0 1 1 0 0 0.2341941 0 1 0 -8.900269 0 0 1 4.911815 0 0 0 1 1 0 0 0.2349617 0 1 0 -8.92107 0 0 1 4.917706 0 0 0 1 1 0 0 0.2357219 0 1 0 -8.941672 0 0 1 4.923541 0 0 0 1 1 0 0 0.2364746 0 1 0 -8.962069 0 0 1 4.929317 0 0 0 1 1 0 0 0.2372195 0 1 0 -8.982257 0 0 1 4.935034 0 0 0 1 1 0 0 0.2379567 0 1 0 -9.002234 0 0 1 4.940691 0 0 0 1 1 0 0 0.238686 0 1 0 -9.021996 0 0 1 4.946288 0 0 0 1 1 0 0 0.2394072 0 1 0 -9.041541 0 0 1 4.951823 0 0 0 1 1 0 0 0.2401201 0 1 0 -9.060863 0 0 1 4.957295 0 0 0 1 1 0 0 0.2408249 0 1 0 -9.079961 0 0 1 4.962704 0 0 0 1 1 0 0 0.2415212 0 1 0 -9.098829 0 0 1 4.968047 0 0 0 1 1 0 0 0.2422089 0 1 0 -9.117467 0 0 1 4.973325 0 0 0 1 1 0 0 0.242888 0 1 0 -9.135869 0 0 1 4.978537 0 0 0 1 1 0 0 0.2435582 0 1 0 -9.154033 0 0 1 4.98368 0 0 0 1 1 0 0 0.2442195 0 1 0 -9.171953 0 0 1 4.988756 0 0 0 1 1 0 0 0.2448717 0 1 0 -9.18963 0 0 1 4.993761 0 0 0 1 1 0 0 0.2455148 0 1 0 -9.207056 0 0 1 4.998697 0 0 0 1 1 0 0 0.2461485 0 1 0 -9.224232 0 0 1 5.003561 0 0 0 1 1 0 0 0.2467729 0 1 0 -9.24115 0 0 1 5.008352 0 0 0 1 1 0 0 0.2473876 0 1 0 -9.257809 0 0 1 5.01307 0 0 0 1 1 0 0 0.2479927 0 1 0 -9.274207 0 0 1 5.017714 0 0 0 1 1 0 0 0.248588 0 1 0 -9.290339 0 0 1 5.022282 0 0 0 1 1 0 0 0.2491733 0 1 0 -9.3062 0 0 1 5.026774 0 0 0 1 1 0 0 0.2497485 0 1 0 -9.321789 0 0 1 5.031188 0 0 0 1 1 0 0 0.2503136 0 1 0 -9.337102 0 0 1 5.035525 0 0 0 1 1 0 0 0.2508684 0 1 0 -9.352137 0 0 1 5.039783 0 0 0 1 1 0 0 0.2514126 0 1 0 -9.366886 0 0 1 5.04396 0 0 0 1 1 0 0 0.2519464 0 1 0 -9.38135 0 0 1 5.048056 0 0 0 1 1 0 0 0.2524694 0 1 0 -9.395525 0 0 1 5.05207 0 0 0 1 1 0 0 0.2529817 0 1 0 -9.409406 0 0 1 5.056001 0 0 0 1 1 0 0 0.2534829 0 1 0 -9.42299 0 0 1 5.059848 0 0 0 1 1 0 0 0.2539731 0 1 0 -9.436274 0 0 1 5.06361 0 0 0 1 1 0 0 0.2544521 0 1 0 -9.449255 0 0 1 5.067286 0 0 0 1 1 0 0 0.2549198 0 1 0 -9.461929 0 0 1 5.070876 0 0 0 1 1 0 0 0.255376 0 1 0 -9.474294 0 0 1 5.074377 0 0 0 1 1 0 0 0.2558207 0 1 0 -9.486343 0 0 1 5.07779 0 0 0 1 1 0 0 0.2562537 0 1 0 -9.498076 0 0 1 5.081112 0 0 0 1 1 0 0 0.2566748 0 1 0 -9.509489 0 0 1 5.084345 0 0 0 1 1 0 0 0.257084 0 1 0 -9.520577 0 0 1 5.087485 0 0 0 1 1 0 0 0.2574811 0 1 0 -9.53134 0 0 1 5.090532 0 0 0 1 1 0 0 0.257866 0 1 0 -9.54177 0 0 1 5.093486 0 0 0 1 1 0 0 0.2582386 0 1 0 -9.551867 0 0 1 5.096346 0 0 0 1 1 0 0 0.2585987 0 1 0 -9.561625 0 0 1 5.099109 0 0 0 1 1 0 0 0.2589462 0 1 0 -9.571043 0 0 1 5.101777 0 0 0 1 1 0 0 0.259281 0 1 0 -9.580116 0 0 1 5.104347 0 0 0 1 1 0 0 0.259603 0 1 0 -9.588842 0 0 1 5.106817 0 0 0 1 1 0 0 0.2599121 0 1 0 -9.597217 0 0 1 5.109189 0 0 0 1 1 0 0 0.260208 0 1 0 -9.605236 0 0 1 5.11146 0 0 0 1 1 0 0 0.2604907 0 1 0 -9.6129 0 0 1 5.11363 0 0 0 1 1 0 0 0.2607602 0 1 0 -9.620199 0 0 1 5.115698 0 0 0 1 1 0 0 0.2610161 0 1 0 -9.627136 0 0 1 5.117662 0 0 0 1 1 0 0 0.2612584 0 1 0 -9.633703 0 0 1 5.119522 0 0 0 1 1 0 0 0.2614871 0 1 0 -9.6399 0 0 1 5.121277 0 0 0 1 1 0 0 0.2617019 0 1 0 -9.645721 0 0 1 5.122926 0 0 0 1 1 0 0 0.2619027 0 1 0 -9.651164 0 0 1 5.124467 0 0 0 1 1 0 0 0.2620895 0 1 0 -9.656225 0 0 1 5.1259 0 0 0 1 1 0 0 0.262262 0 1 0 -9.6609 0 0 1 5.127224 0 0 0 1 1 0 0 0.2624202 0 1 0 -9.665188 0 0 1 5.128438 0 0 0 1 1 0 0 0.2625639 0 1 0 -9.669083 0 0 1 5.12954 0 0 0 1 1 0 0 0.262693 0 1 0 -9.672583 0 0 1 5.130532 0 0 0 1 1 0 0 0.2628075 0 1 0 -9.675682 0 0 1 5.13141 0 0 0 1 1 0 0 0.262907 0 1 0 -9.678379 0 0 1 5.132174 0 0 0 1 1 0 0 0.2629916 0 1 0 -9.680672 0 0 1 5.132823 0 0 0 1 1 0 0 0.2630611 0 1 0 -9.682556 0 0 1 5.133357 0 0 0 1 1 0 0 0.2631153 0 1 0 -9.684028 0 0 1 5.133773 0 0 0 1 1 0 0 0.2631543 0 1 0 -9.685081 0 0 1 5.134071 0 0 0 1 1 0 0 0.2631777 0 1 0 -9.685715 0 0 1 5.134252 0 0 0 1 1 0 0 0.2631856 0 1 0 -9.685928 0 0 1 5.134312 0 0 0 1 + + + + + + + + LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR + + + + + + + + + + + + + + + + + + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + + + + + + + + + + + 1 0 0 0 0 1 0 0.2790807 0 0 1 1.424781 0 0 0 1 + + + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + + 1 0 0 -3.17719e-16 0 1 0 -0.2920505 0 0 1 1.778878 0 0 0 1 + + + 1 0 0 0.2502037 0 1 0 -9.620836 0 0 1 5.135656 0 0 0 1 + + + 1 0 0 0.2631856 0 1 0 -9.685928 0 0 1 5.134312 0 0 0 1 + + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + 1 0 5.98164e-7 -1.004052 -5.98157e-7 0.00465675 0.9999892 1.432954 -2.7855e-9 -0.9999892 0.004656792 0.9881912 0 0 0 1 + + 1 -5.98084e-7 1.18541e-7 -0.001434088 1.21325e-7 0.004656792 -0.9999892 0.424885 5.97526e-7 0.9999892 0.004656792 -0.006624699 0 0 0 1 + + + 0 + 1.21326e-7 + 0 + 0.6195614 + 0 + + + + + + 0 + 5.98164e-7 + 0 + 0.002052783 + -0.4408142 + + + + + 1 2.22045e-16 2.6077e-7 -1.013585 -2.60744e-7 0.01410433 0.9999006 -1.82486 -3.67799e-9 -0.9999006 0.01410425 1.238739 0 0 0 1 + + 1 -2.60498e-7 1.86736e-8 0.007035851 2.23459e-8 0.01410425 -0.9999005 0.4207921 2.60209e-7 0.9999005 0.01410431 0.001840234 0 0 0 1 + + + 0 + 0 + 0 + 0.5452125 + 0 + + + + + + 0 + 2.6077e-7 + 0 + 0.005790472 + -0.4105049 + + + + + 1 2.22045e-16 2.38419e-7 0.9971877 -2.38395e-7 0.01410375 0.9999005 -1.824859 -3.3626e-9 -0.9999005 0.01410383 1.238739 0 0 0 1 + + 1 -2.38398e-7 -4.802e-7 -5.88655e-4 -4.76789e-7 0.01410383 -0.9999006 0.4227737 2.45147e-7 0.9999006 0.01410395 0.001935124 0 0 0 1 + + + 0 + -4.76837e-7 + 0 + 0.5452123 + 0 + + + + + + 0 + 2.38419e-7 + 0 + 0.005790233 + -0.4105048 + + + + + 1 0 1.11759e-7 0.9832794 -1.11758e-7 0.00465621 0.9999892 1.432958 -5.20373e-10 -0.9999892 0.004656196 0.9881967 0 0 0 1 + + 1 -1.1274e-7 1.11239e-7 0.008342445 1.11762e-7 0.004656195 -0.9999892 0.4229819 1.12221e-7 0.9999892 0.004656196 -0.006754637 0 0 0 1 + + + 0 + 0 + 0 + 0.6195612 + 0 + + + + + + 0 + 0 + 0 + 0.002052545 + -0.4408142 + + + + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + + 0 + 0 + 1.631059 + 0 + + + + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + + 0 + 0 + 1.631059 + 0 + + + + + + 0 + 0 + 1.631059 + 0 + + + + + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + + + + + + + \ No newline at end of file diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/car.tscript b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/car.tscript new file mode 100644 index 000000000..105f6b9fb --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/car.tscript @@ -0,0 +1,11 @@ + +singleton TSShapeConstructor(cardae) +{ + baseShapeAsset = "./car.dae"; + singleDetailSize = "0"; + flipUVCoords = "0"; + JoinIdenticalVerts = "0"; + reverseWindingOrder = "0"; + removeRedundantMats = "0"; + animFPS = "2"; +}; diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/carwheel.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/carwheel.asset.taml new file mode 100644 index 000000000..65df6a497 --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/carwheel.asset.taml @@ -0,0 +1 @@ + diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/carwheel.dae b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/carwheel.dae new file mode 100644 index 000000000..dc394f12e --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/carwheel.dae @@ -0,0 +1,140 @@ + + + + + Blender User + Blender 2.90.0 commit date:2020-08-31, commit time:11:26, hash:0330d1af29c0 + + 2021-09-11T01:23:24 + 2021-09-11T01:23:24 + + Z_UP + + + + + + + + 0 0 0 1 + + + 0.8 0.8 0.8 1 + + + 1.45 + + + + + + + + + + + + + + + + + 0.519616 0.1267148 -0.3000001 0.4416719 0.3267148 -0.2550001 0.5795559 0.1267148 -0.155292 0.4926219 0.3267148 -0.1319981 0 0.1267148 0.6 0 0.3267148 0.51 -0.1552919 0.1267148 0.579556 -0.1319979 0.3267148 0.492622 0.4242641 0.1267148 0.424264 0.360624 0.3267148 0.3606239 0.3000001 0.1267148 0.519616 0.2550001 0.3267148 0.441672 -0.3 0.1267148 0.5196161 -0.2549999 0.3267148 0.441672 -0.424264 0.1267147 0.4242641 -0.360624 0.3267148 0.360624 -0.155292 -0.2732852 -0.579556 -0.3000001 -0.2732852 -0.519616 -0.1552921 0.1267148 -0.579556 -0.3000001 0.1267148 -0.519616 0.4242639 0.1267148 -0.4242641 0.3606239 0.3267148 -0.360624 0.519616 0.1267148 -0.3000001 0.4416719 0.3267148 -0.2550001 -0.3000001 0.1267148 -0.519616 -0.4242641 0.1267147 -0.424264 -0.2550001 0.3267148 -0.441672 -0.3606241 0.3267148 -0.3606239 -0.51 0.3267148 0 -0.6 0.1267147 0 -0.492622 0.3267148 0.1319981 -0.579556 0.1267147 0.155292 0.424264 -0.2732852 -0.4242641 0.2999999 -0.2732852 -0.5196161 0.4242639 0.1267148 -0.4242641 0.2999999 0.1267148 -0.5196161 0 -0.2732852 0.6 0 0.1267148 0.6 -0.1552919 -0.2732852 0.579556 -0.1552919 0.1267148 0.579556 0.441672 0.3267148 0.2549999 0.360624 0.3267148 0.3606239 0.5196161 0.1267148 0.2999999 0.4242641 0.1267148 0.424264 -0.5196161 0.1267147 -0.2999999 -0.5196161 -0.2732852 -0.2999999 -0.5795561 0.1267147 -0.1552919 -0.579556 -0.2732852 -0.1552919 0 0.1267148 -0.6 -0.1552921 0.1267148 -0.579556 0 0.3267148 -0.51 -0.1319981 0.3267148 -0.492622 0.579556 -0.2732852 -0.155292 0.5795559 0.1267148 -0.155292 0.6 -0.2732852 0 0.6 0.1267148 0 0.3000001 0.1267148 0.519616 0.2550001 0.3267148 0.441672 0.155292 0.1267148 0.579556 0.131998 0.3267148 0.492622 -0.3000001 -0.2732852 -0.519616 -0.4242641 -0.2732852 -0.424264 -0.3000001 0.1267148 -0.519616 -0.4242641 0.1267147 -0.424264 -0.441672 0.3267148 0.2550001 -0.519616 0.1267147 0.3000001 -0.360624 0.3267148 0.360624 -0.424264 0.1267147 0.4242641 0.579556 -0.2732852 0.1552919 0.579556 0.1267148 0.1552919 0.5196161 -0.2732852 0.2999999 0.5196161 0.1267148 0.2999999 0.4242639 0.1267148 -0.4242641 0.2999999 0.1267148 -0.5196161 0.3606239 0.3267148 -0.360624 0.2549999 0.3267148 -0.441672 0.3000001 -0.2732852 0.519616 0.3000001 0.1267148 0.519616 0.155292 -0.2732852 0.579556 0.155292 0.1267148 0.579556 0.424264 -0.2732852 -0.4242641 0.4242639 0.1267148 -0.4242641 0.519616 -0.2732852 -0.3000001 0.519616 0.1267148 -0.3000001 -0.1552919 0.1267148 0.579556 -0.1319979 0.3267148 0.492622 -0.3 0.1267148 0.5196161 -0.2549999 0.3267148 0.441672 -0.519616 0.1267147 0.3000001 -0.519616 -0.2732852 0.3000001 -0.424264 0.1267147 0.4242641 -0.424264 -0.2732852 0.4242641 0.4242641 -0.2732852 0.424264 0.4242641 0.1267148 0.424264 0.3000001 -0.2732852 0.519616 0.3000001 0.1267148 0.519616 -0.4242641 0.1267147 -0.424264 -0.5196161 0.1267147 -0.2999999 -0.3606241 0.3267148 -0.3606239 -0.441672 0.3267148 -0.2549999 0.1552919 -0.2732852 -0.579556 0 -0.2732852 -0.6 0.1552919 0.1267148 -0.579556 0 0.1267148 -0.6 -0.4242641 0.1267147 -0.424264 -0.4242641 -0.2732852 -0.424264 -0.5196161 0.1267147 -0.2999999 -0.5196161 -0.2732852 -0.2999999 0.5795559 0.1267148 -0.155292 0.4926219 0.3267148 -0.1319981 0.6 0.1267148 0 0.51 0.3267148 0 -0.6 -0.2732852 0 -0.579556 -0.2732852 -0.1552919 -0.579556 -0.2732852 0.155292 -0.5196161 -0.2732852 -0.2999999 -0.519616 -0.2732852 0.3000001 -0.424264 -0.2732852 0.4242641 -0.4242641 -0.2732852 -0.424264 -0.2999999 -0.2732852 0.5196161 -0.3000001 -0.2732852 -0.519616 -0.1552919 -0.2732852 0.579556 -0.155292 -0.2732852 -0.579556 0 -0.2732852 0.6 0 -0.2732852 -0.6 0.155292 -0.2732852 0.579556 0.1552919 -0.2732852 -0.579556 0.3000001 -0.2732852 0.519616 0.2999999 -0.2732852 -0.5196161 0.4242641 -0.2732852 0.424264 0.424264 -0.2732852 -0.4242641 0.5196161 -0.2732852 0.2999999 0.519616 -0.2732852 -0.3000001 0.579556 -0.2732852 0.1552919 0.579556 -0.2732852 -0.155292 0.6 -0.2732852 0 -0.1552919 -0.2732852 0.579556 -0.1552919 0.1267148 0.579556 -0.2999999 -0.2732852 0.5196161 -0.3 0.1267148 0.5196161 0 -0.2732852 -0.6 -0.155292 -0.2732852 -0.579556 0 0.1267148 -0.6 -0.1552921 0.1267148 -0.579556 -0.2999999 -0.2732852 0.5196161 -0.3 0.1267148 0.5196161 -0.424264 -0.2732852 0.4242641 -0.424264 0.1267147 0.4242641 0.519616 -0.2732852 -0.3000001 0.519616 0.1267148 -0.3000001 0.579556 -0.2732852 -0.155292 0.5795559 0.1267148 -0.155292 0.155292 0.1267148 0.579556 0.131998 0.3267148 0.492622 0 0.1267148 0.6 0 0.3267148 0.51 0.1552919 0.1267148 -0.579556 0 0.1267148 -0.6 0.1319979 0.3267148 -0.492622 0 0.3267148 -0.51 0.492622 0.3267148 0.1319979 0.441672 0.3267148 0.2549999 0.579556 0.1267148 0.1552919 0.5196161 0.1267148 0.2999999 0.5196161 -0.2732852 0.2999999 0.5196161 0.1267148 0.2999999 0.4242641 -0.2732852 0.424264 0.4242641 0.1267148 0.424264 -0.579556 0.1267147 0.155292 -0.579556 -0.2732852 0.155292 -0.519616 0.1267147 0.3000001 -0.519616 -0.2732852 0.3000001 0.155292 -0.2732852 0.579556 0.155292 0.1267148 0.579556 0 -0.2732852 0.6 0 0.1267148 0.6 0.2999999 -0.2732852 -0.5196161 0.1552919 -0.2732852 -0.579556 0.2999999 0.1267148 -0.5196161 0.1552919 0.1267148 -0.579556 -0.492622 0.3267148 0.1319981 -0.579556 0.1267147 0.155292 -0.441672 0.3267148 0.2550001 -0.519616 0.1267147 0.3000001 -0.1552921 0.1267148 -0.579556 -0.3000001 0.1267148 -0.519616 -0.1319981 0.3267148 -0.492622 -0.2550001 0.3267148 -0.441672 0.6 0.1267148 0 0.51 0.3267148 0 0.579556 0.1267148 0.1552919 0.492622 0.3267148 0.1319979 -0.5196161 0.1267147 -0.2999999 -0.5795561 0.1267147 -0.1552919 -0.441672 0.3267148 -0.2549999 -0.492622 0.3267148 -0.1319979 -0.6 0.1267147 0 -0.6 -0.2732852 0 -0.579556 0.1267147 0.155292 -0.579556 -0.2732852 0.155292 0.6 -0.2732852 0 0.6 0.1267148 0 0.579556 -0.2732852 0.1552919 0.579556 0.1267148 0.1552919 -0.5795561 0.1267147 -0.1552919 -0.579556 -0.2732852 -0.1552919 -0.6 0.1267147 0 -0.6 -0.2732852 0 -0.51 0.3267148 0 -0.492622 0.3267148 0.1319981 -0.492622 0.3267148 -0.1319979 -0.441672 0.3267148 -0.2549999 -0.441672 0.3267148 0.2550001 -0.3606241 0.3267148 -0.3606239 -0.362736 0.3267148 0 -0.350376 0.3267148 -0.09388393 -0.2550001 0.3267148 -0.441672 -0.3141381 0.3267148 -0.1813679 -0.2564941 0.3267148 -0.2564939 -0.1813681 0.3267148 -0.3141379 -0.1319981 0.3267148 -0.492622 -0.09388405 0.3267148 -0.350376 0 0.3267148 -0.51 0 0.3267148 -0.362736 0.1319979 0.3267148 -0.492622 0.09388387 0.3267148 -0.350376 0.1813679 0.3267148 -0.314138 0.2549999 0.3267148 -0.441672 0.2564939 0.3267148 -0.256494 0.3606239 0.3267148 -0.360624 0.3141379 0.3267148 -0.181368 0.350376 0.3267148 -0.09388405 0.3627359 0.3267148 0 0.4416719 0.3267148 -0.2550001 0.441672 0.3267148 0.2549999 0.360624 0.3267148 0.3606239 0.350376 0.3267148 0.09388393 0.314138 0.3267148 0.1813679 0.256494 0.3267148 0.2564939 0.2550001 0.3267148 0.441672 0.181368 0.3267148 0.3141379 0.131998 0.3267148 0.492622 0.09388399 0.3267148 0.350376 0 0.3267148 0.51 0 0.3267148 0.362736 -0.09388393 0.3267148 0.350376 -0.1319979 0.3267148 0.492622 -0.1813679 0.3267148 0.314138 -0.2549999 0.3267148 0.441672 -0.2564939 0.3267148 0.256494 -0.314138 0.3267148 0.181368 -0.350376 0.3267148 0.09388405 -0.360624 0.3267148 0.360624 0.4926219 0.3267148 -0.1319981 0.492622 0.3267148 0.1319979 0.51 0.3267148 0 -0.5795561 0.1267147 -0.1552919 -0.6 0.1267147 0 -0.492622 0.3267148 -0.1319979 -0.51 0.3267148 0 0.2999999 0.1267148 -0.5196161 0.1552919 0.1267148 -0.579556 0.2549999 0.3267148 -0.441672 0.1319979 0.3267148 -0.492622 -0.208674 0.3267148 -0.1204779 -0.232746 0.3267148 -0.06236392 -0.156506 0.2267147 -0.09035795 -0.17456 0.2267147 -0.04677194 -0.156506 0.2267147 -0.09035795 -0.232746 0.3267148 -0.06236392 0.1807159 0.2267147 0 0.17456 0.2267147 0.04677194 0.240956 0.3267148 0 0.232746 0.3267148 0.06236392 0.240956 0.3267148 0 0.17456 0.2267147 0.04677194 -0.180716 0.2267147 0 -0.240956 0.3267148 0 -0.17456 0.2267147 0.046772 -0.232746 0.3267148 0.06236404 -0.17456 0.2267147 0.046772 -0.240956 0.3267148 0 0.127786 0.2267147 0.1277859 0.09035795 0.2267147 0.156506 0.170382 0.3267148 0.1703819 0.120478 0.3267148 0.208674 0.170382 0.3267148 0.1703819 0.09035795 0.2267147 0.156506 0.09035795 0.2267147 -0.156506 0.1277859 0.2267147 -0.127786 0.1204779 0.3267148 -0.208674 0.1703819 0.3267148 -0.170382 0.1204779 0.3267148 -0.208674 0.1277859 0.2267147 -0.127786 0.046772 0.2267147 0.17456 0 0.2267147 0.180716 0.06236398 0.3267148 0.232746 0 0.3267148 0.240956 0.06236398 0.3267148 0.232746 0 0.2267147 0.180716 -0.046772 0.2267147 -0.17456 -0.06236404 0.3267148 -0.232746 -0.09035801 0.2267147 -0.156506 -0.120478 0.3267148 -0.208674 -0.09035801 0.2267147 -0.156506 -0.06236404 0.3267148 -0.232746 -0.127786 0.2267147 -0.1277859 -0.09035801 0.2267147 -0.156506 -0.170382 0.3267148 -0.1703819 -0.120478 0.3267148 -0.208674 -0.170382 0.3267148 -0.1703819 -0.09035801 0.2267147 -0.156506 0.232746 0.3267148 -0.06236404 0.17456 0.2267147 -0.046772 0.240956 0.3267148 0 0.1807159 0.2267147 0 0.240956 0.3267148 0 0.17456 0.2267147 -0.046772 0.04677194 0.2267147 -0.17456 0.06236392 0.3267148 -0.232746 0 0.2267147 -0.180716 0 0.3267148 -0.240956 0 0.2267147 -0.180716 0.06236392 0.3267148 -0.232746 -0.046772 0.2267147 -0.17456 0 0.2267147 -0.180716 -0.06236404 0.3267148 -0.232746 0 0.3267148 -0.240956 -0.06236404 0.3267148 -0.232746 0 0.2267147 -0.180716 -0.17456 0.2267147 0.046772 -0.232746 0.3267148 0.06236404 -0.156506 0.2267147 0.09035801 -0.208674 0.3267148 0.120478 -0.156506 0.2267147 0.09035801 -0.232746 0.3267148 0.06236404 -0.156506 0.2267147 0.09035801 -0.208674 0.3267148 0.120478 -0.127786 0.2267147 0.127786 -0.170382 0.3267148 0.170382 -0.127786 0.2267147 0.127786 -0.208674 0.3267148 0.120478 0.156506 0.2267147 0.09035795 0.127786 0.2267147 0.1277859 0.208674 0.3267148 0.1204779 0.170382 0.3267148 0.1703819 0.208674 0.3267148 0.1204779 0.127786 0.2267147 0.1277859 -0.180716 0.2267147 0 -0.17456 0.2267147 0.046772 -0.17456 0.2267147 -0.04677194 -0.156506 0.2267147 -0.09035795 -0.17456 0.2267147 -0.04677194 -0.17456 0.2267147 0.046772 -0.156506 0.2267147 0.09035801 -0.156506 0.2267147 -0.09035795 -0.17456 0.2267147 0.046772 -0.127786 0.2267147 -0.1277859 -0.156506 0.2267147 -0.09035795 -0.156506 0.2267147 0.09035801 -0.127786 0.2267147 0.127786 -0.127786 0.2267147 -0.1277859 -0.156506 0.2267147 0.09035801 -0.09035801 0.2267147 -0.156506 -0.127786 0.2267147 -0.1277859 -0.127786 0.2267147 0.127786 -0.09035795 0.2267147 0.156506 -0.09035801 0.2267147 -0.156506 -0.127786 0.2267147 0.127786 -0.046772 0.2267147 -0.17456 -0.09035801 0.2267147 -0.156506 -0.09035795 0.2267147 0.156506 -0.04677194 0.2267147 0.17456 -0.046772 0.2267147 -0.17456 -0.09035795 0.2267147 0.156506 0 0.2267147 -0.180716 -0.046772 0.2267147 -0.17456 -0.04677194 0.2267147 0.17456 0 0.2267147 0.180716 0 0.2267147 -0.180716 -0.04677194 0.2267147 0.17456 0.04677194 0.2267147 -0.17456 0 0.2267147 -0.180716 0 0.2267147 0.180716 0.046772 0.2267147 0.17456 0.04677194 0.2267147 -0.17456 0 0.2267147 0.180716 0.09035795 0.2267147 -0.156506 0.04677194 0.2267147 -0.17456 0.046772 0.2267147 0.17456 0.09035795 0.2267147 0.156506 0.09035795 0.2267147 -0.156506 0.046772 0.2267147 0.17456 0.1277859 0.2267147 -0.127786 0.09035795 0.2267147 -0.156506 0.09035795 0.2267147 0.156506 0.127786 0.2267147 0.1277859 0.1277859 0.2267147 -0.127786 0.09035795 0.2267147 0.156506 0.156506 0.2267147 -0.09035801 0.1277859 0.2267147 -0.127786 0.127786 0.2267147 0.1277859 0.156506 0.2267147 0.09035795 0.156506 0.2267147 -0.09035801 0.127786 0.2267147 0.1277859 0.17456 0.2267147 -0.046772 0.156506 0.2267147 -0.09035801 0.156506 0.2267147 0.09035795 0.17456 0.2267147 0.04677194 0.17456 0.2267147 -0.046772 0.156506 0.2267147 0.09035795 0.1807159 0.2267147 0 0.17456 0.2267147 -0.046772 0.17456 0.2267147 0.04677194 -0.04677194 0.2267147 0.17456 -0.09035795 0.2267147 0.156506 -0.06236398 0.3267148 0.232746 -0.120478 0.3267148 0.208674 -0.06236398 0.3267148 0.232746 -0.09035795 0.2267147 0.156506 0.17456 0.2267147 0.04677194 0.156506 0.2267147 0.09035795 0.232746 0.3267148 0.06236392 0.208674 0.3267148 0.1204779 0.232746 0.3267148 0.06236392 0.156506 0.2267147 0.09035795 0.2086739 0.3267148 -0.120478 0.156506 0.2267147 -0.09035801 0.232746 0.3267148 -0.06236404 0.17456 0.2267147 -0.046772 0.232746 0.3267148 -0.06236404 0.156506 0.2267147 -0.09035801 -0.362736 0.3267148 0 -0.350376 0.3267148 0.09388405 -0.350376 0.3267148 -0.09388393 -0.3141381 0.3267148 -0.1813679 -0.350376 0.3267148 -0.09388393 -0.350376 0.3267148 0.09388405 -0.314138 0.3267148 0.181368 -0.3141381 0.3267148 -0.1813679 -0.350376 0.3267148 0.09388405 -0.2564941 0.3267148 -0.2564939 -0.3141381 0.3267148 -0.1813679 -0.314138 0.3267148 0.181368 -0.2564939 0.3267148 0.256494 -0.2564941 0.3267148 -0.2564939 -0.314138 0.3267148 0.181368 -0.240956 0.3267148 0 -0.2564941 0.3267148 -0.2564939 -0.2564939 0.3267148 0.256494 -0.1813679 0.3267148 0.314138 -0.232746 0.3267148 0.06236404 -0.232746 0.3267148 -0.06236392 -0.2564941 0.3267148 -0.2564939 -0.240956 0.3267148 0 -0.1813681 0.3267148 -0.3141379 -0.2564941 0.3267148 -0.2564939 -0.232746 0.3267148 -0.06236392 -0.208674 0.3267148 -0.1204779 -0.1813681 0.3267148 -0.3141379 -0.232746 0.3267148 -0.06236392 -0.170382 0.3267148 -0.1703819 -0.1813681 0.3267148 -0.3141379 -0.208674 0.3267148 -0.1204779 -0.09388405 0.3267148 -0.350376 -0.1813681 0.3267148 -0.3141379 -0.170382 0.3267148 -0.1703819 -0.120478 0.3267148 -0.208674 -0.09388405 0.3267148 -0.350376 -0.170382 0.3267148 -0.1703819 -0.06236404 0.3267148 -0.232746 -0.09388405 0.3267148 -0.350376 -0.120478 0.3267148 -0.208674 0 0.3267148 -0.362736 -0.09388405 0.3267148 -0.350376 -0.06236404 0.3267148 -0.232746 0 0.3267148 -0.240956 0 0.3267148 -0.362736 -0.06236404 0.3267148 -0.232746 0.09388387 0.3267148 -0.350376 0 0.3267148 -0.362736 0 0.3267148 -0.240956 0.06236392 0.3267148 -0.232746 0.09388387 0.3267148 -0.350376 0 0.3267148 -0.240956 0.1204779 0.3267148 -0.208674 0.09388387 0.3267148 -0.350376 0.06236392 0.3267148 -0.232746 0.1813679 0.3267148 -0.314138 0.09388387 0.3267148 -0.350376 0.1204779 0.3267148 -0.208674 0.1703819 0.3267148 -0.170382 0.1813679 0.3267148 -0.314138 0.1204779 0.3267148 -0.208674 0.2086739 0.3267148 -0.120478 0.1813679 0.3267148 -0.314138 0.1703819 0.3267148 -0.170382 0.2564939 0.3267148 -0.256494 0.1813679 0.3267148 -0.314138 0.2086739 0.3267148 -0.120478 0.232746 0.3267148 -0.06236404 0.2564939 0.3267148 -0.256494 0.2086739 0.3267148 -0.120478 0.240956 0.3267148 0 0.2564939 0.3267148 -0.256494 0.232746 0.3267148 -0.06236404 0.256494 0.3267148 0.2564939 0.2564939 0.3267148 -0.256494 0.240956 0.3267148 0 0.208674 0.3267148 0.1204779 0.181368 0.3267148 0.3141379 0.314138 0.3267148 0.1813679 0.2564939 0.3267148 -0.256494 0.256494 0.3267148 0.2564939 0.3141379 0.3267148 -0.181368 0.2564939 0.3267148 -0.256494 0.314138 0.3267148 0.1813679 0.350376 0.3267148 -0.09388405 0.3141379 0.3267148 -0.181368 0.314138 0.3267148 0.1813679 0.350376 0.3267148 0.09388393 0.350376 0.3267148 -0.09388405 0.314138 0.3267148 0.1813679 0.3627359 0.3267148 0 0.350376 0.3267148 -0.09388405 0.350376 0.3267148 0.09388393 -0.240956 0.3267148 0 -0.2564939 0.3267148 0.256494 -0.232746 0.3267148 0.06236404 -0.208674 0.3267148 0.120478 -0.232746 0.3267148 0.06236404 -0.1813679 0.3267148 0.314138 -0.170382 0.3267148 0.170382 -0.208674 0.3267148 0.120478 -0.09388393 0.3267148 0.350376 -0.170382 0.3267148 0.170382 -0.1813679 0.3267148 0.314138 -0.120478 0.3267148 0.208674 -0.170382 0.3267148 0.170382 -0.09388393 0.3267148 0.350376 -0.06236398 0.3267148 0.232746 -0.120478 0.3267148 0.208674 -0.09388393 0.3267148 0.350376 0 0.3267148 0.362736 -0.06236398 0.3267148 0.232746 -0.09388393 0.3267148 0.350376 0 0.3267148 0.240956 -0.06236398 0.3267148 0.232746 0 0.3267148 0.362736 0.06236398 0.3267148 0.232746 0 0.3267148 0.240956 0 0.3267148 0.362736 0.09388399 0.3267148 0.350376 0.06236398 0.3267148 0.232746 0 0.3267148 0.362736 0.120478 0.3267148 0.208674 0.06236398 0.3267148 0.232746 0.09388399 0.3267148 0.350376 0.181368 0.3267148 0.3141379 0.120478 0.3267148 0.208674 0.09388399 0.3267148 0.350376 0.170382 0.3267148 0.1703819 0.120478 0.3267148 0.208674 0.181368 0.3267148 0.3141379 0.208674 0.3267148 0.1204779 0.170382 0.3267148 0.1703819 0.181368 0.3267148 0.3141379 0.232746 0.3267148 0.06236392 0.208674 0.3267148 0.1204779 0.256494 0.3267148 0.2564939 0.240956 0.3267148 0 0.232746 0.3267148 0.06236392 0.256494 0.3267148 0.2564939 0.09035795 0.2267147 0.156506 0.046772 0.2267147 0.17456 0.120478 0.3267148 0.208674 0.06236398 0.3267148 0.232746 0.120478 0.3267148 0.208674 0.046772 0.2267147 0.17456 0.04677194 0.2267147 -0.17456 0.09035795 0.2267147 -0.156506 0.06236392 0.3267148 -0.232746 0.1204779 0.3267148 -0.208674 0.06236392 0.3267148 -0.232746 0.09035795 0.2267147 -0.156506 -0.232746 0.3267148 -0.06236392 -0.240956 0.3267148 0 -0.17456 0.2267147 -0.04677194 -0.180716 0.2267147 0 -0.17456 0.2267147 -0.04677194 -0.240956 0.3267148 0 0.1703819 0.3267148 -0.170382 0.1277859 0.2267147 -0.127786 0.2086739 0.3267148 -0.120478 0.156506 0.2267147 -0.09035801 0.2086739 0.3267148 -0.120478 0.1277859 0.2267147 -0.127786 -0.09035795 0.2267147 0.156506 -0.127786 0.2267147 0.127786 -0.120478 0.3267148 0.208674 -0.170382 0.3267148 0.170382 -0.120478 0.3267148 0.208674 -0.127786 0.2267147 0.127786 -0.170382 0.3267148 -0.1703819 -0.208674 0.3267148 -0.1204779 -0.127786 0.2267147 -0.1277859 -0.156506 0.2267147 -0.09035795 -0.127786 0.2267147 -0.1277859 -0.208674 0.3267148 -0.1204779 0 0.2267147 0.180716 -0.04677194 0.2267147 0.17456 0 0.3267148 0.240956 -0.06236398 0.3267148 0.232746 0 0.3267148 0.240956 -0.04677194 0.2267147 0.17456 + + + + + + + + + + 0.8437166 0.4074378 -0.3494809 -0.1191788 0.4074361 0.9054238 0.5559365 0.4074304 0.7245241 -0.5559365 0.4074304 0.7245241 -0.3826816 0 -0.9238803 0.7245241 0.4074304 -0.5559365 -0.5559365 0.4074304 -0.7245241 -0.9054238 0.4074361 0.1191788 0.6087679 0 -0.7933484 -0.1305003 0 0.9914484 0.7245241 0.4074304 0.5559365 -0.9238803 0 -0.3826816 -0.1191788 0.4074361 -0.9054238 0.9914484 0 -0.1305003 0.3494809 0.4074378 0.8437166 -0.6087679 0 -0.7933484 -0.7245241 0.4074304 0.5559365 0.9238803 0 0.3826816 0.5559365 0.4074304 -0.7245241 0.3826816 0 0.9238803 0.7933484 0 -0.6087679 -0.3494719 0.4074273 0.8437254 -0.3494809 0.4074378 0.8437166 -0.7933484 0 0.6087679 0.6087679 0 0.7933484 -0.7245241 0.4074304 -0.5559365 0.1305003 0 -0.9914484 -0.7933484 0 -0.6087679 0.9054238 0.4074361 -0.1191788 0 -1 0 0 -1 0 0 -1 0 0 -1 0 2.39831e-7 -1 0 2.39831e-7 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 2.39831e-7 -1 0 2.39831e-7 -1 0 0 -1 0 0 -1 0 0 -1 0 -0.3826816 0 0.9238803 -0.1305003 0 -0.9914484 -0.6087679 0 0.7933484 0.9238803 0 -0.3826816 0.1191788 0.4074361 0.9054238 0.1191788 0.4074361 -0.9054238 0.8437166 0.4074378 0.3494809 0.7933484 0 0.6087679 -0.9238803 0 0.3826816 0.1305003 0 0.9914484 0.3826816 0 -0.9238803 -0.8437166 0.4074378 0.3494809 -0.3494719 0.4074273 -0.8437254 -0.3494809 0.4074378 -0.8437166 0.9054238 0.4074361 0.1191788 -0.8437166 0.4074378 -0.3494809 -0.9914484 0 0.1305003 0.9914484 0 0.1305003 -0.9914484 0 -0.1305003 0 1 0 0 1 1.50978e-7 0 1 0 0 1 0 0 1 1.33391e-7 0 1 0 0 1 -1.44492e-7 0 1 3.52701e-7 0 1 0 0 1 2.69452e-7 0 1 2.87467e-7 0 1 -2.69446e-7 0 1 0 0 1 -1.34726e-7 0 1 -1.22775e-7 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 -5.38907e-7 0 1 0 0 1 2.6945e-7 0 1 2.13308e-7 0 1 -2.69446e-7 0 1 0 0 1 0 0 1 3.52702e-7 0 1 0 0 1 1.36669e-7 0 1 0 0 1 0 0 1 -2.76961e-7 0 1 0 -0.9054238 0.4074361 -0.1191788 0.3494809 0.4074378 -0.8437166 0.7931899 0.5127505 0.3285375 -0.851202 0.5127477 -0.1120042 -0.8511992 0.512746 -0.1120344 0.851202 0.5127477 -0.1120042 0.8511992 0.512746 -0.1120344 -0.5226402 0.512752 -0.6811261 -0.5226402 0.512752 0.6811261 -0.1120042 0.5127477 -0.851202 -0.1120373 0.5127593 -0.8511908 0.3285375 0.5127505 0.7931899 0.5226402 0.512752 0.6811261 -0.8511992 0.512746 0.1120344 -0.851202 0.5127477 0.1120042 -0.1120042 0.5127477 0.851202 -0.1120373 0.5127593 0.8511908 0.1120042 0.5127477 0.851202 0.1120373 0.5127593 0.8511908 0.7931899 0.5127505 -0.3285375 0.6811261 0.512752 -0.5226402 -0.6811261 0.512752 -0.5226402 0 1 0 0 1 -1.40552e-7 0 1 2.8545e-7 0 1 0 0 1 1.26883e-7 0 1 0 0 1 0 0 1 1.22408e-7 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 1.7944e-7 0 1 -1.45507e-7 0 1 0 0.3285375 0.5127505 -0.7931899 -0.7931899 0.5127505 -0.3285375 -0.7931899 0.5127505 0.3285375 0 1 0 0 1 1.49225e-7 0 1 0 0 1 0 0 1 -1.75136e-7 0 1 0 0 1 -1.43562e-7 0 1 3.25832e-7 0 1 -4.90513e-7 0 1 -1.5643e-7 0 1 2.45256e-7 0 1 -1.53862e-7 0 1 -1.43558e-7 0 1 0 0 1 -1.78162e-7 0 1 0 0 1 0 0 1 0 0 1 -2.45256e-7 0 1 1.62916e-7 0 1 2.55021e-7 0 1 -3.25832e-7 0 1 -3.25838e-7 0 1 0 -0.3285375 0.5127505 -0.7931899 -0.3285375 0.5127505 0.7931899 0.8511992 0.512746 0.1120344 0.851202 0.5127477 0.1120042 -0.6811261 0.512752 0.5226402 0.5226402 0.512752 -0.6811261 0.6811261 0.512752 0.5226402 0.1120042 0.5127477 -0.851202 0.1120344 0.512746 -0.8511992 + + + + + + + + + + -2.642518 -1.11748 -6.85499 -0.172037 -2.129416 1.922823 -6.418854 2.41222 -2.129416 1.922823 -6.85499 -0.172037 2.210953 -1.828482 3.31643 -6.001815 -0.722982 -2.776501 0.822585 -6.807631 -0.722982 -2.776501 3.31643 -6.001815 -1.414126 -2.496379 -5.330165 -4.313911 -2.860106 0.226827 -6.559249 -1.999185 -2.860106 0.226827 -5.330165 -4.313911 2.860106 0.226827 6.559249 -1.999185 1.414126 -2.496379 5.330165 -4.313911 1.414126 -2.496379 6.559249 -1.999185 0 -1.541648 0 1.541648 7.874016 -1.541648 7.874016 1.541648 7.874016 -1.541648 0 1.541648 -2.769491 -0.749384 -6.815154 0.757733 -1.849449 2.193444 -6.033118 3.259136 -1.849449 2.193444 -6.815154 0.757733 2.860106 -0.226827 1.414126 2.496379 6.559249 1.999185 5.330165 4.313911 6.559249 1.999185 1.414126 2.496379 6.650924 -1.669042 2.333658 -1.669042 6.791303 0.947997 2.498809 1.409827 6.791303 0.947997 2.333658 -1.669042 0 1.541648 0 -1.541648 -7.874016 1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 0 1.541648 7.874016 1.541648 0 -1.541648 7.874016 -1.541648 0 -1.541648 7.874016 1.541648 -6.033118 -3.259136 -6.815154 -0.757733 -1.849449 -2.193444 -2.769491 0.749384 -1.849449 -2.193444 -6.815154 -0.757733 7.874016 -1.541648 0 -1.541648 7.874016 1.541648 0 1.541648 7.874016 1.541648 0 -1.541648 2.210953 1.828482 -0.722982 2.776501 3.31643 6.001815 0.822585 6.807631 3.31643 6.001815 -0.722982 2.776501 0 -1.541648 -7.874016 -1.541648 0 1.541648 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 -0.643955 -2.795887 -3.879534 -5.654176 -2.806125 -0.597765 -5.717378 -3.785773 -2.806125 -0.597765 -3.879534 -5.654176 0 -1.541648 0 1.541648 7.874016 -1.541648 7.874016 1.541648 7.874016 -1.541648 0 1.541648 6.033118 -3.259136 1.849449 -2.193444 6.815154 -0.757733 2.769491 0.749384 6.815154 -0.757733 1.849449 -2.193444 0 -1.541648 -7.874016 -1.541648 0 1.541648 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 -1.414126 2.496379 -2.860106 -0.226827 -5.330165 4.313911 -6.559249 1.999185 -5.330165 4.313911 -2.860106 -0.226827 0 -1.541648 -7.874016 -1.541648 0 1.541648 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 0 -1.541648 -7.874016 -1.541648 0 1.541648 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 2.806125 -0.597765 5.717378 -3.785773 0.643955 -2.795887 3.879534 -5.654176 0.643955 -2.795887 5.717378 -3.785773 7.874016 -1.541648 0 -1.541648 7.874016 1.541648 0 1.541648 7.874016 1.541648 0 -1.541648 0 -1.541648 -7.874016 -1.541648 0 1.541648 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 2.769491 -0.749384 1.849449 2.193444 6.815154 0.757733 6.033118 3.259136 6.815154 0.757733 1.849449 2.193444 0 1.541648 0 -1.541648 -7.874016 1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 7.874016 -1.541648 0 -1.541648 7.874016 1.541648 0 1.541648 7.874016 1.541648 0 -1.541648 -2.498809 -1.409827 -6.791303 -0.947997 -2.333658 1.669042 -6.650924 1.669042 -2.333658 1.669042 -6.791303 -0.947997 11.81102 0 11.40857 -3.056918 11.40857 3.056918 10.22865 -5.905512 11.40857 3.056918 11.40857 -3.056918 10.22865 5.905512 11.40857 3.056918 10.22865 -5.905512 8.351655 8.351655 10.22865 5.905512 10.22865 -5.905512 8.351655 -8.351655 8.351655 8.351655 10.22865 -5.905512 5.905512 10.22865 8.351655 8.351655 8.351655 -8.351655 5.905512 -10.22865 5.905512 10.22865 8.351655 -8.351655 3.056918 11.40857 5.905512 10.22865 5.905512 -10.22865 3.056918 -11.40857 3.056918 11.40857 5.905512 -10.22865 0 11.81102 3.056918 11.40857 3.056918 -11.40857 0 -11.81102 0 11.81102 3.056918 -11.40857 -3.056918 11.40857 0 11.81102 0 -11.81102 -3.056918 -11.40857 -3.056918 11.40857 0 -11.81102 -5.905512 10.22865 -3.056918 11.40857 -3.056918 -11.40857 -5.905512 -10.22865 -5.905512 10.22865 -3.056918 -11.40857 -8.351655 8.351655 -5.905512 10.22865 -5.905512 -10.22865 -8.351655 -8.351655 -8.351655 8.351655 -5.905512 -10.22865 -10.22865 5.905512 -8.351655 8.351655 -8.351655 -8.351655 -10.22865 -5.905512 -10.22865 5.905512 -8.351655 -8.351655 -11.40857 3.056918 -10.22865 5.905512 -10.22865 -5.905512 -11.40857 -3.056918 -11.40857 3.056918 -10.22865 -5.905512 -11.81102 0 -11.40857 3.056918 -11.40857 -3.056918 0 1.541648 7.874016 1.541648 0 -1.541648 7.874016 -1.541648 0 -1.541648 7.874016 1.541648 0 -1.541648 0 1.541648 7.874016 -1.541648 7.874016 1.541648 7.874016 -1.541648 0 1.541648 0 1.541648 7.874016 1.541648 0 -1.541648 7.874016 -1.541648 0 -1.541648 7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 0 1.541648 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 0.722982 -2.776501 -0.822585 -6.807631 -2.210953 -1.828482 -3.31643 -6.001815 -2.210953 -1.828482 -0.822585 -6.807631 0.722982 2.776501 -2.210953 1.828482 -0.822585 6.807631 -3.31643 6.001815 -0.822585 6.807631 -2.210953 1.828482 -6.418854 -2.41222 -6.85499 0.172037 -2.129416 -1.922823 -2.642518 1.11748 -2.129416 -1.922823 -6.85499 0.172037 0 -1.541648 -7.874016 -1.541648 0 1.541648 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 7.874016 -1.541648 0 -1.541648 7.874016 1.541648 0 1.541648 7.874016 1.541648 0 -1.541648 0 -1.541648 -7.874016 -1.541648 0 1.541648 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 0 1.541648 0 -1.541648 -7.874016 1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 6.418854 -2.41222 2.129416 -1.922823 6.85499 0.172037 2.642518 1.11748 6.85499 0.172037 2.129416 -1.922823 2.806125 0.597765 0.643955 2.795887 5.717378 3.785773 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 -2.333658 -1.669042 -6.650924 -1.669042 -2.498809 1.409827 -6.791303 0.947997 -2.498809 1.409827 -6.650924 -1.669042 2.642518 -1.11748 2.129416 1.922823 6.85499 -0.172037 6.418854 2.41222 6.85499 -0.172037 2.129416 1.922823 7.874016 -1.541648 0 -1.541648 7.874016 1.541648 0 1.541648 7.874016 1.541648 0 -1.541648 0 -1.541648 -7.874016 -1.541648 0 1.541648 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 7.874016 -1.541648 0 -1.541648 7.874016 1.541648 0 1.541648 7.874016 1.541648 0 -1.541648 -10.03937 0 -9.697287 2.59838 -9.697287 -2.59838 -8.69435 -5.019685 -9.697287 -2.59838 -9.697287 2.59838 -8.69435 5.019685 -8.69435 -5.019685 -9.697287 2.59838 -7.098907 -7.098907 -8.69435 -5.019685 -8.69435 5.019685 -7.140481 0 -7.098907 -7.098907 -8.69435 5.019685 -6.897174 -1.848092 -7.098907 -7.098907 -7.140481 0 -5.019685 -8.69435 -7.098907 -7.098907 -6.897174 -1.848092 -6.183837 -3.57024 -5.019685 -8.69435 -6.897174 -1.848092 -5.049082 -5.049082 -5.019685 -8.69435 -6.183837 -3.57024 -3.57024 -6.183837 -5.019685 -8.69435 -5.049082 -5.049082 -2.59838 -9.697287 -5.019685 -8.69435 -3.57024 -6.183837 -1.848092 -6.897174 -2.59838 -9.697287 -3.57024 -6.183837 0 -10.03937 -2.59838 -9.697287 -1.848092 -6.897174 0 -7.140481 0 -10.03937 -1.848092 -6.897174 2.59838 -9.697287 0 -10.03937 0 -7.140481 1.848092 -6.897174 2.59838 -9.697287 0 -7.140481 3.57024 -6.183837 2.59838 -9.697287 1.848092 -6.897174 5.019685 -8.69435 2.59838 -9.697287 3.57024 -6.183837 5.049082 -5.049082 5.019685 -8.69435 3.57024 -6.183837 7.098907 -7.098907 5.019685 -8.69435 5.049082 -5.049082 6.183837 -3.57024 7.098907 -7.098907 5.049082 -5.049082 6.897174 -1.848092 7.098907 -7.098907 6.183837 -3.57024 7.140481 0 7.098907 -7.098907 6.897174 -1.848092 8.69435 -5.019685 7.098907 -7.098907 7.140481 0 8.69435 -5.019685 7.140481 0 8.69435 5.019685 8.69435 5.019685 7.140481 0 7.098907 7.098907 7.140481 0 6.897174 1.848092 7.098907 7.098907 6.897174 1.848092 6.183837 3.57024 7.098907 7.098907 6.183837 3.57024 5.049082 5.049082 7.098907 7.098907 7.098907 7.098907 5.049082 5.049082 5.019685 8.69435 5.049082 5.049082 3.57024 6.183837 5.019685 8.69435 5.019685 8.69435 3.57024 6.183837 2.59838 9.697287 3.57024 6.183837 1.848092 6.897174 2.59838 9.697287 2.59838 9.697287 1.848092 6.897174 0 10.03937 1.848092 6.897174 0 7.140481 0 10.03937 0 7.140481 -1.848092 6.897174 0 10.03937 0 10.03937 -1.848092 6.897174 -2.59838 9.697287 -1.848092 6.897174 -3.57024 6.183837 -2.59838 9.697287 -2.59838 9.697287 -3.57024 6.183837 -5.019685 8.69435 -3.57024 6.183837 -5.049082 5.049082 -5.019685 8.69435 -5.049082 5.049082 -6.183837 3.57024 -5.019685 8.69435 -6.183837 3.57024 -6.897174 1.848092 -5.019685 8.69435 -5.019685 8.69435 -6.897174 1.848092 -7.098907 7.098907 -6.897174 1.848092 -7.140481 0 -7.098907 7.098907 -8.69435 5.019685 -7.098907 7.098907 -7.140481 0 9.697287 -2.59838 8.69435 -5.019685 8.69435 5.019685 9.697287 2.59838 9.697287 -2.59838 8.69435 5.019685 10.03937 0 9.697287 -2.59838 9.697287 2.59838 2.498809 -1.409827 2.333658 1.669042 6.791303 -0.947997 6.650924 1.669042 6.791303 -0.947997 2.333658 1.669042 -0.643955 2.795887 -2.806125 0.597765 -3.879534 5.654176 -5.717378 3.785773 -3.879534 5.654176 -2.806125 0.597765 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 0 1.541648 7.874016 1.541648 0 -1.541648 0 1.541648 7.874016 1.541648 0 -1.541648 -6.650924 1.669042 -2.333658 1.669042 -6.791303 -0.947997 -6.650924 1.669042 -2.333658 1.669042 -6.791303 -0.947997 -6.650924 1.669042 -2.333658 1.669042 -6.791303 -0.947997 -6.650924 1.669042 -2.333658 1.669042 -6.791303 -0.947997 7.874016 1.541648 7.874016 -1.541648 0 1.541648 7.874016 1.541648 7.874016 -1.541648 0 1.541648 7.874016 1.541648 7.874016 -1.541648 0 1.541648 7.874016 1.541648 7.874016 -1.541648 0 1.541648 7.874016 1.541648 7.874016 -1.541648 0 1.541648 7.874016 1.541648 7.874016 -1.541648 0 1.541648 7.874016 -1.541648 0 -1.541648 7.874016 1.541648 7.874016 -1.541648 0 -1.541648 7.874016 1.541648 7.874016 -1.541648 0 -1.541648 7.874016 1.541648 7.874016 -1.541648 0 -1.541648 7.874016 1.541648 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 -3.31643 -6.001815 -2.210953 -1.828482 -0.822585 -6.807631 -3.31643 -6.001815 -2.210953 -1.828482 -0.822585 -6.807631 -3.31643 -6.001815 -2.210953 -1.828482 -0.822585 -6.807631 -3.31643 -6.001815 -2.210953 -1.828482 -0.822585 -6.807631 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 1.541648 -7.874016 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 -7.874016 -1.541648 -7.874016 1.541648 0 -1.541648 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 3.879534 5.654176 5.717378 3.785773 0.643955 2.795887 6.418854 2.41222 6.85499 -0.172037 2.129416 1.922823 6.418854 2.41222 6.85499 -0.172037 2.129416 1.922823 6.418854 2.41222 6.85499 -0.172037 2.129416 1.922823 6.418854 2.41222 6.85499 -0.172037 2.129416 1.922823 0 1.541648 7.874016 1.541648 0 -1.541648 0 1.541648 7.874016 1.541648 0 -1.541648 6.650924 1.669042 6.791303 -0.947997 2.333658 1.669042 6.650924 1.669042 6.791303 -0.947997 2.333658 1.669042 + + + + + + + + + + + + + + +

0 0 0 1 0 1 2 0 2 3 0 3 2 0 4 1 0 5 4 1 6 5 1 7 6 1 8 7 1 9 6 1 10 5 1 11 8 2 12 9 2 13 10 2 14 11 2 15 10 2 16 9 2 17 12 3 18 13 3 19 14 3 20 15 3 21 14 3 22 13 3 23 16 4 24 17 4 25 18 4 26 19 4 27 18 4 28 17 4 29 20 5 30 21 5 31 22 5 32 23 5 33 22 5 34 21 5 35 24 6 36 25 6 37 26 6 38 27 6 39 26 6 40 25 6 41 28 7 42 29 7 43 30 7 44 31 7 45 30 7 46 29 7 47 32 8 48 33 8 49 34 8 50 35 8 51 34 8 52 33 8 53 36 9 54 37 9 55 38 9 56 39 9 57 38 9 58 37 9 59 40 10 60 41 10 61 42 10 62 43 10 63 42 10 64 41 10 65 44 11 66 45 11 67 46 11 68 47 11 69 46 11 70 45 11 71 48 12 72 49 12 73 50 12 74 51 12 75 50 12 76 49 12 77 52 13 78 53 13 79 54 13 80 55 13 81 54 13 82 53 13 83 56 14 84 57 14 85 58 14 86 59 14 87 58 14 88 57 14 89 60 15 90 61 15 91 62 15 92 63 15 93 62 15 94 61 15 95 64 16 96 65 16 97 66 16 98 67 16 99 66 16 100 65 16 101 68 17 102 69 17 103 70 17 104 71 17 105 70 17 106 69 17 107 72 18 108 73 18 109 74 18 110 75 18 111 74 18 112 73 18 113 76 19 114 77 19 115 78 19 116 79 19 117 78 19 118 77 19 119 80 20 120 81 20 121 82 20 122 83 20 123 82 20 124 81 20 125 84 21 126 85 22 127 86 22 128 87 22 129 86 22 130 85 22 131 88 23 132 89 23 133 90 23 134 91 23 135 90 23 136 89 23 137 92 24 138 93 24 139 94 24 140 95 24 141 94 24 142 93 24 143 96 25 144 97 25 145 98 25 146 99 25 147 98 25 148 97 25 149 100 26 150 101 26 151 102 26 152 103 26 153 102 26 154 101 26 155 104 27 156 105 27 157 106 27 158 107 27 159 106 27 160 105 27 161 108 28 162 109 28 163 110 28 164 111 28 165 110 28 166 109 28 167 112 29 168 113 29 169 114 29 170 115 29 171 114 29 172 113 29 173 116 30 174 114 30 175 115 30 176 117 31 177 116 31 178 115 31 179 118 32 180 117 32 181 115 32 182 119 33 183 117 33 184 118 33 185 120 34 186 119 34 187 118 34 188 121 35 189 119 35 190 120 35 191 122 36 192 121 36 193 120 36 194 123 37 195 121 37 196 122 37 197 124 38 198 123 38 199 122 38 200 125 39 201 123 39 202 124 39 203 126 29 204 125 29 205 124 29 206 127 40 207 125 40 208 126 40 209 128 41 210 127 41 211 126 41 212 129 42 213 127 42 214 128 42 215 130 43 216 129 43 217 128 43 218 131 44 219 129 44 220 130 44 221 132 45 222 131 45 223 130 45 224 133 46 225 131 46 226 132 46 227 134 29 228 133 29 229 132 29 230 135 29 231 133 29 232 134 29 233 136 47 234 137 47 235 138 47 236 139 47 237 138 47 238 137 47 239 140 48 240 141 48 241 142 48 242 143 48 243 142 48 244 141 48 245 144 49 246 145 49 247 146 49 248 147 49 249 146 49 250 145 49 251 148 50 252 149 50 253 150 50 254 151 50 255 150 50 256 149 50 257 152 51 258 153 51 259 154 51 260 155 51 261 154 51 262 153 51 263 156 52 264 157 52 265 158 52 266 159 52 267 158 52 268 157 52 269 160 53 270 161 53 271 162 53 272 163 53 273 162 53 274 161 53 275 164 54 276 165 54 277 166 54 278 167 54 279 166 54 280 165 54 281 168 55 282 169 55 283 170 55 284 171 55 285 170 55 286 169 55 287 172 56 288 173 56 289 174 56 290 175 56 291 174 56 292 173 56 293 176 57 294 177 57 295 178 57 296 179 57 297 178 57 298 177 57 299 180 58 300 181 58 301 182 58 302 183 58 303 182 58 304 181 58 305 184 59 306 185 60 307 186 60 308 187 60 309 186 60 310 185 60 311 188 61 312 189 61 313 190 61 314 191 61 315 190 61 316 189 61 317 192 62 318 193 62 319 194 62 320 195 62 321 194 62 322 193 62 323 196 63 324 197 63 325 198 63 326 199 63 327 198 63 328 197 63 329 200 64 330 201 64 331 202 64 332 203 64 333 202 64 334 201 64 335 204 65 336 205 65 337 206 65 338 207 65 339 206 65 340 205 65 341 208 66 342 209 66 343 210 66 344 211 67 345 210 67 346 209 67 347 212 68 348 211 68 349 209 68 350 213 69 351 211 69 352 212 69 353 214 70 354 213 70 355 212 70 356 215 71 357 213 71 358 214 71 359 216 72 360 213 72 361 215 72 362 217 68 363 216 68 364 215 68 365 218 73 366 216 73 367 217 73 368 219 74 369 216 74 370 218 74 371 220 68 372 216 68 373 219 68 374 221 75 375 220 75 376 219 75 377 222 76 378 220 76 379 221 76 380 223 77 381 222 77 382 221 77 383 224 78 384 222 78 385 223 78 386 225 68 387 224 68 388 223 68 389 226 79 390 224 79 391 225 79 392 227 68 393 224 68 394 226 68 395 228 68 396 227 68 397 226 68 398 229 80 399 227 80 400 228 80 401 230 68 402 229 68 403 228 68 404 231 68 405 229 68 406 230 68 407 232 81 408 229 81 409 231 81 410 233 82 411 229 82 412 232 82 413 233 83 414 232 83 415 234 83 416 234 84 417 232 84 418 235 84 419 232 85 420 236 85 421 235 85 422 236 68 423 237 68 424 235 68 425 237 86 426 238 86 427 235 86 428 235 87 429 238 87 430 239 87 431 238 88 432 240 88 433 239 88 434 239 68 435 240 68 436 241 68 437 240 68 438 242 68 439 241 68 440 241 68 441 242 68 442 243 68 443 242 89 444 244 89 445 243 89 446 244 90 447 245 90 448 243 90 449 243 91 450 245 91 451 246 91 452 245 75 453 247 75 454 246 75 455 246 68 456 247 68 457 248 68 458 247 92 459 249 92 460 248 92 461 249 93 462 250 93 463 248 93 464 250 68 465 251 68 466 248 68 467 248 94 468 251 94 469 252 94 470 251 95 471 214 95 472 252 95 473 212 96 474 252 96 475 214 96 476 253 97 477 233 97 478 234 97 479 254 98 480 253 98 481 234 98 482 255 99 483 253 99 484 254 99 485 256 100 486 257 100 487 258 100 488 259 100 489 258 100 490 257 100 491 260 101 492 261 101 493 262 101 494 263 101 495 262 101 496 261 101 497 264 102 498 265 102 499 266 102 500 267 102 501 268 102 502 269 102 503 270 103 504 271 103 505 272 103 506 273 104 507 274 104 508 275 104 509 276 105 510 277 105 511 278 105 512 279 106 513 280 106 514 281 106 515 282 107 516 283 107 517 284 107 518 285 107 519 286 107 520 287 107 521 288 108 522 289 108 523 290 108 524 291 108 525 292 108 526 293 108 527 294 109 528 295 109 529 296 109 530 297 110 531 298 110 532 299 110 533 300 111 534 301 111 535 302 111 536 303 111 537 304 111 538 305 111 539 306 112 540 307 112 541 308 112 542 309 112 543 310 112 544 311 112 545 312 113 546 313 113 547 314 113 548 315 114 549 316 114 550 317 114 551 318 115 552 319 115 553 320 115 554 321 116 555 322 116 556 323 116 557 324 117 558 325 117 559 326 117 560 327 118 561 328 118 562 329 118 563 330 119 564 331 119 565 332 119 566 333 119 567 334 119 568 335 119 569 336 120 570 337 120 571 338 120 572 339 120 573 340 120 574 341 120 575 342 121 576 343 121 577 344 121 578 345 121 579 346 121 580 347 121 581 348 122 582 349 122 583 350 122 584 351 123 585 352 123 586 353 123 587 354 124 588 355 124 589 356 124 590 357 125 591 358 125 592 359 125 593 360 126 594 361 126 595 362 126 596 363 127 597 364 127 598 365 127 599 366 68 600 367 68 601 368 68 602 369 128 603 370 128 604 371 128 605 372 129 606 373 129 607 374 129 608 375 130 609 376 130 610 377 130 611 378 68 612 379 68 613 380 68 614 381 131 615 382 131 616 383 131 617 384 132 618 385 132 619 386 132 620 387 133 621 388 133 622 389 133 623 390 68 624 391 68 625 392 68 626 393 134 627 394 134 628 395 134 629 396 68 630 397 68 631 398 68 632 399 135 633 400 135 634 401 135 635 402 136 636 403 136 637 404 136 638 405 137 639 406 137 640 407 137 641 408 68 642 409 68 643 410 68 644 411 138 645 412 138 646 413 138 647 414 139 648 415 139 649 416 139 650 417 139 651 418 139 652 419 139 653 420 140 654 421 140 655 422 140 656 423 140 657 424 140 658 425 140 659 426 141 660 427 141 661 428 141 662 429 141 663 430 141 664 431 141 665 432 142 666 433 142 667 434 142 668 435 143 669 436 143 670 437 143 671 438 68 672 439 68 673 440 68 674 441 144 675 442 144 676 443 144 677 444 68 678 445 68 679 446 68 680 447 145 681 448 145 682 449 145 683 450 146 684 451 146 685 449 146 686 452 68 687 453 68 688 454 68 689 455 147 690 456 147 691 457 147 692 458 68 693 459 68 694 460 68 695 461 68 696 462 68 697 463 68 698 464 148 699 465 148 700 466 148 701 467 68 702 468 68 703 469 68 704 470 68 705 471 68 706 472 68 707 473 149 708 474 149 709 475 149 710 476 150 711 477 150 712 478 150 713 479 151 714 480 151 715 481 151 716 482 68 717 483 68 718 484 68 719 485 152 720 486 152 721 487 152 722 488 68 723 489 68 724 490 68 725 491 68 726 492 68 727 493 68 728 494 153 729 495 153 730 496 153 731 497 68 732 498 68 733 499 68 734 500 68 735 501 68 736 502 68 737 503 68 738 504 68 739 505 68 740 506 68 741 507 68 742 508 68 743 506 154 744 509 154 745 510 154 746 511 155 747 512 155 748 513 155 749 514 156 750 515 156 751 516 156 752 517 157 753 518 157 754 519 157 755 520 68 756 521 68 757 522 68 758 523 158 759 524 158 760 525 158 761 526 68 762 527 68 763 528 68 764 529 68 765 530 68 766 531 68 767 532 68 768 533 68 769 531 68 770 534 159 771 535 159 772 536 159 773 537 68 774 538 68 775 539 68 776 540 160 777 541 160 778 542 160 779 543 161 780 544 161 781 545 161 782 546 150 783 547 150 784 548 150 785 549 162 786 550 162 787 551 162 788 552 163 789 553 163 790 554 163 791 555 68 792 556 68 793 557 68 794 558 164 795 559 164 796 560 164 797 561 68 798 562 68 799 563 68 800 564 165 801 565 165 802 566 165 803 567 68 804 568 68 805 569 68 806 570 68 807 571 68 808 572 68 809 573 166 810 574 166 811 575 166 812 576 166 813 577 166 814 578 166 815 579 167 816 580 167 817 581 167 818 582 167 819 583 167 820 584 167 821 585 168 822 586 168 823 587 168 824 588 169 825 589 169 826 590 169 827 591 170 828 592 170 829 593 170 830 594 170 831 595 170 832 596 170 833 597 171 834 598 171 835 599 171 836 600 171 837 601 171 838 602 171 839 603 172 840 604 172 841 605 172 842 606 172 843 607 172 844 608 172 845 609 173 846 610 173 847 611 173 848 612 174 849 613 174 850 614 174 851

+
+
+
+ + + + 0.5763563 -0.2305425 -0.5763563 0.5763563 0.2305426 -0.5763563 -0.5763563 -0.2305425 -0.5763563 -0.5763563 0.2305426 -0.5763563 0.5763563 -0.2305426 0.5763563 0.5763563 0.2305425 0.5763563 -0.5763563 -0.2305426 0.5763563 -0.5763563 0.2305425 0.5763563 + + + + + + + + + + 0 0 -1 0 0 1 1 0 0 0 1 0 0 1 1.34573e-7 -1 0 0 0 -1 -1.34573e-7 0 -1 0 + + + + + + + + + + + + + + +

3 0 1 0 0 0 0 0 2 0 3 0 7 1 6 1 4 1 4 1 5 1 7 1 5 2 4 2 0 2 0 2 1 2 5 2 7 3 5 3 1 3 1 4 3 4 7 4 6 5 7 5 3 5 3 5 2 5 6 5 4 6 6 6 2 6 2 7 0 7 4 7

+
+
+
+
+ + + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + + + + + + + + + + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + + + + + + +
\ No newline at end of file diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/carwheel.tscript b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/carwheel.tscript new file mode 100644 index 000000000..cd0ab9d0c --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/carwheel.tscript @@ -0,0 +1,11 @@ + +singleton TSShapeConstructor(carwheeldae) +{ + baseShapeAsset = "./carwheel.dae"; + singleDetailSize = "0"; + flipUVCoords = "0"; + JoinIdenticalVerts = "0"; + reverseWindingOrder = "0"; + removeRedundantMats = "0"; + animFPS = "2"; +}; diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/flier.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/flier.asset.taml new file mode 100644 index 000000000..8e4d115cb --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/flier.asset.taml @@ -0,0 +1 @@ + diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/flier.dae b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/flier.dae new file mode 100644 index 000000000..ea6deafb1 --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/flier.dae @@ -0,0 +1,253 @@ + + + + + Blender User + Blender 2.90.0 commit date:2020-08-31, commit time:11:26, hash:0330d1af29c0 + + 2021-09-11T14:15:31 + 2021-09-11T14:15:31 + + Z_UP + + + + + + 0 0 0 + + + + + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 25 + 45 + 0.15 + 0 + 1 + 2 + 0.04999995 + 40 + 1 + 3 + 512 + 3 + 1 + 0 + 0.25 + 0.25 + 0.25 + + + + + + + + + + + 0 0 0 1 + + + 0.8 0.8 0.8 1 + + + 1.45 + + + + + + + + + + + + + + + + + 2.8 -0.4256695 0.3000001 1.6 -0.02566969 0.4 2.8 -0.4256695 0.5000001 1.6 -0.02566957 0.8 2.8 -1.02567 0.3000002 2.8 -1.02567 0.5000002 1.6 -1.02567 0.4000002 1.6 -1.02567 0.8000002 2.8 -1.02567 0.5000002 2.8 -0.4256695 0.5000001 1.6 -1.02567 0.8000002 1.6 -0.02566957 0.8 2.8 -0.4256695 0.3000001 2.8 -1.02567 0.3000002 1.6 -0.02566969 0.4 1.6 -1.02567 0.4000002 2.8 -1.02567 0.5000002 2.8 -1.02567 0.3000002 2.8 -0.4256695 0.5000001 2.8 -0.4256695 0.3000001 0.4000003 -2.22567 0.4000003 0.5000004 -2.22567 0.5280784 0.4000003 -2.22567 1.2 0.5000004 -2.22567 1.071922 1.2 -2.22567 0.6000004 1.1 -2.22567 0.6780784 1.2 -2.22567 1 1.1 -2.22567 0.9219223 0.8000001 -0.2256697 0.8000001 0.4 -0.2256698 0.8000001 0.8000001 -0.2256697 0.9 0.4 -0.2256698 1 0.6000001 -0.2256697 1 0.8000001 -0.4256697 0.9 0.8000001 -0.2256697 0.9 0.6000001 -0.4256697 1 0.6000001 -0.2256697 1 0.6000001 -0.4256697 1 0.6000001 -0.2256697 1 0.4 -0.4256698 1 0.4 -0.2256698 1 0.8000001 -0.4256697 0.9 0.8000001 -0.4256697 0.8000001 0.8000001 -0.2256697 0.9 0.8000001 -0.2256697 0.8000001 0.4 -0.4256698 0.8000001 0.8000001 -0.4256697 0.8000001 0.4 -0.4256698 1 0.8000001 -0.4256697 0.9 0.6000001 -0.4256697 1 -0.3999997 -2.22567 0.4000003 -0.4999997 -2.22567 0.5280784 -1.2 -2.22567 0.6000004 -1.1 -2.22567 0.6780784 -1.2 -2.22567 1 -1.1 -2.22567 0.9219223 -0.4999997 -2.22567 1.071922 -0.3999997 -2.22567 1.2 -1.6 -0.02567017 0.4 -1.6 -1.02567 0.4000002 -2.8 -0.4256704 0.3000001 -2.8 -1.02567 0.3000002 -2.8 -0.4256704 0.3000001 -2.8 -0.4256703 0.5000001 -1.6 -0.02567017 0.4 -1.6 -0.02567011 0.8 -1.6 -1.02567 0.8000002 -1.6 -0.02567011 0.8 -2.8 -1.02567 0.5000002 -2.8 -0.4256703 0.5000001 -2.8 -1.02567 0.3000002 -2.8 -1.02567 0.5000002 -2.8 -0.4256704 0.3000001 -2.8 -0.4256703 0.5000001 -2.8 -1.02567 0.3000002 -1.6 -1.02567 0.4000002 -2.8 -1.02567 0.5000002 -1.6 -1.02567 0.8000002 -0.3999999 -0.3216579 1 -0.4 -0.2256699 1 -0.3999999 -0.4256699 1 -0.6 -0.2256699 1 -0.6 -0.4256699 1 -0.8 -0.42567 0.8000001 -0.8 -0.42567 0.9 -0.8 -0.2256699 0.8000001 -0.8 -0.2256699 0.9 -0.4 -0.2256699 0.8000001 -0.8 -0.2256699 0.8000001 -0.4 -0.2256699 1 -0.8 -0.2256699 0.9 -0.6 -0.2256699 1 -0.8 -0.42567 0.8000001 -0.3999999 -0.4256699 0.8000001 -0.8 -0.42567 0.9 -0.3999999 -0.4256699 1 -0.6 -0.4256699 1 -0.6 -0.2256699 1 -0.8 -0.2256699 0.9 -0.6 -0.4256699 1 -0.8 -0.42567 0.9 1.2 -1.02567 0.4000002 1.2 -1.02567 0.6000002 1.2 -1.02567 0.8000002 1.2 0.1076622 0.4 1.2 0.1076623 0.6 0.3999999 0.3743301 0.6 0.3999999 0.3743302 0.8 1.6 -0.02566969 0.4 1.6 -1.02567 0.4000002 1.2 0.1076622 0.4 1.2 -1.02567 0.4000002 1.2 -2.22567 1 1.2 -2.22567 0.6000004 1.2 -1.82567 1 1.2 -1.02567 0.6000002 1.2 -1.02567 1 1.2 -1.02567 0.8000002 1.2 -1.02567 0.6000002 1.2 -2.22567 0.6000004 0.4000002 -1.02567 0.4000002 0.4000003 -1.82567 0.4000003 0.4000002 -1.42567 0.4000002 0.4000003 -2.22567 0.4000003 1.2 -1.02567 0.8000002 0.4000002 -1.02567 0.8000002 1.2 -1.02567 1 0.4000002 -1.02567 1.2 0.8119422 -1.02567 1.097014 1.2 -1.02567 1 0.4000002 -1.02567 1.2 1.2 -2.22567 1 1.2 -1.82567 1 0.4000003 -2.22567 1.2 0.8119423 -1.82567 1.097014 0.8119422 -1.02567 1.097014 0.4000002 -1.02567 1.2 0.4000003 -1.82567 1.2 0.4000003 -2.22567 0.4000003 0.4000003 -2.22567 1.2 0.4000003 -1.82567 0.4000003 0.4000003 -1.82567 1.2 0.3999999 0.9743301 -1.58739e-7 -0.4000002 0.97433 -1.58739e-7 0.3999999 0.9743301 0.3999999 -0.4000002 0.97433 0.3999999 0.4000002 -1.42567 0.4000002 0.4000002 -1.42567 2.32271e-7 0.4000002 -1.02567 0.4000002 0.4000002 -1.02567 1.67103e-7 0.3999999 0.9743301 -1.58739e-7 0.4000002 -1.02567 1.67103e-7 -0.4000002 0.97433 -1.58739e-7 -0.3999999 -1.02567 1.67103e-7 -0.3999998 -1.42567 2.32271e-7 0.4000002 -1.42567 2.32271e-7 -0.3999998 -1.42567 2.32271e-7 0.4000002 -1.42567 2.32271e-7 -0.3999998 -1.42567 0.4000002 0.4000002 -1.42567 0.4000002 1.2 -1.02567 0.8000002 0.8000001 -0.4256697 0.8000001 0.4000002 -1.02567 0.8000002 0.4 -0.4256698 0.8000001 0.8000001 -0.2256697 0.8000001 1.6 -0.02566957 0.8 1.6 -1.02567 0.8000002 0.3999999 0.3743302 0.8 0.4 -0.2256698 0.8000001 0.0999999 0.3743303 1.7 -0.1 0.3743302 1.7 0.09999996 0.1743303 1.8 -0.1 0.1743302 1.8 0.0999999 0.3743302 1.6 0.0130859 0.3743302 1.6 0.0999999 0.3743303 1.7 -0.1 0.3743302 1.6 -0.1 0.3743302 1.7 -0.0999999 -0.4256697 1.8 -0.1 0.1743302 1.8 -0.0999999 -0.4256697 1.6 -0.1 0.3743302 1.6 -0.1 0.3743302 1.7 4.40643e-5 -0.4256697 1.6 0.1 -0.4256697 1.6 -0.0999999 -0.4256697 1.6 0.1 -0.4256697 1.8 -0.0999999 -0.4256697 1.8 0.09999996 0.1743303 1.8 -0.1 0.1743302 1.8 0.1 -0.4256697 1.8 -0.0999999 -0.4256697 1.8 0.1 -0.4256697 1.8 0.1 -0.4256697 1.6 0.09999996 0.1743303 1.8 0.0999999 0.3743302 1.6 0.0999999 0.3743303 1.7 -0.3999999 -1.02567 0.4000002 -0.3999998 -1.42567 0.4000002 -1.2 -1.02567 0.6000002 -0.3999997 -1.82567 0.4000003 -1.2 -2.22567 0.6000004 -0.3999997 -2.22567 0.4000003 -0.3999997 -2.22567 1.2 -0.3999997 -2.22567 0.4000003 -0.3999997 -1.82567 1.2 -0.3999997 -1.82567 0.4000003 -1.2 -2.22567 0.6000004 -1.2 -2.22567 1 -1.2 -1.02567 0.6000002 -1.2 -1.82567 1 -1.2 -1.02567 0.8000002 -1.2 -1.02567 1 -0.3999998 -1.42567 2.32271e-7 -0.3999998 -1.42567 0.4000002 -0.3999999 -1.02567 1.67103e-7 -0.3999999 -1.02567 0.4000002 -0.3999999 -1.02567 0.8000002 -1.2 -1.02567 0.8000002 -0.3999999 -1.02567 1.2 -1.2 -1.02567 1 -0.8119418 -1.02567 1.097014 -0.3999999 -1.02567 1.2 -1.2 -1.02567 1 -0.3999999 -1.02567 0.8000002 -0.3999999 -0.4256699 0.8000001 -1.2 -1.02567 0.8000002 -0.8 -0.42567 0.8000001 -1.6 -0.02567011 0.8 -0.8 -0.2256699 0.8000001 -0.4 0.3743301 0.8 -0.4 -0.2256699 0.8000001 -1.6 -1.02567 0.8000002 -1.2 0.1076619 0.4 -1.2 -1.02567 0.4000002 -1.6 -0.02567017 0.4 -1.6 -1.02567 0.4000002 -1.2 -1.02567 0.4000002 -1.2 -1.02567 0.6000002 -1.2 -1.02567 0.8000002 -0.4 0.37433 0.6 -1.2 0.1076619 0.6 -0.4 0.3743301 0.8 -1.2 0.1076619 0.4 0.3999998 1.17433 0.3999998 0.3999999 0.9743301 0.3999999 -0.4000002 1.17433 0.3999998 -0.4000002 0.97433 0.3999999 0.3999997 1.668394 0.4784297 0.3999998 1.17433 0.3999998 -0.4000002 1.668394 0.4784297 -0.4000002 1.17433 0.3999998 0.4 -0.2256698 1 0.4 -0.2256698 0.8000001 0.3999999 0.7733362 0.9999999 0.3999999 0.3743302 0.8 0.3999999 0.3743301 0.6 0.3999999 0.9743302 0.5999999 0.3999997 1.668394 0.4784297 0.3999999 0.9743301 0.3999999 0.3999998 1.17433 0.3999998 -0.4000002 0.97433 0.3999999 -0.4000002 0.9743301 0.5999999 -0.4000002 1.17433 0.3999998 -0.4000002 1.668394 0.4784297 -0.4000001 0.7733361 0.9999999 -0.4 0.37433 0.6 -0.4 0.3743301 0.8 -0.4 -0.2256699 1 -0.4 -0.2256699 0.8000001 -0.3999997 -2.22567 1.2 -0.3999997 -1.82567 1.2 -1.2 -2.22567 1 -0.8119417 -1.82567 1.097014 -0.3999999 -1.02567 1.2 -1.2 -1.82567 1 -0.8119418 -1.02567 1.097014 1.1 -2.22567 0.6780784 1.1 -2.02567 0.6780784 0.5000004 -2.22567 0.5280784 0.5000003 -2.02567 0.5280784 1.1 -2.02567 0.9219223 1.1 -2.22567 0.9219223 0.5000003 -2.02567 1.071922 0.5000004 -2.22567 1.071922 0.5000003 -2.02567 0.5280784 1.1 -2.02567 0.6780784 0.5000003 -2.02567 1.071922 1.1 -2.02567 0.9219223 1.1 -2.22567 0.6780784 1.1 -2.22567 0.9219223 1.1 -2.02567 0.6780784 1.1 -2.02567 0.9219223 0.5000004 -2.22567 1.071922 0.5000004 -2.22567 0.5280784 0.5000003 -2.02567 1.071922 0.5000003 -2.02567 0.5280784 0.541422 0.3157501 0.1999999 1.058578 0.3157502 0.1999999 0.5414219 0.8329081 0.1999998 0.5414219 0.8329081 0.3999999 1.058578 0.3157503 0.3999999 0.541422 0.3157501 0.3999999 1.058578 0.3157502 0.1999999 0.541422 0.3157501 0.1999999 1.058578 0.3157503 0.3999999 0.541422 0.3157501 0.3999999 0.541422 0.3157501 0.3999999 0.541422 0.3157501 0.1999999 0.5414219 0.8329081 0.3999999 0.5414219 0.8329081 0.1999998 -0.4999997 -2.02567 0.5280784 -0.4999997 -2.02567 1.071922 -1.1 -2.02567 0.6780784 -1.1 -2.02567 0.9219223 -0.4999997 -2.02567 1.071922 -0.4999997 -2.22567 1.071922 -1.1 -2.02567 0.9219223 -1.1 -2.22567 0.9219223 -1.1 -2.22567 0.9219223 -1.1 -2.22567 0.6780784 -1.1 -2.02567 0.9219223 -1.1 -2.02567 0.6780784 -0.4999997 -2.22567 0.5280784 -0.4999997 -2.02567 0.5280784 -1.1 -2.22567 0.6780784 -1.1 -2.02567 0.6780784 -0.4999997 -2.22567 0.5280784 -0.4999997 -2.22567 1.071922 -0.4999997 -2.02567 0.5280784 -0.4999997 -2.02567 1.071922 -0.5414221 0.31575 0.1999999 -0.5414221 0.31575 0.3999999 -0.5414221 0.8329079 0.1999998 -0.5414221 0.832908 0.3999999 -0.5414221 0.31575 0.1999999 -1.058578 0.3157499 0.1999999 -0.5414221 0.31575 0.3999999 -1.058578 0.3157499 0.3999999 -0.5414221 0.832908 0.3999999 -0.5414221 0.31575 0.3999999 -1.058578 0.3157499 0.3999999 -0.5414221 0.31575 0.1999999 -0.5414221 0.8329079 0.1999998 -1.058578 0.3157499 0.1999999 0.1999998 1.42567 1.533792 0.3999999 0.7733363 1.5801 0.3999997 2.22567 0.7337917 -0.4000001 0.7733362 1.5801 -0.2000002 1.42567 1.533792 -0.4000003 2.22567 0.7337917 0.3999997 2.22567 0.7337917 -0.4000003 2.22567 0.7337917 0.1999998 1.42567 1.533792 -0.2000002 1.42567 1.533792 0.3999999 0.7733363 1.5801 0.1999998 1.42567 1.533792 -0.4000001 0.7733362 1.5801 -0.2000002 1.42567 1.533792 1.26583 -1.82567 1.263324 1.2 -1.82567 1 1.26583 -1.62567 1.263324 1.2 -1.02567 1 0.8777743 -1.82567 1.360338 0.8777742 -1.62567 1.360338 0.8119423 -1.82567 1.097014 0.8119422 -1.02567 1.097014 1.26583 -1.82567 1.263324 1.26583 -1.62567 1.263324 0.8777743 -1.82567 1.360338 0.8777742 -1.62567 1.360338 1.2 -1.82567 1 1.26583 -1.82567 1.263324 0.8119423 -1.82567 1.097014 0.8777743 -1.82567 1.360338 1.26583 -1.62567 1.263324 1.2 -1.02567 1 0.8777742 -1.62567 1.360338 0.8119422 -1.02567 1.097014 1.2 0.1743301 0 1.2 -1.02567 1.67103e-7 0.3999999 0.9743301 -1.58739e-7 1.058578 0.3157502 0.1999999 1.2 0.1743301 0 1.2 0.1743302 0.6 1.058578 0.3157503 0.3999999 0.5414219 0.8329081 0.3999999 0.3999999 0.9743301 0.3999999 0.3999999 0.9743302 0.5999999 0.5414219 0.8329081 0.1999998 1.2 0.1076623 0.6 1.2 0.1743302 0.6 0.3999999 0.3743301 0.6 0.3999999 0.9743302 0.5999999 0.4000002 -1.02567 1.67103e-7 1.2 -1.02567 1.67103e-7 0.4000002 -1.02567 0.4000002 1.2 0.1076623 0.6 1.2 0.1076622 0.4 1.2 0.1743302 0.6 1.2 0.1743301 0 1.2 -1.02567 1.67103e-7 1.2 -1.02567 0.4000002 0.4000003 -1.82567 1.4 0.4 -0.4256697 1.6 -0.3999997 -1.82567 1.4 0.1 -0.4256697 1.6 4.40643e-5 -0.4256697 1.6 -0.0999999 -0.4256697 1.6 -0.3999999 -0.4256698 1.6 -0.3999997 -1.82567 0.4000003 0.4000003 -1.82567 0.4000003 -0.3999997 -1.82567 1.2 0.4000003 -1.82567 1.2 -0.3999997 -1.82567 1.4 0.4000003 -1.82567 1.4 0.4000003 -1.82567 0.4000003 -0.3999997 -1.82567 0.4000003 0.4000002 -1.42567 0.4000002 -0.3999998 -1.42567 0.4000002 0.4 -0.4256697 1.6 0.3999999 0.3743303 1.6 0.1 -0.4256697 1.6 0.0999999 0.3743302 1.6 -0.1 0.3743302 1.6 -0.4 0.3743302 1.6 -0.0999999 -0.4256697 1.6 -0.3999999 -0.4256698 1.6 -1.2 -1.02567 1.67103e-7 -0.3999999 -1.02567 1.67103e-7 -0.3999999 -1.02567 0.4000002 -1.2 -1.02567 1.67103e-7 -1.2 0.1743298 0 -1.2 0.1743299 0.6 -1.058578 0.3157499 0.1999999 -1.2 0.1743298 0 -0.4000002 0.97433 -1.58739e-7 -0.5414221 0.8329079 0.1999998 -0.5414221 0.832908 0.3999999 -1.058578 0.3157499 0.3999999 -0.4000002 0.9743301 0.5999999 -0.4000002 0.97433 0.3999999 -1.2 -1.02567 0.4000002 -1.2 0.1076619 0.4 -1.2 -1.02567 1.67103e-7 -1.2 0.1743298 0 -1.2 0.1076619 0.6 -1.2 0.1743299 0.6 -0.4 0.37433 0.6 -0.4000002 0.9743301 0.5999999 -1.2 0.1076619 0.6 -1.2 0.1743299 0.6 0.3999999 0.3743303 1.6 0.3999999 0.7733363 1.5801 0.0999999 0.3743302 1.6 -0.4000001 0.7733362 1.5801 0.0130859 0.3743302 1.6 -0.1 0.3743302 1.6 -0.4 0.3743302 1.6 -0.3999999 -1.02567 0.8000002 -0.3999999 -1.02567 1.2 -0.3999999 -0.4256699 0.8000001 -0.3999999 -0.4256698 1.6 -0.3999997 -1.82567 1.4 -0.3999997 -1.82567 1.2 -0.3999999 -0.4256699 1 -0.3999999 -0.3216579 1 -0.4 0.3743302 1.6 -0.4000001 0.7733362 1.5801 -0.4000003 2.22567 0.7337917 -0.4000003 2.22567 0.5668957 0.3999997 2.22567 0.5668957 -0.4000003 2.22567 0.5668957 0.3999997 2.22567 0.7337917 -0.4000003 2.22567 0.7337917 0.4 -0.4256697 1.6 0.4 -0.4256698 1 0.3999999 0.3743303 1.6 0.3999999 0.7733363 1.5801 0.3999997 2.22567 0.7337917 0.3999997 2.22567 0.5668957 0.4 -0.4256698 0.8000001 0.4000002 -1.02567 0.8000002 0.4000002 -1.02567 1.2 0.4000003 -1.82567 1.2 0.4000003 -1.82567 1.4 0.3999997 2.22567 0.5668957 -0.4000003 2.22567 0.5668957 -0.8119418 -1.02567 1.097014 -1.2 -1.02567 1 -0.8777738 -1.62567 1.360338 -1.26583 -1.62567 1.263324 -0.8777737 -1.82567 1.360338 -0.8777738 -1.62567 1.360338 -1.26583 -1.82567 1.263324 -1.26583 -1.62567 1.263324 -1.2 -1.82567 1 -0.8119417 -1.82567 1.097014 -1.26583 -1.82567 1.263324 -0.8777737 -1.82567 1.360338 -0.8777737 -1.82567 1.360338 -0.8119417 -1.82567 1.097014 -0.8777738 -1.62567 1.360338 -0.8119418 -1.02567 1.097014 -1.26583 -1.82567 1.263324 -1.26583 -1.62567 1.263324 -1.2 -1.82567 1 -1.2 -1.02567 1 + + + + + + + + + + 0.3162278 0.9486834 -2.35608e-7 0.3162277 0.9486834 0 0 -1 0 0 -1 0 0.2425357 3.2125e-7 0.9701426 0.2425357 1.9275e-7 0.9701426 -0.08304548 -1.64997e-7 -0.9965459 -0.08304548 -2.22745e-7 -0.9965459 1 0 0 1 9.9341e-7 0 0 -1 0 0 -1 -3.85499e-6 0 -1 2.40937e-6 -1.49011e-7 1 0 -1.49012e-7 1 -3.72529e-7 -1.49011e-7 1 7.45058e-7 0.4472138 0 0.8944271 0.4472133 3.332e-7 0.8944274 0 5.96046e-7 1 0 5.96046e-7 1 1.49012e-7 -1 0 2.23518e-7 -1 7.45059e-7 2.98024e-7 -1 0 0 -1 -2.89124e-6 0 -1 -4.81873e-7 -2.07943e-7 -1 5.78247e-6 3.81703e-7 -1 3.72529e-7 2.38419e-6 -1 0 0.08304542 -1.48497e-7 -0.9965459 0.08304554 -1.64997e-7 -0.9965459 -0.316228 0.9486833 -2.35608e-7 -0.3162279 0.9486833 0 -0.2425356 1.9275e-7 0.9701426 -0.2425357 0 0.9701426 -1 0 0 -1 -9.93411e-7 0 1.98682e-7 -1 0 1.98682e-7 -1 0 0 2.29222e-6 1 0 5.96046e-7 1 -1.49012e-7 1 0 -1.49012e-7 1 -3.72529e-7 -1.49012e-7 1 0 1.49012e-7 -1 0 0 -1 0 1.49012e-7 -1 0 -0.4472134 3.332e-7 0.8944274 -0.4472137 0 0.8944273 2.98023e-7 -1 0 2.98023e-7 -1 0 0 -1 7.45059e-7 0.3162246 0.9486845 -1.54618e-7 0.3162252 0.9486842 -1.3253e-7 0.3162289 0.9486829 -9.43168e-6 0.3162275 0.9486835 0 0 -1.78814e-7 -1 1.31481e-7 -1.84073e-7 -1 1 7.45058e-7 0 1 -1.24176e-7 0 1 3.72529e-7 0 0.2425354 0 -0.9701426 0.2425357 -1.35527e-7 -0.9701425 0 0 1 0.2425355 0 -0.9701426 -1.49012e-7 1 0 -1.49012e-7 1 0 -0.02498906 -0.9659332 -0.2575822 0.242536 4.51758e-7 0.9701424 0.2425342 3.16649e-6 0.9701429 0.2425367 2.19331e-7 0.9701423 0.242537 2.19331e-7 0.9701423 -1 -3.72529e-7 0 -1.49012e-7 1 -3.72529e-7 1 1.86265e-7 0 0 -1.62921e-7 -1 0 -1.62921e-7 -1 0 -1.62921e-7 -1 0 -1.62921e-7 -1 2.98023e-7 -1 7.45058e-7 1.49012e-7 -1 0 1.24176e-7 1.98682e-7 1 4.96705e-7 1.98682e-7 1 -1.49012e-6 0 1 -1.65568e-7 1.65568e-7 1 0 1.78814e-7 1 0 2.12874e-7 1 0 1.98682e-7 1 0 0.4472138 0.8944272 0 0.4472137 0.8944272 0 1 -8.57236e-7 -2.63537e-7 1 6.58842e-7 -1.49012e-7 1 -7.45058e-7 -1 -1.55221e-7 0 -1 -1.62981e-7 0 1.49012e-7 -1 0 -1.98682e-6 1.98682e-7 1 1.98682e-6 1.98682e-7 1 1 1.55221e-7 0 1 1.86264e-7 0 -0.2425356 -1.80703e-7 -0.9701426 -0.2425354 0 -0.9701426 -0.2425356 -1.80703e-7 -0.9701426 -0.2425358 -1.80703e-7 -0.9701425 1 1.86265e-7 0 -1 -2.48353e-7 0 -1 0 -2.98023e-7 -1 -3.72529e-7 0 -1 -2.98023e-7 0 -1 -3.72529e-7 0 -1.49012e-7 1 0 -0.02424633 -0.9997061 0 0 1.98682e-7 1 -2.48353e-7 1.98682e-7 1 0 1.86264e-7 1 0 2.12874e-7 1 -2.48353e-7 1.98682e-7 1 -2.98023e-7 1.78814e-7 1 0 -1.84073e-7 -1 0 -1.78814e-7 -1 2.98023e-7 -1 7.45059e-7 -0.3162295 0.9486829 0 -0.3162277 0.9486834 -6.43505e-6 -0.3162251 0.9486843 -1.76706e-7 -0.316225 0.9486842 -1.76706e-7 0 -1.49012e-7 -1 0 -1.49012e-7 -1 0 0.1567812 -0.9876334 0 0.1567813 -0.9876334 1 1.4916e-7 0 1 1.24176e-7 0 1 0 0 1 2.48353e-7 0 1 0 0 1 1.61021e-7 0 1 0 -1.78716e-7 -1 3.72529e-7 0 -1 -2.60285e-7 0 -1 0 0 -1 -1.24176e-7 0 -1 -3.73457e-7 0 -1 0 0 -1 -2.48353e-7 0 -0.2425356 2.71055e-7 0.9701426 -0.2425373 2.9829e-6 0.9701421 -0.2425374 1.53531e-7 0.9701421 -0.2425342 2.79396e-7 0.9701429 -0.2425366 0 0.9701423 -0.242536 0 0.9701424 -0.2425349 -1.20468e-7 0.9701427 -0.2425349 0 -0.9701427 -0.2425358 -1.20469e-7 -0.9701426 1 1.09599e-6 0 0 1.72881e-7 1 1.56003e-7 -1.72881e-7 -1 0 1 -2.88137e-7 -1.72882e-7 1 0 1 2.88136e-7 0 0.2425358 1.20469e-7 -0.9701426 0.2425354 0 -0.9701427 0.2425354 1.20469e-7 0.9701427 0.242536 0 0.9701424 -1 -5.47994e-7 0 -1 -2.88136e-7 0 0 1 -2.88137e-7 0 1 0 1.78289e-7 -1.72881e-7 -1 0 1.72881e-7 1 0.8217637 0.2868959 0.4923366 -0.8217638 0.2868956 0.4923366 -2.63418e-7 0.7071068 0.7071068 0 0.7071069 0.7071067 0 0.07081001 0.9974899 0 0.07081001 0.9974899 0.9701434 0 -0.2425318 0.9701433 2.74496e-7 -0.2425324 -0.9701417 0 0.2425394 -0.9701417 -1.37248e-7 0.2425392 0.2425349 0 0.9701427 0.2425356 0 0.9701426 0.2209759 0.412167 0.8839051 0.2209749 0.4121683 0.8839047 0 -1.62921e-7 -1 0 -1.62921e-7 -1 0.7071067 0.707107 6.58544e-6 0.7071021 0.7071115 -1.24177e-7 0.7071024 0.7071112 -1.86265e-7 0.7071079 0.7071057 -9.21937e-6 0.7071061 0.7071076 0 0.7071067 0.707107 0 0.7071067 0.7071069 -3.72527e-7 0.7071081 0.7071055 -1.62994e-6 0.7071069 0.7071067 0 -2.79391e-7 0 1 0 1.98682e-7 1 1.49012e-7 -1 0 1 2.98017e-6 0 1 0 0 1 2.62962e-7 0 0 -0.1414213 0.9899495 -1.12392e-6 -0.1414213 0.9899496 0 -0.1414212 0.9899496 0 -0.1414212 0.9899496 0 -0.1414213 0.9899495 1.49012e-7 -1 3.72529e-7 1.49012e-7 -1 0 0 -1.49012e-7 -1 0 -1.49012e-7 -1 0 2.98023e-7 1 0 2.98023e-7 1 0 2.98023e-7 1 1.49012e-7 -1 7.45058e-7 1.49012e-7 -1 3.72529e-7 1.49012e-7 -1 0 0 -1.62921e-7 -1 0 -1.62921e-7 -1 -0.7071022 0.7071114 -1.24177e-7 -0.7071068 0.7071067 7.0135e-6 -0.7071083 0.7071053 -2.03743e-6 -0.7071069 0.7071067 0 -0.7071024 0.7071112 -1.86265e-7 -0.707107 0.7071067 -7.44155e-6 -0.7071084 0.7071052 2.03743e-6 -0.7071071 0.7071065 -2.48352e-7 -1 -1.31481e-7 0 -1 0 0 -1 8.94051e-6 0 -9.94649e-7 0.04981219 0.9987586 0 0.04981219 0.9987586 0 0.04981219 0.9987587 0 0.04981225 0.9987587 0 0.04981219 0.9987586 -1 -2.48353e-7 0 -1 -1.24176e-7 0 -1 -1.35465e-7 0 -1 -1.86265e-7 0 -1 -1.24176e-7 0 -1 -5.17468e-7 1.61469e-7 -1 -1.4916e-7 0 -1 -1.28756e-7 0 -1 0 0 -1 -1.41495e-7 0 -2.98023e-7 1 0 1 1.86265e-7 0 1 2.48353e-7 0 1 0 0 1 1.28756e-7 0 1 1.41495e-7 0 1 1.43495e-7 0 1 1.60215e-7 0 1 1.24176e-7 0 1 2.48353e-7 0 1 1.86265e-7 0 1 0 0 -1.32043e-7 0.1567836 -0.9876331 0 0.1567838 -0.9876329 -0.2209749 0.4121678 0.8839049 -0.2209764 0.4121677 0.8839045 -0.2425349 0 0.9701427 -0.2425356 0 0.9701426 0 -1 -1.09798e-6 1.82606e-7 -1 1.09798e-6 0.9701415 0 0.2425396 0.9701416 4.11743e-7 0.2425392 -0.9701434 0 -0.2425318 -0.9701434 -2.74496e-7 -0.2425321 + + + + + + + + + + 54.93941 5.905512 30.03959 7.874016 54.93941 9.84252 30.03959 15.74803 54.93941 9.84252 30.03959 7.874016 -55.11811 5.905512 -55.11811 9.84252 -31.49606 7.874016 -31.49606 15.74803 -31.49606 7.874016 -55.11811 9.84252 20.19037 -51.08525 8.379343 -51.08525 20.19037 -26.73621 0.505327 -26.73621 20.19037 -26.73621 8.379343 -51.08525 -8.379343 -54.43729 -20.19037 -54.43729 -0.505327 -30.73337 -20.19037 -30.73337 -0.505327 -30.73337 -20.19037 -54.43729 20.19037 9.84252 20.19037 5.905512 8.379343 9.84252 8.379343 5.905512 8.379343 9.84252 20.19037 5.905512 -7.874016 7.874016 -9.84252 10.39523 -7.874016 23.62205 -9.84252 21.10083 -7.874016 23.62205 -9.84252 10.39523 -7.874016 7.874016 -23.62205 11.81102 -9.84252 10.39523 -21.65354 13.34799 -9.84252 10.39523 -23.62205 11.81102 -23.62205 19.68504 -21.65354 13.34799 -23.62205 11.81102 -7.874016 23.62205 -9.84252 21.10083 -23.62205 19.68504 -21.65354 18.14808 -21.65354 13.34799 -23.62205 19.68504 -9.84252 21.10083 -21.65354 18.14808 -23.62205 19.68504 15.74803 15.74803 7.874016 15.74803 15.74803 17.71654 7.874016 19.68504 15.74803 17.71654 7.874016 15.74803 11.81102 19.68504 15.74803 17.71654 7.874016 19.68504 8.379343 -6.162392 4.442334 -6.162392 8.379343 -1.760683 4.442334 -1.760683 8.379343 -1.760683 4.442334 -6.162392 -11.81102 -8.379343 -11.81102 -4.442334 -7.874016 -8.379343 -7.874016 -4.442334 -7.874016 -8.379343 -11.81102 -4.442334 8.379343 17.71654 8.379343 15.74803 4.442334 17.71654 4.442334 15.74803 4.442334 17.71654 8.379343 15.74803 -7.874016 15.74803 -15.74803 15.74803 -7.874016 19.68504 -15.74803 17.71654 -7.874016 19.68504 -15.74803 15.74803 -11.81102 19.68504 -7.874016 19.68504 -15.74803 17.71654 7.874016 7.874016 9.84252 10.39523 23.62205 11.81102 21.65354 13.34799 23.62205 11.81102 9.84252 10.39523 23.62205 19.68504 23.62205 11.81102 21.65354 13.34799 21.65354 18.14808 23.62205 19.68504 21.65354 13.34799 9.84252 21.10083 23.62205 19.68504 21.65354 18.14808 7.874016 23.62205 23.62205 19.68504 9.84252 21.10083 7.874016 7.874016 7.874016 23.62205 9.84252 10.39523 9.84252 21.10083 9.84252 10.39523 7.874016 23.62205 0.505327 -30.73337 20.19037 -30.73337 8.379343 -54.43729 20.19037 -54.43729 8.379343 -54.43729 20.19037 -30.73337 -54.93941 5.905512 -54.93941 9.84252 -30.03959 7.874016 -30.03959 15.74803 -30.03959 7.874016 -54.93941 9.84252 -20.19037 -26.73621 -0.505327 -26.73621 -20.19037 -51.08525 -8.379343 -51.08525 -20.19037 -51.08525 -0.505327 -26.73621 -20.19037 5.905512 -20.19037 9.84252 -8.379343 5.905512 -8.379343 9.84252 -8.379343 5.905512 -20.19037 9.84252 55.11811 5.905512 31.49606 7.874016 55.11811 9.84252 31.49606 15.74803 55.11811 9.84252 31.49606 7.874016 7.874016 -6.331833 7.874016 -4.442335 7.874016 -8.379343 11.81102 -4.442334 7.874016 -8.379343 7.874016 -4.442335 11.81102 -8.379343 7.874016 -8.379343 11.81102 -4.442334 -8.379343 15.74803 -8.379343 17.71654 -4.442335 15.74803 -4.442335 17.71654 -4.442335 15.74803 -8.379343 17.71654 -7.874016 15.74803 -15.74803 15.74803 -7.874016 19.68504 -15.74803 17.71654 -7.874016 19.68504 -15.74803 15.74803 -11.81102 19.68504 -7.874016 19.68504 -15.74803 17.71654 15.74803 15.74803 7.874016 15.74803 15.74803 17.71654 7.874016 19.68504 15.74803 17.71654 7.874016 15.74803 11.81102 19.68504 15.74803 17.71654 7.874016 19.68504 -4.442335 -1.760683 -4.442335 -6.162392 -8.379343 -1.760683 -8.379343 -6.162392 -8.379343 -1.760683 -4.442335 -6.162392 -23.62205 7.874016 -31.49606 7.874016 -23.62205 11.81102 -31.49606 15.74803 -23.62205 11.81102 -31.49606 7.874016 -23.62205 15.74803 -23.62205 11.81102 -31.49606 15.74803 30.03959 7.874016 21.73964 7.874016 30.03959 15.74803 21.73964 11.81102 30.03959 15.74803 21.73964 7.874016 5.139763 11.81102 30.03959 15.74803 21.73964 11.81102 5.139763 15.74803 30.03959 15.74803 5.139763 11.81102 31.49606 -0.505327 31.49606 -20.19037 23.62205 2.119345 23.62205 -20.19037 23.62205 2.119345 31.49606 -20.19037 43.81241 19.68504 43.81241 11.81102 35.9384 19.68504 20.19037 11.81102 35.9384 19.68504 43.81241 11.81102 20.19037 19.68504 35.9384 19.68504 20.19037 11.81102 20.19037 15.74803 20.19037 19.68504 20.19037 11.81102 20.19037 25.78134 43.81241 25.78134 20.19037 9.548647 35.9384 9.548647 20.19037 9.548647 43.81241 25.78134 28.06439 9.548647 20.19037 9.548647 35.9384 9.548647 35.9384 9.548647 43.81241 25.78134 43.81241 9.548647 23.62205 15.74803 7.874016 15.74803 23.62205 19.68504 7.874016 23.62205 23.62205 19.68504 7.874016 15.74803 15.98313 21.59477 23.62205 19.68504 7.874016 23.62205 43.81241 -18.14243 35.9384 -18.14243 43.81241 -1.909729 35.9384 -10.26841 43.81241 -1.909729 35.9384 -18.14243 20.19037 -10.26841 43.81241 -1.909729 35.9384 -10.26841 20.19037 -1.909729 43.81241 -1.909729 20.19037 -10.26841 35.9384 -1.909729 43.81241 -1.909729 20.19037 -1.909729 -43.81241 7.874016 -43.81241 23.62205 -35.9384 7.874016 -35.9384 23.62205 -35.9384 7.874016 -43.81241 23.62205 7.874016 0 -7.874016 0 7.874016 7.874016 -7.874016 7.874016 7.874016 7.874016 -7.874016 0 28.06439 7.874016 28.06439 0 20.19037 7.874016 20.19037 0 20.19037 7.874016 28.06439 0 7.874016 19.17971 7.874016 -20.19037 -7.874016 19.17971 -7.874016 -20.19037 -7.874016 19.17971 7.874016 -20.19037 -7.874016 -20.19037 7.874016 -20.19037 -7.874016 -28.06439 7.874016 -28.06439 -7.874016 -28.06439 7.874016 -20.19037 7.874016 0 -7.874016 0 7.874016 7.874016 -7.874016 7.874016 7.874016 7.874016 -7.874016 0 -23.62205 -20.19037 -15.74803 -8.379343 -7.874016 -20.19037 -7.874016 -8.379343 -7.874016 -20.19037 -15.74803 -8.379343 -15.74803 -8.379343 -23.62205 -20.19037 -15.74803 -4.442334 -15.74803 -4.442334 -23.62205 -20.19037 -31.49606 -0.505327 -31.49606 -20.19037 -31.49606 -0.505327 -23.62205 -20.19037 -7.874016 7.368689 -15.74803 -4.442334 -31.49606 -0.505327 -7.874016 -4.442334 -15.74803 -4.442334 -7.874016 7.368689 1.968504 8.375054 -1.968504 8.375054 1.968504 12.77676 -1.968504 12.77676 1.968504 12.77676 -1.968504 8.375054 1.968504 31.49606 0.257605 31.49606 1.968504 33.46456 -1.968504 31.49606 1.968504 33.46456 0.257605 31.49606 -1.968504 33.46456 1.968504 33.46456 -1.968504 31.49606 -8.379343 35.43307 3.431681 35.43307 -8.379342 31.49606 7.368689 31.49606 -8.379342 31.49606 3.431681 35.43307 7.368689 33.46456 7.368689 31.49606 3.431681 35.43307 -8.71e-4 31.49606 -1.968504 31.49606 1.968504 31.49606 -1.968504 35.43307 1.968504 31.49606 -1.968504 31.49606 1.968504 35.43307 1.968504 31.49606 -1.968504 35.43307 -1.968504 3.431681 1.968504 3.431681 -1.968504 -8.379343 1.968504 -8.379343 -1.968504 -8.379343 1.968504 3.431681 8.379343 35.43307 8.379342 31.49606 -3.431681 35.43307 -7.368689 31.49606 -3.431681 35.43307 8.379342 31.49606 -7.368689 33.46456 -3.431681 35.43307 -7.368689 31.49606 -20.19037 9.548647 -28.06439 9.548647 -20.19037 25.78134 -35.9384 9.548647 -20.19037 25.78134 -28.06439 9.548647 -20.19037 25.78134 -35.9384 9.548647 -43.81241 25.78134 -43.81241 9.548647 -43.81241 25.78134 -35.9384 9.548647 43.81241 23.62205 43.81241 7.874016 35.9384 23.62205 35.9384 7.874016 35.9384 23.62205 43.81241 7.874016 -43.81241 11.81102 -43.81241 19.68504 -20.19037 11.81102 -35.9384 19.68504 -20.19037 11.81102 -43.81241 19.68504 -20.19037 15.74803 -20.19037 11.81102 -35.9384 19.68504 -20.19037 15.74803 -35.9384 19.68504 -20.19037 19.68504 -28.06439 0 -28.06439 7.874016 -20.19037 0 -20.19037 7.874016 -20.19037 0 -28.06439 7.874016 -7.874016 15.74803 -23.62205 15.74803 -7.874016 23.62205 -23.62205 19.68504 -7.874016 23.62205 -23.62205 15.74803 -15.98313 21.59477 -7.874016 23.62205 -23.62205 19.68504 7.874016 -20.19037 7.874016 -8.379343 23.62205 -20.19037 15.74803 -8.379343 23.62205 -20.19037 7.874016 -8.379343 23.62205 -20.19037 15.74803 -8.379343 31.49606 -0.505327 15.74803 -8.379343 15.74803 -4.442334 31.49606 -0.505327 31.49606 -0.505327 15.74803 -4.442334 7.874016 7.368689 7.874016 -4.442335 7.874016 7.368689 15.74803 -4.442334 31.49606 -20.19037 23.62205 -20.19037 31.49606 -0.505327 -23.62205 2.119345 -23.62205 -20.19037 -31.49606 -0.505327 -31.49606 -20.19037 -31.49606 -0.505327 -23.62205 -20.19037 31.49606 7.874016 23.62205 7.874016 31.49606 15.74803 23.62205 11.81102 31.49606 15.74803 23.62205 7.874016 23.62205 15.74803 31.49606 15.74803 23.62205 11.81102 -5.139763 11.81102 -21.73964 11.81102 -5.139763 15.74803 -5.139763 15.74803 -21.73964 11.81102 -30.03959 15.74803 -30.03959 15.74803 -21.73964 11.81102 -30.03959 7.874016 -21.73964 7.874016 -30.03959 7.874016 -21.73964 11.81102 7.874016 23.11672 7.874016 19.17971 -7.874016 23.11672 -7.874016 19.17971 -7.874016 23.11672 7.874016 19.17971 7.874016 33.91281 7.874016 24.06535 -7.874016 33.91281 -7.874016 24.06535 -7.874016 33.91281 7.874016 24.06535 4.442334 19.68504 4.442334 15.74803 -15.22317 19.68504 -7.368689 15.74803 -15.22317 19.68504 4.442334 15.74803 -7.368689 11.81102 -15.22317 19.68504 -7.368689 15.74803 -19.17971 11.81102 -15.22317 19.68504 -7.368689 11.81102 -32.8424 9.417931 -15.22317 19.68504 -19.17971 11.81102 -19.17971 7.874016 -32.8424 9.417931 -19.17971 11.81102 -23.11672 7.874016 -32.8424 9.417931 -19.17971 7.874016 19.17971 7.874016 19.17971 11.81102 23.11672 7.874016 23.11672 7.874016 19.17971 11.81102 32.8424 9.417931 32.8424 9.417931 19.17971 11.81102 15.22317 19.68504 19.17971 11.81102 7.368689 11.81102 15.22317 19.68504 7.368689 11.81102 7.368689 15.74803 15.22317 19.68504 15.22317 19.68504 7.368689 15.74803 -4.442335 19.68504 -4.442334 15.74803 -4.442335 19.68504 7.368689 15.74803 -43.81241 -1.909729 -35.9384 -1.909729 -43.81241 -18.14243 -35.9384 -10.26841 -43.81241 -18.14243 -35.9384 -1.909729 -20.19037 -1.909729 -35.9384 -10.26841 -35.9384 -1.909729 -35.9384 -18.14243 -43.81241 -18.14243 -35.9384 -10.26841 -35.9384 -10.26841 -20.19037 -1.909729 -20.19037 -10.26841 -43.81241 24.24439 -39.8754 24.24439 -43.81241 12.06986 -39.8754 12.06986 -43.81241 12.06986 -39.8754 24.24439 -39.8754 -16.60547 -43.81241 -16.60547 -39.8754 -4.430943 -43.81241 -4.430943 -39.8754 -4.430943 -43.81241 -16.60547 -9.84252 10.39523 -21.65354 13.34799 -9.84252 21.10083 -21.65354 18.14808 -9.84252 21.10083 -21.65354 13.34799 -43.81241 13.34799 -43.81241 18.14808 -39.8754 13.34799 -39.8754 18.14808 -39.8754 13.34799 -43.81241 18.14808 43.81241 21.10083 43.81241 10.39523 39.8754 21.10083 39.8754 10.39523 39.8754 21.10083 43.81241 10.39523 -10.6579 6.215566 -20.83816 6.215566 -10.6579 16.39583 10.6579 16.39583 20.83816 6.215566 10.6579 6.215566 20.83816 3.937008 10.6579 3.937008 20.83816 7.874016 10.6579 7.874016 20.83816 7.874016 10.6579 3.937008 -6.215566 7.874016 -6.215566 3.937008 -16.39583 7.874016 -16.39583 3.937008 -16.39583 7.874016 -6.215566 3.937008 9.84252 10.39523 9.84252 21.10083 21.65354 13.34799 21.65354 18.14808 21.65354 13.34799 9.84252 21.10083 39.8754 -4.430943 43.81241 -4.430943 39.8754 -16.60547 43.81241 -16.60547 39.8754 -16.60547 43.81241 -4.430943 43.81241 18.14808 43.81241 13.34799 39.8754 18.14808 39.8754 13.34799 39.8754 18.14808 43.81241 13.34799 43.81241 12.06986 39.8754 12.06986 43.81241 24.24439 39.8754 24.24439 43.81241 24.24439 39.8754 12.06986 -43.81241 10.39523 -43.81241 21.10083 -39.8754 10.39523 -39.8754 21.10083 -39.8754 10.39523 -43.81241 21.10083 6.215566 3.937008 6.215566 7.874016 16.39583 3.937008 16.39583 7.874016 16.39583 3.937008 6.215566 7.874016 -10.6579 3.937008 -20.83816 3.937008 -10.6579 7.874016 -20.83816 7.874016 -10.6579 7.874016 -20.83816 3.937008 -10.6579 16.39583 -10.6579 6.215566 -20.83816 6.215566 10.6579 6.215566 10.6579 16.39583 20.83816 6.215566 -25.19838 19.89568 -11.77709 20.94294 -38.76868 1.80292 11.77709 20.94294 25.19838 19.89568 38.76868 1.80292 7.874016 -20.76608 -7.874016 -20.76608 3.937008 1.505001 -3.937008 1.505001 3.937008 1.505001 -7.874016 -20.76608 7.874016 -12.98254 3.937008 -25.85607 -7.874016 -12.98254 -3.937008 -25.85607 -7.874016 -12.98254 3.937008 -25.85607 35.9384 30.16956 35.9384 24.82648 32.00139 30.16956 20.19037 24.82648 32.00139 30.16956 35.9384 24.82648 -35.9384 30.16956 -32.00139 30.16956 -35.9384 24.82648 -20.19037 24.82648 -35.9384 24.82648 -32.00139 30.16956 35.9384 -18.14243 32.00139 -18.14243 35.9384 -10.26841 32.00139 -10.26841 35.9384 -10.26841 32.00139 -18.14243 -23.62205 19.68504 -24.91794 24.86859 -15.98313 21.59477 -17.27902 26.77832 -15.98313 21.59477 -24.91794 24.86859 37.08172 26.15259 30.35884 15.06875 30.34934 30.23611 23.62645 19.15227 30.34934 30.23611 30.35884 15.06875 23.62205 3.431681 23.62205 -20.19037 7.874016 19.17971 7.874016 -20.19037 7.874016 19.17971 23.62205 -20.19037 -7.994335 0 10.33974 3.937008 14.27674 0 14.27674 11.81102 14.27674 0 10.33974 3.937008 10.33974 7.874016 14.27674 11.81102 10.33974 3.937008 -4.057327 7.874016 14.27674 11.81102 10.33974 7.874016 -7.994335 7.874016 14.27674 11.81102 -4.057327 7.874016 -7.994335 11.81102 14.27674 11.81102 -7.994335 7.874016 -7.994335 7.874016 -4.057327 3.937008 -7.994335 0 10.33974 3.937008 -7.994335 0 -4.057327 3.937008 -4.057327 7.874016 -4.057327 3.937008 -7.994335 7.874016 -23.62205 2.119345 -23.62205 3.431681 -7.874016 7.368689 -7.874016 19.17971 -7.874016 7.368689 -23.62205 3.431681 -7.874016 0 -23.62205 0 -7.874016 7.874016 -23.62205 7.874016 -7.874016 7.874016 -23.62205 0 -23.62205 11.81102 -7.874016 7.874016 -23.62205 7.874016 -2.119345 11.81102 -2.119345 7.874016 -3.431681 11.81102 -3.431681 11.81102 -2.119345 7.874016 -3.431681 0 -3.431681 0 -2.119345 7.874016 20.19037 0 20.19037 7.874016 20.19037 0 -2.119345 7.874016 -7.874016 -31.67976 -7.874016 -3.84091 7.874016 -31.67976 -1.968504 -3.840909 7.874016 -31.67976 -7.874016 -3.84091 -8.71e-4 -3.84091 7.874016 -31.67976 -1.968504 -3.840909 1.968504 -3.840909 7.874016 -31.67976 -8.71e-4 -3.84091 7.874016 -3.84091 7.874016 -31.67976 1.968504 -3.840909 7.874016 7.874016 -7.874016 7.874016 7.874016 23.62205 -7.874016 23.62205 7.874016 23.62205 -7.874016 7.874016 7.874016 27.55906 7.874016 23.62205 -7.874016 23.62205 -7.874016 27.55906 7.874016 27.55906 -7.874016 23.62205 7.874016 -35.9384 -7.874016 -35.9384 7.874016 -28.06439 -7.874016 -28.06439 7.874016 -28.06439 -7.874016 -35.9384 -7.874015 -8.379343 -7.874015 7.368689 -1.968503 -8.379342 -1.968503 7.368689 -1.968503 -8.379342 -7.874015 7.368689 1.968503 7.368689 7.874015 7.368689 1.968504 -8.379342 7.874015 -8.379343 1.968504 -8.379342 7.874015 7.368689 23.62205 0 7.874016 0 23.62205 7.874016 7.874016 7.874016 23.62205 7.874016 7.874016 0 23.62205 11.81102 23.62205 7.874016 7.874016 7.874016 -7.874016 -20.19037 -23.62205 -20.19037 -7.874016 19.17971 -23.62205 3.431681 -7.874016 19.17971 -23.62205 -20.19037 -14.27674 11.81102 -10.33974 3.937008 -14.27674 0 7.994335 0 -14.27674 0 -10.33974 3.937008 4.057327 3.937008 7.994335 0 -10.33974 3.937008 4.057327 7.874016 7.994335 0 4.057327 3.937008 -10.33974 3.937008 -14.27674 11.81102 -10.33974 7.874016 7.994335 11.81102 -10.33974 7.874016 -14.27674 11.81102 4.057327 7.874016 -10.33974 7.874016 7.994335 11.81102 7.994335 0 4.057327 7.874016 7.994335 11.81102 7.994335 7.874016 7.994335 0 7.994335 11.81102 -20.19037 7.874016 2.119345 7.874016 -20.19037 0 3.431681 0 -20.19037 0 2.119345 7.874016 2.119345 11.81102 3.431681 0 2.119345 7.874016 3.431681 11.81102 3.431681 0 2.119345 11.81102 7.874016 7.368689 7.874016 19.17971 23.62205 2.119345 23.62205 3.431681 23.62205 2.119345 7.874016 19.17971 7.874016 -5.790606 7.874016 -13.65485 1.968504 -5.790606 -7.874016 -13.65485 1.968504 -5.790606 7.874016 -13.65485 0.257605 -5.790606 1.968504 -5.790606 -7.874016 -13.65485 -1.968504 -5.790606 0.257605 -5.790606 -7.874016 -13.65485 -7.874016 -5.790606 -1.968504 -5.790606 -7.874016 -13.65485 -20.19037 15.74803 -20.19037 23.62205 -8.379343 15.74803 -8.379343 15.74803 -20.19037 23.62205 -8.379343 31.49606 -8.379343 31.49606 -20.19037 23.62205 -35.9384 27.55906 -35.9384 23.62205 -35.9384 27.55906 -20.19037 23.62205 -8.379343 19.68504 -8.379343 15.74803 -8.379343 31.49606 -6.331833 19.68504 -8.379343 19.68504 -8.379343 31.49606 7.368689 31.49606 -6.331833 19.68504 -8.379343 31.49606 -4.442335 19.68504 -6.331833 19.68504 7.368689 31.49606 15.22317 19.68504 -4.442335 19.68504 7.368689 31.49606 15.22317 31.10432 15.22317 19.68504 7.368689 31.49606 32.8424 9.417931 15.22317 19.68504 15.22317 31.10432 43.81241 14.44474 32.8424 9.417931 15.22317 31.10432 43.81241 11.15938 32.8424 9.417931 43.81241 14.44474 7.874016 11.15938 -7.874016 11.15938 7.874016 14.44474 -7.874016 14.44474 7.874016 14.44474 -7.874016 11.15938 8.379343 31.49606 8.379343 19.68504 -7.368689 31.49606 4.442334 19.68504 -7.368689 31.49606 8.379343 19.68504 -15.22317 19.68504 -7.368689 31.49606 4.442334 19.68504 -15.22317 31.10432 -7.368689 31.49606 -15.22317 19.68504 -43.81241 14.44474 -15.22317 31.10432 -15.22317 19.68504 -32.8424 9.417931 -43.81241 14.44474 -15.22317 19.68504 -43.81241 11.15938 -43.81241 14.44474 -32.8424 9.417931 8.379343 19.68504 8.379343 31.49606 8.379343 15.74803 8.379343 15.74803 8.379343 31.49606 20.19037 15.74803 20.19037 15.74803 8.379343 31.49606 20.19037 23.62205 20.19037 23.62205 8.379343 31.49606 35.9384 23.62205 35.9384 27.55906 35.9384 23.62205 8.379343 31.49606 7.874016 45.02019 7.874016 33.91281 -7.874016 45.02019 -7.874016 33.91281 -7.874016 45.02019 7.874016 33.91281 -23.62645 19.15227 -30.35884 15.06875 -30.34934 30.23611 -37.08172 26.15259 -30.34934 30.23611 -30.35884 15.06875 -35.9384 -10.26841 -32.00139 -10.26841 -35.9384 -18.14243 -32.00139 -18.14243 -35.9384 -18.14243 -32.00139 -10.26841 23.62205 19.68504 15.98313 21.59477 24.91794 24.86859 17.27902 26.77832 24.91794 24.86859 15.98313 21.59477 35.9384 30.16956 35.9384 24.82648 32.00139 30.16956 20.19037 24.82648 32.00139 30.16956 35.9384 24.82648 -35.9384 30.16956 -32.00139 30.16956 -35.9384 24.82648 -20.19037 24.82648 -35.9384 24.82648 -32.00139 30.16956 + + + + + + + + + + + + + + +

0 0 0 1 0 1 2 0 2 3 1 3 2 1 4 1 1 5 4 2 6 5 2 7 6 2 8 7 3 9 6 3 10 5 3 11 8 4 12 9 4 13 10 4 14 11 5 15 10 5 16 9 5 17 12 6 18 13 6 19 14 6 20 15 7 21 14 7 22 13 7 23 16 8 24 17 8 25 18 8 26 19 9 27 18 9 28 17 9 29 20 10 30 21 10 31 22 10 32 23 10 33 22 10 34 21 10 35 20 10 36 24 10 37 21 10 38 25 11 39 21 11 40 24 11 41 26 10 42 25 10 43 24 10 44 22 10 45 23 10 46 26 10 47 27 10 48 25 10 49 26 10 50 23 12 51 27 12 52 26 12 53 28 13 54 29 13 55 30 13 56 31 14 57 30 14 58 29 14 59 32 15 60 30 15 61 31 15 62 33 16 63 34 16 64 35 16 65 36 17 66 35 17 67 34 17 68 37 18 69 38 18 70 39 18 71 40 19 72 39 19 73 38 19 74 41 8 75 42 8 76 43 8 77 44 8 78 43 8 79 42 8 80 45 20 81 46 20 82 47 20 83 48 21 84 47 21 85 46 21 86 49 22 87 47 22 88 48 22 89 50 23 90 51 23 91 52 23 92 53 10 93 52 10 94 51 10 95 54 10 96 52 10 97 53 10 98 55 10 99 54 10 100 53 10 101 56 24 102 54 24 103 55 24 104 57 25 105 54 25 106 56 25 107 50 26 108 57 26 109 51 26 110 56 27 111 51 27 112 57 27 113 58 28 114 59 28 115 60 28 116 61 29 117 60 29 118 59 29 119 62 30 120 63 30 121 64 30 122 65 31 123 64 31 124 63 31 125 66 32 126 67 32 127 68 32 128 69 33 129 68 33 130 67 33 131 70 34 132 71 34 133 72 34 134 73 35 135 72 35 136 71 35 137 74 36 138 75 36 139 76 36 140 77 37 141 76 37 142 75 37 143 78 38 144 79 38 145 80 38 146 81 39 147 80 39 148 79 39 149 82 18 150 80 18 151 81 18 152 83 34 153 84 34 154 85 34 155 86 34 156 85 34 157 84 34 158 87 40 159 88 40 160 89 40 161 90 41 162 89 41 163 88 41 164 91 42 165 89 42 166 90 42 167 92 43 168 93 43 169 94 43 170 95 44 171 94 44 172 93 44 173 96 45 174 94 45 175 95 45 176 97 46 177 98 46 178 99 46 179 100 47 180 99 47 181 98 47 182 101 48 183 6 48 184 102 48 185 7 49 186 102 49 187 6 49 188 103 50 189 102 50 190 7 50 191 1 51 192 104 51 193 3 51 194 105 52 195 3 52 196 104 52 197 106 53 198 3 53 199 105 53 200 107 54 201 3 54 202 106 54 203 108 55 204 109 55 205 110 55 206 111 56 207 110 56 208 109 56 209 112 57 210 113 57 211 114 57 212 115 58 213 114 58 214 113 58 215 116 59 216 114 59 217 115 59 218 117 8 219 116 8 220 115 8 221 118 60 222 119 60 223 120 60 224 121 61 225 120 61 226 119 61 227 122 62 228 120 62 229 121 62 230 121 63 231 119 63 232 123 63 233 124 64 234 125 64 235 126 64 236 127 65 237 126 65 238 125 65 239 128 66 240 129 66 241 130 66 242 131 67 243 132 67 244 133 67 245 134 68 246 133 68 247 132 68 248 135 69 249 133 69 250 134 69 251 136 70 252 133 70 253 135 70 254 137 10 255 133 10 256 136 10 257 138 71 258 139 71 259 140 71 260 141 34 261 140 34 262 139 34 263 142 72 264 143 72 265 144 72 266 145 64 267 144 64 268 143 64 269 146 8 270 147 8 271 148 8 272 149 73 273 148 73 274 147 73 275 150 74 276 151 74 277 152 74 278 153 75 279 152 75 280 151 75 281 153 76 282 151 76 283 154 76 284 155 77 285 154 77 286 151 77 287 156 78 288 157 78 289 158 78 290 159 79 291 158 79 292 157 79 293 160 80 294 161 80 295 162 80 296 163 81 297 162 81 298 161 81 299 161 82 300 160 82 301 164 82 302 164 83 303 160 83 304 165 83 305 166 84 306 165 84 307 160 84 308 167 85 309 164 85 310 165 85 311 168 86 312 164 86 313 167 86 314 169 87 315 170 87 316 171 87 317 172 88 318 171 88 319 170 88 320 173 89 321 174 89 322 175 89 323 176 90 324 175 90 325 174 90 326 177 91 327 175 91 328 176 91 329 178 92 330 179 92 331 180 92 332 181 93 333 180 93 334 179 93 335 182 34 336 181 34 337 179 34 338 183 62 339 184 62 340 185 62 341 186 94 342 185 94 343 184 94 344 187 43 345 185 43 346 186 43 347 188 95 348 189 95 349 190 95 350 191 96 351 190 96 352 189 96 353 192 97 354 193 97 355 194 97 356 195 98 357 194 98 358 193 98 359 196 8 360 194 8 361 195 8 362 197 99 363 198 99 364 199 99 365 200 100 366 199 100 367 198 100 368 199 101 369 200 101 370 201 101 371 202 102 372 201 102 373 200 102 374 203 103 375 204 103 376 205 103 377 206 8 378 205 8 379 204 8 380 207 104 381 208 104 382 209 104 383 210 105 384 209 105 385 208 105 386 211 106 387 209 106 388 210 106 389 211 107 390 210 107 391 212 107 392 213 34 393 214 34 394 215 34 395 216 108 396 215 108 397 214 108 398 217 109 399 218 109 400 219 109 401 220 13 402 219 13 403 218 13 404 221 110 405 222 110 406 223 110 407 224 111 408 225 111 409 226 111 410 227 112 411 226 112 412 225 112 413 226 113 414 227 113 415 228 113 416 227 62 417 229 62 418 228 62 419 228 114 420 229 114 421 230 114 422 231 115 423 230 115 424 229 115 425 232 116 426 226 116 427 228 116 428 233 117 429 234 117 430 235 117 431 236 118 432 235 118 433 234 118 434 75 10 435 237 10 436 77 10 437 238 10 438 77 10 439 237 10 440 239 119 441 77 119 442 238 119 443 240 120 444 241 120 445 242 120 446 242 121 447 241 121 448 65 121 449 65 122 450 241 122 451 64 122 452 243 123 453 64 123 454 241 123 455 244 124 456 245 124 457 246 124 458 247 125 459 246 125 460 245 125 461 248 126 462 249 126 463 250 126 464 251 127 465 250 127 466 249 127 467 252 128 468 253 128 469 254 128 470 255 129 471 254 129 472 253 129 473 256 130 474 254 130 475 255 130 476 257 131 477 254 131 478 256 131 479 258 132 480 254 132 481 257 132 482 259 133 483 258 133 484 257 133 485 260 134 486 258 134 487 259 134 488 261 135 489 262 135 490 263 135 491 263 136 492 262 136 493 264 136 494 264 137 495 262 137 496 265 137 497 262 138 498 266 138 499 265 138 500 266 139 501 267 139 502 265 139 503 265 140 504 267 140 505 268 140 506 269 141 507 268 141 508 267 141 509 270 142 510 271 142 511 272 142 512 273 143 513 272 143 514 271 143 515 274 144 516 273 144 517 271 144 518 275 145 519 272 145 520 273 145 521 273 146 522 274 146 523 276 146 524 277 147 525 278 147 526 279 147 527 280 148 528 279 148 529 278 148 530 281 149 531 282 149 532 283 149 533 284 150 534 283 150 535 282 150 536 285 10 537 286 10 538 287 10 539 288 10 540 287 10 541 286 10 542 289 34 543 290 34 544 291 34 545 292 34 546 291 34 547 290 34 548 293 8 549 294 8 550 295 8 551 296 151 552 295 151 553 294 151 554 297 152 555 298 152 556 299 152 557 300 153 558 301 153 559 302 153 560 303 154 561 304 154 562 305 154 563 306 155 564 305 155 565 304 155 566 307 156 567 308 156 568 309 156 569 310 8 570 309 8 571 308 8 572 311 10 573 312 10 574 313 10 575 314 10 576 313 10 577 312 10 578 315 157 579 316 157 580 317 157 581 318 158 582 317 158 583 316 158 584 319 8 585 320 8 586 321 8 587 322 8 588 321 8 589 320 8 590 323 159 591 324 159 592 325 159 593 326 160 594 325 160 595 324 160 596 327 161 597 328 161 598 329 161 599 330 34 600 329 34 601 328 34 602 331 162 603 332 162 604 333 162 605 334 34 606 333 34 607 332 34 608 335 163 609 336 163 610 337 163 611 338 164 612 337 164 613 336 164 614 339 165 615 340 165 616 341 165 617 342 166 618 343 166 619 344 166 620 345 167 621 346 167 622 347 167 623 348 168 624 349 168 625 350 168 626 351 169 627 352 169 628 353 169 629 354 170 630 353 170 631 352 170 632 355 171 633 356 171 634 357 171 635 358 172 636 357 172 637 356 172 638 359 173 639 360 173 640 361 173 641 362 174 642 361 174 643 360 174 644 363 175 645 364 175 646 365 175 647 366 176 648 365 176 649 364 176 650 367 177 651 368 177 652 369 177 653 370 178 654 369 178 655 368 178 656 371 10 657 372 10 658 373 10 659 374 10 660 373 10 661 372 10 662 375 179 663 376 179 664 377 179 665 378 180 666 377 180 667 376 180 668 379 181 669 380 181 670 150 181 671 151 182 672 150 182 673 380 182 674 381 183 675 382 183 676 383 183 677 384 184 678 383 184 679 382 184 680 385 185 681 384 185 682 382 185 683 386 186 684 384 186 685 385 186 686 387 187 687 384 187 688 386 187 689 388 188 690 384 188 691 387 188 692 387 189 693 389 189 694 381 189 695 382 190 696 381 190 697 389 190 698 386 191 699 389 191 700 387 191 701 390 192 702 391 192 703 392 192 704 393 193 705 392 193 706 391 193 707 394 79 708 395 79 709 396 79 710 101 79 711 396 79 712 395 79 713 102 194 714 396 194 715 101 194 716 397 8 717 398 8 718 399 8 719 399 195 720 398 195 721 400 195 722 400 196 723 398 196 724 401 196 725 402 197 726 401 197 727 398 197 728 403 198 729 404 198 730 405 198 731 406 199 732 405 199 733 404 199 734 407 200 735 405 200 736 406 200 737 408 201 738 405 201 739 407 201 740 409 202 741 405 202 742 408 202 743 410 203 744 411 203 745 412 203 746 413 194 747 412 194 748 411 194 749 414 43 750 412 43 751 413 43 752 415 204 753 414 204 754 413 204 755 416 205 756 417 205 757 418 205 758 419 206 759 418 206 760 417 206 761 420 207 762 421 207 763 422 207 764 423 208 765 422 208 766 421 208 767 424 209 768 425 209 769 426 209 770 427 209 771 426 209 772 425 209 773 428 210 774 429 210 775 237 210 776 430 211 777 237 211 778 429 211 779 238 212 780 237 212 781 430 212 782 153 213 783 431 213 784 152 213 785 432 214 786 152 214 787 431 214 788 433 215 789 434 215 790 435 215 791 436 216 792 435 216 793 434 216 794 437 217 795 436 217 796 434 217 797 438 218 798 436 218 799 437 218 800 434 219 801 433 219 802 439 219 803 440 220 804 439 220 805 433 220 806 438 221 807 439 221 808 440 221 809 436 222 810 438 222 811 440 222 812 441 8 813 436 8 814 440 8 815 442 223 816 443 223 817 444 223 818 445 224 819 444 224 820 443 224 821 446 225 822 445 225 823 443 225 824 447 34 825 445 34 826 446 34 827 448 111 828 449 111 829 450 111 830 451 62 831 450 62 832 449 62 833 452 226 834 453 226 835 454 226 836 455 227 837 454 227 838 453 227 839 456 228 840 454 228 841 455 228 842 457 229 843 456 229 844 455 229 845 458 230 846 457 230 847 455 230 848 459 231 849 460 231 850 461 231 851 461 232 852 460 232 853 462 232 854 462 233 855 460 233 856 463 233 857 464 234 858 463 234 859 460 234 860 465 8 861 461 8 862 462 8 863 466 34 864 465 34 865 462 34 866 467 235 867 466 235 868 462 235 869 268 236 870 466 236 871 467 236 872 265 237 873 268 237 874 467 237 875 468 238 876 265 238 877 467 238 878 264 239 879 265 239 880 468 239 881 469 240 882 264 240 883 468 240 884 470 34 885 264 34 886 469 34 887 471 241 888 472 241 889 473 241 890 474 241 891 473 241 892 472 241 893 475 242 894 476 242 895 477 242 896 252 243 897 477 243 898 476 243 899 254 244 900 477 244 901 252 244 902 478 245 903 477 245 904 254 245 905 479 246 906 478 246 907 254 246 908 258 247 909 479 247 910 254 247 911 480 248 912 479 248 913 258 248 914 476 34 915 475 34 916 481 34 917 481 249 918 475 249 919 482 249 920 482 250 921 475 250 922 483 250 923 483 251 924 475 251 925 484 251 926 485 252 927 484 252 928 475 252 929 486 253 930 248 253 931 487 253 932 250 254 933 487 254 934 248 254 935 488 255 936 489 255 937 490 255 938 491 256 939 490 256 940 489 256 941 492 257 942 493 257 943 494 257 944 495 258 945 494 258 946 493 258 947 496 259 948 497 259 949 498 259 950 499 260 951 498 260 952 497 260 953 500 261 954 501 261 955 502 261 956 503 262 957 502 262 958 501 262 959 504 263 960 505 263 961 506 263 962 507 264 963 506 264 964 505 264 965

+
+
+
+ + + + 1.188083 -0.08953237 0.371709 0.7994193 1.140056 -1.433514 1.188083 -1.474636 0.3514011 1.315013 -1.853213 -1.433514 -1.188083 -0.08953237 0.371709 -0.7994193 1.140056 -1.433514 -1.188083 -1.474636 0.3514011 -1.315013 -1.853213 -1.433514 -0.9862595 -2.500253 -1.22394 -0.9862595 -2.519339 -0.2239396 0.9862595 -2.519339 -0.2239396 0.9862595 -2.500253 -1.22394 0.5995645 1.971269 -0.8815678 -0.5995645 1.971269 -0.8815678 0.5995645 1.16453 0.09344267 -0.5995645 1.16453 0.09344267 2.776942 -0.1095306 -0.8880948 2.83363 -1.621893 -0.8862085 -2.776942 -0.1095306 -0.8880948 -2.83363 -1.621893 -0.8862083 + + + + + + + + + + 0 -0.01466006 0.9998926 0 -0.3081366 -0.9513422 -0.6022508 0.02356946 0.7979589 0 0 -1 0.602251 0.02356934 0.7979589 0 0.2166231 0.9762553 0 -0.999818 -0.01908236 0 -0.482404 0.8759489 0.4953244 -0.4905348 0.7169584 -0.2783797 -0.8712932 -0.4041697 0 0.7704592 0.6374894 0.5225462 0.8508509 0.05475574 -0.5663074 0.4227536 0.7075135 0 0.5531756 -0.8330647 0.2952768 0.05086171 -0.954057 0.5663074 0.4227536 0.7075136 0.8903515 -0.4551908 -0.008687913 -0.2952769 0.05086171 -0.9540569 -0.9803138 0.1521239 0.1258695 -0.4953244 -0.4905348 0.7169584 0 -0.01466006 0.9998925 0 -0.3081362 -0.9513424 -0.6211663 -0.01148867 0.7835946 0.6211663 -0.01148867 0.7835946 0 -0.999818 -0.01908284 0 -0.4824041 0.8759489 -0.8903515 -0.4551908 -0.008687913 0 0.7704591 0.6374895 0.9803138 0.1521239 0.1258695 0.3374801 0.0114758 -0.9412627 0.2783796 -0.8712932 -0.4041697 -0.3374803 0.01147562 -0.9412626 -0.5225462 0.8508509 0.05475574 + + + + + + + + + + 0.875 0.5 0.625 0.75 0.625 0.5 0.375 0.75 0.125 0.75 0.125 0.75 0.625 0 0.5135849 0.25 0.5356172 0 0.375 0.5 0.125 0.75 0.125 0.5 0.5135849 0.5 0.625 0.75 0.5356172 0.75 0.625 0.5 0.875 0.5 0.875 0.5 0.625 0.75 0.375 1 0.375 0.75 0.875 0.75 0.625 0.75 0.625 0.75 0.5356172 0.75 0.625 0.75 0.625 0.75 0.375 0 0.625 0 0.5356172 0 0.625 0.25 0.375 0.5 0.375 0.25 0.375 0.5 0.625 0.5 0.5135849 0.5 0.5135849 0.25 0.625 0.25 0.625 0.25 0.125 0.5 0.375 0.5 0.375 0.5 0.5135849 0.5 0.375 0.75 0.375 0.5 0.625 0.5 0.5135849 0.5 0.625 0.5 0.375 0.75 0.625 0.75 0.375 0.75 0.375 0 0.5135849 0.25 0.375 0.25 0.375 0.25 0.625 0.25 0.375 0.25 0.625 0 0.5356172 0 0.625 0 0.875 0.5 0.875 0.75 0.625 0.75 0.375 0.75 0.375 0.75 0.125 0.75 0.625 0 0.625 0.25 0.5135849 0.25 0.375 0.5 0.375 0.75 0.125 0.75 0.5135849 0.5 0.625 0.5 0.625 0.75 0.625 0.5 0.625 0.5 0.875 0.5 0.625 0.75 0.625 1 0.375 1 0.875 0.75 0.875 0.75 0.625 0.75 0.375 0 0.375 0 0.625 0 0.625 0.25 0.625 0.5 0.375 0.5 0.375 0.5 0.375 0.5 0.625 0.5 0.125 0.5 0.125 0.5 0.375 0.5 0.5135849 0.5 0.5356172 0.75 0.375 0.75 0.375 0.75 0.5356172 0.75 0.625 0.75 0.375 0 0.5356172 0 0.5135849 0.25 0.375 0.25 0.5135849 0.25 0.625 0.25 + + + + + + + + + + + + + + +

4 0 0 2 0 1 0 0 2 3 1 3 8 1 4 7 1 5 6 2 6 18 2 7 19 2 8 1 3 9 7 3 10 5 3 11 16 4 12 2 4 13 17 4 14 0 5 15 15 5 16 4 5 17 10 6 18 8 6 19 11 6 20 6 7 21 10 7 22 2 7 23 17 8 24 2 8 25 10 8 26 7 9 27 9 9 28 19 9 29 15 10 30 12 10 31 13 10 32 1 11 33 14 11 34 16 11 35 18 12 36 4 12 37 15 12 38 5 13 39 12 13 40 1 13 41 16 14 42 3 14 43 1 14 44 0 15 45 16 15 46 14 15 47 3 16 48 10 16 49 11 16 50 7 17 51 18 17 52 5 17 53 5 18 54 15 18 55 13 18 56 6 19 57 19 19 58 9 19 59 4 20 60 6 20 61 2 20 62 3 21 63 11 21 64 8 21 65 6 22 66 4 22 67 18 22 68 1 3 69 3 3 70 7 3 71 16 23 72 0 23 73 2 23 74 0 5 75 14 5 76 15 5 77 10 24 78 9 24 79 8 24 80 6 25 81 9 25 82 10 25 83 7 26 84 8 26 85 9 26 86 15 27 87 14 27 88 12 27 89 1 28 90 12 28 91 14 28 92 5 13 93 13 13 94 12 13 95 16 29 96 17 29 97 3 29 98 3 30 99 17 30 100 10 30 101 7 31 102 19 31 103 18 31 104 5 32 105 18 32 106 15 32 107

+
+
+
+
+ + + + + 1 0 0 2.746234 0 1 0 -0.7129033 0 0 1 0.3962743 0 0 0 1 + + + 1 0 0 -2.753439 0 1 0 -0.7129033 0 0 1 0.3962743 0 0 0 1 + + + 1 0 0 0.7613215 0 1 0 -2.217451 0 0 1 0.8382882 0 0 0 1 + + + 1 0 0 -0.7983776 0 1 0 -2.217451 0 0 1 0.8382882 0 0 0 1 + + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + + + + + + + + + + + 1 0 0 0 0 1 0 0.2790807 0 0 1 1.424781 0 0 0 1 + + + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + + 1 0 0 0 0 1 0 0.1752674 0 0 1 1.070523 0 0 0 1 + + + 1 0 0 0 0 1 0 1.608763 0 0 1 1.325542 0 0 0 1 + + + 1 0 0 0 0 1 0 -0.02438152 0 0 1 2.130329 0 0 0 1 + + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + + 0 + 0 + 1.631059 + 0 + + + + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + + 0 + 0 + 1.631059 + 0 + + + + + + 0 + 0 + 1.631059 + 0 + + + + + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + + + + + + +
\ No newline at end of file diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/flier.tscript b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/flier.tscript new file mode 100644 index 000000000..9f2b53390 --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/flier.tscript @@ -0,0 +1,11 @@ + +singleton TSShapeConstructor(flierdae) +{ + baseShapeAsset = "./flier.dae"; + singleDetailSize = "0"; + flipUVCoords = "0"; + JoinIdenticalVerts = "0"; + reverseWindingOrder = "0"; + removeRedundantMats = "0"; + animFPS = "2"; +}; diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/hoverboat.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/hoverboat.asset.taml new file mode 100644 index 000000000..c2c15714a --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/hoverboat.asset.taml @@ -0,0 +1 @@ + diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/hoverboat.dae b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/hoverboat.dae new file mode 100644 index 000000000..18b22f7ad --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/hoverboat.dae @@ -0,0 +1,156 @@ + + + + + Blender User + Blender 2.90.0 commit date:2020-08-31, commit time:11:26, hash:0330d1af29c0 + + 2021-09-11T16:05:47 + 2021-09-11T16:05:47 + + Z_UP + + + + + + + + 0 0 0 1 + + + 0.8 0.8 0.8 1 + + + 1.45 + + + + + + + + + + + + + + + + + 0.7238646 -2.736287 0 1.46437e-7 -3.198901 0.4 1.30974e-7 -2.933427 0 0.8008492 -2.870321 0.4 1.509492 -1.992523 0.01999771 0.8008492 -2.870321 0.4 0.7238646 -2.736287 0 1.67003 -1.67303 0.3850017 1.509492 -1.992523 0.01999771 1.83015 2.968142 0.4 1.67003 -1.67303 0.3850017 1.65422 2.791054 0 0.7238646 -2.736287 0 1.65422 2.791054 0 1.509492 -1.992523 0.01999771 1.30974e-7 -2.933427 0 -0.7238643 -2.736287 0 -1.509492 -1.992523 0.01999771 -1.65422 2.791054 0 -1.670029 -1.67303 0.3850017 -1.65422 2.791054 0 -1.509492 -1.992523 0.01999771 -1.83015 2.968142 0.4 -1.670029 -1.67303 0.3850017 -1.785 2.968142 1.2 -1.83015 2.968142 0.4 -1.785 -1.346858 1.2 -0.800849 -2.870321 0.4 -1.785 -1.346858 1.2 -1.670029 -1.67303 0.3850017 -0.7810919 -2.939518 1.2 -0.800849 -2.870321 0.4 1.36834e-7 -3.371857 1.2 -0.7810919 -2.939518 1.2 1.46437e-7 -3.198901 0.4 -0.7238643 -2.736287 0 1.46437e-7 -3.198901 0.4 -0.800849 -2.870321 0.4 1.30974e-7 -2.933427 0 -0.800849 -2.870321 0.4 -1.509492 -1.992523 0.01999771 -0.7238643 -2.736287 0 -1.670029 -1.67303 0.3850017 0.8008492 -2.870321 0.4 1.36834e-7 -3.371857 1.2 1.46437e-7 -3.198901 0.4 0.7810921 -2.939518 1.2 0.8008492 -2.870321 0.4 1.785 -1.346858 1.2 0.7810921 -2.939518 1.2 1.67003 -1.67303 0.3850017 1.67003 -1.67303 0.3850017 1.785 2.968142 1.2 1.785 -1.346858 1.2 1.83015 2.968142 0.4 1.83015 2.968142 0.4 -1.785 2.968142 1.2 1.785 2.968142 1.2 -1.83015 2.968142 0.4 1.65422 2.791054 0 -1.65422 2.791054 0 -1.785 2.968142 1.2 1.785 2.968142 1.2 -1.69575 2.968142 1.6 1.69575 2.968142 1.6 -1.102238 2.968142 1.8 -1.69575 2.968142 1.6 -1.102238 -0.7950175 1.8 -1.102238 2.968142 1.8 -1.69575 -1.227617 1.6 -1.785 2.968142 1.2 -1.69575 -1.227617 1.6 -1.69575 2.968142 1.6 -1.785 -1.346858 1.2 -1.785 -1.346858 1.2 -0.7420379 -2.740638 1.6 -1.69575 -1.227617 1.6 -0.7810919 -2.939518 1.2 -0.7810919 -2.939518 1.2 1.36834e-7 -3.151357 1.6 -0.7420379 -2.740638 1.6 1.36834e-7 -3.371857 1.2 1.36834e-7 -3.371857 1.2 0.7420381 -2.740638 1.6 1.36834e-7 -3.151357 1.6 0.7810921 -2.939518 1.2 1.785 -1.346858 1.2 0.7420381 -2.740638 1.6 0.7810921 -2.939518 1.2 1.69575 -1.227617 1.6 1.785 2.968142 1.2 1.69575 -1.227617 1.6 1.785 -1.346858 1.2 1.69575 2.968142 1.6 1.102238 2.968142 1.8 1.69575 -1.227617 1.6 1.69575 2.968142 1.6 1.102238 2.468142 1.8 1.102238 1.664157 1.8 1.102238 -0.3559176 1.8 1.102238 -0.7950175 1.8 1.102238 1.664157 1.8 -1.102238 2.468142 1.8 -1.102238 1.664157 1.8 -0.8022379 2.468142 1.8 -0.8022379 2.968142 1.8 0.8022381 2.468142 1.8 1.102238 2.468142 1.8 1.102238 2.968142 1.8 -0.8022379 2.968142 1.8 0.8022381 2.968142 1.8 0.8022381 2.968142 1.8 -1.102238 1.664157 1.8 -1.102238 2.468142 1.8 -1.102238 -0.3559176 1.8 -1.102238 -0.7950175 1.8 -0.7420379 -2.740638 1.6 -0.4823238 -1.778477 1.8 -1.69575 -1.227617 1.6 1.36834e-7 -3.151357 1.6 -0.4823238 -1.778477 1.8 -0.7420379 -2.740638 1.6 1.36834e-7 -2.045438 1.8 0.7420381 -2.740638 1.6 1.36834e-7 -2.045438 1.8 1.36834e-7 -3.151357 1.6 0.4823241 -1.778477 1.8 0.7420381 -2.740638 1.6 1.102238 -0.7950175 1.8 0.4823241 -1.778477 1.8 1.69575 -1.227617 1.6 0.8266781 -0.3559176 2.399 1.102238 -0.7950175 1.8 1.102238 -0.3559176 1.8 0.3617441 -1.093518 2.399 1.102238 -0.7950175 1.8 0.8266781 -0.3559176 2.399 0.4823241 -1.778477 1.8 1.36834e-7 -1.293737 2.399 0.4823241 -1.778477 1.8 0.3617441 -1.093518 2.399 1.36834e-7 -2.045438 1.8 -0.3617438 -1.093518 2.399 1.36834e-7 -2.045438 1.8 1.36834e-7 -1.293737 2.399 -0.4823238 -1.778477 1.8 -0.3617438 -1.093518 2.399 -1.102238 -0.7950175 1.8 -0.4823238 -1.778477 1.8 -0.8266779 -0.3559176 2.399 -0.3617438 -1.093518 2.399 0.8266781 -0.3559176 2.399 -0.8266779 -0.3559176 2.399 1.36834e-7 -1.293737 2.399 0.3617441 -1.093518 2.399 -1.102238 -0.3559176 1.8 -1.102238 -0.7950175 1.8 -0.8266779 -0.3559176 2.399 0.8266781 -0.3559176 2.399 -0.8266779 -0.3559176 2.399 -0.8266779 1.164156 2.399 0.8266781 1.164156 2.399 0.8266781 -0.3559176 2.399 1.102238 1.664157 1.8 0.8266781 1.164156 2.399 1.102238 -0.3559176 1.8 1.102238 1.664157 1.8 -0.8266779 1.164156 2.399 0.8266781 1.164156 2.399 -1.102238 1.664157 1.8 1.102238 2.868143 3 0.8022381 2.468142 1.8 1.102238 2.468142 1.8 0.8022381 2.768142 2.7 -0.8022379 2.768142 2.7 -1.102238 2.868143 3 -1.102238 2.468142 1.8 -0.8022379 2.468142 1.8 -0.8022379 2.968142 1.8 -0.8022379 2.768142 2.7 -0.8022379 2.468142 1.8 -0.8022379 3.268142 2.7 -0.8022379 2.968142 1.8 -1.102238 3.368143 3 -0.8022379 3.268142 2.7 -1.102238 2.968142 1.8 0.8022381 2.768142 2.7 0.8022381 2.968142 1.8 0.8022381 2.468142 1.8 0.8022381 3.268142 2.7 -0.8022379 2.768142 2.7 0.8022381 3.268142 2.7 0.8022381 2.768142 2.7 -0.8022379 3.268142 2.7 0.8022381 3.268142 2.7 1.102238 3.368143 3 1.102238 2.968142 1.8 0.8022381 2.968142 1.8 1.102238 2.968142 1.8 1.102238 2.868143 3 1.102238 2.468142 1.8 1.102238 3.368143 3 -1.102238 3.368143 3 1.102238 2.868143 3 1.102238 3.368143 3 -1.102238 2.868143 3 -1.102238 2.968142 1.8 -1.102238 2.868143 3 -1.102238 3.368143 3 -1.102238 2.468142 1.8 -0.8266779 1.164156 2.399 -1.102238 -0.3559176 1.8 -0.8266779 -0.3559176 2.399 -1.102238 1.664157 1.8 -1.102238 2.468142 1.8 -0.8022379 2.468142 1.8 -0.8022379 2.968142 1.8 0.8022381 2.468142 1.8 1.102238 2.468142 1.8 -1.102238 2.968142 1.8 0.8022381 2.968142 1.8 1.102238 2.968142 1.8 + + + + + + + + + + 0.2212894 -0.8125379 -0.5392711 0.3544659 -0.863941 -0.3577151 0.6484157 -0.675471 -0.3511354 0.8004003 -0.579115 0.154872 0.9240899 -0.03055113 -0.3809523 0.9200505 -0.02954447 -0.3906844 0.9245606 -0.03066992 -0.379799 0.9197186 -0.02946275 -0.3914711 0.03026527 -0.00509417 -0.999529 0 0 -1 -0.01808375 0.007780373 -0.9998062 0 -0.004180431 -0.9999914 -0.9240651 -0.029594 -0.3810878 -0.9200519 -0.03042972 -0.3906134 -0.9242513 -0.0295546 -0.3806391 -0.9198509 -0.0304709 -0.3910831 -0.9978132 -0.03460645 0.05631381 -0.9901961 0 -0.1396851 -0.8041464 -0.5822765 0.1195945 -0.8456949 -0.5330703 -0.02522212 -0.4324874 -0.8926935 -0.1267009 -0.4268929 -0.8944119 -0.1333786 -0.4832925 -0.8731467 -0.0635876 -0.3722102 -0.9071894 -0.1961297 -0.3544659 -0.8639412 -0.3577146 -0.2212894 -0.8125381 -0.5392709 -0.6484157 -0.675471 -0.3511354 -0.8004005 -0.5791149 0.1548717 0.4324874 -0.8926935 -0.1267008 0.4268929 -0.894412 -0.1333785 0.3722102 -0.9071894 -0.1961297 0.4832926 -0.8731467 -0.06358742 0.845695 -0.5330703 -0.025222 0.8041464 -0.5822765 0.1195945 0.990196 0 -0.139685 0.9978132 -0.03460639 0.05631381 0 1 0 0 1 -6.51364e-7 0 0.9143953 -0.4048224 0 0.9143947 -0.4048241 0 1 -1.33568e-6 0 1 1.40598e-6 0 1 3.51494e-7 -0.3193336 0 0.9476425 -0.3197686 0 0.9474958 -0.3192518 0 0.9476699 -0.3193343 0 0.9476422 -0.9760001 0 0.2177699 -0.9760001 0 0.2177701 -0.799037 -0.5036623 0.3284268 -0.799036 -0.5036595 0.3284335 -0.4361897 -0.7880539 0.4344075 -0.4361911 -0.7880498 0.4344134 0.4361883 -0.7880512 0.4344137 0.4361925 -0.7880522 0.4344076 0.7990362 -0.5036595 0.3284333 0.799037 -0.5036625 0.3284265 0.9760001 0 0.2177699 0.9760001 0 0.21777 0.9760002 0 0.21777 0.9760001 0 0.2177699 0.319334 0 0.9476422 0.319334 0 0.9476423 0.3193349 0 0.9476419 0.3193358 0 0.9476417 0.319333 0 0.9476427 0.319333 0 0.9476426 0.3193328 0 0.9476426 0.3193333 0 0.9476425 0 0 1 -4.76718e-5 1 0 -4.79658e-5 1 0 0 1 -2.16304e-6 -4.79658e-5 1 0 -0.3193297 -4.54545e-5 0.9476437 0.9476437 -4.54545e-5 0.3193297 -0.3193298 -4.54545e-5 0.9476436 -0.2227466 -0.1404055 0.9647126 -0.2227461 -0.1404054 0.9647127 -0.2227452 -0.1404052 0.9647129 -0.2227471 -0.1404055 0.9647125 -0.09802633 -0.1771023 0.9792985 -0.09802353 -0.1771012 0.9792991 0.09802603 -0.1771011 0.9792988 0.09802401 -0.1771028 0.9792987 0.2227461 -0.1404054 0.9647126 0.2227466 -0.1404055 0.9647125 0.2227452 -0.1404053 0.9647129 0.2227472 -0.1404056 0.9647125 0.908479 0 0.4179307 0.6670235 -0.4204472 0.6150641 0.6670231 -0.4204514 0.6150618 0.3260775 -0.5891351 0.7393195 0.3260786 -0.5891344 0.7393196 -0.3260778 -0.5891345 0.7393199 -0.3260784 -0.5891349 0.7393193 -0.667023 -0.4204514 0.6150617 -0.6670234 -0.4204474 0.6150642 0 0 1 3.43081e-7 0 1 -0.908479 0 0.4179307 0.9084789 0 0.4179307 0.9084789 0 0.4179308 0 0.7676952 0.6408152 0 0.7676949 0.6408155 0 -0.9486833 0.3162277 0 -0.9486833 0.3162277 0 -0.9486833 0.3162277 0 -0.9486835 0.3162274 0 -0.948683 0.3162288 0 -0.9486829 0.3162289 0 -0.9486833 0.3162277 1 0 0 0 0.9486833 -0.3162277 0 0.9486834 -0.3162276 0 0.9486835 -0.3162273 -1 0 0 0 0.9486832 -0.3162283 0 0.9486832 -0.3162284 0 0.9486833 -0.3162277 0 0.9486833 -0.3162277 -0.9084789 0 0.4179307 -0.9084789 0 0.4179308 + + + + + + + + + + -14.1628 38.434 -36.9745 66.3048 -22.1765 38.434 -36.9745 66.3048 -14.1628 38.434 -23.6182 66.3048 -14.819 26.0998 -52.8879 46.5459 -31.7185 26.0998 -52.8879 46.5459 -14.819 26.0998 -24.7221 46.5459 -27.6169 12.8975 27.6169 26.1678 -46.0563 26.1678 27.6169 26.1678 -27.6169 12.8975 27.6169 12.8975 -7.01139 -41.9133 -16.0228 27.6169 -16.0228 -27.6169 0 -45.7941 -16.0228 27.6169 -7.01139 -41.9133 7.01139 -41.9133 -16.0228 27.6169 0 -45.7941 16.0228 -27.6169 -16.0228 27.6169 7.01139 -41.9133 -16.0228 27.6169 16.0228 -27.6169 16.0228 27.6169 46.0563 26.1678 -27.6169 12.8975 27.6169 12.8975 -27.6169 12.8975 46.0563 26.1678 -27.6169 26.1678 46.0563 19.548 -27.6169 37.4119 -27.6169 19.548 -27.6169 37.4119 46.0563 19.548 57.324 37.4119 52.8879 36.2561 29.7573 56.7677 24.7221 36.2561 29.7573 56.7677 52.8879 36.2561 66.8176 56.7677 23.6182 55.6976 47.064 79.7867 29.49 79.7867 47.064 79.7867 23.6182 55.6976 36.9745 55.6976 14.1628 38.434 36.9745 66.3048 23.6182 66.3048 36.9745 66.3048 14.1628 38.434 22.1765 38.434 52.8879 46.5459 14.819 26.0998 31.7185 26.0998 14.819 26.0998 52.8879 46.5459 24.7221 46.5459 -23.6182 55.6976 -47.064 79.7867 -36.9745 55.6976 -47.064 79.7867 -23.6182 55.6976 -29.49 79.7867 -52.8879 36.2561 -29.7573 56.7677 -66.8176 56.7677 -29.7573 56.7677 -52.8879 36.2561 -24.7221 36.2561 -46.0563 19.548 27.6169 37.4119 -57.324 37.4119 27.6169 37.4119 -46.0563 19.548 27.6169 19.548 -26.7047 7.87402 35.1378 23.622 -35.1378 23.622 35.1378 23.622 -26.7047 7.87402 26.7047 7.87402 -16.0228 0 26.7047 7.87402 -26.7047 7.87402 26.7047 7.87402 -16.0228 0 16.0228 0 33.3809 31.4961 -35.1378 23.622 35.1378 23.622 -35.1378 23.622 33.3809 31.4961 -33.3809 31.4961 -33.3809 31.4961 33.3809 31.4961 21.6976 35.4331 -27.6169 -21.5754 46.4608 -9.246581 -27.6169 -9.246581 46.4608 -9.246581 -27.6169 -21.5754 54.9766 -21.5754 -27.6169 15.4032 54.9766 23.4708 -27.6169 23.4708 54.9766 23.4708 -27.6169 15.4032 57.324 15.4032 29.7573 2.50924 63.9156 10.8457 28.7083 10.8457 63.9156 10.8457 29.7573 2.50924 66.8176 2.50924 29.49 -15.6617 44.962 -6.91968 28.2667 -6.91968 44.962 -6.91968 29.49 -15.6617 47.064 -15.6617 -47.064 -15.6617 -28.2667 -6.91968 -44.962 -6.91968 -28.2667 -6.91968 -47.064 -15.6617 -29.49 -15.6617 -29.7573 2.50924 -63.9156 10.8457 -66.8176 2.50924 -63.9156 10.8457 -29.7573 2.50924 -28.7083 10.8457 27.6169 15.4032 -54.9766 23.4708 -57.324 15.4032 -54.9766 23.4708 27.6169 15.4032 27.6169 23.4708 27.6169 -9.246581 -54.9766 -21.5754 27.6169 -21.5754 17.7744 -9.246581 -54.9766 -21.5754 27.6169 -9.246581 1.94793 -9.246581 -54.9766 -21.5754 17.7744 -9.246581 -37.8173 -9.246581 -54.9766 -21.5754 1.94793 -9.246581 -54.9766 -21.5754 -37.8173 -9.246581 -46.4608 -9.246581 21.6976 1.94793 -21.6976 17.7744 -21.6976 1.94793 -21.6976 17.7744 21.6976 1.94793 -15.7921 17.7744 -15.7921 17.7744 21.6976 1.94793 -15.7921 27.6169 -15.7921 27.6169 21.6976 1.94793 15.7921 17.7744 15.7921 17.7744 21.6976 1.94793 21.6976 17.7744 -21.6976 35.4331 21.6976 35.4331 15.7921 35.4331 -33.3809 31.4961 21.6976 35.4331 -21.6976 35.4331 -21.6976 35.4331 15.7921 35.4331 -15.7921 35.4331 15.7921 27.6169 -15.7921 27.6169 15.7921 17.7744 -27.6169 -9.246581 -1.94793 -9.246581 -17.7744 -9.246581 -27.6169 -9.246581 37.8173 -9.246581 -1.94793 -9.246581 -27.6169 -9.246581 46.4608 -9.246581 37.8173 -9.246581 27.7343 -32.2784 63.9156 -47.2306 50.619 -32.2784 63.9156 -47.2306 27.7343 -32.2784 28.7083 -47.2306 44.962 -73.1755 23.5676 -53.7259 28.2667 -73.1755 23.5676 -53.7259 44.962 -73.1755 34.4196 -53.7259 -28.2667 -73.1755 -34.4196 -53.7259 -44.962 -73.1755 -34.4196 -53.7259 -28.2667 -73.1755 -23.5676 -53.7259 -63.9156 -47.2306 -27.7343 -32.2784 -50.619 -32.2784 -27.7343 -32.2784 -63.9156 -47.2306 -28.7083 -47.2306 -37.8173 36.1016 -46.4608 23.1223 -37.8173 23.1223 -40.4782 16.3656 -27.7343 1.41104 -23.3147 16.3656 -27.7343 1.41104 -40.4782 16.3656 -50.619 1.41104 -27.2538 -4.60419 -23.5676 -22.1155 -19.1148 -4.60419 -23.5676 -22.1155 -27.2538 -4.60419 -34.4196 -22.1155 19.1148 -4.60419 34.4196 -22.1155 27.2538 -4.60419 34.4196 -22.1155 19.1148 -4.60419 23.5676 -22.1155 40.4782 16.3656 27.7343 1.41104 50.619 1.41104 27.7343 1.41104 40.4782 16.3656 23.3147 16.3656 -7.12094 -52.3371 16.2732 -37.8173 -16.2732 -37.8173 16.2732 -37.8173 -7.12094 -52.3371 0 -56.2785 16.2732 -37.8173 0 -56.2785 7.12094 -52.3371 37.8173 23.1223 46.4608 23.1223 37.8173 36.1016 16.2732 -37.8173 -16.2732 -7.89459 -16.2732 -37.8173 -16.2732 -7.89459 16.2732 -37.8173 16.2732 -7.89459 -37.8173 36.1016 1.94793 23.1223 -7.89459 36.1016 1.94793 23.1223 -37.8173 36.1016 -37.8173 23.1223 -21.6976 25.9537 16.2732 41.3131 -16.2732 41.3131 16.2732 41.3131 -21.6976 25.9537 21.6976 25.9537 21.6976 64.1353 15.7921 39.2355 21.6976 39.2355 15.7921 39.2355 21.6976 64.1353 15.7921 57.9104 15.7921 57.9104 21.6976 64.1353 -15.7921 57.9104 -21.6976 64.1353 -15.7921 57.9104 21.6976 64.1353 -21.6976 39.2355 -15.7921 57.9104 -21.6976 64.1353 -15.7921 57.9104 -21.6976 39.2355 -15.7921 39.2355 27.6169 35.4331 23.6799 53.1496 17.7744 35.4331 23.6799 53.1496 27.6169 35.4331 33.5224 53.1496 15.7921 42.348 21.6976 67.24781 15.7921 61.0229 21.6976 67.24781 15.7921 42.348 21.6976 42.348 -23.6799 53.1496 -27.6169 35.4331 -17.7744 35.4331 -27.6169 35.4331 -23.6799 53.1496 -33.5224 53.1496 15.7921 23.6799 -15.7921 33.5224 -15.7921 23.6799 -15.7921 33.5224 15.7921 23.6799 15.7921 33.5224 15.7921 61.0229 21.6976 67.24781 -15.7921 61.0229 -21.6976 67.24781 -15.7921 61.0229 21.6976 67.24781 -21.6976 42.348 -15.7921 61.0229 -21.6976 67.24781 -15.7921 61.0229 -21.6976 42.348 -15.7921 42.348 27.6169 35.4331 25.6484 59.0551 17.7744 35.4331 25.6484 59.0551 27.6169 35.4331 35.4909 59.0551 -21.6976 35.4909 21.6976 25.6484 21.6976 35.4909 21.6976 25.6484 -21.6976 35.4909 -21.6976 25.6484 -27.6169 35.4331 -25.6484 59.0551 -35.4909 59.0551 -25.6484 59.0551 -27.6169 35.4331 -17.7744 35.4331 7.89459 36.1016 37.8173 23.1223 37.8173 36.1016 37.8173 23.1223 7.89459 36.1016 -1.94793 23.1223 -15.7921 17.7744 -21.6976 27.6169 -21.6976 17.7744 -21.6976 27.6169 -15.7921 17.7744 -15.7921 27.6169 15.7921 27.6169 21.6976 17.7744 21.6976 27.6169 21.6976 17.7744 15.7921 27.6169 15.7921 17.7744 + + + + + + + + + + + + + + +

0 0 0 1 0 1 2 0 2 1 1 3 0 1 4 3 1 5 4 2 6 5 2 7 6 2 8 5 3 9 4 3 10 7 3 11 8 4 12 9 5 13 10 6 14 9 5 15 8 4 16 11 7 17 12 8 18 13 8 19 14 8 20 15 9 21 13 9 22 12 9 23 16 9 24 13 9 25 15 9 26 17 10 27 13 10 28 16 10 29 13 11 30 17 11 31 18 11 32 19 12 33 20 13 34 21 14 35 20 13 36 19 12 37 22 15 38 23 16 39 24 16 40 25 16 41 24 17 42 23 17 43 26 17 44 27 18 45 28 18 46 29 18 47 28 19 48 27 19 49 30 19 50 31 20 51 32 21 52 33 22 53 32 21 54 31 20 55 34 23 56 35 24 57 36 24 58 37 24 59 36 25 60 35 25 61 38 25 62 39 26 63 40 26 64 41 26 65 40 27 66 39 27 67 42 27 68 43 28 69 44 29 70 45 30 71 44 29 72 43 28 73 46 31 74 47 32 75 48 32 76 49 32 77 48 33 78 47 33 79 50 33 80 51 34 81 52 34 82 53 34 83 52 35 84 51 35 85 54 35 86 55 36 87 56 36 88 57 36 89 56 37 90 55 37 91 58 37 92 59 38 93 58 38 94 55 38 95 58 39 96 59 39 97 60 39 98 63 40 99 62 40 100 61 40 101 62 41 102 63 41 103 64 41 104 64 42 105 63 42 106 65 42 107 66 43 108 67 44 109 68 45 110 67 44 111 66 43 112 69 46 113 70 47 114 71 47 115 72 47 116 71 48 117 70 48 118 73 48 119 74 49 120 75 49 121 76 49 122 75 50 123 74 50 124 77 50 125 78 51 126 79 51 127 80 51 128 79 52 129 78 52 130 81 52 131 82 53 132 83 53 133 84 53 134 83 54 135 82 54 136 85 54 137 86 55 138 87 55 139 88 55 140 87 56 141 86 56 142 89 56 143 90 57 144 91 58 145 92 59 146 91 58 147 90 57 148 93 60 149 94 61 150 95 61 151 96 62 152 97 63 153 95 61 154 94 61 155 98 64 156 95 64 157 97 64 158 99 65 159 95 66 160 98 67 161 95 66 162 99 65 163 100 68 164 101 69 165 102 69 166 103 69 167 102 69 168 101 69 169 104 69 170 104 69 171 101 69 172 105 69 173 105 69 174 101 69 175 106 69 176 106 69 177 101 69 178 107 69 179 108 36 180 65 70 181 109 71 182 64 72 183 65 72 184 108 72 185 108 36 186 109 71 187 110 73 188 111 69 189 105 69 190 106 69 191 68 45 192 112 74 193 113 75 194 68 45 195 114 76 196 112 74 197 68 45 198 67 44 199 114 76 200 115 77 201 116 78 202 117 79 203 116 78 204 115 77 205 118 80 206 119 81 207 120 81 208 121 81 209 120 82 210 119 82 211 122 82 212 123 83 213 124 83 214 125 83 215 124 84 216 123 84 217 126 84 218 127 85 219 128 86 220 129 87 221 128 86 222 127 85 223 130 88 224 131 89 225 132 89 226 133 89 227 134 90 228 135 90 229 136 90 230 135 91 231 134 91 232 137 91 233 138 92 234 139 92 235 140 92 236 139 93 237 138 93 238 141 93 239 142 94 240 143 94 241 144 94 242 143 95 243 142 95 244 145 95 245 146 96 246 147 96 247 148 96 248 147 97 249 146 97 250 149 97 251 150 69 252 151 69 253 152 69 254 151 98 255 150 98 256 153 98 257 151 99 258 153 99 259 154 99 260 155 100 261 156 100 262 157 100 263 158 69 264 160 69 265 159 69 266 160 69 267 158 69 268 161 69 269 162 101 270 163 101 271 164 101 272 163 102 273 162 102 274 165 102 275 166 103 276 167 103 277 168 103 278 167 104 279 166 104 280 169 104 281 170 105 282 171 106 283 172 107 284 171 106 285 170 105 286 173 108 287 173 108 288 170 105 289 174 109 290 175 110 291 174 109 292 170 105 293 176 105 294 174 109 295 175 110 296 174 109 297 176 105 298 177 111 299 178 112 300 179 112 301 180 112 302 179 112 303 178 112 304 181 112 305 182 113 306 183 114 307 184 115 308 183 114 309 182 113 310 185 113 311 186 116 312 187 116 313 188 116 314 187 116 315 186 116 316 189 116 317 190 9 318 191 9 319 192 9 320 191 9 321 190 9 322 193 9 323 184 115 324 183 114 325 194 117 326 195 118 327 194 117 328 183 114 329 196 119 330 194 117 331 195 118 332 194 117 333 196 119 334 197 120 335 198 112 336 199 112 337 200 112 338 199 112 339 198 112 340 201 112 341 202 69 342 203 69 343 204 69 344 203 69 345 202 69 346 205 69 347 206 116 348 207 116 349 208 116 350 207 116 351 206 116 352 209 116 353 210 121 354 211 121 355 212 121 356 211 122 357 210 122 358 213 122 359 215 69 360 219 69 361 214 69 362 219 69 363 215 69 364 216 69 365 220 69 366 218 69 367 221 69 368 218 69 369 220 69 370 217 69 371

+
+
+
+ + + + -1.554587 -3.327249 1.217115 -0.8379113 -3.199351 1.635984 -2 3.004421 0.8137459 -2 2.984745 1.626146 1.554587 -3.327249 1.217115 0.8379115 -3.199351 1.635984 2 3.004421 0.8137459 2 2.984745 1.626146 -0.8341614 -1.28556 2.393531 -0.8341614 1.169336 2.364016 0.8341616 1.169336 2.364016 0.8341616 -1.28556 2.393531 -1.725639 -2.667086 0.8137459 1.36834e-7 2.984745 1.626146 1.72564 -2.667086 0.8137459 -1.975116 -1.32069 1.631065 1.975116 -1.32069 1.631065 + + + + + + + + + + -0.5558079 0.009994029 0.8312508 0 0.9997069 0.02421271 0.5209673 -0.3132765 0.7940095 0 -0.9564092 0.29203 0 -0.5213904 -0.8533183 0 -0.3680505 0.9298059 0 0.3765351 0.9264024 0 0.01202195 0.9999278 0 0 -1 -0.4495213 -0.2698778 0.851526 0.4495213 -0.2698778 0.851526 0.5371739 -0.002140939 0.8434689 -0.5209673 -0.3132765 0.7940095 -0.9745129 -0.2164185 0.05905586 0.974513 -0.2164187 0.05905592 0.974411 -0.04713737 -0.2197759 -0.9999833 -0.005779683 -1.39986e-4 -0.5371739 -0.002140998 0.8434688 0 0.9997069 0.02421331 0 0.9997069 0.02421271 0 -0.956409 0.2920307 0 -0.5213901 -0.8533185 0 -0.3680503 0.9298059 0 0.376535 0.9264024 0 0.376535 0.9264024 0 0.01202195 0.9999278 0.5558079 0.00999391 0.8312508 0.9999833 -0.005779802 -1.39988e-4 -0.974411 -0.04713737 -0.2197759 + + + + + + + + + + 0.625 0.1666666 0.625 0.125 0.625 0.08333331 0.625 0.375 0.625 0.5 0.375 0.5 0.625 0.625 0.625 0.6666666 0.625 0.75 0.625 0.75 0.375 1 0.375 0.75 0.375 0.625 0.125 0.75 0.125 0.625 0.875 0.6666666 0.625 0.75 0.625 0.6666666 0.75 0.5 0.875 0.5833333 0.625 0.5833333 0.875 0.5833333 0.625 0.6666666 0.625 0.5833333 0.375 0.5 0.125 0.625 0.125 0.5 0.375 0 0.625 0 0.625 0.125 0.375 0.75 0.625 0.625 0.625 0.75 0.625 0.5833333 0.625 0.625 0.625 0.5 0.625 0 0.625 0.08333331 0.625 0.125 0.375 0.125 0.375 0 0.625 0.125 0.375 0.625 0.625 0.625 0.375 0.75 0.375 0.5 0.625 0.625 0.375 0.625 0.375 0.25 0.625 0.125 0.625 0.25 0.625 0.1666666 0.625 0.25 0.625 0.125 0.375 0.5 0.375 0.25 0.625 0.375 0.375 0.25 0.625 0.25 0.625 0.375 0.625 0.75 0.625 1 0.375 1 0.375 0.625 0.375 0.75 0.125 0.75 0.875 0.6666666 0.875 0.75 0.625 0.75 0.625 0.5833333 0.625 0.5 0.75 0.5 0.75 0.5 0.875 0.5 0.875 0.5833333 0.875 0.5833333 0.875 0.6666666 0.625 0.6666666 0.375 0.5 0.375 0.625 0.125 0.625 0.625 0.5833333 0.625 0.6666666 0.625 0.625 0.375 0.5 0.625 0.5 0.625 0.625 0.375 0.25 0.375 0.125 0.625 0.125 + + + + + + + + + + + + + + +

9 0 0 15 0 1 8 0 2 13 1 3 7 1 4 6 1 5 16 2 6 11 2 7 5 2 8 5 3 9 0 3 10 4 3 11 14 4 12 0 4 13 12 4 14 8 5 15 5 5 16 11 5 17 13 6 18 9 6 19 10 6 20 9 7 21 11 7 22 10 7 23 6 8 24 12 8 25 2 8 26 0 9 27 1 9 28 15 9 29 4 10 30 16 10 31 5 10 32 10 11 33 16 11 34 7 11 35 1 12 36 8 12 37 15 12 38 12 13 39 0 13 40 15 13 41 14 14 42 16 14 43 4 14 44 6 15 45 16 15 46 14 15 47 2 16 48 15 16 49 3 16 50 9 17 51 3 17 52 15 17 53 6 18 54 2 18 55 13 18 56 2 19 57 3 19 58 13 19 59 5 20 60 1 20 61 0 20 62 14 21 63 4 21 64 0 21 65 8 22 66 1 22 67 5 22 68 10 23 69 7 23 70 13 23 71 13 24 72 3 24 73 9 24 74 9 25 75 8 25 76 11 25 77 6 8 78 14 8 79 12 8 80 10 26 81 11 26 82 16 26 83 6 27 84 7 27 85 16 27 86 2 28 87 12 28 88 15 28 89

+
+
+
+
+ + + + 1 0 0 -1.30003e-15 0 1 0 -8.471325 0 0 1 5.85482 0 0 0 1 + + + 1 0 0 -1.30395e-15 0 1 0 -8.471325 0 0 1 5.872447 0 0 0 1 + + + 1 0 0 -3.45175e-16 0 1 0 0.2570481 0 0 1 1.554529 0 0 0 1 + + + -1 8.74228e-8 0 0 -8.74228e-8 -1 0 0 0 0 1 0 0 0 0 1 + + + + + + + + + + + + -1 8.74228e-8 0 0 -8.74228e-8 -1 0 0 0 0 1 0 0 0 0 1 + + + + + + + +
\ No newline at end of file diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/hoverboat.tscript b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/hoverboat.tscript new file mode 100644 index 000000000..dc5c5a796 --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Vehicles/hoverboat.tscript @@ -0,0 +1,11 @@ + +singleton TSShapeConstructor(hoverboatdae) +{ + baseShapeAsset = "./hoverboat.dae"; + singleDetailSize = "0"; + flipUVCoords = "0"; + JoinIdenticalVerts = "0"; + reverseWindingOrder = "0"; + removeRedundantMats = "0"; + animFPS = "2"; +}; diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/materials.tscript b/Templates/BaseGame/game/data/Prototyping/shapes/materials.tscript deleted file mode 100644 index 482e431af..000000000 --- a/Templates/BaseGame/game/data/Prototyping/shapes/materials.tscript +++ /dev/null @@ -1,8 +0,0 @@ - -singleton Material(DetailBlue) -{ - mapTo = "DetailBlue"; - diffuseColor[0] = "0.8 0.8 0.8 1"; - DiffuseMap[0] = "data/Prototyping/Materials/DetailBlue.png"; - translucentBlendOp = "None"; -}; From 5892ff7428fbe5d89f310da9cbe05573a0ea70af Mon Sep 17 00:00:00 2001 From: Areloch Date: Sun, 12 Sep 2021 05:32:30 -0500 Subject: [PATCH 072/399] Adds handling for drag-and-drop import of files even if asset browser is not open. If world or gui editor are the active controls, then it will injest the incoming files and prompt what their destination module and path will be via a new popup window. After clicking OK, import continues into that destination. Cleaned up commented lines from drag-and-drop functions. Fixed issue where material icon on buttons in the object creator windows wouldn't display. Fixed issue where it wasn't correctly binding cloud textures for BasicClouds object or ripple/foam/depth textures for water objects when newly created Fixed issue where when double-clicking on a datablock type in the datablock editor, wasn't correctly going through the module selection process, making an invalid destination. Added handling for Trigger object creation via TriggerData class Standardized double-click handling of datablock entries in AB to respect double click action mode, and properly either open the datablock editor to the given datablock, or spawn it. Made Create New Datablock prompt window indicate the destination module to be clearer where it's going if force-prompt of module setting is off. --- .../assetBrowser/guis/setAssetTarget.gui | 220 ++++++++++++++++++ .../game/tools/assetBrowser/main.tscript | 2 + .../scripts/addModuleWindow.tscript | 7 +- .../assetBrowser/scripts/assetImport.tscript | 90 +++---- .../assetTypes/datablockObjects.tscript | 17 +- .../assetBrowser/scripts/creator.tscript | 2 - .../scripts/setAssetTarget.tscript | 43 ++++ .../DatablockEditorCreatePrompt.ed.gui | 26 +-- .../DatablockEditorTreeWindow.ed.gui | 2 +- .../datablockEditor/datablockEditor.tscript | 2 + .../scripts/input/dragDropEvents.ed.tscript | 1 - .../guiEditor/scripts/guiEditor.ed.tscript | 58 +++++ .../scripts/guiEditorUndo.ed.tscript | 2 +- .../worldEditor/gui/objectBuilderGui.ed.gui | 29 ++- .../scripts/editors/worldEditor.ed.tscript | 58 +++++ 15 files changed, 469 insertions(+), 90 deletions(-) create mode 100644 Templates/BaseGame/game/tools/assetBrowser/guis/setAssetTarget.gui create mode 100644 Templates/BaseGame/game/tools/assetBrowser/scripts/setAssetTarget.tscript diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/setAssetTarget.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/setAssetTarget.gui new file mode 100644 index 000000000..700058f74 --- /dev/null +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/setAssetTarget.gui @@ -0,0 +1,220 @@ +//--- OBJECT WRITE BEGIN --- +$guiContent = new GuiControl(AssetBrowser_setAssetTarget) { + position = "0 0"; + extent = "1024 768"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultNonModalProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + + new GuiWindowCtrl(AssetBrowser_setAssetTargetWindow) { + text = "Set Asset Destination"; + resizeWidth = "1"; + resizeHeight = "1"; + canMove = "1"; + canClose = "1"; + canMinimize = "0"; + canMaximize = "0"; + canCollapse = "0"; + closeCommand = "Canvas.popDialog(AssetBrowser_setAssetTarget);"; + edgeSnap = "1"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "328 311"; + extent = "368 118"; + minExtent = "48 92"; + horizSizing = "center"; + vertSizing = "center"; + profile = "ToolsGuiWindowProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextCtrl() { + text = "Target Module:"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "12 29"; + extent = "116 17"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiPopUpMenuCtrlEx() { + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + hotTrackCallback = "0"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "135 28"; + extent = "202 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiPopUpMenuProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "ModuleList"; + class = "AssetBrowserModuleList"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Target Path:"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "12 54"; + extent = "116 17"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextEditCtrl() { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + text = "data/"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "135 54"; + extent = "201 18"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "0"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "targetPath"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl() { + BitmapAsset = "ToolsModule:iconOpen_image"; + bitmapMode = "Centered"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "340 51"; + extent = "22 22"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "SelectAssetPath.showDialog(AssetBrowser.dirHandler.currentAddress, \"setAssetTargetUpdatePath\");\nSelectAssetPathWindow.selectWindow();"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "New Module"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Done"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "227 87"; + extent = "64 22"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "setAssetTarget();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Cancel"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "295 87"; + extent = "64 22"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "AssetBrowser_setAssetTargetWindow.onClose();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/tools/assetBrowser/main.tscript b/Templates/BaseGame/game/tools/assetBrowser/main.tscript index dc41eacb9..8f6ca92dd 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/main.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/main.tscript @@ -69,6 +69,7 @@ function initializeAssetBrowser() exec("./guis/looseFileAudit.gui"); exec("./guis/assetNameEdit.gui"); exec("./guis/createNewCollectionSet.gui"); + exec("./guis/setAssetTarget.gui"); exec("./scripts/assetBrowser." @ $TorqueScriptFileExtension); exec("./scripts/popupMenus." @ $TorqueScriptFileExtension); @@ -85,6 +86,7 @@ function initializeAssetBrowser() exec("./scripts/selectPath." @ $TorqueScriptFileExtension); exec("./scripts/looseFileAudit." @ $TorqueScriptFileExtension); exec("./scripts/creator." @ $TorqueScriptFileExtension); + exec("./scripts/setAssetTarget." @ $TorqueScriptFileExtension); //Processing for the different asset types exec("./scripts/assetTypes/component." @ $TorqueScriptFileExtension); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/addModuleWindow.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/addModuleWindow.tscript index ade7dce8e..ff085835b 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/addModuleWindow.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/addModuleWindow.tscript @@ -95,7 +95,7 @@ function AssetBrowser_addModuleWindow::CreateNewModule(%this) //force a refresh of our modules list ModuleDatabase.ignoreLoadedGroups(true); - ModuleDatabase.scanModules(); + ModuleDatabase.registerModule(%moduleFilePath, %newModuleName @ ".module"); %success = ModuleDatabase.loadExplicit(%newModuleName, 1); ModuleDatabase.ignoreLoadedGroups(false); @@ -123,8 +123,9 @@ function AssetBrowserModuleList::refresh(%this) %count = getWordCount(%moduleList); for(%i=0; %i < %count; %i++) { - %moduleName = getWord(%moduleList, %i); - %this.add(%moduleName.ModuleId, %i); + %moduleDef = getWord(%moduleList, %i); + %moduleName = %moduleDef.ModuleId; + %this.add(%moduleName, %i); } } diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.tscript index a65a0af7b..1b42f482f 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.tscript @@ -165,8 +165,14 @@ function getAssetTypeByFilename(%filePath) function AssetBrowser::onBeginDropFiles( %this ) { - if(!AssetBrowser.isAwake()) + if(!AssetBrowser.isAwake() || !AssetBrowser.isVisible()) + { + if(GuiEditorIsActive()) + GuiEditor.onBeginDropFiles(); + else if(EditorIsActive()) + EWorldEditor.onBeginDropFiles(); return; + } error("% DragDrop - Beginning files dropping."); if(!ImportAssetWindow.isAwake()) @@ -175,45 +181,28 @@ function AssetBrowser::onBeginDropFiles( %this ) function AssetBrowser::onDropFile( %this, %filePath ) { - if(!%this.isVisible()) + if(!AssetBrowser.isAwake() || !AssetBrowser.isVisible()) + { + if(GuiEditorIsActive()) + GuiEditor.onDropFile(%filePath); + else if(EditorIsActive()) + EWorldEditor.onDropFile(%filePath); return; + } ImportAssetWindow.importer.addImportingFile(%filePath); - - /*%fileExt = fileExt( %filePath ); - //add it to our array! - if(isImageFormat(%fileExt)) - %assetItem = %this.addImportingAsset("ImageAsset", %filePath); - else if( isShapeFormat(%fileExt)) - %assetItem = %this.addImportingAsset("ShapeAsset", %filePath); - else if( isSoundFormat(%fileExt)) - %assetItem = %this.addImportingAsset("SoundAsset", %filePath); - else if( %fileExt $= "." @ $TorqueScriptFileExtension || %fileExt $= "." @ $TorqueScriptFileExtension @ ".dso" ) - %assetItem = %this.addImportingAsset("ScriptAsset", %filePath); - else if( %fileExt $= ".gui" || %fileExt $= ".gui.dso" ) - %assetItem = %this.addImportingAsset("GUIAsset", %filePath); - else if (%fileExt $= ".zip") - %this.onDropZipFile(%filePath); - else if( %fileExt $= "") - %this.onDropFolder(%filePath); - - if(%assetItem !$= "") - { - SessionImportAssetItems.add(%assetItem); - ImportAssetItems.add(%assetItem); - }*/ - - //Used to keep tabs on what files we were trying to import, used mainly in the event of - //adjusting configs and needing to completely reprocess the import - //ensure we're not doubling-up on files by accident - //if(ImportAssetWindow.importingFilesArray.getIndexFromKey(%filePath) == -1) - // ImportAssetWindow.importingFilesArray.add(%filePath); } function AssetBrowser::onDropZipFile(%this, %filePath) { - if(!%this.isVisible()) + if(!AssetBrowser.isAwake() || !AssetBrowser.isVisible()) + { + if(GuiEditorIsActive()) + GuiEditor.onDropZipFile(%filePath); + else if(EditorIsActive()) + EWorldEditor.onDropZipFile(%filePath); return; + } %zip = new ZipObject(); %zip.openArchive(%filePath); @@ -226,27 +215,6 @@ function AssetBrowser::onDropZipFile(%this, %filePath) %fileEntry = %zip.getFileEntry(%i); %fileFrom = getField(%fileEntry, 0); - //First, we wanna scan to see if we have modules to contend with. If we do, we'll just plunk them in wholesale - //and not process their contents. - - //If not modules, it's likely an art pack or other mixed files, so we'll import them as normal - /*if( (%fileExt $= ".png") || (%fileExt $= ".jpg") || (%fileExt $= ".bmp") || (%fileExt $= ".dds") ) - %this.importAssetListArray.add("ImageAsset", %filePath); - else if( (%fileExt $= ".dae") || (%fileExt $= ".dts")) - %this.importAssetListArray.add("ShapeAsset", %filePath); - else if( (%fileExt $= ".ogg") || (%fileExt $= ".wav") || (%fileExt $= ".mp3")) - %this.importAssetListArray.add("SoundAsset", %filePath); - else if( (%fileExt $= ".gui") || (%fileExt $= ".gui.dso")) - %this.importAssetListArray.add("GUIAsset", %filePath); - //else if( (%fileExt $= "." @ $TorqueScriptFileExtension) || (%fileExt $= ".dso")) - // %this.importAssetListArray.add("Script", %filePath); - else if( (%fileExt $= ".mis")) - %this.importAssetListArray.add("LevelAsset", %filePath);*/ - - // For now, if it's a .tscript file, we'll assume it's a behavior. - //if (fileExt(%fileFrom) !$= "." @ $TorqueScriptFileExtension) - // continue; - %fileTo = expandFilename("^tools/assetBrowser/importTemp/") @ %fileFrom; %zip.extractFile(%fileFrom, %fileTo); //exec(%fileTo); @@ -259,8 +227,14 @@ function AssetBrowser::onDropZipFile(%this, %filePath) function AssetBrowser::onDropFolder(%this, %filePath) { - if(!%this.isVisible()) + if(!AssetBrowser.isAwake() || !AssetBrowser.isVisible()) + { + if(GuiEditorIsActive()) + GuiEditor.onDropFolder(%filePath); + else if(EditorIsActive()) + EWorldEditor.onDropFolder(%filePath); return; + } %zip = new ZipObject(); %zip.openArchive(%filePath); @@ -306,8 +280,14 @@ function AssetBrowser::onDropFolder(%this, %filePath) function AssetBrowser::onEndDropFiles( %this ) { - if(!%this.isVisible()) + if(!AssetBrowser.isAwake() || !AssetBrowser.isVisible()) + { + if(GuiEditorIsActive()) + GuiEditor.onEndDropFiles(); + else if(EditorIsActive()) + EWorldEditor.onEndDropFiles(); return; + } ImportAssetWindow.refresh(); } diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.tscript index ea77f8b1a..a0aad9382 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.tscript @@ -63,7 +63,22 @@ function AssetBrowser::buildDatablockPreview(%this, %assetDef, %previewData) "\nDatablock Type: " @ %assetDef.getClassName() @ "\nDefinition Path: " @ %assetDef.getFilename(); - %previewData.doubleClickCommand = "AssetBrowser.schedule(10, \"spawnDatablockObject\",\""@ %assetDef @"\");";//browseTo %assetDef.dirPath / %assetDef.assetName + + if(%this.selectMode) + { + %previewData.doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );"; + } + else + { + if(EditorSettings.value("Assets/Browser/doubleClickAction", "Edit Asset") $= "Edit Asset") + { + %previewData.doubleClickCommand = "DatablockEditorPlugin.openDatablock( "@%assetDef@" );"; + } + else + { + %previewData.doubleClickCommand = "AssetBrowser.onDatablockEditorDropped( "@%assetDef@" );"; + } + } } function spawnDatablockObject(%datablock) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript index d2254ee12..15dc88d0a 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript @@ -106,8 +106,6 @@ function AssetBrowser::loadCreatorClasses(%this) %guiClasses.sortk(true); - %guiClasses.echo(); - %currentCat = ""; for(%i=0; %i < %guiClasses.count(); %i++) { diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/setAssetTarget.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/setAssetTarget.tscript new file mode 100644 index 000000000..f2440e873 --- /dev/null +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/setAssetTarget.tscript @@ -0,0 +1,43 @@ +function AssetBrowser_setAssetTarget::showDialog(%this, %callback) +{ + AssetBrowser_setAssetTarget.callback = %callback; + Canvas.pushDialog(AssetBrowser_setAssetTarget); +} + +function AssetBrowser_setAssetTarget::onWake(%this) +{ + %targetModule = AssetBrowser.dirHandler.getModuleFromAddress(AssetBrowser.dirHandler.currentAddress).ModuleId; + + if(%targetModule $= "") + %targetModule = EditorSettings.value("Assets/New/defaultModule", ""); + + AssetBrowser_setAssetTarget-->moduleList.setText(%targetModule); + + %moduleDef = ModuleDatabase.findModule(%targetModule); + + %targetPath = AssetBrowser.dirHandler.currentAddress; + if(!startsWith(%targetPath, %moduleDef.ModulePath)) + { + %targetPath = %moduleDef.ModulePath; + } + + AssetBrowser_setAssetTarget-->targetPath.text = %targetPath; +} + +function AssetBrowser_setAssetTargetWindow::onClose(%this) +{ + Canvas.popDialog(AssetBrowser_setAssetTarget); +} + +function setAssetTargetUpdatePath(%targetPath) +{ + AssetBrowser_setAssetTarget-->targetPath.text = %targetPath; +} + +function setAssetTarget() +{ + AssetBrowser.dirHandler.currentAddress = AssetBrowser_setAssetTarget-->targetPath.text; + eval(AssetBrowser_setAssetTarget.callback); + + Canvas.popDialog(AssetBrowser_setAssetTarget); +} \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorCreatePrompt.ed.gui b/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorCreatePrompt.ed.gui index 5f1783390..29b3afb9e 100644 --- a/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorCreatePrompt.ed.gui +++ b/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorCreatePrompt.ed.gui @@ -5,7 +5,6 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) { minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - fixedAspectRatio = "0"; profile = "ToolsGuiDefaultProfile"; visible = "1"; active = "1"; @@ -14,6 +13,7 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) { isContainer = "1"; canSave = "1"; canSaveDynamicFields = "1"; + fixedAspectRatio = "0"; new GuiWindowCtrl() { text = "Create New Datablock"; @@ -32,18 +32,18 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) { anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "389 252"; - extent = "207 167"; + position = "374 252"; + extent = "309 167"; minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - fixedAspectRatio = "0"; profile = "ToolsGuiWindowProfile"; visible = "1"; active = "1"; tooltipProfile = "ToolsGuiToolTipProfile"; hovertime = "1000"; isContainer = "1"; + internalName = "promptWindow"; canSave = "1"; canSaveDynamicFields = "0"; @@ -61,7 +61,6 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) { minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - fixedAspectRatio = "0"; profile = "ToolsGuiTextProfile"; visible = "1"; active = "1"; @@ -86,11 +85,10 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) { anchorLeft = "1"; anchorRight = "0"; position = "7 45"; - extent = "191 17"; + extent = "294 18"; minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - fixedAspectRatio = "0"; profile = "ToolsGuiTextEditProfile"; visible = "1"; active = "1"; @@ -106,12 +104,11 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) { groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; - position = "7 137"; + position = "111 137"; extent = "122 22"; minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - fixedAspectRatio = "0"; profile = "ToolsGuiButtonProfile"; visible = "1"; active = "1"; @@ -128,12 +125,11 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) { groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; - position = "135 137"; + position = "239 137"; extent = "63 22"; minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - fixedAspectRatio = "0"; profile = "ToolsGuiButtonProfile"; visible = "1"; active = "1"; @@ -159,7 +155,6 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) { minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - fixedAspectRatio = "0"; profile = "ToolsGuiTextProfile"; visible = "1"; active = "1"; @@ -182,11 +177,10 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) { anchorLeft = "1"; anchorRight = "0"; position = "7 87"; - extent = "191 19"; + extent = "294 19"; minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - fixedAspectRatio = "0"; profile = "ToolsGuiPopUpMenuProfile"; visible = "1"; active = "1"; @@ -198,7 +192,6 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) { canSaveDynamicFields = "0"; }; new GuiCheckBoxCtrl() { - useInactiveState = "0"; text = "Client-Side Datablock"; groupNum = "-1"; buttonType = "ToggleButton"; @@ -208,10 +201,9 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) { minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - fixedAspectRatio = "0"; profile = "ToolsGuiCheckBoxProfile"; visible = "1"; - active = "1"; + active = "0"; tooltipProfile = "ToolsGuiToolTipProfile"; hovertime = "1000"; isContainer = "0"; diff --git a/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorTreeWindow.ed.gui b/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorTreeWindow.ed.gui index 95ba4a277..8f0d0eaee 100644 --- a/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorTreeWindow.ed.gui +++ b/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorTreeWindow.ed.gui @@ -259,7 +259,7 @@ $guiContent = new GuiControl() { tooltipprofile = "ToolsGuiToolTipProfile"; hovertime = "1000"; canSaveDynamicFields = "0"; - altCommand = "DatablockEditorPlugin.createDatablock();"; + altCommand = "DatablockEditorPlugin.pickDatablockPath();"; }; }; }; diff --git a/Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript b/Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript index ca9373416..d780731ef 100644 --- a/Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript +++ b/Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript @@ -666,6 +666,7 @@ function DatablockEditorPlugin::createDatablock(%this) // Show the dialog. canvas.pushDialog( DatablockEditorCreatePrompt, 0, true ); + DatablockEditorCreatePrompt-->promptWindow.text = "Create New Datablock in module: " @ DatablockEditorPlugin.targetCreationModule; } } @@ -679,6 +680,7 @@ function DatablockEditorPlugin::pickDatablockPath(%this) function DatablockEditorPlugin::pickedNewDBTargetModule(%this, %module) { + DatablockEditorPlugin.targetCreationModule = %module; %moduleDef = ModuleDatabase.findModule(%module); $DATABLOCK_EDITOR_DEFAULT_FILENAME = %moduleDef.ModulePath @ "/scripts/managedData/managedDatablocks." @ $TorqueScriptFileExtension; diff --git a/Templates/BaseGame/game/tools/editorClasses/scripts/input/dragDropEvents.ed.tscript b/Templates/BaseGame/game/tools/editorClasses/scripts/input/dragDropEvents.ed.tscript index 70582bd20..5e4405282 100644 --- a/Templates/BaseGame/game/tools/editorClasses/scripts/input/dragDropEvents.ed.tscript +++ b/Templates/BaseGame/game/tools/editorClasses/scripts/input/dragDropEvents.ed.tscript @@ -39,7 +39,6 @@ function onDropFile( %filePath ) } function onDropEnd( %fileCount ) { - //error("% DragDrop - Completed file dropping"); Input::GetEventManager().postEvent( "EndDropFiles" ); } diff --git a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript index 9436283d4..e9eabea7e 100644 --- a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript +++ b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript @@ -722,6 +722,64 @@ function GuiEditor::onMouseModeChange( %this ) GuiEditorStatusBar.setText( GuiEditorStatusBar.getMouseModeHelp() ); } +// +function GuiEditor::onBeginDropFiles( %this ) +{ + if(!%this.isVisible()) + return; + + AssetBrowser_setAssetTarget.showDialog("EWorldEditor.doFileDropProcessing();"); + + if(!isObject($EditorImportFileList)) + $EditorImportFileList = new ArrayObject(); + + $EditorImportFileList.empty(); +} + +function GuiEditor::onDropFile( %this, %filePath ) +{ + if(!%this.isVisible()) + return; + + $EditorImportFileList.add(%filePath); +} + +function GuiEditor::onDropZipFile(%this, %filePath) +{ + if(!%this.isVisible()) + return; +} + +function GuiEditor::onDropFolder(%this, %filePath) +{ + if(!%this.isVisible()) + return; +} + +function GuiEditor::onEndDropFiles( %this ) +{ + if(!%this.isVisible()) + return; +} + +function GuiEditor::doFileDropProcessing(%this) +{ + if(!ImportAssetWindow.isAwake()) + ImportAssetWindow.showDialog(); + + for(%i=0; %i < $EditorImportFileList.Count(); %i++) + { + %file = $EditorImportFileList.getKey(%i); + ImportAssetWindow.importer.addImportingFile(%file); + } + + $EditorImportFileList.empty(); + + ImportAssetWindow.refresh(); +} + +// + //============================================================================================= // Resolution List. //============================================================================================= diff --git a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorUndo.ed.tscript b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorUndo.ed.tscript index f28a26109..ba75ee7a0 100644 --- a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorUndo.ed.tscript +++ b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorUndo.ed.tscript @@ -599,4 +599,4 @@ function GuiEditor::onFitIntoParents( %this ) { %selected = %this.getSelection(); //TODO -} +} \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui index 755227156..dc757dc54 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui @@ -375,7 +375,7 @@ function ObjectBuilderGui::createImageAssetType(%this, %index) modal = "1"; command = %this @ ".getImageAsset(" @ %index @ ");"; }; - %button.setBitmap("tools/materialEditor/gui/change-material-btn"); + %button.setBitmap("ToolsModule:change_material_btn_n_image"); %this.controls[%this.numControls].addGuiControl(%button); %this.numControls++; @@ -466,7 +466,7 @@ function ObjectBuilderGui::createMaterialNameType(%this, %index) modal = "1"; command = %this @ ".getMaterialName(" @ %index @ ");"; }; - %button.setBitmap("tools/materialEditor/gui/change-material-btn"); + %button.setBitmap("ToolsModule:change_material_btn_n_image"); %this.controls[%this.numControls].addGuiControl(%button); //%val = %this.field[%index, value]; @@ -869,7 +869,6 @@ function ObjectBuilderGui::buildCloudLayer(%this) OBObjectName.setValue( "" ); %this.objectClassName = "CloudLayer"; %this.addField( "textureAsset", "TypeImageAsset", "Image", "Core_Rendering:clouds_normal_displacement_image" ); - //%this.addField( "textureFile", "TypeImageFilename", "Texture", "core/rendering/images/clouds_normal_displacement" ); %this.process(); } @@ -881,9 +880,10 @@ function ObjectBuilderGui::buildBasicClouds(%this) // This is a trick... any fields added after process won't show // up as controls, but will be applied to the created object. - %this.addField( "texture[0]", "TypeImageFilename", "Texture", "core/rendering/images/cloud1" ); - %this.addField( "texture[1]", "TypeImageFilename", "Texture", "core/rendering/images/cloud2" ); - %this.addField( "texture[2]", "TypeImageFilename", "Texture", "core/rendering/images/cloud3" ); + %this.addField( "textureAsset[0]", "TypeImageAssetId", "TextureAsset", "Core_Rendering:cloud1_image" ); + %this.addField( "textureAsset[1]", "TypeImageAssetId", "TextureAsset", "Core_Rendering:cloud2_image" ); + %this.addField( "textureAsset[2]", "TypeImageAssetId", "TextureAsset", "Core_Rendering:cloud3_image" ); + } function ObjectBuilderGui::checkExists( %this, %classname ) @@ -994,9 +994,9 @@ function ObjectBuilderGui::addWaterObjectFields(%this) %this.addField("waveSpeed[2]", "TypeFloat", "Wave Speed", "1"); %this.addField("overallWaveMagnitude", "TypeFloat", "Overall Wave Magnitude", "1.0"); - %this.addField("rippleTex", "TypeImageFilename", "Ripple Texture", "core/rendering/images/ripple" ); - %this.addField("depthGradientTex", "TypeImageFilename", "Depth Gradient Texture", "core/rendering/images/depthcolor_ramp" ); - %this.addField("foamTex", "TypeImageFilename", "Foam Texture", "core/rendering/images/foam" ); + %this.addField("rippleTexAsset", "TypeImageAssetId", "Ripple Texture", "Core_Rendering:ripple_image" ); + %this.addField("depthGradientTexAsset", "TypeImageAssetId", "Depth Gradient Texture", "Core_Rendering:depthcolor_ramp_imag" ); + %this.addField("foamTexAsset", "TypeImageAssetId", "Foam Texture", "Core_Rendering:foam_image" ); } function ObjectBuilderGui::buildWaterBlock(%this) @@ -1410,4 +1410,15 @@ function PrecipitationData::create(%datablock) parentGroup = EWCreatorWindow.objectGroup; }; return %obj; +} + +function TriggerData::create(%datablock) +{ + %obj = new Trigger() + { + dataBlock = %datablock; + parentGroup = EWCreatorWindow.objectGroup; + polyhedron = "-0.5 0.5 0.0 1.0 0.0 0.0 0.0 -1.0 0.0 0.0 0.0 1.0"; + }; + return %obj; } \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/editors/worldEditor.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/editors/worldEditor.ed.tscript index 08b65c716..3ff1a1075 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/editors/worldEditor.ed.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/editors/worldEditor.ed.tscript @@ -321,6 +321,64 @@ function WorldEditor::onWorldEditorUndo( %this ) Inspector.refresh(); } +// +function WorldEditor::onBeginDropFiles( %this ) +{ + if(!%this.isVisible()) + return; + + AssetBrowser_setAssetTarget.showDialog("EWorldEditor.doFileDropProcessing();"); + + if(!isObject($EditorImportFileList)) + $EditorImportFileList = new ArrayObject(); + + $EditorImportFileList.empty(); +} + +function WorldEditor::onDropFile( %this, %filePath ) +{ + if(!%this.isVisible()) + return; + + $EditorImportFileList.add(%filePath); +} + +function WorldEditor::onDropZipFile(%this, %filePath) +{ + if(!%this.isVisible()) + return; +} + +function WorldEditor::onDropFolder(%this, %filePath) +{ + if(!%this.isVisible()) + return; +} + +function WorldEditor::onEndDropFiles( %this ) +{ + if(!%this.isVisible()) + return; +} + +function WorldEditor::doFileDropProcessing(%this) +{ + if(!ImportAssetWindow.isAwake()) + ImportAssetWindow.showDialog(); + + for(%i=0; %i < $EditorImportFileList.Count(); %i++) + { + %file = $EditorImportFileList.getKey(%i); + ImportAssetWindow.importer.addImportingFile(%file); + } + + $EditorImportFileList.empty(); + + ImportAssetWindow.refresh(); +} + +// + function Inspector::onInspectorFieldModified( %this, %object, %fieldName, %arrayIndex, %oldValue, %newValue ) { // The instant group will try to add our From 7556e403e79353c1b802733d3cae89127c571349 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sun, 12 Sep 2021 15:05:19 -0400 Subject: [PATCH 073/399] Clean up more evals that have local variables are not working correctly. --- .../Scripts/Inspector/Controls.tscript | 2 +- .../game/tools/gui/materialSelector.ed.gui | 6 ++-- .../game/tools/gui/scriptEditorDlg.ed.gui | 2 +- .../scripts/materialEditor.ed.tscript | 12 ++++---- .../scripts/materialEditorUndo.ed.tscript | 30 +++++++++---------- .../game/tools/navEditor/navEditor.tscript | 4 +-- 6 files changed, 27 insertions(+), 29 deletions(-) diff --git a/Templates/BaseGame/game/tools/VerveEditor/Scripts/Inspector/Controls.tscript b/Templates/BaseGame/game/tools/VerveEditor/Scripts/Inspector/Controls.tscript index b2b64f858..79beeda86 100644 --- a/Templates/BaseGame/game/tools/VerveEditor/Scripts/Inspector/Controls.tscript +++ b/Templates/BaseGame/game/tools/VerveEditor/Scripts/Inspector/Controls.tscript @@ -123,7 +123,7 @@ function VerveEditor::CreateField( %targetStack, %fieldName, %fieldType ) if ( isMethod( "VerveEditor", "Create" @ %fieldType @ "Field" ) ) { // Create the Input Control. - eval( "%fieldInput = VerveEditor::Create" @ %fieldType @ "Field( %fieldContainer, %fieldName );" ); + %fieldInput = eval( "return VerveEditor::Create" @ %fieldType @ "Field( %fieldContainer, %fieldName );" ); } else { diff --git a/Templates/BaseGame/game/tools/gui/materialSelector.ed.gui b/Templates/BaseGame/game/tools/gui/materialSelector.ed.gui index b043d62fc..a1e263b2a 100644 --- a/Templates/BaseGame/game/tools/gui/materialSelector.ed.gui +++ b/Templates/BaseGame/game/tools/gui/materialSelector.ed.gui @@ -1420,15 +1420,13 @@ function MaterialSelector::updateSelection( %this, %material, %previewImagePath // after we move away from the material. eg: if we remove a field from the material, // the empty checkbox will still be there until you move fro and to the material again - %isMaterialBorder = 0; - eval("%isMaterialBorder = isObject(MaterialSelector-->"@%material@"Border);"); + %isMaterialBorder = eval("return isObject(MaterialSelector-->"@%material@"Border);"); if( %isMaterialBorder ) { eval( "MaterialSelector-->"@%material@"Border.setStateOn(1);"); } - %isMaterialBorderPrevious = 0; - eval("%isMaterialBorderPrevious = isObject(MaterialSelector-->"@$prevSelectedMaterialHL@"Border);"); + %isMaterialBorderPrevious = eval("return isObject(MaterialSelector-->"@$prevSelectedMaterialHL@"Border);"); if( %isMaterialBorderPrevious ) { eval( "MaterialSelector-->"@$prevSelectedMaterialHL@"Border.setStateOn(0);"); diff --git a/Templates/BaseGame/game/tools/gui/scriptEditorDlg.ed.gui b/Templates/BaseGame/game/tools/gui/scriptEditorDlg.ed.gui index 3758916f6..0bbad9488 100644 --- a/Templates/BaseGame/game/tools/gui/scriptEditorDlg.ed.gui +++ b/Templates/BaseGame/game/tools/gui/scriptEditorDlg.ed.gui @@ -205,7 +205,7 @@ function _TextPadOnOk() if(ScriptEditorDlg.callback !$= "") { %text = ScriptEditorDlg-->textpad.getText(); - %command = ScriptEditorDlg.callback @ "( %text );"; + %command = ScriptEditorDlg.callback @ "(\"" @ expandEscape(%text) @ "\");"; eval(%command); } ScriptEditorDlg.callback = ""; diff --git a/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript b/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript index 7f3fb2d43..bdca293da 100644 --- a/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript +++ b/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript @@ -1124,13 +1124,13 @@ function MaterialEditorGui::updateActiveMaterial(%this, %propertyField, %value, MaterialEditorGui.submitUndo( %action ); } - eval("materialEd_previewMaterial." @ %propertyField @ " = " @ %value @ ";"); + materialEd_previewMaterial.setFieldValue(%propertyField, %value); materialEd_previewMaterial.flush(); materialEd_previewMaterial.reload(); if (MaterialEditorGui.livePreview == true) { - eval("MaterialEditorGui.currentMaterial." @ %propertyField @ " = " @ %value @ ";"); + MaterialEditorGui.setFieldValue(%propertyField, %value); MaterialEditorGui.currentMaterial.flush(); MaterialEditorGui.currentMaterial.reload(); } @@ -1173,7 +1173,7 @@ function MaterialEditorGui::updateMaterialReferences( %this, %obj, %oldName, %ne %fieldName = %obj.getField( %i ); if ( ( %obj.getFieldType( %fieldName ) $= "TypeMaterialName" ) && ( %obj.getFieldValue( %fieldName ) $= %oldName ) ) { - eval( %obj @ "." @ %fieldName @ " = " @ %newName @ ";" ); + %obj.setFieldValue(%fieldName, %newName); %objChanged = true; } } @@ -1431,13 +1431,13 @@ function MaterialEditorGui::updateAnimationFlags(%this) %action.oldValue = %oldFlags; MaterialEditorGui.submitUndo( %action ); - eval("materialEd_previewMaterial.animFlags[" @ MaterialEditorGui.currentLayer @ "] = " @ %flags @ ";"); + materialEd_previewMaterial.animFlags[MaterialEditorGui.currentLayer] = %flags; materialEd_previewMaterial.flush(); materialEd_previewMaterial.reload(); if (MaterialEditorGui.livePreview == true) { - eval("MaterialEditorGui.currentMaterial.animFlags[" @ MaterialEditorGui.currentLayer @ "] = " @ %flags @ ";"); + MaterialEditorGui.currentMaterial.animFlags[MaterialEditorGui.currentLayer] = %flags; MaterialEditorGui.currentMaterial.flush(); MaterialEditorGui.currentMaterial.reload(); } @@ -2324,7 +2324,7 @@ function MaterialEditorGui::changeMaterial(%this, %fromMaterial, %toMaterial) { %action.mode = "editorShapes"; - eval("MaterialEditorGui.currentObject." @ SubMaterialSelector.getText() @ " = " @ %toMaterial.getName() @ ";"); + MaterialEditorGui.currentObject.setFieldValue(SubMaterialSelector.getText(), %toMaterial.getName()); if( MaterialEditorGui.currentObject.isMethod("postApply") ) MaterialEditorGui.currentObject.postApply(); diff --git a/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditorUndo.ed.tscript b/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditorUndo.ed.tscript index 4f08ed9e0..5e1aa0ec7 100644 --- a/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditorUndo.ed.tscript +++ b/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditorUndo.ed.tscript @@ -62,13 +62,13 @@ function ActionUpdateActiveMaterial::redo(%this) MaterialEditorGui.setActiveMaterial(%this.material); } */ - eval("materialEd_previewMaterial." @ %this.field @ " = " @ %this.newValue @ ";"); + materialEd_previewMaterial.setFieldValue(%this.field, %this.newValue); materialEd_previewMaterial.flush(); materialEd_previewMaterial.reload(); if (MaterialEditorGui.livePreview == true) { - eval("%this.material." @ %this.field @ " = " @ %this.newValue @ ";"); + %this.material.setFieldValue(%this.field, %this.newValue); MaterialEditorGui.currentMaterial.flush(); MaterialEditorGui.currentMaterial.reload(); } @@ -80,7 +80,7 @@ function ActionUpdateActiveMaterial::redo(%this) } else { - eval("%this.material." @ %this.field @ " = " @ %this.newValue @ ";"); + %this.material.setFieldValue(%this.field, %this.newValue); %this.material.flush(); %this.material.reload(); } @@ -100,13 +100,13 @@ function ActionUpdateActiveMaterial::undo(%this) } */ - eval("materialEd_previewMaterial." @ %this.field @ " = " @ %this.oldValue @ ";"); + materialEd_previewMaterial.setFieldValue(%this.field, %this.oldValue); materialEd_previewMaterial.flush(); materialEd_previewMaterial.reload(); if (MaterialEditorGui.livePreview == true) { - eval("%this.material." @ %this.field @ " = " @ %this.oldValue @ ";"); + %this.material.setFieldValue(%this.field, %this.oldValue); MaterialEditorGui.currentMaterial.flush(); MaterialEditorGui.currentMaterial.reload(); } @@ -115,7 +115,7 @@ function ActionUpdateActiveMaterial::undo(%this) } else { - eval("%this.material." @ %this.field @ " = " @ %this.oldValue @ ";"); + %this.material.setFieldValue(%this.field, %this.oldValue); %this.material.flush(); %this.material.reload(); } @@ -138,13 +138,13 @@ function ActionUpdateActiveMaterialAnimationFlags::redo(%this) } */ - eval("materialEd_previewMaterial.animFlags[" @ %this.layer @ "] = " @ %this.newValue @ ";"); + materialEd_previewMaterial.animFlags[%this.layer] = %this.newValue; materialEd_previewMaterial.flush(); materialEd_previewMaterial.reload(); if (MaterialEditorGui.livePreview == true) { - eval("%this.material.animFlags[" @ %this.layer @ "] = " @ %this.newValue @ ";"); + %this.material.animFlags[%this.layer] = %this.newValue; MaterialEditorGui.currentMaterial.flush(); MaterialEditorGui.currentMaterial.reload(); } @@ -153,7 +153,7 @@ function ActionUpdateActiveMaterialAnimationFlags::redo(%this) } else { - eval("%this.material.animFlags[" @ %this.layer @ "] = " @ %this.newValue @ ";"); + %this.material.animFlags[%this.layer] = %this.newValue; %this.material.flush(); %this.material.reload(); } @@ -162,14 +162,14 @@ function ActionUpdateActiveMaterialAnimationFlags::redo(%this) function ActionUpdateActiveMaterialAnimationFlags::undo(%this) { if( MaterialEditorPreviewWindow.isVisible() && MaterialEditorGui.currentMaterial == %this.material ) - { - eval("materialEd_previewMaterial.animFlags[" @ %this.layer @ "] = " @ %this.oldValue @ ";"); + { + materialEd_previewMaterial.animFlags[%this.layer] = %this.oldValue; materialEd_previewMaterial.flush(); materialEd_previewMaterial.reload(); if (MaterialEditorGui.livePreview == true) { - eval("%this.material.animFlags[" @ %this.layer @ "] = " @ %this.oldValue @ ";"); + %this.material.animFlags[%this.layer] = %this.oldValue; MaterialEditorGui.currentMaterial.flush(); MaterialEditorGui.currentMaterial.reload(); } @@ -178,7 +178,7 @@ function ActionUpdateActiveMaterialAnimationFlags::undo(%this) } else { - eval("%this.material.animFlags[" @ %this.layer @ "] = " @ %this.oldValue @ ";"); + %this.material.animFlags[%this.layer] = %this.oldValue; %this.material.flush(); %this.material.reload(); } @@ -340,7 +340,7 @@ function ActionChangeMaterial::redo(%this) } else { - eval("%this.object." @ %this.materialTarget @ " = " @ %this.toMaterial.getName() @ ";"); + %this.object.setFieldValue(%this.materialTarget, %this.toMaterial.getName()); MaterialEditorGui.currentObject.postApply(); } @@ -372,7 +372,7 @@ function ActionChangeMaterial::undo(%this) } else { - eval("%this.object." @ %this.materialTarget @ " = " @ %this.fromMaterial.getName() @ ";"); + %this.object.setFieldValue(%this.materialTarget, %this.fromMaterial.getName()); MaterialEditorGui.currentObject.postApply(); } diff --git a/Templates/BaseGame/game/tools/navEditor/navEditor.tscript b/Templates/BaseGame/game/tools/navEditor/navEditor.tscript index 1f9e023bf..8fc2b15ba 100644 --- a/Templates/BaseGame/game/tools/navEditor/navEditor.tscript +++ b/Templates/BaseGame/game/tools/navEditor/navEditor.tscript @@ -262,7 +262,7 @@ function NavEditorGui::findCover(%this) %pos = LocalClientConnection.getControlObject().getPosition(); %text = NavEditorOptionsWindow-->TestProperties->CoverPosition.getText(); if(%text !$= "") - %pos = eval(%text); + %pos = eval("return " @ %text); %this.getPlayer().findCover(%pos, NavEditorOptionsWindow-->TestProperties->CoverRadius.getText()); } } @@ -275,7 +275,7 @@ function NavEditorGui::followObject(%this) %text = NavEditorOptionsWindow-->TestProperties->FollowObject.getText(); if(%text !$= "") { - eval("%obj = " @ %text); + %obj = eval("return " @ %text); if(!isObject(%obj)) toolsMessageBoxOk("Error", "Cannot find object" SPC %text); } From a7db690b59cca8a9859e28ee13d3d3755ec88a6d Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Mon, 13 Sep 2021 19:46:21 -0400 Subject: [PATCH 074/399] Reimplement object copy failures. --- Engine/source/console/compiledEval.cpp | 7 ++++++- Engine/source/console/console.cpp | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index f33586676..f4c48ef68 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -142,6 +142,7 @@ namespace Con // console variables. extern StringTableEntry gCurrentFile; extern StringTableEntry gCurrentRoot; + extern S32 gObjectCopyFailures; } namespace Con @@ -972,7 +973,11 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa } else { - Con::errorf(ConsoleLogEntry::General, "%s: Unable to find parent object %s for %s.", getFileLine(ip - 1), objParent, callArgv[1].getString()); + if (Con::gObjectCopyFailures == -1) + Con::errorf(ConsoleLogEntry::General, "%s: Unable to find parent object %s for %s.", getFileLine(ip - 1), objParent, callArgv[1].getString()); + else + ++Con::gObjectCopyFailures; + delete object; currentNewObject = NULL; ip = failJump; diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index ab93d554e..643f8cbec 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -300,6 +300,7 @@ Con::ConsoleInputEvent smConsoleInput; /// StringTableEntry gCurrentFile; StringTableEntry gCurrentRoot; +S32 gObjectCopyFailures = -1; /// @} bool alwaysUseDebugOutput = true; @@ -373,6 +374,9 @@ void init() "@ingroup Console\n"); addVariable( "instantGroup", TypeRealString, &gInstantGroup, "The group that objects will be added to when they are created.\n" "@ingroup Console\n"); + addVariable("Con::objectCopyFailures", TypeS32, &gObjectCopyFailures, "If greater than zero then it counts the number of object creation " + "failures based on a missing copy object and does not report an error..\n" + "@ingroup Console\n"); // Current script file name and root addVariable( "Con::File", TypeString, &gCurrentFile, "The currently executing script file.\n" From 98a4e7fb12a918a35b258661c9a235b6798a7762 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Tue, 14 Sep 2021 17:49:27 -0500 Subject: [PATCH 075/399] dedicated gfx device surpression augments $Video::forceDisplayAdapter = -1; to force usage of GFXAdapterType::NullDevice skips trying to open a splash window for dedicated servers bypasses guicanvas window display if window does not exist --- Engine/source/gfx/gfxInit.cpp | 2 +- Engine/source/gui/core/guiCanvas.cpp | 14 ++++++++------ Templates/BaseGame/game/main.tscript.in | 14 +++++++++----- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Engine/source/gfx/gfxInit.cpp b/Engine/source/gfx/gfxInit.cpp index b5d67206d..0a5c66466 100644 --- a/Engine/source/gfx/gfxInit.cpp +++ b/Engine/source/gfx/gfxInit.cpp @@ -290,7 +290,7 @@ GFXAdapter *GFXInit::getBestAdapterChoice() { S32 adapterIdx = dAtoi(adapterDevice.c_str()); if (adapterIdx == -1) - adapter = chooseAdapter(adapterType, outputDevice.c_str()); + adapter = chooseAdapter(NullDevice, outputDevice.c_str()); else adapter = chooseAdapter(adapterType, adapterIdx); } diff --git a/Engine/source/gui/core/guiCanvas.cpp b/Engine/source/gui/core/guiCanvas.cpp index 7cbea6d64..967c3e7d7 100644 --- a/Engine/source/gui/core/guiCanvas.cpp +++ b/Engine/source/gui/core/guiCanvas.cpp @@ -258,17 +258,19 @@ bool GuiCanvas::onAdd() // Make sure we're able to render. newDevice->setAllowRender( true ); - if(mDisplayWindow) + // NULL device returns a nullptr for getPlatformWindow + PlatformWindow* window = getPlatformWindow(); + if (mDisplayWindow && window) { - getPlatformWindow()->show(); + window->show(); WindowManager->setDisplayWindow(true); - getPlatformWindow()->setDisplayWindow(true); + window->setDisplayWindow(true); } - else + else if (window) { - getPlatformWindow()->hide(); + window->hide(); WindowManager->setDisplayWindow(false); - getPlatformWindow()->setDisplayWindow(false); + window->setDisplayWindow(false); } // Propagate add to parents. diff --git a/Templates/BaseGame/game/main.tscript.in b/Templates/BaseGame/game/main.tscript.in index 5d5569e7d..4e83ff2b2 100644 --- a/Templates/BaseGame/game/main.tscript.in +++ b/Templates/BaseGame/game/main.tscript.in @@ -1,10 +1,6 @@ $Core::windowIcon = "data/icon.png"; $Core::splashWindowImage = "data/splash.png"; -// Display a splash window immediately to improve app responsiveness before -// engine is initialized and main window created. -displaySplashWindow($Core::splashWindowImage); - // Console does something. setLogMode(6); @@ -20,6 +16,13 @@ ModuleDatabase.setModuleExtension("module"); ModuleDatabase.scanModules( "core", false ); ModuleDatabase.LoadExplicit( "CoreModule" ); +// Display a splash window immediately to improve app responsiveness before +// engine is initialized and main window created. +if ($Server::Dedicated == false) + displaySplashWindow($Core::splashWindowImage); +else + $Video::forceDisplayAdapter = -1; + //----------------------------------------------------------------------------- // Load any gameplay modules ModuleDatabase.scanModules( "data", false ); @@ -42,6 +45,7 @@ else } } -closeSplashWindow(); +if ($Server::Dedicated == false) + closeSplashWindow(); echo("Engine initialized..."); \ No newline at end of file From 433d32f237cf09b47f05d0c92ec361a41b38412e Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Wed, 15 Sep 2021 00:02:50 -0400 Subject: [PATCH 076/399] Implement better CPU Detection --- Engine/source/platform/platform.h | 47 +--- Engine/source/platform/platformCPU.cpp | 277 ++++----------------- Engine/source/platformWin32/winCPUInfo.cpp | 38 ++- 3 files changed, 88 insertions(+), 274 deletions(-) diff --git a/Engine/source/platform/platform.h b/Engine/source/platform/platform.h index 7158c5163..35cd1a687 100644 --- a/Engine/source/platform/platform.h +++ b/Engine/source/platform/platform.h @@ -55,50 +55,11 @@ /// @note These enums must be globally scoped so that they work with the inline assembly enum ProcessorType { - // x86 CPU_X86Compatible, - CPU_Intel_Unknown, - CPU_Intel_486, - CPU_Intel_Pentium, - CPU_Intel_PentiumMMX, - CPU_Intel_PentiumPro, - CPU_Intel_PentiumII, - CPU_Intel_PentiumCeleron, - CPU_Intel_PentiumIII, - CPU_Intel_Pentium4, - CPU_Intel_PentiumM, - CPU_Intel_Core, - CPU_Intel_Core2, - CPU_Intel_Corei7Xeon, // Core i7 or Xeon - CPU_AMD_K6, - CPU_AMD_K6_2, - CPU_AMD_K6_3, - CPU_AMD_Athlon, - CPU_AMD_Phenom, - CPU_AMD_PhenomII, - CPU_AMD_Bulldozer, - CPU_AMD_Unknown, - CPU_Cyrix_6x86, - CPU_Cyrix_MediaGX, - CPU_Cyrix_6x86MX, - CPU_Cyrix_GXm, ///< Media GX w/ MMX - CPU_Cyrix_Unknown, - - // PowerPC - CPU_PowerPC_Unknown, - CPU_PowerPC_601, - CPU_PowerPC_603, - CPU_PowerPC_603e, - CPU_PowerPC_603ev, - CPU_PowerPC_604, - CPU_PowerPC_604e, - CPU_PowerPC_604ev, - CPU_PowerPC_G3, - CPU_PowerPC_G4, - CPU_PowerPC_G4_7450, - CPU_PowerPC_G4_7455, - CPU_PowerPC_G4_7447, - CPU_PowerPC_G5, + CPU_ArmCompatible, + CPU_Intel, + CPU_AMD, + CPU_Apple }; /// Properties for CPU. diff --git a/Engine/source/platform/platformCPU.cpp b/Engine/source/platform/platformCPU.cpp index 4eaa33b8d..d0a852431 100644 --- a/Engine/source/platform/platformCPU.cpp +++ b/Engine/source/platform/platformCPU.cpp @@ -31,12 +31,11 @@ Signal Platform::SystemInfoReady; enum CPUFlags { // EDX Register flags - BIT_FPU = BIT(0), BIT_RDTSC = BIT(4), BIT_MMX = BIT(23), BIT_SSE = BIT(25), BIT_SSE2 = BIT(26), - BIT_3DNOW = BIT(31), + BIT_3DNOW = BIT(31), // only available for amd cpus in x86 // These use a different value for comparison than the above flags (ECX Register) BIT_SSE3 = BIT(0), @@ -47,241 +46,63 @@ enum CPUFlags // fill the specified structure with information obtained from asm code void SetProcessorInfo(Platform::SystemInfo_struct::Processor& pInfo, - char* vendor, U32 processor, U32 properties, U32 properties2) + char* vendor, char* brand, U32 processor, U32 properties, U32 properties2) { - Platform::SystemInfo.processor.properties |= (properties & BIT_FPU) ? CPU_PROP_FPU : 0; - Platform::SystemInfo.processor.properties |= (properties & BIT_RDTSC) ? CPU_PROP_RDTSC : 0; - Platform::SystemInfo.processor.properties |= (properties & BIT_MMX) ? CPU_PROP_MMX : 0; + // always assume FPU is available in 2021... + pInfo.properties |= CPU_PROP_FPU; + +#if defined(TORQUE_CPU_X86) || defined(TORQUE_CPU_X64) || defined(TORQUE_CPU_ARM64) + pInfo.properties |= CPU_PROP_LE; +#endif + +#if defined(TORQUE_CPU_X64) || defined(TORQUE_CPU_ARM64) + pInfo.properties |= CPU_PROP_64bit; +#endif + +#if defined(TORQUE_CPU_X86) || defined(TORQUE_CPU_X64) + pInfo.properties |= (properties & BIT_RDTSC) ? CPU_PROP_RDTSC : 0; + pInfo.properties |= (properties & BIT_MMX) ? CPU_PROP_MMX : 0; + pInfo.properties |= (properties & BIT_SSE) ? CPU_PROP_SSE : 0; + pInfo.properties |= (properties & BIT_SSE2) ? CPU_PROP_SSE2 : 0; + pInfo.properties |= (properties2 & BIT_SSE3) ? CPU_PROP_SSE3 : 0; + pInfo.properties |= (properties2 & BIT_SSE3xt) ? CPU_PROP_SSE3xt : 0; + pInfo.properties |= (properties2 & BIT_SSE4_1) ? CPU_PROP_SSE4_1 : 0; + pInfo.properties |= (properties2 & BIT_SSE4_2) ? CPU_PROP_SSE4_2 : 0; +#endif if (dStricmp(vendor, "GenuineIntel") == 0) { - pInfo.properties |= (properties & BIT_SSE) ? CPU_PROP_SSE : 0; - pInfo.properties |= (properties & BIT_SSE2) ? CPU_PROP_SSE2 : 0; - pInfo.properties |= (properties2 & BIT_SSE3) ? CPU_PROP_SSE3 : 0; - pInfo.properties |= (properties2 & BIT_SSE3xt) ? CPU_PROP_SSE3xt : 0; - pInfo.properties |= (properties2 & BIT_SSE4_1) ? CPU_PROP_SSE4_1 : 0; - pInfo.properties |= (properties2 & BIT_SSE4_2) ? CPU_PROP_SSE4_2 : 0; - - pInfo.type = CPU_Intel_Unknown; - // switch on processor family code - switch ((processor >> 8) & 0x0f) - { - case 4: - pInfo.type = CPU_Intel_486; - pInfo.name = StringTable->insert("Intel 486 class"); - break; - - // Pentium Family - case 5: - // switch on processor model code - switch ((processor >> 4) & 0xf) - { - case 1: - case 2: - case 3: - pInfo.type = CPU_Intel_Pentium; - pInfo.name = StringTable->insert("Intel Pentium"); - break; - case 4: - pInfo.type = CPU_Intel_PentiumMMX; - pInfo.name = StringTable->insert("Intel Pentium MMX"); - break; - default: - pInfo.type = CPU_Intel_Pentium; - pInfo.name = StringTable->insert( "Intel (unknown)" ); - break; - } - break; - - // Pentium Pro/II/II family - case 6: - { - U32 extendedModel = ( processor & 0xf0000 ) >> 16; - // switch on processor model code - switch ((processor >> 4) & 0xf) - { - case 1: - pInfo.type = CPU_Intel_PentiumPro; - pInfo.name = StringTable->insert("Intel Pentium Pro"); - break; - case 3: - case 5: - pInfo.type = CPU_Intel_PentiumII; - pInfo.name = StringTable->insert("Intel Pentium II"); - break; - case 6: - pInfo.type = CPU_Intel_PentiumCeleron; - pInfo.name = StringTable->insert("Intel Pentium Celeron"); - break; - case 7: - case 8: - case 11: - pInfo.type = CPU_Intel_PentiumIII; - pInfo.name = StringTable->insert("Intel Pentium III"); - break; - case 0xA: - if( extendedModel == 1) - { - pInfo.type = CPU_Intel_Corei7Xeon; - pInfo.name = StringTable->insert( "Intel Core i7 / Xeon" ); - } - else - { - pInfo.type = CPU_Intel_PentiumIII; - pInfo.name = StringTable->insert( "Intel Pentium III Xeon" ); - } - break; - case 0xD: - if( extendedModel == 1 ) - { - pInfo.type = CPU_Intel_Corei7Xeon; - pInfo.name = StringTable->insert( "Intel Core i7 / Xeon" ); - } - else - { - pInfo.type = CPU_Intel_PentiumM; - pInfo.name = StringTable->insert( "Intel Pentium/Celeron M" ); - } - break; - case 0xE: - pInfo.type = CPU_Intel_Core; - pInfo.name = StringTable->insert( "Intel Core" ); - break; - case 0xF: - pInfo.type = CPU_Intel_Core2; - pInfo.name = StringTable->insert( "Intel Core 2" ); - break; - default: - pInfo.type = CPU_Intel_PentiumPro; - pInfo.name = StringTable->insert( "Intel (unknown)" ); - break; - } - break; - } - - // Pentium4 Family - case 0xf: - pInfo.type = CPU_Intel_Pentium4; - pInfo.name = StringTable->insert( "Intel Pentium 4" ); - break; - - default: - pInfo.type = CPU_Intel_Unknown; - pInfo.name = StringTable->insert( "Intel (unknown)" ); - break; - } + pInfo.type = CPU_Intel; + pInfo.name = StringTable->insert(brand ? brand : "Intel (Unknown)"); } //-------------------------------------- + else if (dStricmp(vendor, "AuthenticAMD") == 0) + { + pInfo.name = StringTable->insert(brand ? brand : "AMD (unknown)"); + pInfo.type = CPU_AMD; + + // 3dnow! is only available in AMD cpus on x86. Otherwise its not reliably set. + pInfo.properties |= (properties & BIT_3DNOW) ? CPU_PROP_3DNOW : 0; + } + else if (dStricmp(vendor, "Apple") == 0) + { + pInfo.name = StringTable->insert(brand ? brand : "Apple (unknown)"); + pInfo.type = CPU_Apple; + } else - if (dStricmp(vendor, "AuthenticAMD") == 0) - { - // AthlonXP processors support SSE - pInfo.properties |= (properties & BIT_SSE) ? CPU_PROP_SSE : 0; - pInfo.properties |= ( properties & BIT_SSE2 ) ? CPU_PROP_SSE2 : 0; - pInfo.properties |= (properties & BIT_3DNOW) ? CPU_PROP_3DNOW : 0; - // Phenom and PhenomII support SSE3, SSE4a - pInfo.properties |= ( properties2 & BIT_SSE3 ) ? CPU_PROP_SSE3 : 0; - pInfo.properties |= ( properties2 & BIT_SSE4_1 ) ? CPU_PROP_SSE4_1 : 0; - // switch on processor family code - switch ((processor >> 8) & 0xf) - { - // K6 Family - case 5: - // switch on processor model code - switch ((processor >> 4) & 0xf) - { - case 0: - case 1: - case 2: - case 3: - pInfo.type = CPU_AMD_K6_3; - pInfo.name = StringTable->insert("AMD K5"); - break; - case 4: - case 5: - case 6: - case 7: - pInfo.type = CPU_AMD_K6; - pInfo.name = StringTable->insert("AMD K6"); - break; - case 8: - pInfo.type = CPU_AMD_K6_2; - pInfo.name = StringTable->insert("AMD K6-2"); - break; - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - pInfo.type = CPU_AMD_K6_3; - pInfo.name = StringTable->insert("AMD K6-3"); - break; - } - break; - - // Athlon Family - case 6: - pInfo.type = CPU_AMD_Athlon; - pInfo.name = StringTable->insert("AMD Athlon"); - break; - - // Phenom Family - case 15: - pInfo.type = CPU_AMD_Phenom; - pInfo.name = StringTable->insert("AMD Phenom"); - break; - - // Phenom II Family - case 16: - pInfo.type = CPU_AMD_PhenomII; - pInfo.name = StringTable->insert("AMD Phenom II"); - break; - - // Bulldozer Family - case 17: - pInfo.type = CPU_AMD_Bulldozer; - pInfo.name = StringTable->insert("AMD Bulldozer"); - break; - - default: - pInfo.type = CPU_AMD_Unknown; - pInfo.name = StringTable->insert("AMD (unknown)"); - break; - } - } - //-------------------------------------- - else - if (dStricmp(vendor, "CyrixInstead") == 0) - { - switch (processor) - { - case 0x520: - pInfo.type = CPU_Cyrix_6x86; - pInfo.name = StringTable->insert("Cyrix 6x86"); - break; - case 0x440: - pInfo.type = CPU_Cyrix_MediaGX; - pInfo.name = StringTable->insert("Cyrix Media GX"); - break; - case 0x600: - pInfo.type = CPU_Cyrix_6x86MX; - pInfo.name = StringTable->insert("Cyrix 6x86mx/MII"); - break; - case 0x540: - pInfo.type = CPU_Cyrix_GXm; - pInfo.name = StringTable->insert("Cyrix GXm"); - break; - default: - pInfo.type = CPU_Cyrix_Unknown; - pInfo.name = StringTable->insert("Cyrix (unknown)"); - break; - } - } + { +#if defined(TORQUE_CPU_X86) || defined(TORQUE_CPU_X64) + pInfo.name = StringTable->insert(brand ? brand : "x86 Compatible (unknown)"); + pInfo.type = CPU_X86Compatible; +#elif defined(TORQUE_CPU_ARM64) + pInfo.name = StringTable->insert(brand ? brand : "Arm Compatible (unknown)"); + pInfo.type = CPU_ArmCompatible; +#else +#error "Unknown CPU Architecture" +#endif + } // Get multithreading caps. - CPUInfo::EConfig config = CPUInfo::CPUCount( pInfo.numLogicalProcessors, pInfo.numAvailableCores, pInfo.numPhysicalProcessors ); pInfo.isHyperThreaded = CPUInfo::isHyperThreaded( config ); pInfo.isMultiCore = CPUInfo::isMultiCore( config ); diff --git a/Engine/source/platformWin32/winCPUInfo.cpp b/Engine/source/platformWin32/winCPUInfo.cpp index 4c836ad9e..3765f5c51 100644 --- a/Engine/source/platformWin32/winCPUInfo.cpp +++ b/Engine/source/platformWin32/winCPUInfo.cpp @@ -30,7 +30,7 @@ Platform::SystemInfo_struct Platform::SystemInfo; extern void PlatformBlitInit(); extern void SetProcessorInfo(Platform::SystemInfo_struct::Processor& pInfo, - char* vendor, U32 processor, U32 properties, U32 properties2); // platform/platformCPU.cc + char* vendor, char* brand, U32 processor, U32 properties, U32 properties2); // platform/platformCPU.cc void Processor::init() { @@ -45,7 +45,7 @@ void Processor::init() Platform::SystemInfo.processor.type = CPU_X86Compatible; Platform::SystemInfo.processor.name = StringTable->insert("Unknown x86 Compatible"); Platform::SystemInfo.processor.mhz = 0; - Platform::SystemInfo.processor.properties = CPU_PROP_C | CPU_PROP_LE; + Platform::SystemInfo.processor.properties = CPU_PROP_C; char vendor[0x20]; dMemset(vendor, 0, sizeof(vendor)); @@ -65,7 +65,31 @@ void Processor::init() properties = cpuInfo[3]; // edx properties2 = cpuInfo[2]; // ecx - SetProcessorInfo(Platform::SystemInfo.processor, vendor, processor, properties, properties2); + char brand[0x40]; + dMemset(brand, 0, sizeof(brand)); + S32 extendedInfo[4]; + __cpuid(extendedInfo, 0x80000000); + S32 numberExtendedIds = extendedInfo[0]; + + // Sets brand + if (numberExtendedIds >= 0x80000004) + { + int offset = 0; + for (int i = 0; i < 3; ++i) + { + S32 brandInfo[4]; + __cpuidex(brandInfo, 0x80000002 + i, 0); + + *reinterpret_cast(brand + offset + 0) = brandInfo[0]; + *reinterpret_cast(brand + offset + 4) = brandInfo[1]; + *reinterpret_cast(brand + offset + 8) = brandInfo[2]; + *reinterpret_cast(brand + offset + 12) = brandInfo[3]; + + offset += sizeof(S32) * 4; + } + } + + SetProcessorInfo(Platform::SystemInfo.processor, vendor, brand, processor, properties, properties2); // now calculate speed of processor... U32 nearmhz = 0; // nearest rounded mhz @@ -126,6 +150,14 @@ void Processor::init() Con::printf( " SSE detected" ); if( Platform::SystemInfo.processor.properties & CPU_PROP_SSE2 ) Con::printf( " SSE2 detected" ); + if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE3) + Con::printf( " SSE3 detected" ); + if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE3xt) + Con::printf( " SSE3ex detected "); + if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE4_1) + Con::printf( " SSE4.1 detected" ); + if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE4_2) + Con::printf( " SSE4.2 detected" ); if( Platform::SystemInfo.processor.isHyperThreaded ) Con::printf( " HT detected" ); if( Platform::SystemInfo.processor.properties & CPU_PROP_MP ) From 17d1253ba29b97d74686e5f3eccb34755ebe1758 Mon Sep 17 00:00:00 2001 From: Areloch Date: Wed, 15 Sep 2021 00:41:23 -0500 Subject: [PATCH 077/399] Converts precipitationData to use sound asset macros Adds handling for soundProfile fields and lookups of sound assets by SFXProfile name in project importer --- Engine/source/T3D/fx/precipitation.cpp | 17 ++++---- Engine/source/T3D/fx/precipitation.h | 39 ++++++++++--------- .../pre40/T3Dpre4ProjectImporter.tscript | 2 +- .../scripts/projectImporter.tscript | 28 ++++++++++++- 4 files changed, 58 insertions(+), 28 deletions(-) diff --git a/Engine/source/T3D/fx/precipitation.cpp b/Engine/source/T3D/fx/precipitation.cpp index caebe48cd..91249fe2b 100644 --- a/Engine/source/T3D/fx/precipitation.cpp +++ b/Engine/source/T3D/fx/precipitation.cpp @@ -127,7 +127,7 @@ ConsoleDocClass( PrecipitationData, //---------------------------------------------------------- PrecipitationData::PrecipitationData() { - soundProfile = NULL; + INIT_SOUNDASSET(Sound); INIT_IMAGEASSET(Drop); @@ -143,8 +143,7 @@ PrecipitationData::PrecipitationData() void PrecipitationData::initPersistFields() { - addField( "soundProfile", TYPEID< SFXTrack >(), Offset(soundProfile, PrecipitationData), - "Looping SFXProfile effect to play while Precipitation is active." ); + INITPERSISTFIELD_SOUNDASSET(Sound, PrecipitationData, "Looping SFXProfile effect to play while Precipitation is active."); addProtectedField( "dropTexture", TypeFilename, Offset(mDropName, PrecipitationData), &_setDropData, &defaultProtectedGetFn, "@brief Texture filename for drop particles.\n\n" @@ -190,7 +189,7 @@ bool PrecipitationData::preload( bool server, String &errorStr ) if( Parent::preload( server, errorStr) == false) return false; - if( !server && !sfxResolve( &soundProfile, errorStr ) ) + if (!server && (mSoundAsset.isNull() || !mSoundAsset->getSfxProfile())) return false; return true; @@ -200,7 +199,8 @@ void PrecipitationData::packData(BitStream* stream) { Parent::packData(stream); - sfxWrite( stream, soundProfile ); + PACKDATA_SOUNDASSET(Sound); + //sfxWrite( stream, soundProfile ); PACKDATA_IMAGEASSET(Drop); @@ -217,7 +217,8 @@ void PrecipitationData::unpackData(BitStream* stream) { Parent::unpackData(stream); - sfxRead( stream, &soundProfile ); + UNPACKDATA_SOUNDASSET(Sound); + //sfxRead( stream, &soundProfile ); UNPACKDATA_IMAGEASSET(Drop); @@ -598,9 +599,9 @@ bool Precipitation::onNewDataBlock( GameBaseData *dptr, bool reload ) { SFX_DELETE( mAmbientSound ); - if ( mDataBlock->soundProfile ) + if ( mDataBlock->mSoundAsset && mDataBlock->mSoundAsset->getSfxProfile() ) { - mAmbientSound = SFX->createSource( mDataBlock->soundProfile, &getTransform() ); + mAmbientSound = SFX->createSource(mDataBlock->mSoundAsset->getSfxProfile(), &getTransform() ); if ( mAmbientSound ) mAmbientSound->play(); } diff --git a/Engine/source/T3D/fx/precipitation.h b/Engine/source/T3D/fx/precipitation.h index 58c8c44dd..0bb06e0f2 100644 --- a/Engine/source/T3D/fx/precipitation.h +++ b/Engine/source/T3D/fx/precipitation.h @@ -34,8 +34,9 @@ #endif #include "T3D/assets/ImageAsset.h" +#include "T3D/assets/SoundAsset.h" -class SFXTrack; +//class SFXTrack; class SFXSource; //-------------------------------------------------------------------------- @@ -45,30 +46,32 @@ class PrecipitationData : public GameBaseData typedef GameBaseData Parent; public: - SFXTrack* soundProfile; + //SFXTrack* soundProfile; + DECLARE_SOUNDASSET(PrecipitationData, Sound); + DECLARE_SOUNDASSET_SETGET(PrecipitationData, Sound); - DECLARE_IMAGEASSET(PrecipitationData, Drop, onDropChanged, GFXStaticTextureSRGBProfile); ///< Texture for drop particles - DECLARE_IMAGEASSET_SETGET(PrecipitationData, Drop); + DECLARE_IMAGEASSET(PrecipitationData, Drop, onDropChanged, GFXStaticTextureSRGBProfile); ///< Texture for drop particles + DECLARE_IMAGEASSET_SETGET(PrecipitationData, Drop); - StringTableEntry mDropShaderName; ///< The name of the shader used for raindrops + StringTableEntry mDropShaderName; ///< The name of the shader used for raindrops - DECLARE_IMAGEASSET(PrecipitationData, Splash, onSplashChanged, GFXStaticTextureSRGBProfile); ///< Texture for splash particles - DECLARE_IMAGEASSET_SETGET(PrecipitationData, Splash); + DECLARE_IMAGEASSET(PrecipitationData, Splash, onSplashChanged, GFXStaticTextureSRGBProfile); ///< Texture for splash particles + DECLARE_IMAGEASSET_SETGET(PrecipitationData, Splash); - StringTableEntry mSplashShaderName; ///< The name of the shader used for raindrops + StringTableEntry mSplashShaderName; ///< The name of the shader used for raindrops - S32 mDropsPerSide; ///< How many drops are on a side of the raindrop texture. - S32 mSplashesPerSide; ///< How many splash are on a side of the splash texture. + S32 mDropsPerSide; ///< How many drops are on a side of the raindrop texture. + S32 mSplashesPerSide; ///< How many splash are on a side of the splash texture. - PrecipitationData(); - DECLARE_CONOBJECT(PrecipitationData); - bool preload( bool server, String& errorStr ); - static void initPersistFields(); - virtual void packData(BitStream* stream); - virtual void unpackData(BitStream* stream); + PrecipitationData(); + DECLARE_CONOBJECT(PrecipitationData); + bool preload( bool server, String& errorStr ); + static void initPersistFields(); + virtual void packData(BitStream* stream); + virtual void unpackData(BitStream* stream); - void onDropChanged() {} - void onSplashChanged() {} + void onDropChanged() {} + void onSplashChanged() {} }; struct Raindrop diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript index d996182dd..645bd38ca 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript @@ -919,7 +919,7 @@ T3Dpre4ProjectImporter::genProcessor("DebrisData", "shape shapeAsset shapeFile s T3Dpre4ProjectImporter::genProcessor("DecalData", "material materialAsset"); T3Dpre4ProjectImporter::genProcessor("ExplosionData", "explosionShape explosionShapeAsset"); T3Dpre4ProjectImporter::genProcessor("ParticleData", "texture textureAsset textureName textureAsset textureExt textureExtAsset textureExtName textureExtAsset"); -T3Dpre4ProjectImporter::genProcessor("PrecipitationData", "drop dropAsset dropTexture dropAsset splash splashAsset splashTexture splashAsset"); +T3Dpre4ProjectImporter::genProcessor("PrecipitationData", "drop dropAsset dropTexture dropAsset splash splashAsset splashTexture splashAsset soundProfile soundAsset"); T3Dpre4ProjectImporter::genProcessor("SplashData", "texture textureAsset"); T3Dpre4ProjectImporter::genProcessor("LightFlareData", "flareTexture flareTextureAsset"); T3Dpre4ProjectImporter::genProcessor("PhysicsDebrisData", "shape shapeAsset shapeFile shapeAsset"); diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript index ab62befb8..073a7a6bf 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript @@ -556,23 +556,49 @@ function processLegacyField(%line, %originalFieldName, %newFieldName) %targetFilename = sanitizeFilename(%value); if(isObject(%targetFilename)) + { + if(%originalFieldName $= "soundProfile") + { + $ProjectImporter::assetQuery.clear(); + %foundAssets = AssetDatabase.findAssetName($ProjectImporter::assetQuery, %targetFilename); + if(%foundAssets != 0) + { + %assetId = $ProjectImporter::assetQuery.getAsset(0); + } + } + else { //likely a material name, so handle it that way %assetId = MaterialAsset::getAssetIdByMaterialName(%targetFilename); } + } else { if(!isFile(%targetFilename)) { + if(%originalFieldName $= "soundProfile") + { + $ProjectImporter::assetQuery.clear(); + %foundAssets = AssetDatabase.findAssetName($ProjectImporter::assetQuery, %targetFilename); + if(%foundAssets != 0) + { + %assetId = $ProjectImporter::assetQuery.getAsset(0); + } + } + else + { error("Legacy Project Importer - file described in line could not be found/is not valid"); return %line; } - + } + else + { $ProjectImporter::assetQuery.clear(); %foundAssets = AssetDatabase.findAssetLooseFile($ProjectImporter::assetQuery, %targetFilename); if(%foundAssets != 0) { %assetId = $ProjectImporter::assetQuery.getAsset(0); + } } } From f9b78597f768595d88cf757e1b7ac3b03db51305 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Thu, 16 Sep 2021 21:21:04 -0400 Subject: [PATCH 078/399] * BugFix: Correct an error that causes the engine to crash when calling non-namespaced engine functions incorrectly. --- Engine/source/console/compiledEval.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index f4c48ef68..561e1f04a 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -734,7 +734,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa SimObject* curObject = NULL; SimObject* saveObject = NULL; Namespace::Entry* nsEntry; - Namespace* ns; + Namespace* ns = NULL; const char* curFNDocBlock = NULL; const char* curNSDocBlock = NULL; const S32 nsDocLength = 128; From 21c17d0ed1748973d4558fd76c1a893bb2e7906a Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Fri, 17 Sep 2021 01:24:20 -0500 Subject: [PATCH 079/399] cleanups for shadergen and the visibility feature math fixes, feature inclusion removal. will still need to circle back on why the crosshatch.. isn't --- .../lighting/shadowMap/shadowMatHook.cpp | 4 +--- .../shaderGen/GLSL/shaderFeatureGLSL.cpp | 24 ++++--------------- .../shaderGen/HLSL/shaderFeatureHLSL.cpp | 6 ++--- .../core/rendering/shaders/gl/torque.glsl | 4 ++-- 4 files changed, 11 insertions(+), 27 deletions(-) diff --git a/Engine/source/lighting/shadowMap/shadowMatHook.cpp b/Engine/source/lighting/shadowMap/shadowMatHook.cpp index 30f2db593..c6b8bab01 100644 --- a/Engine/source/lighting/shadowMap/shadowMatHook.cpp +++ b/Engine/source/lighting/shadowMap/shadowMatHook.cpp @@ -186,10 +186,8 @@ void ShadowMaterialHook::_overrideFeatures( ProcessedMaterial *mat, type == MFT_TexAnim || type == MFT_DiffuseMap || type == MFT_IsTranslucent || - type == MFT_Visibility || type == MFT_UseInstancing || - type == MFT_EyeSpaceDepthOut || - type == MFT_DeferredConditioner) + type == MFT_EyeSpaceDepthOut) newFeatures.addFeature(type); else if (type.getGroup() == MFG_PreTransform || type.getGroup() == MFG_Transform || diff --git a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp index 2bd24931d..3ee76ffdf 100644 --- a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp +++ b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp @@ -455,12 +455,12 @@ Var* ShaderFeatureGLSL::addOutVpos( MultiLine *meta, outVpos = connectComp->getElement( RT_TEXCOORD ); outVpos->setName( "outVpos" ); outVpos->setStructName( "OUT" ); - outVpos->setType( "vec4" ); + outVpos->setType( "vec3" ); Var *outPosition = (Var*) LangElement::find( "gl_Position" ); AssertFatal( outPosition, "ShaderFeatureGLSL::addOutVpos - Didn't find the output position." ); - meta->addStatement( new GenOp( " @ = @;\r\n", outVpos, outPosition ) ); + meta->addStatement( new GenOp( " @ = @.xyz;\r\n", outVpos, outPosition ) ); } return outVpos; @@ -474,25 +474,11 @@ Var* ShaderFeatureGLSL::getInVpos( MultiLine *meta, return inVpos; ShaderConnector *connectComp = dynamic_cast( componentList[C_CONNECTOR] ); - /* - if ( GFX->getPixelShaderVersion() >= 3.0f ) - { - inVpos = connectComp->getElement( RT_VPOS ); - inVpos->setName( "vpos" ); - inVpos->setStructName( "IN" ); - inVpos->setType( "vec2" ); - return inVpos; - } - */ inVpos = connectComp->getElement( RT_TEXCOORD ); inVpos->setName( "inVpos" ); inVpos->setStructName( "IN" ); inVpos->setType( "vec4" ); - - Var *vpos = new Var( "vpos", "vec2" ); - meta->addStatement( new GenOp( " @ = @.xy / @.w;\r\n", new DecOp( vpos ), inVpos, inVpos ) ); - - return vpos; + return inVpos; } Var* ShaderFeatureGLSL::getInWorldToTangent( Vector &componentList ) @@ -2473,7 +2459,7 @@ void VisibilityFeatGLSL::processPix( Vector &componentList, // Everything else does a fizzle. Var *vPos = getInVpos( meta, componentList ); - meta->addStatement( new GenOp( " fizzle( @, @ );\r\n", vPos, visibility ) ); + meta->addStatement( new GenOp( " fizzle( @.xy, @ );\r\n", vPos, visibility ) ); } ShaderFeature::Resources VisibilityFeatGLSL::getResources( const MaterialFeatureData &fd ) @@ -2616,7 +2602,7 @@ void FoliageFeatureGLSL::processVert( Vector &componentList, tangent->setType( "vec3" ); tangent->setName( "T" ); LangElement *tangentDec = new DecOp( tangent ); - meta->addStatement( new GenOp( " @;\n", tangentDec ) ); + meta->addStatement( new GenOp( " @ = vec3(1.0,0,0);\n", tangentDec ) ); // We add a float foliageFade to the OUT structure. ShaderConnector *connectComp = dynamic_cast( componentList[C_CONNECTOR] ); diff --git a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp index 80601ad68..2fe171aba 100644 --- a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp +++ b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp @@ -453,12 +453,12 @@ Var* ShaderFeatureHLSL::addOutVpos( MultiLine *meta, outVpos = connectComp->getElement( RT_TEXCOORD ); outVpos->setName( "outVpos" ); outVpos->setStructName( "OUT" ); - outVpos->setType( "float4" ); + outVpos->setType( "float3" ); Var *outPosition = (Var*) LangElement::find( "hpos" ); AssertFatal( outPosition, "ShaderFeatureHLSL::addOutVpos - Didn't find the output position." ); - meta->addStatement( new GenOp( " @ = @;\r\n", outVpos, outPosition ) ); + meta->addStatement( new GenOp( " @ = @.xyz;\r\n", outVpos, outPosition ) ); } return outVpos; @@ -2686,7 +2686,7 @@ void FoliageFeatureHLSL::processVert( Vector &componentList, tangent->setType( "float3" ); tangent->setName( "T" ); LangElement *tangentDec = new DecOp( tangent ); - meta->addStatement( new GenOp( " @;\n", tangentDec ) ); + meta->addStatement( new GenOp( " @ = float3(1.0,0,0);\n", tangentDec ) ); // We add a float foliageFade to the OUT structure. ShaderConnector *connectComp = dynamic_cast( componentList[C_CONNECTOR] ); diff --git a/Templates/BaseGame/game/core/rendering/shaders/gl/torque.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/torque.glsl index 5482bdaf3..4ec0303aa 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/gl/torque.glsl +++ b/Templates/BaseGame/game/core/rendering/shaders/gl/torque.glsl @@ -291,8 +291,8 @@ void fizzle(vec2 vpos, float visibility) // I'm sure there are many more patterns here to // discover for different effects. - mat2x2 m = mat2x2( vpos.x, vpos.y, 0.916, 0.350 ); - if( (visibility - fract( determinant( m ) )) < 0 ) //if(a < 0) discard; + mat2x2 m = mat2x2( vpos.x, 0.916, vpos.y, 0.350 ); + if( (visibility - fract( determinant( m ) )) < 0 ) discard; } #endif //TORQUE_PIXEL_SHADER From c8a5ccb191b22d0d974778a8c98a789923528218 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Fri, 17 Sep 2021 17:37:19 -0400 Subject: [PATCH 080/399] * [OpenGL] BugFix: Correct shader errors being thrown during the load phase due to direct use of glUseProgram causing desync with GFXGLDevice. --- Engine/source/gfx/gl/gfxGLDevice.cpp | 2 +- Engine/source/gfx/gl/gfxGLShader.cpp | 8 +++++--- Engine/source/gfx/gl/gfxGLShader.h | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Engine/source/gfx/gl/gfxGLDevice.cpp b/Engine/source/gfx/gl/gfxGLDevice.cpp index 6179bd618..1c82b4e74 100644 --- a/Engine/source/gfx/gl/gfxGLDevice.cpp +++ b/Engine/source/gfx/gl/gfxGLDevice.cpp @@ -933,7 +933,7 @@ void GFXGLDevice::setupGenericShaders( GenericShaderType type ) } GFXShader* GFXGLDevice::createShader() { - GFXGLShader* shader = new GFXGLShader(); + GFXGLShader* shader = new GFXGLShader(this); shader->registerResourceWithDevice( this ); return shader; } diff --git a/Engine/source/gfx/gl/gfxGLShader.cpp b/Engine/source/gfx/gl/gfxGLShader.cpp index d2f2edd22..ce8e7c855 100644 --- a/Engine/source/gfx/gl/gfxGLShader.cpp +++ b/Engine/source/gfx/gl/gfxGLShader.cpp @@ -382,10 +382,11 @@ void GFXGLShaderConstBuffer::onShaderReload( GFXGLShader *shader ) mWasLost = true; } -GFXGLShader::GFXGLShader() : +GFXGLShader::GFXGLShader(GFXGLDevice* device) : mVertexShader(0), mPixelShader(0), mProgram(0), + mDevice(device), mConstBufferSize(0), mConstBuffer(NULL) { @@ -706,7 +707,8 @@ void GFXGLShader::initHandles() dMemset(mConstBuffer, 0, mConstBufferSize); // Set our program so uniforms are assigned properly. - glUseProgram(mProgram); + mDevice->setShader(this, false); + // Iterate through uniforms to set sampler numbers. for (HandleMap::Iterator iter = mHandles.begin(); iter != mHandles.end(); ++iter) { @@ -723,7 +725,6 @@ void GFXGLShader::initHandles() dMemcpy(mConstBuffer + handle->mOffset, &handle->mSamplerNum, handle->getSize()); } } - glUseProgram(0); //instancing if (!mInstancingFormat) @@ -830,6 +831,7 @@ void GFXGLShader::setConstantsFromBuffer(GFXGLShaderConstBuffer* buffer) // Copy new value into our const buffer and set in GL. dMemcpy(mConstBuffer + handle->mOffset, buffer->mBuffer + handle->mOffset, handle->getSize()); + switch(handle->mDesc.constType) { case GFXSCT_Float: diff --git a/Engine/source/gfx/gl/gfxGLShader.h b/Engine/source/gfx/gl/gfxGLShader.h index 80fa4d9d9..e3d3bb69c 100644 --- a/Engine/source/gfx/gl/gfxGLShader.h +++ b/Engine/source/gfx/gl/gfxGLShader.h @@ -32,14 +32,15 @@ class GFXGLShaderConstHandle; class FileStream; class GFXGLShaderConstBuffer; +class GFXGLDevice; class GFXGLShader : public GFXShader { typedef Map HandleMap; public: - GFXGLShader(); + GFXGLShader(GFXGLDevice* device); virtual ~GFXGLShader(); - + /// @name GFXShader interface /// @{ virtual GFXShaderConstHandle* getShaderConstHandle(const String& name); @@ -99,6 +100,7 @@ protected: U32 mConstBufferSize; U8* mConstBuffer; HandleMap mHandles; + GFXGLDevice* mDevice; Vector mValidHandles; }; From 2a8f8c15f36a309eeb1bcdc7842881645d804bde Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 18 Sep 2021 02:46:15 -0500 Subject: [PATCH 081/399] Shifted long-form check/fetch of sound asset's SFXProfile to a convenience function Fixed formatting on projectImporter.tscript file --- Engine/source/T3D/fx/precipitation.cpp | 8 +++--- Engine/source/T3D/fx/precipitation.h | 7 +++++ .../scripts/projectImporter.tscript | 26 +++++++++---------- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Engine/source/T3D/fx/precipitation.cpp b/Engine/source/T3D/fx/precipitation.cpp index 91249fe2b..4356cd45f 100644 --- a/Engine/source/T3D/fx/precipitation.cpp +++ b/Engine/source/T3D/fx/precipitation.cpp @@ -189,7 +189,7 @@ bool PrecipitationData::preload( bool server, String &errorStr ) if( Parent::preload( server, errorStr) == false) return false; - if (!server && (mSoundAsset.isNull() || !mSoundAsset->getSfxProfile())) + if (!server && !getSFXProfile()) return false; return true; @@ -200,7 +200,6 @@ void PrecipitationData::packData(BitStream* stream) Parent::packData(stream); PACKDATA_SOUNDASSET(Sound); - //sfxWrite( stream, soundProfile ); PACKDATA_IMAGEASSET(Drop); @@ -218,7 +217,6 @@ void PrecipitationData::unpackData(BitStream* stream) Parent::unpackData(stream); UNPACKDATA_SOUNDASSET(Sound); - //sfxRead( stream, &soundProfile ); UNPACKDATA_IMAGEASSET(Drop); @@ -599,9 +597,9 @@ bool Precipitation::onNewDataBlock( GameBaseData *dptr, bool reload ) { SFX_DELETE( mAmbientSound ); - if ( mDataBlock->mSoundAsset && mDataBlock->mSoundAsset->getSfxProfile() ) + if ( mDataBlock->getSFXProfile()) { - mAmbientSound = SFX->createSource(mDataBlock->mSoundAsset->getSfxProfile(), &getTransform() ); + mAmbientSound = SFX->createSource(mDataBlock->getSFXProfile(), &getTransform() ); if ( mAmbientSound ) mAmbientSound->play(); } diff --git a/Engine/source/T3D/fx/precipitation.h b/Engine/source/T3D/fx/precipitation.h index 0bb06e0f2..cdef0c2a8 100644 --- a/Engine/source/T3D/fx/precipitation.h +++ b/Engine/source/T3D/fx/precipitation.h @@ -72,6 +72,13 @@ class PrecipitationData : public GameBaseData void onDropChanged() {} void onSplashChanged() {} + + SFXProfile* getSFXProfile() { + if (mSoundAsset.notNull()) + return mSoundAsset->getSfxProfile(); + else + return NULL; + } }; struct Raindrop diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript index 073a7a6bf..039a71238 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript @@ -556,7 +556,7 @@ function processLegacyField(%line, %originalFieldName, %newFieldName) %targetFilename = sanitizeFilename(%value); if(isObject(%targetFilename)) - { + { if(%originalFieldName $= "soundProfile") { $ProjectImporter::assetQuery.clear(); @@ -568,14 +568,14 @@ function processLegacyField(%line, %originalFieldName, %newFieldName) } else { - //likely a material name, so handle it that way - %assetId = MaterialAsset::getAssetIdByMaterialName(%targetFilename); - } + //likely a material name, so handle it that way + %assetId = MaterialAsset::getAssetIdByMaterialName(%targetFilename); + } } else { if(!isFile(%targetFilename)) - { + { if(%originalFieldName $= "soundProfile") { $ProjectImporter::assetQuery.clear(); @@ -587,17 +587,17 @@ function processLegacyField(%line, %originalFieldName, %newFieldName) } else { - error("Legacy Project Importer - file described in line could not be found/is not valid"); - return %line; - } + error("Legacy Project Importer - file described in line could not be found/is not valid"); + return %line; + } } else { - $ProjectImporter::assetQuery.clear(); - %foundAssets = AssetDatabase.findAssetLooseFile($ProjectImporter::assetQuery, %targetFilename); - if(%foundAssets != 0) - { - %assetId = $ProjectImporter::assetQuery.getAsset(0); + $ProjectImporter::assetQuery.clear(); + %foundAssets = AssetDatabase.findAssetLooseFile($ProjectImporter::assetQuery, %targetFilename); + if(%foundAssets != 0) + { + %assetId = $ProjectImporter::assetQuery.getAsset(0); } } } From adec6e7c74375bbad47bb4accc0b18f0db8965c7 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sun, 19 Sep 2021 01:01:47 -0500 Subject: [PATCH 082/399] Adds load status to MaterialAsset for if the Script file itself has been loaded, but the material itself hasn't yet been processed. Fixed String -> StringTableEntry conversion in prefab file to correct corruption when setting the filename Cleaned up message spam from the MaterialSlot fields on TSStatics Added getter/setters for terrain file and assets Removed unneeded exec of tools profiles for MainMenuGUI Add logic to remove creators section of AB if in select mode Fixed misc. messageBox invokes that were erroneously converted to 'toolsMessageBox' Fix classname for NotesObject in AB Creator Entry Fix issue where ConvexShapeEditor toolbar would hide after being seen once Changed keybind for quick AB access from 'space' to 'shift space' to avoid input issues when typing in fields in some cases Fixed default image assignments for River objects on foam/ripple/depth Added handling for Material, Sound and Shape asset fields in Object Builder, and updated various objectBuilder class entries to utilize them now. Updated various fields' defaults for ObjectBuilder to utilize correct assetId's Fixed editor SceneTree tooltips for TSShape and GroundCovert to correctly reference assets as needed Added logic to properly check terrain asset validity when prompting to save changes, which would break saving actions before Added menubar items in the Object category to take control and release control of control objects quickly for testing --- Engine/source/T3D/assets/MaterialAsset.cpp | 27 +- Engine/source/T3D/assets/MaterialAsset.h | 6 + Engine/source/T3D/prefab.cpp | 4 +- Engine/source/T3D/prefab.h | 2 +- Engine/source/T3D/tsStatic.cpp | 4 - Engine/source/terrain/terrData.cpp | 12 + Engine/source/terrain/terrData.h | 33 ++ .../BaseGame/game/data/UI/guis/mainMenu.gui | 2 - .../assetBrowser/scripts/assetBrowser.tscript | 4 +- .../scripts/assetTypes/terrain.tscript | 2 +- .../assetBrowser/scripts/creator.tscript | 2 +- .../game/tools/convexEditor/main.tscript | 1 - .../guiEditor/scripts/guiEditor.ed.tscript | 2 +- .../scripts/guiEditorCanvas.ed.tscript | 10 +- .../scripts/guiEditorNewGuiDialog.ed.tscript | 2 +- .../tools/riverEditor/riverEditorGui.tscript | 6 +- .../worldEditor/gui/objectBuilderGui.ed.gui | 333 ++++++++++++++++-- .../worldEditor/scripts/EditorGui.ed.tscript | 10 +- .../scripts/editor.keybinds.tscript | 2 +- .../scripts/menuHandlers.ed.tscript | 42 ++- .../worldEditor/scripts/menus.ed.tscript | 8 +- 21 files changed, 436 insertions(+), 78 deletions(-) diff --git a/Engine/source/T3D/assets/MaterialAsset.cpp b/Engine/source/T3D/assets/MaterialAsset.cpp index eaafca03d..8fd2b6ecf 100644 --- a/Engine/source/T3D/assets/MaterialAsset.cpp +++ b/Engine/source/T3D/assets/MaterialAsset.cpp @@ -169,7 +169,13 @@ void MaterialAsset::initializeAsset() mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath; if (Torque::FS::IsScriptFile(mScriptPath)) - Con::executeFile(mScriptPath, false, false); + { + if (!Sim::findObject(mMatDefinitionName)) + if (Con::executeFile(mScriptPath, false, false)) + mLoadedState = ScriptLoaded; + else + mLoadedState = Failed; + } loadMaterial(); } @@ -179,7 +185,22 @@ void MaterialAsset::onAssetRefresh() mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath; if (Torque::FS::IsScriptFile(mScriptPath)) - Con::executeFile(mScriptPath, false, false); + { + //Since we're refreshing, we can assume that the file we're executing WILL have an existing definition. + //But that definition, whatever it is, is the 'correct' one, so we enable the Replace Existing behavior + //when the engine encounters a named object conflict. + String redefineBehaviorPrev = Con::getVariable("$Con::redefineBehavior"); + Con::setVariable("$Con::redefineBehavior", "replaceExisting"); + + if (Con::executeFile(mScriptPath, false, false)) + mLoadedState = ScriptLoaded; + else + mLoadedState = Failed; + + //And now that we've executed, switch back to the prior behavior + Con::setVariable("$Con::redefineBehavior", redefineBehaviorPrev.c_str()); + + } loadMaterial(); } @@ -206,7 +227,7 @@ void MaterialAsset::loadMaterial() if (mMaterialDefinition) SAFE_DELETE(mMaterialDefinition); - if (mMatDefinitionName != StringTable->EmptyString()) + if (mLoadedState == ScriptLoaded && mMatDefinitionName != StringTable->EmptyString()) { Material* matDef; if (!Sim::findObject(mMatDefinitionName, matDef)) diff --git a/Engine/source/T3D/assets/MaterialAsset.h b/Engine/source/T3D/assets/MaterialAsset.h index 018e2a989..07ec0227a 100644 --- a/Engine/source/T3D/assets/MaterialAsset.h +++ b/Engine/source/T3D/assets/MaterialAsset.h @@ -70,6 +70,12 @@ class MaterialAsset : public AssetBase public: static StringTableEntry smNoMaterialAssetFallback; + enum MaterialAssetErrCode + { + ScriptLoaded = AssetErrCode::Extended, + Extended + }; + public: MaterialAsset(); virtual ~MaterialAsset(); diff --git a/Engine/source/T3D/prefab.cpp b/Engine/source/T3D/prefab.cpp index 38934062f..0bebb443f 100644 --- a/Engine/source/T3D/prefab.cpp +++ b/Engine/source/T3D/prefab.cpp @@ -242,7 +242,7 @@ bool Prefab::protectedSetFile( void *object, const char *index, const char *data return false; } -void Prefab::setFile( String file ) +void Prefab::setFile( StringTableEntry file ) { AssertFatal( isServerObject(), "Prefab-bad" ); @@ -257,7 +257,7 @@ void Prefab::setFile( String file ) // be called for the client-side prefab but maybe the user did so accidentally. if ( isClientObject() ) { - Con::errorf( "Prefab::setFile( %s ) - Should not be called on a client-side Prefab.", file.c_str() ); + Con::errorf( "Prefab::setFile( %s ) - Should not be called on a client-side Prefab.", file ); return; } diff --git a/Engine/source/T3D/prefab.h b/Engine/source/T3D/prefab.h index 6ebe88b0a..def70857e 100644 --- a/Engine/source/T3D/prefab.h +++ b/Engine/source/T3D/prefab.h @@ -90,7 +90,7 @@ public: void render( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat ); /// - void setFile( String file ); + void setFile(StringTableEntry file ); /// Removes all children from this Prefab and puts them into a SimGroup /// which is added to the Scene and returned to the caller. diff --git a/Engine/source/T3D/tsStatic.cpp b/Engine/source/T3D/tsStatic.cpp index 9b093f476..9028653b8 100644 --- a/Engine/source/T3D/tsStatic.cpp +++ b/Engine/source/T3D/tsStatic.cpp @@ -1675,10 +1675,6 @@ void TSStatic::onInspect(GuiInspector* inspector) { dSprintf(matFieldName, 128, "MaterialSlot%d", i); - //addComponentField(matFieldName, "A material used in the shape file", "Material", matAsset->getAssetId(), ""); - //Con::executef(this, "onConstructComponentField", mTargetComponent, field->mFieldName); - Con::printf("Added material field for MaterialSlot %d", i); - GuiInspectorField* fieldGui = materialGroup->constructField(TypeMaterialAssetPtr); fieldGui->init(inspector, materialGroup); diff --git a/Engine/source/terrain/terrData.cpp b/Engine/source/terrain/terrData.cpp index a80e350f0..be43d6638 100644 --- a/Engine/source/terrain/terrData.cpp +++ b/Engine/source/terrain/terrData.cpp @@ -1613,3 +1613,15 @@ void TerrainBlock::deleteZodiacPrimitiveBuffer() } } +DefineEngineMethod(TerrainBlock, getTerrain, String, (), , "Returns the terrain file used for this terrain block, either via the asset or the filename assigned, which ever is valid") +{ + return object->getTerrain(); +} +DefineEngineMethod(TerrainBlock, getTerrainAsset, String, (), , "Returns the assetId used for this terrain block") +{ + return object->getTerrainAssetId(); +} +DefineEngineMethod(TerrainBlock, setTerrain, bool, (const char* terrain), , "Terrain assignment.first tries asset then flat file.") +{ + return object->_setTerrain(StringTable->insert(terrain)); +} diff --git a/Engine/source/terrain/terrData.h b/Engine/source/terrain/terrData.h index 5550ea30e..cc1479004 100644 --- a/Engine/source/terrain/terrData.h +++ b/Engine/source/terrain/terrData.h @@ -488,6 +488,39 @@ public: void inspectPostApply(); virtual void getUtilizedAssets(Vector* usedAssetsList); + + const StringTableEntry getTerrain() const + { + if (mTerrainAsset && (mTerrainAsset->getTerrainFilePath() != StringTable->EmptyString())) + return mTerrainAsset->getTerrainFilePath(); + else if (mTerrainAssetId != StringTable->EmptyString()) + return mTerrainAssetId; + else if (mTerrFileName != StringTable->EmptyString()) + return mTerrFileName; + else + return StringTable->EmptyString(); + } + + const StringTableEntry getTerrainAssetId() const + { + if (mTerrainAssetId != StringTable->EmptyString()) + return mTerrainAssetId; + else + return StringTable->EmptyString(); + } + + bool _setTerrain(StringTableEntry terrain) + { + if (terrain == StringTable->EmptyString()) + return false; + + if (AssetDatabase.isDeclaredAsset(terrain)) + setTerrainAsset(terrain); + else + mTerrFileName = terrain; + + return true; + } protected: bool mUpdateBasetex; diff --git a/Templates/BaseGame/game/data/UI/guis/mainMenu.gui b/Templates/BaseGame/game/data/UI/guis/mainMenu.gui index 4cc06b26e..f33c06b1d 100644 --- a/Templates/BaseGame/game/data/UI/guis/mainMenu.gui +++ b/Templates/BaseGame/game/data/UI/guis/mainMenu.gui @@ -1,5 +1,3 @@ -exec( "tools/gui/profiles.ed.tscript" ); - //--- OBJECT WRITE BEGIN --- $guiContent = new GuiChunkedBitmapCtrl(MainMenuGui) { bitmapAsset = "UI:background_dark_image"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript index ec2d0db4d..747d3e86d 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript @@ -618,7 +618,9 @@ function AssetBrowser::loadDirectories( %this ) %dataItem = AssetBrowser-->filterTree.insertItem(AssetBrowser-->filterTree.modulesIdx, "data"); AssetBrowser-->filterTree.tagsIdx = AssetBrowser-->filterTree.insertItem(1, "Tags"); - AssetBrowser-->filterTree.creatorIdx = AssetBrowser-->filterTree.insertItem(1, "Creator"); + + if(!%this.selectMode) + AssetBrowser-->filterTree.creatorIdx = AssetBrowser-->filterTree.insertItem(1, "Creator"); %this.dirHandler.loadFolders("data", %dataItem); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript index 9081729d0..c7e8fe92e 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript @@ -79,7 +79,7 @@ function AssetBrowser::createTerrainAsset(%this) } else { - toolsMessageBox( "Import Terrain", + MessageBox( "Import Terrain", "Terrain import failed! Check console for error messages.", "Ok", "Error" ); } diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript index 15dc88d0a..48366f453 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript @@ -47,7 +47,7 @@ function AssetBrowser::loadCreatorClasses(%this) %this.addCreatorClass("LevelInfo", "Level Info" ); %this.addCreatorClass("Marker", "Path Node" ); %this.addCreatorClass("MissionArea", "Mission Area" ); - %this.addCreatorClass("Note", "Note" ); + %this.addCreatorClass("NotesObject", "Note" ); %this.addCreatorClass("Path" ); %this.addCreatorClass("SpawnSphere", "General Spawn Sphere" ); %this.addCreatorClass("SpawnSphere", "Player Spawn Sphere"/*, "PlayerDropPoint"*/ ); diff --git a/Templates/BaseGame/game/tools/convexEditor/main.tscript b/Templates/BaseGame/game/tools/convexEditor/main.tscript index 260c955ae..3930f5b11 100644 --- a/Templates/BaseGame/game/tools/convexEditor/main.tscript +++ b/Templates/BaseGame/game/tools/convexEditor/main.tscript @@ -145,7 +145,6 @@ function ConvexEditorPlugin::onDeactivated( %this ) ConvexEditorTreeWindow.setVisible( false ); ConvexEditorOptionsWindow.setVisible( false ); - ConvexEditorToolbar.setVisible( false ); %this.map.pop(); // Remove our menu. diff --git a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript index e9eabea7e..823fa39b3 100644 --- a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript +++ b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditor.ed.tscript @@ -910,7 +910,7 @@ function GuiEditorTabBook::onWake( %this ) item[ 1 ] = "Categorized View" TAB "" TAB "GuiEditorToolbox.setViewType( \"Categorized\" );"; }; - GlobalActionMap.bindCmd( keyboard, space, "", "AssetBrowser.toggleDialog();" ); + GlobalActionMap.bindCmd( keyboard, "shift space", "", "AssetBrowser.toggleDialog();" ); } //--------------------------------------------------------------------------------------------- diff --git a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorCanvas.ed.tscript b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorCanvas.ed.tscript index 1fbe50c12..f62fe12ea 100644 --- a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorCanvas.ed.tscript +++ b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorCanvas.ed.tscript @@ -283,7 +283,7 @@ function GuiEditCanvas::load( %this, %filename ) // group. And, it should be the only thing in the group. if( !isObject( $guiContent ) ) { - toolsMessageBox( getEngineName(), + MessageBox( getEngineName(), "You have loaded a Gui file that was created before this version. It has been loaded but you must open it manually from the content list dropdown", "Ok", "Information" ); return 0; @@ -333,7 +333,7 @@ function GuiEditCanvas::save( %this, %selectedOnly, %noPrompt ) return; else if( %selected.getCount() > 1 ) { - toolsMessageBox( "Invalid selection", "Only a single control hierarchy can be saved to a file. Make sure you have selected only one control in the tree view." ); + MessageBox( "Invalid selection", "Only a single control hierarchy can be saved to a file. Make sure you have selected only one control in the tree view." ); return; } @@ -464,7 +464,7 @@ function GuiEditCanvas::save( %this, %selectedOnly, %noPrompt ) GuiEditorStatusBar.print( "Saved file '" @ %currentObject.getFileName() @ "'" ); } else - toolsMessageBox( "Error writing to file", "There was an error writing to file '" @ %currentFile @ "'. The file may be read-only.", "Ok", "Error" ); + MessageBox( "Error writing to file", "There was an error writing to file '" @ %currentFile @ "'. The file may be read-only.", "Ok", "Error" ); } //--------------------------------------------------------------------------------------------- @@ -490,7 +490,7 @@ function GuiEditCanvas::append( %this ) if( !isObject( $guiContent ) ) { - toolsMessageBox( "Error loading GUI file", "The GUI content controls could not be found. This function can only be used with files saved by the GUI editor.", "Ok", "Error" ); + MessageBox( "Error loading GUI file", "The GUI content controls could not be found. This function can only be used with files saved by the GUI editor.", "Ok", "Error" ); return; } @@ -519,7 +519,7 @@ function GuiEditCanvas::revert( %this ) if( %filename $= "" ) return; - if( toolsMessageBox( "Revert Gui", "Really revert the current Gui? This cannot be undone.", "OkCancel", "Question" ) == $MROk ) + if( MessageBox( "Revert Gui", "Really revert the current Gui? This cannot be undone.", "OkCancel", "Question" ) == $MROk ) %this.load( %filename ); } diff --git a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorNewGuiDialog.ed.tscript b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorNewGuiDialog.ed.tscript index 85fa7263e..248c0e97d 100644 --- a/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorNewGuiDialog.ed.tscript +++ b/Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorNewGuiDialog.ed.tscript @@ -81,7 +81,7 @@ function GuiEditorNewGuiDialog::onOK( %this ) if( isObject( %name ) && %name.isMemberOfClass( "GuiControl" ) ) { - if( toolsMessageBox( "Warning", "Replace the existing control '" @ %name @ "'?", "OkCancel", "Question" ) == $MROk ) + if( MessageBox( "Warning", "Replace the existing control '" @ %name @ "'?", "OkCancel", "Question" ) == $MROk ) %name.delete(); else return; diff --git a/Templates/BaseGame/game/tools/riverEditor/riverEditorGui.tscript b/Templates/BaseGame/game/tools/riverEditor/riverEditorGui.tscript index 814782cb2..bb0f40037 100644 --- a/Templates/BaseGame/game/tools/riverEditor/riverEditorGui.tscript +++ b/Templates/BaseGame/game/tools/riverEditor/riverEditorGui.tscript @@ -76,9 +76,9 @@ function RiverEditorGui::createRiver( %this ) baseColor = "45 108 171 255"; - rippleTex = "core/rendering/images/ripple.dds"; - foamTex = "core/rendering/images/foam"; - depthGradientTex = "core/rendering/images/depthcolor_ramp"; + rippleTex = "Core_Rendering:ripple_image"; + foamTex = "Core_Rendering:foam_image"; + depthGradientTex = "Core_Rendering:depthcolor_ramp_image"; }; return %river; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui index dc757dc54..8dafe0357 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui @@ -313,30 +313,6 @@ function ObjectBuilderGui::createImageAssetType(%this, %index) else %name = %this.field[%index, text]; - // - /*%this.textControls[%this.numControls] = new GuiTextCtrl() { - profile = "ToolsGuiTextRightProfile"; - internalName = "assetText"; - text = %name; - extent = %this.fieldNameExtent; - position = %this.curXPos @ " " @ %this.curYPos; - modal = "1"; - }; - - // - %this.controls[%this.numControls] = new GuiButtonCtrl() { - HorizSizing = "width"; - profile = "ToolsGuiButtonProfile"; - internalName = "assetButton"; - extent = %this.fileButtonExtent; - position = %this.curXPos + %this.columnOffset @ " " @ %this.curYPos; - modal = "1"; - command = %this @ ".getImageAsset(" @ %index @ ");"; - }; - - %val = %this.field[%index, value]; - %this.controls[%this.numControls].setText(fileBase(%val) @ fileExt(%val));*/ - %this.textControls[%this.numControls] = new GuiTextCtrl() { profile = "ToolsGuiTextRightProfile"; text = %name; @@ -375,7 +351,7 @@ function ObjectBuilderGui::createImageAssetType(%this, %index) modal = "1"; command = %this @ ".getImageAsset(" @ %index @ ");"; }; - %button.setBitmap("ToolsModule:change_material_btn_n_image"); + %button.setBitmap("ToolsModule:GameTSCtrl_image"); %this.controls[%this.numControls].addGuiControl(%button); %this.numControls++; @@ -412,6 +388,279 @@ function ObjectBuilderGui::gotImageAsset(%this, %name) // This doesn't work for button controls as getValue returns their state! //%this.controls[%this.currentControl].setValue(%name); } + +//------------------------------------------------------------------------------ +function ObjectBuilderGui::createMaterialAssetType(%this, %index) +{ + if(%index >= %this.numFields || %this.field[%index, name] $= "") + { + error("ObjectBuilderGui::createMaterialAssetType: invalid field"); + return; + } + + // + if(%this.field[%index, text] $= "") + %name = %this.field[%index, name]; + else + %name = %this.field[%index, text]; + + %this.textControls[%this.numControls] = new GuiTextCtrl() { + profile = "ToolsGuiTextRightProfile"; + text = %name; + extent = %this.fieldNameExtent; + position = %this.curXPos @ " " @ %this.curYPos; + modal = "1"; + }; + + // + %this.controls[%this.numControls] = new GuiControl() { + HorizSizing = "width"; + profile = "ToolsGuiDefaultProfile"; + extent = %this.textEditExtent; + position = %this.curXPos + %this.columnOffset @ " " @ %this.curYPos; + modal = "1"; + }; + + %text = new GuiTextEditCtrl() { + class = ObjectBuilderGuiTextEditCtrl; + internalName = "assetText"; + HorizSizing = "width"; + profile = "ToolsGuiTextEditProfile"; + extent = getWord(%this.textEditExtent,0) - getWord(%this.matButtonExtent,0) - 2 @ " " @ getWord(%this.textEditExtent,1); + text = %this.field[%index, value]; + position = "0 0"; + modal = "1"; + }; + %this.controls[%this.numControls].addGuiControl(%text); + + %button = new GuiBitmapButtonCtrl() { + internalName = "assetButton"; + HorizSizing = "left"; + profile = "ToolsGuiButtonProfile"; + extent = %this.matButtonExtent; + position = getWord(%this.textEditExtent,0) - getWord(%this.matButtonExtent,0) @ " 0"; + modal = "1"; + command = %this @ ".getMaterialAsset(" @ %index @ ");"; + }; + %button.setBitmap("ToolsModule:change_material_btn_n_image"); + %this.controls[%this.numControls].addGuiControl(%button); + + %this.numControls++; + %this.curYPos += %this.defaultFieldStep; +} + +function ObjectBuilderGui::getMaterialAsset(%this, %index) +{ + if(%index >= %this.numFields || %this.field[%index, name] $= "") + { + error("ObjectBuilderGui::getMaterialAsset: invalid field"); + return; + } + + %val = %this.field[%index, ext]; + + //%path = filePath(%val); + //%ext = fileExt(%val); + + %this.currentControl = %index; + AssetBrowser.showDialog("MaterialAsset", %this @ ".gotMaterialAsset", "", "", ""); + //getLoadFilename( %val @ "|" @ %val, %this @ ".gotFileName", %this.lastPath ); +} + +function ObjectBuilderGui::gotMaterialAsset(%this, %name) +{ + %index = %this.currentControl; + + %this.field[%index, value] = %name; + %this.controls[%this.currentControl]-->assetText.setText(%name); + + %this.lastPath = %name; + + // This doesn't work for button controls as getValue returns their state! + //%this.controls[%this.currentControl].setValue(%name); +} + +//------------------------------------------------------------------------------ +function ObjectBuilderGui::createShapeAssetType(%this, %index) +{ + if(%index >= %this.numFields || %this.field[%index, name] $= "") + { + error("ObjectBuilderGui::createShapeAssetType: invalid field"); + return; + } + + // + if(%this.field[%index, text] $= "") + %name = %this.field[%index, name]; + else + %name = %this.field[%index, text]; + + %this.textControls[%this.numControls] = new GuiTextCtrl() { + profile = "ToolsGuiTextRightProfile"; + text = %name; + extent = %this.fieldNameExtent; + position = %this.curXPos @ " " @ %this.curYPos; + modal = "1"; + }; + + // + %this.controls[%this.numControls] = new GuiControl() { + HorizSizing = "width"; + profile = "ToolsGuiDefaultProfile"; + extent = %this.textEditExtent; + position = %this.curXPos + %this.columnOffset @ " " @ %this.curYPos; + modal = "1"; + }; + + %text = new GuiTextEditCtrl() { + class = ObjectBuilderGuiTextEditCtrl; + internalName = "assetText"; + HorizSizing = "width"; + profile = "ToolsGuiTextEditProfile"; + extent = getWord(%this.textEditExtent,0) - getWord(%this.matButtonExtent,0) - 2 @ " " @ getWord(%this.textEditExtent,1); + text = %this.field[%index, value]; + position = "0 0"; + modal = "1"; + }; + %this.controls[%this.numControls].addGuiControl(%text); + + %button = new GuiBitmapButtonCtrl() { + internalName = "assetButton"; + HorizSizing = "left"; + profile = "ToolsGuiButtonProfile"; + extent = %this.matButtonExtent; + position = getWord(%this.textEditExtent,0) - getWord(%this.matButtonExtent,0) @ " 0"; + modal = "1"; + command = %this @ ".getShapeAsset(" @ %index @ ");"; + }; + %button.setBitmap("ToolsModule:shape_editor_n_image"); + %this.controls[%this.numControls].addGuiControl(%button); + + %this.numControls++; + %this.curYPos += %this.defaultFieldStep; +} + +function ObjectBuilderGui::getShapeAsset(%this, %index) +{ + if(%index >= %this.numFields || %this.field[%index, name] $= "") + { + error("ObjectBuilderGui::getShapeAsset: invalid field"); + return; + } + + %val = %this.field[%index, ext]; + + //%path = filePath(%val); + //%ext = fileExt(%val); + + %this.currentControl = %index; + AssetBrowser.showDialog("ShapeAsset", %this @ ".gotShapeAsset", "", "", ""); + //getLoadFilename( %val @ "|" @ %val, %this @ ".gotFileName", %this.lastPath ); +} + +function ObjectBuilderGui::gotShapeAsset(%this, %name) +{ + %index = %this.currentControl; + + %this.field[%index, value] = %name; + %this.controls[%this.currentControl]-->assetText.setText(%name); + + %this.lastPath = %name; + + // This doesn't work for button controls as getValue returns their state! + //%this.controls[%this.currentControl].setValue(%name); +} + +//------------------------------------------------------------------------------ +function ObjectBuilderGui::createSoundAssetType(%this, %index) +{ + if(%index >= %this.numFields || %this.field[%index, name] $= "") + { + error("ObjectBuilderGui::createSoundAssetType: invalid field"); + return; + } + + // + if(%this.field[%index, text] $= "") + %name = %this.field[%index, name]; + else + %name = %this.field[%index, text]; + + %this.textControls[%this.numControls] = new GuiTextCtrl() { + profile = "ToolsGuiTextRightProfile"; + text = %name; + extent = %this.fieldNameExtent; + position = %this.curXPos @ " " @ %this.curYPos; + modal = "1"; + }; + + // + %this.controls[%this.numControls] = new GuiControl() { + HorizSizing = "width"; + profile = "ToolsGuiDefaultProfile"; + extent = %this.textEditExtent; + position = %this.curXPos + %this.columnOffset @ " " @ %this.curYPos; + modal = "1"; + }; + + %text = new GuiTextEditCtrl() { + class = ObjectBuilderGuiTextEditCtrl; + internalName = "assetText"; + HorizSizing = "width"; + profile = "ToolsGuiTextEditProfile"; + extent = getWord(%this.textEditExtent,0) - getWord(%this.matButtonExtent,0) - 2 @ " " @ getWord(%this.textEditExtent,1); + text = %this.field[%index, value]; + position = "0 0"; + modal = "1"; + }; + %this.controls[%this.numControls].addGuiControl(%text); + + %button = new GuiBitmapButtonCtrl() { + internalName = "assetButton"; + HorizSizing = "left"; + profile = "ToolsGuiButtonProfile"; + extent = %this.matButtonExtent; + position = getWord(%this.textEditExtent,0) - getWord(%this.matButtonExtent,0) @ " 0"; + modal = "1"; + command = %this @ ".getSoundAsset(" @ %index @ ");"; + }; + %button.setBitmap("ToolsModule:SFXEmitter_image"); + %this.controls[%this.numControls].addGuiControl(%button); + + %this.numControls++; + %this.curYPos += %this.defaultFieldStep; +} + +function ObjectBuilderGui::getSoundAsset(%this, %index) +{ + if(%index >= %this.numFields || %this.field[%index, name] $= "") + { + error("ObjectBuilderGui::getSoundAsset: invalid field"); + return; + } + + %val = %this.field[%index, ext]; + + //%path = filePath(%val); + //%ext = fileExt(%val); + + %this.currentControl = %index; + AssetBrowser.showDialog("SoundAsset", %this @ ".gotSoundAsset", "", "", ""); + //getLoadFilename( %val @ "|" @ %val, %this @ ".gotFileName", %this.lastPath ); +} + +function ObjectBuilderGui::gotSoundAsset(%this, %name) +{ + %index = %this.currentControl; + + %this.field[%index, value] = %name; + %this.controls[%this.currentControl]-->assetText.setText(%name); + + %this.lastPath = %name; + + // This doesn't work for button controls as getValue returns their state! + //%this.controls[%this.currentControl].setValue(%name); +} //------------------------------------------------------------------------------ function ObjectBuilderGui::createMaterialNameType(%this, %index) { @@ -680,6 +929,15 @@ function ObjectBuilderGui::process(%this) case "TypeImageAsset": %this.createImageAssetType(%i); + case "TypeMaterialAsset": + %this.createMaterialAssetType(%i); + + case "TypeShapeAsset": + %this.createShapeAssetType(%i); + + case "TypeSoundAsset": + %this.createSoundAssetType(%i); + case "TypeMaterialName": %this.createMaterialNameType(%i); @@ -753,7 +1011,10 @@ function ObjectBuilderGui::onOK(%this) continue; } if (%this.field[%i, type] $= "TypeImageAsset" || - %this.field[%i, type] $= "TypeTerrainAsset") + %this.field[%i, type] $= "TypeTerrainAsset" || + %this.field[%i, type] $= "TypeMaterialAsset" || + %this.field[%i, type] $= "TypeShapeAsset" + ) { %this.field[%i, value] = %this.controls[%i]-->assetText.getText(); continue; @@ -861,7 +1122,6 @@ function ObjectBuilderGui::buildScatterSky( %this, %dontWarnAboutSun ) %this.addField( "moonMatAsset", "TypeMaterialAsset", "Moon Material", "Core_Rendering:moon_wglow" ); %this.addField( "nightCubemap", "TypeCubemapName", "Night Cubemap", "NightCubemap" ); %this.addField( "useNightCubemap", "TypeBool", "Use Night Cubemap", "true" ); - } function ObjectBuilderGui::buildCloudLayer(%this) @@ -954,7 +1214,7 @@ function ObjectBuilderGui::buildSun( %this, %dontWarnAboutScatterSky ) // This is a trick... any fields added after process won't show // up as controls, but will be applied to the created object. - %this.addField( "coronaMaterial", "TypeMaterialName", "Corona Material", "Corona_Mat" ); + %this.addField( "coronaMaterial", "TypeMaterialAsset", "Corona Material", "Core_Rendering:Corona_Mat" ); %this.addField( "flareType", "TypeLightFlareDataPtr", "Flare", "SunFlareExample" ); } @@ -994,9 +1254,9 @@ function ObjectBuilderGui::addWaterObjectFields(%this) %this.addField("waveSpeed[2]", "TypeFloat", "Wave Speed", "1"); %this.addField("overallWaveMagnitude", "TypeFloat", "Overall Wave Magnitude", "1.0"); - %this.addField("rippleTexAsset", "TypeImageAssetId", "Ripple Texture", "Core_Rendering:ripple_image" ); - %this.addField("depthGradientTexAsset", "TypeImageAssetId", "Depth Gradient Texture", "Core_Rendering:depthcolor_ramp_imag" ); - %this.addField("foamTexAsset", "TypeImageAssetId", "Foam Texture", "Core_Rendering:foam_image" ); + %this.addField("rippleTex", "TypeImageAsset", "Ripple Texture", "Core_Rendering:ripple_image" ); + %this.addField("depthGradientTex", "TypeImageAsset", "Depth Gradient Texture", "Core_Rendering:depthcolor_ramp_image" ); + %this.addField("foamTex", "TypeImageAsset", "Foam Texture", "Core_Rendering:foam_image" ); } function ObjectBuilderGui::buildWaterBlock(%this) @@ -1038,8 +1298,8 @@ function ObjectBuilderGui::buildTerrainBlock(%this) function ObjectBuilderGui::buildGroundCover( %this ) { %this.objectClassName = "GroundCover"; - %this.addField( "material", "TypeMaterialName", "Material Name", "" ); - %this.addField( "shapeFilename[0]", "TypeFile", "Shape File [Optional]", "", "*.*"); + %this.addField( "materialAsset", "TypeMaterialAsset", "Material Asset", "" ); + %this.addField( "shapeAsset[0]", "TypeShapeAsset", "Shape Asset [Optional]", "", ""); %this.process(); // This is a trick... any fields added after process won't show @@ -1212,6 +1472,9 @@ function ObjectBuilderGui::buildGeneralDropPoint(%this) function ObjectBuilderGui::buildNotesObject(%this) { %this.objectClassName = "NotesObject"; + %this.addField("note", "TypeString", "Note Text", ""); + %this.addField("showArrow", "TypeBool", "Show Arrow", ""); + %this.addField("arrowColor", "TypeColorI", "Arrow Color", "255 0 0 255"); %this.process(); } //------------------------------------------------------------------------------ @@ -1221,11 +1484,11 @@ function ObjectBuilderGui::buildVolumetricFog(%this) { // Change this if you want to default to another Folder // Otherwise every time you want to add a Fog you will go this. - %defShape = "core/rendering/shapes/Fog_Cube.DAE"; + %defShape = "Core_Rendering:Fog_Cube"; %this.lastPath=getMainDotCsDir() @ %defShape; OBObjectName.setValue( "" ); %this.objectClassName = "VolumetricFog"; - %this.addField( "shapeName", "TypeFile", "Shape (Fog volume)", "", "*.dts;*.dae"); + %this.addField( "shapeAsset", "TypeShapeAsset", "Shape (Fog volume)", "", ""); %this.addField("Scale", "TypePoint3", "Scale", "1 1 1"); %this.addField("FogColor", "TypeColorI", "FogColor", "200 200 200 255"); %this.process(); diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript index e7972a4c8..dca4d1f30 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript @@ -1826,7 +1826,10 @@ function EditorTree::update( %this ) // Tooltip for TSStatic function EditorTree::GetTooltipTSStatic( %this, %obj ) { - return "Shape: " @ %obj.shapeName; + %shapeName = %obj.shapeAsset; + if(%shapeName $= "") + %shapeName = %obj.getShape(); + return "Shape: " @ %shapeName; } // Tooltip for ShapeBase @@ -1862,7 +1865,10 @@ function EditorTree::GetTooltipPrefab( %this, %obj ) // Tooltip for GroundCover function EditorTree::GetTooltipGroundCover( %this, %obj ) { - %text = "Material: " @ %obj.material; + %matName = %obj.materialAsset; + if(%matName $= "") + %matName = %obj.getMaterial(); + %text = "Material: " @ %matName; for(%i=0; %i<8; %i++) { if(%obj.probability[%i] > 0 && %obj.shapeFilename[%i] !$= "") diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/editor.keybinds.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/editor.keybinds.tscript index a077b8611..74c681bd5 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/editor.keybinds.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/editor.keybinds.tscript @@ -79,4 +79,4 @@ GlobalActionMap.bind(keyboard, "tilde", toggleConsole); EditorMap.bind( mouse, "alt zaxis", editorWheelFadeScroll ); -EditorMap.bindCmd( keyboard, space, "", "AssetBrowser.toggleDialog();" ); +EditorMap.bindCmd( keyboard, "shift space", "", "AssetBrowser.toggleDialog();" ); diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript index a1771cdcf..4679dba92 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript @@ -204,8 +204,7 @@ function EditorNewLevel( %level ) %saveFirst = false; if ( EditorIsDirty() ) { - error(knob); - %saveFirst = toolsMessageBox("Mission Modified", "Would you like to save changes to the current mission \"" @ + %saveFirst = MessageBox("Mission Modified", "Would you like to save changes to the current mission \"" @ $Server::MissionFile @ "\" before creating a new mission?", "SaveDontSave", "Question") == $MROk; } @@ -300,7 +299,7 @@ function EditorSaveMission() // first check for dirty and read-only files: if((EWorldEditor.isDirty || ETerrainEditor.isMissionDirty) && !isWriteableFileName($Server::MissionFile)) { - toolsMessageBox("Error", "Mission file \""@ $Server::MissionFile @ "\" is read-only. Continue?", "Ok", "Stop"); + MessageBox("Error", "Mission file \""@ $Server::MissionFile @ "\" is read-only. Continue?", "Ok", "Stop"); return false; } if(ETerrainEditor.isDirty) @@ -310,9 +309,18 @@ function EditorSaveMission() while ((%terrainObject = containerSearchNext()) != 0) { - if (!isWriteableFileName(%terrainObject.terrainFile)) + %terrFile = %terrainObject.getTerrain(); + if(AssetDatabase.isDeclaredAsset(%terrFile)) { - if (toolsMessageBox("Error", "Terrain file \""@ %terrainObject.terrainFile @ "\" is read-only. Continue?", "Ok", "Stop") == $MROk) + %assetDef = AssetDatabase.acquireAsset(%terrFile); + %file = %assetDef.getTerrainFilePath(); + AssetDatabase.releaseAsset(%terrFile); + %terrFile = %file; + } + + if (!isWriteableFileName(%terrFile) && %bypass $= "") + { + if (MessageBox("Error", "Terrain file \""@ %terrainObject.terrainFile @ "\" is read-only. Continue?", "Ok", "Stop") == $MROk) continue; else return false; @@ -497,12 +505,12 @@ function EditorOpenMission(%levelAsset) if( EditorIsDirty()) { // "EditorSaveBeforeLoad();", "getLoadFilename(\"*.mis\", \"EditorDoLoadMission\");" - if(toolsMessageBox("Mission Modified", "Would you like to save changes to the current mission \"" @ + if(MessageBox("Mission Modified", "Would you like to save changes to the current mission \"" @ $Server::MissionFile @ "\" before opening a new mission?", SaveDontSave, Question) == $MROk) { - if(! EditorSaveMission()) - return; - } + if(!EditorSaveMission()) + return; + } } if(%levelAsset $= "") @@ -779,8 +787,20 @@ function makeSelectedAMesh(%assetId) function EditorTakeControlOfEntity() { %object = EWorldEditor.getSelectedObject(0); - switchCamera(localClientConnection, %object); - switchControlObject(localClientConnection, %object); + if(isObject(%object) && %object.getClassName() !$= "Camera") + { + $Editor::previousControlObject = localClientConnection.getControlObject(); + localClientConnection.setControlObject(%object); + + } +} + +function EditorReleaseControlOfEntity() +{ + if(isObject($Editor::previousControlObject)) + { + localClientConnection.setControlObject($Editor::previousControlObject); + } } function EditorMount() diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/menus.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/menus.ed.tscript index 21eaea05a..bf69e6bdb 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/menus.ed.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/menus.ed.tscript @@ -459,9 +459,11 @@ function EditorGui::buildMenus(%this) Item[18] = "Explode Selected Prefab" TAB "" TAB "EditorExplodePrefab();"; Item[19] = "-"; Item[20] = "Take control of entity" TAB "" TAB "EditorTakeControlOfEntity();"; - Item[21] = "-"; - Item[22] = "Mount Selection A to B" TAB "" TAB "EditorMount();"; - Item[23] = "Unmount Selected Object" TAB "" TAB "EditorUnmount();"; + Item[21] = "Release control of entity" TAB "" TAB "EditorReleaseControlOfEntity();"; + + Item[22] = "-"; + Item[23] = "Mount Selection A to B" TAB "" TAB "EditorMount();"; + Item[24] = "Unmount Selected Object" TAB "" TAB "EditorUnmount();"; }; } } From ef5daae77045588f054152bd325c9f2ee44e8af7 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sun, 19 Sep 2021 12:55:56 -0500 Subject: [PATCH 083/399] Removed unneeded var --- .../game/tools/worldEditor/scripts/menuHandlers.ed.tscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript index 4679dba92..a2ea3b015 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript @@ -318,7 +318,7 @@ function EditorSaveMission() %terrFile = %file; } - if (!isWriteableFileName(%terrFile) && %bypass $= "") + if (!isWriteableFileName(%terrFile)) { if (MessageBox("Error", "Terrain file \""@ %terrainObject.terrainFile @ "\" is read-only. Continue?", "Ok", "Stop") == $MROk) continue; From c92cfe3e81898f66fe2dfb35118605e97b10a577 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Mon, 20 Sep 2021 09:37:31 +0100 Subject: [PATCH 084/399] SoundAssetImplements -Explosion -Lightning -Splash -Other sound asset implementations will require soundasset array if possible. --- Engine/source/T3D/fx/explosion.cpp | 32 ++++++++++++++---------------- Engine/source/T3D/fx/explosion.h | 13 +++++++++++- Engine/source/T3D/fx/lightning.cpp | 21 ++++++++++---------- Engine/source/T3D/fx/lightning.h | 16 +++++++++++++-- Engine/source/T3D/fx/splash.cpp | 24 +++++++++++++++++++--- Engine/source/T3D/fx/splash.h | 16 +++++++++++++-- 6 files changed, 87 insertions(+), 35 deletions(-) diff --git a/Engine/source/T3D/fx/explosion.cpp b/Engine/source/T3D/fx/explosion.cpp index aa86e27a9..e842f73e4 100644 --- a/Engine/source/T3D/fx/explosion.cpp +++ b/Engine/source/T3D/fx/explosion.cpp @@ -230,7 +230,9 @@ ExplosionData::ExplosionData() faceViewer = false; - soundProfile = NULL; + INIT_SOUNDASSET(Sound); + + //soundProfile = NULL; particleEmitter = NULL; particleEmitterId = 0; @@ -308,7 +310,7 @@ ExplosionData::ExplosionData(const ExplosionData& other, bool temp_clone) : Game faceViewer = other.faceViewer; particleDensity = other.particleDensity; particleRadius = other.particleRadius; - soundProfile = other.soundProfile; + CLONE_SOUNDASSET(Sound); particleEmitter = other.particleEmitter; particleEmitterId = other.particleEmitterId; // -- for pack/unpack of particleEmitter ptr explosionScale = other.explosionScale; @@ -358,12 +360,6 @@ ExplosionData::~ExplosionData() if (!isTempClone()) return; - if (soundProfile && soundProfile->isTempClone()) - { - delete soundProfile; - soundProfile = 0; - } - // particleEmitter, emitterList[*], debrisList[*], explosionList[*] will delete themselves #ifdef TRACK_EXPLOSION_DATA_CLONES @@ -399,8 +395,9 @@ void ExplosionData::initPersistFields() "of the explosion." ); addField( "playSpeed", TypeF32, Offset(playSpeed, ExplosionData), "Time scale at which to play the explosionShape ambient sequence." ); - addField( "soundProfile", TYPEID< SFXTrack >(), Offset(soundProfile, ExplosionData), - "Non-looping sound effect that will be played at the start of the explosion." ); + + INITPERSISTFIELD_SOUNDASSET(Sound, ExplosionData, "Sound to play when this explosion explodes."); + addField( "faceViewer", TypeBool, Offset(faceViewer, ExplosionData), "Controls whether the visual effects of the explosion always face the camera." ); @@ -523,7 +520,6 @@ void ExplosionData::initPersistFields() onlyKeepClearSubstitutions("debris"); // subs resolving to "~~", or "~0" are OK onlyKeepClearSubstitutions("emitter"); onlyKeepClearSubstitutions("particleEmitter"); - onlyKeepClearSubstitutions("soundProfile"); onlyKeepClearSubstitutions("subExplosion"); Parent::initPersistFields(); } @@ -656,7 +652,8 @@ void ExplosionData::packData(BitStream* stream) PACKDATA_SHAPEASSET(ExplosionShape); - sfxWrite( stream, soundProfile ); + PACKDATA_SOUNDASSET(Sound); + if (stream->writeFlag(particleEmitter)) stream->writeRangedU32(particleEmitter->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast); @@ -759,7 +756,7 @@ void ExplosionData::unpackData(BitStream* stream) UNPACKDATA_SHAPEASSET(ExplosionShape); - sfxRead( stream, &soundProfile ); + UNPACKDATA_SOUNDASSET(Sound); if (stream->readFlag()) particleEmitterId = stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast); @@ -861,12 +858,13 @@ bool ExplosionData::preload(bool server, String &errorStr) { if (Parent::preload(server, errorStr) == false) return false; - + + if (!server && !getSFXProfile()) + return false; + if( !server ) { String sfxErrorStr; - if( !sfxResolve( &soundProfile, sfxErrorStr ) ) - Con::errorf(ConsoleLogEntry::General, "Error, unable to load sound profile for explosion datablock: %s", sfxErrorStr.c_str()); if (!particleEmitter && particleEmitterId != 0) if (Sim::findObject(particleEmitterId, particleEmitter) == false) Con::errorf(ConsoleLogEntry::General, "Error, unable to load particle emitter for explosion datablock"); @@ -1384,7 +1382,7 @@ bool Explosion::explode() resetWorldBox(); } - SFXProfile* sound_prof = dynamic_cast(mDataBlock->soundProfile); + SFXProfile* sound_prof = dynamic_cast(mDataBlock->getSFXProfile()); if (sound_prof) { soundProfile_clone = sound_prof->cloneAndPerformSubstitutions(ss_object, ss_index); diff --git a/Engine/source/T3D/fx/explosion.h b/Engine/source/T3D/fx/explosion.h index a82d28644..ae01c4bee 100644 --- a/Engine/source/T3D/fx/explosion.h +++ b/Engine/source/T3D/fx/explosion.h @@ -42,6 +42,7 @@ #endif #include "T3D/assets/ShapeAsset.h" +#include "T3D/assets/SoundAsset.h" class ParticleEmitter; class ParticleEmitterData; @@ -69,7 +70,17 @@ class ExplosionData : public GameBaseData { S32 particleDensity; F32 particleRadius; - SFXTrack* soundProfile; + //SFXTrack* soundProfile; + DECLARE_SOUNDASSET(ExplosionData, Sound); + DECLARE_SOUNDASSET_SETGET(ExplosionData, Sound); + + SFXProfile* getSFXProfile() { + if (mSoundAsset.notNull()) + return mSoundAsset->getSfxProfile(); + else + return NULL; + } + ParticleEmitterData* particleEmitter; S32 particleEmitterId; diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index e808fb406..20925ec58 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -238,7 +238,7 @@ void LightningStrikeEvent::process(NetConnection*) // LightningData::LightningData() { - strikeSound = NULL; + INIT_SOUNDASSET(StrikeSound); for (S32 i = 0; i < MaxThunders; i++) thunderSounds[i] = NULL; @@ -260,8 +260,9 @@ LightningData::~LightningData() //-------------------------------------------------------------------------- void LightningData::initPersistFields() { - addField( "strikeSound", TYPEID< SFXTrack >(), Offset(strikeSound, LightningData), - "Sound profile to play when a lightning strike occurs." ); + + INITPERSISTFIELD_SOUNDASSET(StrikeSound, LightningData, "Sound to play when lightning STRIKES!"); + addField( "thunderSounds", TYPEID< SFXTrack >(), Offset(thunderSounds, LightningData), MaxThunders, "@brief List of thunder sound effects to play.\n\n" "A random one of these sounds will be played shortly after each strike " @@ -302,8 +303,8 @@ bool LightningData::preload(bool server, String &errorStr) Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid packet: %s", sfxErrorStr.c_str()); } - if( !sfxResolve( &strikeSound, sfxErrorStr ) ) - Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid packet: %s", sfxErrorStr.c_str()); + if(!getSFXProfile()) + Con::errorf(ConsoleLogEntry::General, "LightningData::preload: can't get sfxProfile from asset"); mNumStrikeTextures = 0; for (U32 i = 0; i < MaxTextures; i++) @@ -338,7 +339,7 @@ void LightningData::packData(BitStream* stream) for (i = 0; i < MaxTextures; i++) stream->writeString(strikeTextureNames[i]); - sfxWrite( stream, strikeSound ); + PACKDATA_SOUNDASSET(StrikeSound); } void LightningData::unpackData(BitStream* stream) @@ -359,7 +360,7 @@ void LightningData::unpackData(BitStream* stream) for (i = 0; i < MaxTextures; i++) strikeTextureNames[i] = stream->readSTString(); - sfxRead( stream, &strikeSound ); + UNPACKDATA_SOUNDASSET(StrikeSound); } @@ -735,9 +736,9 @@ void Lightning::processEvent(LightningStrikeEvent* pEvent) MatrixF trans(true); trans.setPosition( strikePoint ); - if (mDataBlock->strikeSound) + if (mDataBlock->getSFXProfile()) { - SFX->playOnce(mDataBlock->strikeSound, &trans ); + SFX->playOnce(mDataBlock->getSFXProfile(), &trans ); } } @@ -1337,4 +1338,4 @@ void LightningBolt::update( F32 dt ) isFading = false; elapsedTime = 0.0f; } -} \ No newline at end of file +} diff --git a/Engine/source/T3D/fx/lightning.h b/Engine/source/T3D/fx/lightning.h index 93a54ffc7..78ef4a20b 100644 --- a/Engine/source/T3D/fx/lightning.h +++ b/Engine/source/T3D/fx/lightning.h @@ -41,7 +41,8 @@ #include "gfx/gfxTextureHandle.h" - +#include "T3D/assets/ImageAsset.h" +#include "T3D/assets/SoundAsset.h" class ShapeBase; class LightningStrikeEvent; @@ -63,7 +64,10 @@ class LightningData : public GameBaseData //-------------------------------------- Console set variables public: SFXTrack* thunderSounds[MaxThunders]; - SFXTrack* strikeSound; + + DECLARE_SOUNDASSET(LightningData, StrikeSound); + DECLARE_SOUNDASSET_SETGET(LightningData, StrikeSound); + StringTableEntry strikeTextureNames[MaxTextures]; //-------------------------------------- load set variables @@ -86,6 +90,14 @@ class LightningData : public GameBaseData DECLARE_CONOBJECT(LightningData); static void initPersistFields(); + + SFXProfile* getSFXProfile() { + if (mStrikeSoundAsset.notNull()) + return mStrikeSoundAsset->getSfxProfile(); + else + return NULL; + } + }; diff --git a/Engine/source/T3D/fx/splash.cpp b/Engine/source/T3D/fx/splash.cpp index c6ac5582b..6af8a0c1a 100644 --- a/Engine/source/T3D/fx/splash.cpp +++ b/Engine/source/T3D/fx/splash.cpp @@ -67,8 +67,10 @@ ConsoleDocClass( Splash, //-------------------------------------------------------------------------- SplashData::SplashData() { - soundProfile = NULL; - soundProfileId = 0; + //soundProfile = NULL; + //soundProfileId = 0; + + INIT_SOUNDASSET(Sound); scale.set(1, 1, 1); @@ -112,7 +114,8 @@ SplashData::SplashData() //-------------------------------------------------------------------------- void SplashData::initPersistFields() { - addField("soundProfile", TYPEID< SFXProfile >(), Offset(soundProfile, SplashData), "SFXProfile effect to play.\n"); + INITPERSISTFIELD_SOUNDASSET(Sound, SplashData, "Sound to play when splash, splashes."); + addField("scale", TypePoint3F, Offset(scale, SplashData), "The scale of this splashing effect, defined as the F32 points X, Y, Z.\n"); addField("emitter", TYPEID< ParticleEmitterData >(), Offset(emitterList, SplashData), NUM_EMITTERS, "List of particle emitters to create at the point of this Splash effect.\n"); addField("delayMS", TypeS32, Offset(delayMS, SplashData), "Time to delay, in milliseconds, before actually starting this effect.\n"); @@ -158,6 +161,8 @@ void SplashData::packData(BitStream* stream) { Parent::packData(stream); + PACKDATA_SOUNDASSET(Sound); + mathWrite(*stream, scale); stream->write(delayMS); stream->write(delayVariance); @@ -212,6 +217,8 @@ void SplashData::unpackData(BitStream* stream) { Parent::unpackData(stream); + UNPACKDATA_SOUNDASSET(Sound); + mathRead(*stream, &scale); stream->read(&delayMS); stream->read(&delayVariance); @@ -267,6 +274,9 @@ bool SplashData::preload(bool server, String &errorStr) if (Parent::preload(server, errorStr) == false) return false; + if (!server && !getSFXProfile()) + return false; + if (!server) { S32 i; @@ -667,6 +677,14 @@ void Splash::spawnExplosion() { if( !mDataBlock->explosion ) return; + /// could just play the explosion one, but explosion could be weapon specific, + /// splash sound could be liquid specific. food for thought. + SFXProfile* sound_prof = dynamic_cast(mDataBlock->getSFXProfile()); + if (sound_prof) + { + SFX->playOnce(sound_prof, &getTransform()); + } + Explosion* pExplosion = new Explosion; pExplosion->onNewDataBlock(mDataBlock->explosion, false); diff --git a/Engine/source/T3D/fx/splash.h b/Engine/source/T3D/fx/splash.h index f90a72d3c..40c6838fc 100644 --- a/Engine/source/T3D/fx/splash.h +++ b/Engine/source/T3D/fx/splash.h @@ -34,6 +34,7 @@ #include "gfx/gfxTextureHandle.h" #include "T3D/assets/ImageAsset.h" +#include "T3D/assets/SoundAsset.h" class ParticleEmitter; class ParticleEmitterData; @@ -91,8 +92,19 @@ class SplashData : public GameBaseData }; public: - AudioProfile* soundProfile; - S32 soundProfileId; + //AudioProfile* soundProfile; + //S32 soundProfileId; + + DECLARE_SOUNDASSET(SplashData, Sound); + DECLARE_SOUNDASSET_SETGET(SplashData, Sound); + + /// this should probably be added as a function higher up to stop repeats. + SFXProfile* getSFXProfile() { + if (mSoundAsset.notNull()) + return mSoundAsset->getSfxProfile(); + else + return NULL; + } ParticleEmitterData* emitterList[NUM_EMITTERS]; S32 emitterIDList[NUM_EMITTERS]; From 3ad6d47ca9eaf57e64afc872cbde5c76cf47557d Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Mon, 20 Sep 2021 09:55:36 +0100 Subject: [PATCH 085/399] Update SoundAsset.h -SoundAsset array setters getters and binds in place --- Engine/source/T3D/assets/SoundAsset.h | 218 ++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index 710652830..757d85ab6 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -360,5 +360,223 @@ DefineEngineMethod(className, set##name, bool, (const char* shape), , assetText #pragma endregion +#pragma region Arrayed Asset Macros + +#define DECLARE_SOUNDASSET_ARRAY(className, name, max) public: \ + static const U32 sm##name##count = max;\ + Resource m##name[max];\ + StringTableEntry m##name##Name[max]; \ + StringTableEntry m##name##AssetId[max];\ + AssetPtr m##name##Asset[max] = NULL;\ + SFXProfile* m##name##Profile[max] = NULL;\ +public: \ + const StringTableEntry get##name##File(const U32& id) const { return m##name##Name[id]; }\ + void set##name##File(const FileName &_in, const U32& id) { m##name##Name[id] = StringTable->insert(_in.c_str());}\ + const AssetPtr & get##name##Asset(const U32& id) const { return m##name##Asset[id]; }\ + void set##name##Asset(const AssetPtr &_in, const U32& id) { m##name##Asset[id] = _in;}\ + \ + bool _set##name(StringTableEntry _in, const U32& id)\ + {\ + if(m##name##AssetId[id] != _in || m##name##Name[id] != _in)\ + {\ + if (_in == NULL || _in == StringTable->EmptyString())\ + {\ + if(id >= sm##name##Count || id < 0) \ + return false;\ + m##name##Name[id] = StringTable->EmptyString();\ + m##name##AssetId[id] = StringTable->EmptyString();\ + m##name##Asset[id] = NULL;\ + m##name[id] = NULL;\ + return true;\ + }\ + \ + if (AssetDatabase.isDeclaredAsset(_in))\ + {\ + m##name##AssetId[id] = _in;\ + \ + U32 assetState = SoundAsset::getAssetById(m##name##AssetId[id], &m##name##Asset[id]);\ + \ + if (SoundAsset::Ok == assetState)\ + {\ + m##name##Name[id] = StringTable->EmptyString();\ + }\ + }\ + else\ + {\ + StringTableEntry assetId = SoundAsset::getAssetIdByFileName(_in);\ + if (assetId != StringTable->EmptyString())\ + {\ + m##name##AssetId[id] = assetId;\ + if(SoundAsset::getAssetById(m##name##AssetId, &m##name##Asset) == SoundAsset::Ok)\ + {\ + m##name##Name[id] = StringTable->EmptyString();\ + }\ + }\ + else\ + {\ + m##name##Name[id] = _in;\ + m##name##AssetId[id] = StringTable->EmptyString();\ + m##name##Asset[id] = NULL;\ + }\ + }\ + }\ + if (get##name(id) != StringTable->EmptyString() && m##name##Asset[id].notNull())\ + {\ + m##name[id] = m##name##Asset[id]->getSoundResource();\ + }\ + else\ + {\ + m##name[id] = NULL;\ + }\ + \ + if (m##name##Asset[id].notNull() && m##name##Asset[id]->getStatus() != SoundAsset::Ok)\ + {\ + Con::errorf("%s(%s)::_set%s(%i) - sound asset failure\"%s\" due to [%s]", macroText(className), getName(), macroText(name),id, _in, SoundAsset::getAssetErrstrn(m##name##Asset->getStatus()).c_str());\ + return false; \ + }\ + else if (!m##name)\ + {\ + Con::errorf("%s(%s)::_set%s(%i) - Couldn't load sound \"%s\"", macroText(className), getName(), macroText(name),id, _in);\ + return false;\ + }\ + return true;\ + }\ + \ + const StringTableEntry get##name(const U32& id) const\ + {\ + if (m##name##Asset[id] && (m##name##Asset[id]->getSoundPath() != StringTable->EmptyString()))\ + return m##name##Asset[id]->getSoundPath();\ + else if (m##name##AssetId[id] != StringTable->EmptyString())\ + return m##name##AssetId[id];\ + else if (m##name##Name[id] != StringTable->EmptyString())\ + return StringTable->insert(m##name##Name[id]);\ + else\ + return StringTable->EmptyString();\ + }\ + Resource get##name##Resource() \ + {\ + return m##name;\ + } + +#define DECLARE_SOUNDASSET_ARRAY_SETGET(className, name)\ + static bool _set##name##Data(void* obj, const char* index, const char* data)\ + {\ + if(!index) return false;\ + U32 idx = dAtoi(index);\ + if (idx >= sm##name##Count)\ + return false;\ + bool ret = false;\ + className* object = static_cast(obj);\ + ret = object->_set##name(StringTable->insert(data), idx);\ + return ret;\ + } + +#define DECLARE_SOUNDASSET_ARRAY_NET_SETGET(className, name, bitmask)\ + static bool _set##name##Data(void* obj, const char* index, const char* data)\ + {\ + if (!index) return false;\ + U32 idx = dAtoi(index);\ + if (idx >= sm##name##Count)\ + return false;\ + bool ret = false;\ + className* object = static_cast(obj);\ + ret = object->_set##name(StringTable->insert(data, idx));\ + if(ret)\ + object->setMaskBits(bitmask);\ + return ret;\ + } + +#define DEF_SOUNDASSET_ARRAY_BINDS(className,name)\ +DefineEngineMethod(className, get##name, const char*, (S32 index), , "get name")\ +{\ + return object->get##name(index); \ +}\ +DefineEngineMethod(className, get##name##Asset, const char*, (S32 index), , assetText(name, asset reference))\ +{\ + if(index >= className::sm##name##Count || index < 0)\ + return "";\ + return object->m##name##AssetId[index]; \ +}\ +DefineEngineMethod(className, set##name, bool, (const char* map, S32 index), , assetText(name,assignment. first tries asset then flat file.))\ +{\ + return object->_set##name(StringTable->insert(map), index);\ +} + +#define INIT_SOUNDASSET_ARRAY(name, index) \ +{\ + m##name##Name[index] = StringTable->EmptyString(); \ + m##name##AssetId[index] = StringTable->EmptyString(); \ + m##name##Asset[index] = NULL;\ +} + +#ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS + +#define INITPERSISTFIELD_IMAGEASSET_ARRAY(name, arraySize, consoleClass, docs) \ + addProtectedField(#name, TypeImageFilename, Offset(m##name##Name, consoleClass), _set##name##Data, &defaultProtectedGetFn, arraySize, assetDoc(name, docs)); \ + addProtectedField(assetText(name, Asset), TypeImageAssetId, Offset(m##name##AssetId, consoleClass), _set##name##Data, &defaultProtectedGetFn, arraySize, assetDoc(name, asset docs.)); + +#else + +#define INITPERSISTFIELD_SOUNDASSET_ARRAY(name, arraySize, consoleClass, docs) \ + addProtectedField(#name, TypeImageFilename, Offset(m##name##Name, consoleClass), _set##name##Data, &defaultProtectedGetFn, arraySize, assetDoc(name, docs), AbstractClassRep::FIELD_HideInInspectors); \ + addProtectedField(assetText(name, Asset), TypeImageAssetId, Offset(m##name##AssetId, consoleClass), _set##name##Data, &defaultProtectedGetFn, arraySize, assetDoc(name, asset docs.)); + +#endif + +#define CLONE_SOUNDASSET_ARRAY(name, index) \ +{\ + m##name##Name[index] = other.m##name##Name[index];\ + m##name##AssetId[index] = other.m##name##AssetId[index];\ + m##name##Asset[index] = other.m##name##Asset[index];\ +} + +#define LOAD_SOUNDASSET_ARRAY(name, index)\ +if (m##name##AssetId[index] != StringTable->EmptyString())\ +{\ + S32 assetState = SoundAsset::getAssetById(m##name##AssetId[index], &m##name##Asset[index]);\ + if (assetState == SoundAsset::Ok )\ + {\ + m##name##Name[index] = StringTable->EmptyString();\ + }\ + else Con::warnf("Warning: %s::LOAD_IMAGEASSET(%s)-%s", mClassName, m##name##AssetId[index], ImageAsset::getAssetErrstrn(assetState).c_str());\ +} + +#define PACKDATA_SOUNDASSET_ARRAY(name, index)\ + if (stream->writeFlag(m##name##Asset[index].notNull()))\ + {\ + stream->writeString(m##name##Asset[index].getAssetId());\ + }\ + else\ + stream->writeString(m##name##Name[index]); + +#define UNPACKDATA_SOUNDASSET_ARRAY(name, index)\ + if (stream->readFlag())\ + {\ + m##name##AssetId[index] = stream->readSTString();\ + _set##name(m##name##AssetId[index], index);\ + }\ + else\ + m##name##Name[index] = stream->readSTString(); + +#define PACK_SOUNDASSET_ARRAY(netconn, name, index)\ + if (stream->writeFlag(m##name##Asset[index].notNull()))\ + {\ + NetStringHandle assetIdStr = m##name##Asset[index].getAssetId();\ + netconn->packNetStringHandleU(stream, assetIdStr);\ + }\ + else\ + stream->writeString(m##name##Name[index]); + +#define UNPACK_SOUNDASSET_ARRAY(netconn, name, index)\ + if (stream->readFlag())\ + {\ + m##name##AssetId[index] = StringTable->insert(netconn->unpackNetStringHandleU(stream).getString());\ + _set##name(m##name##AssetId[index], index);\ + }\ + else\ + m##name##Name[index] = stream->readSTString(); + +#pragma endregion + #endif // _ASSET_BASE_H_ From 1ea693fea637a065f17446aefc8f3408b7f684d6 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Mon, 20 Sep 2021 10:49:34 +0100 Subject: [PATCH 086/399] SoundAsset Array Few fixes to soundasset array to stop it complaining --- Engine/source/T3D/assets/SoundAsset.cpp | 1 + Engine/source/T3D/assets/SoundAsset.h | 98 ++++++++++++++----------- Engine/source/T3D/fx/lightning.cpp | 29 ++++---- Engine/source/T3D/fx/lightning.h | 13 +++- 4 files changed, 80 insertions(+), 61 deletions(-) diff --git a/Engine/source/T3D/assets/SoundAsset.cpp b/Engine/source/T3D/assets/SoundAsset.cpp index d00c0dbe2..72a3a2526 100644 --- a/Engine/source/T3D/assets/SoundAsset.cpp +++ b/Engine/source/T3D/assets/SoundAsset.cpp @@ -107,6 +107,7 @@ ConsoleSetType(TypeSoundAssetId) //----------------------------------------------------------------------------- SoundAsset::SoundAsset() + : AssetBase() { mSoundFile = StringTable->EmptyString(); mSoundPath = StringTable->EmptyString(); diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index 757d85ab6..adacf2d9b 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -362,43 +362,51 @@ DefineEngineMethod(className, set##name, bool, (const char* shape), , assetText #pragma region Arrayed Asset Macros -#define DECLARE_SOUNDASSET_ARRAY(className, name, max) public: \ - static const U32 sm##name##count = max;\ +#define DECLARE_SOUNDASSET_ARRAY(className,name,max) public: \ + static const U32 sm##name##Count = max;\ Resource m##name[max];\ StringTableEntry m##name##Name[max]; \ StringTableEntry m##name##AssetId[max];\ - AssetPtr m##name##Asset[max] = NULL;\ - SFXProfile* m##name##Profile[max] = NULL;\ + AssetPtr m##name##Asset[max];\ + SFXProfile* m##name##Profile[max];\ public: \ - const StringTableEntry get##name##File(const U32& id) const { return m##name##Name[id]; }\ - void set##name##File(const FileName &_in, const U32& id) { m##name##Name[id] = StringTable->insert(_in.c_str());}\ - const AssetPtr & get##name##Asset(const U32& id) const { return m##name##Asset[id]; }\ - void set##name##Asset(const AssetPtr &_in, const U32& id) { m##name##Asset[id] = _in;}\ + const StringTableEntry get##name##File(const U32& index) const { return m##name##Name[index]; }\ + void set##name##File(const FileName &_in, const U32& index) { m##name##Name[index] = StringTable->insert(_in.c_str());}\ + const AssetPtr & get##name##Asset(const U32& index) const { return m##name##Asset[index]; }\ + void set##name##Asset(const AssetPtr &_in, const U32& index) { m##name##Asset[index] = _in;}\ \ - bool _set##name(StringTableEntry _in, const U32& id)\ + bool _set##name(StringTableEntry _in, const U32& index)\ {\ - if(m##name##AssetId[id] != _in || m##name##Name[id] != _in)\ + if(m##name##AssetId[index] != _in || m##name##Name[index] != _in)\ {\ + if(index >= sm##name##Count || index < 0) \ + return false;\ if (_in == NULL || _in == StringTable->EmptyString())\ {\ - if(id >= sm##name##Count || id < 0) \ - return false;\ - m##name##Name[id] = StringTable->EmptyString();\ - m##name##AssetId[id] = StringTable->EmptyString();\ - m##name##Asset[id] = NULL;\ - m##name[id] = NULL;\ + m##name##Name[index] = StringTable->EmptyString();\ + m##name##AssetId[index] = StringTable->EmptyString();\ + m##name##Asset[index] = NULL;\ + m##name[index] = NULL;\ + return true;\ + }\ + else if(_in[0] == '$' || _in[0] == '#')\ + {\ + m##name##Name[index] = _in;\ + m##name##AssetId[index] = StringTable->EmptyString();\ + m##name##Asset[index] = NULL;\ + m##name[index] = NULL;\ return true;\ }\ \ if (AssetDatabase.isDeclaredAsset(_in))\ {\ - m##name##AssetId[id] = _in;\ + m##name##AssetId[index] = _in;\ \ - U32 assetState = SoundAsset::getAssetById(m##name##AssetId[id], &m##name##Asset[id]);\ + U32 assetState = SoundAsset::getAssetById(m##name##AssetId[index], &m##name##Asset[index]);\ \ if (SoundAsset::Ok == assetState)\ {\ - m##name##Name[id] = StringTable->EmptyString();\ + m##name##Name[index] = StringTable->EmptyString();\ }\ }\ else\ @@ -406,56 +414,58 @@ public: \ StringTableEntry assetId = SoundAsset::getAssetIdByFileName(_in);\ if (assetId != StringTable->EmptyString())\ {\ - m##name##AssetId[id] = assetId;\ - if(SoundAsset::getAssetById(m##name##AssetId, &m##name##Asset) == SoundAsset::Ok)\ + m##name##AssetId[index] = assetId;\ + if(SoundAsset::getAssetById(m##name##AssetId[index], &m##name##Asset[index]) == SoundAsset::Ok)\ {\ - m##name##Name[id] = StringTable->EmptyString();\ + m##name##Name[index] = StringTable->EmptyString();\ }\ }\ else\ {\ - m##name##Name[id] = _in;\ - m##name##AssetId[id] = StringTable->EmptyString();\ - m##name##Asset[id] = NULL;\ + m##name##Name[index] = _in;\ + m##name##AssetId[index] = StringTable->EmptyString();\ + m##name##Asset[index] = NULL;\ }\ }\ }\ - if (get##name(id) != StringTable->EmptyString() && m##name##Asset[id].notNull())\ + if (get##name(index) != StringTable->EmptyString() && m##name##Asset[index].notNull())\ {\ - m##name[id] = m##name##Asset[id]->getSoundResource();\ + m##name[index] = m##name##Asset[index]->getSoundResource();\ }\ else\ {\ - m##name[id] = NULL;\ + m##name[index] = NULL;\ }\ \ - if (m##name##Asset[id].notNull() && m##name##Asset[id]->getStatus() != SoundAsset::Ok)\ + if (m##name##Asset[index].notNull() && m##name##Asset[index]->getStatus() != SoundAsset::Ok)\ {\ - Con::errorf("%s(%s)::_set%s(%i) - sound asset failure\"%s\" due to [%s]", macroText(className), getName(), macroText(name),id, _in, SoundAsset::getAssetErrstrn(m##name##Asset->getStatus()).c_str());\ + Con::errorf("%s(%s)::_set%s(%i) - sound asset failure\"%s\" due to [%s]", macroText(className), getName(), macroText(name),index, _in, SoundAsset::getAssetErrstrn(m##name##Asset[index]->getStatus()).c_str());\ return false; \ }\ - else if (!m##name)\ + else if (!m##name[index])\ {\ - Con::errorf("%s(%s)::_set%s(%i) - Couldn't load sound \"%s\"", macroText(className), getName(), macroText(name),id, _in);\ + Con::errorf("%s(%s)::_set%s(%i) - Couldn't load sound \"%s\"", macroText(className), getName(), macroText(name),index, _in);\ return false;\ }\ return true;\ }\ \ - const StringTableEntry get##name(const U32& id) const\ + const StringTableEntry get##name(const U32& index) const\ {\ - if (m##name##Asset[id] && (m##name##Asset[id]->getSoundPath() != StringTable->EmptyString()))\ - return m##name##Asset[id]->getSoundPath();\ - else if (m##name##AssetId[id] != StringTable->EmptyString())\ - return m##name##AssetId[id];\ - else if (m##name##Name[id] != StringTable->EmptyString())\ - return StringTable->insert(m##name##Name[id]);\ + if (m##name##Asset[index] && (m##name##Asset[index]->getSoundPath() != StringTable->EmptyString()))\ + return m##name##Asset[index]->getSoundPath();\ + else if (m##name##AssetId[index] != StringTable->EmptyString())\ + return m##name##AssetId[index];\ + else if (m##name##Name[index] != StringTable->EmptyString())\ + return StringTable->insert(m##name##Name[index]);\ else\ return StringTable->EmptyString();\ }\ - Resource get##name##Resource() \ + Resource get##name##Resource(const U32& id) \ {\ - return m##name;\ + if(id >= sm##name##Count || id < 0)\ + return ResourceManager::get().load( "" );\ + return m##name[id];\ } #define DECLARE_SOUNDASSET_ARRAY_SETGET(className, name)\ @@ -512,14 +522,14 @@ DefineEngineMethod(className, set##name, bool, (const char* map, S32 index), , a #ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS #define INITPERSISTFIELD_IMAGEASSET_ARRAY(name, arraySize, consoleClass, docs) \ - addProtectedField(#name, TypeImageFilename, Offset(m##name##Name, consoleClass), _set##name##Data, &defaultProtectedGetFn, arraySize, assetDoc(name, docs)); \ + addProtectedField(#name, TypeSoundFilename, Offset(m##name##Name, consoleClass), _set##name##Data, &defaultProtectedGetFn, arraySize, assetDoc(name, docs)); \ addProtectedField(assetText(name, Asset), TypeImageAssetId, Offset(m##name##AssetId, consoleClass), _set##name##Data, &defaultProtectedGetFn, arraySize, assetDoc(name, asset docs.)); #else #define INITPERSISTFIELD_SOUNDASSET_ARRAY(name, arraySize, consoleClass, docs) \ - addProtectedField(#name, TypeImageFilename, Offset(m##name##Name, consoleClass), _set##name##Data, &defaultProtectedGetFn, arraySize, assetDoc(name, docs), AbstractClassRep::FIELD_HideInInspectors); \ - addProtectedField(assetText(name, Asset), TypeImageAssetId, Offset(m##name##AssetId, consoleClass), _set##name##Data, &defaultProtectedGetFn, arraySize, assetDoc(name, asset docs.)); + addProtectedField(#name, TypeSoundFilename, Offset(m##name##Name, consoleClass), _set##name##Data, &defaultProtectedGetFn, arraySize, assetDoc(name, docs), AbstractClassRep::FIELD_HideInInspectors); \ + addProtectedField(assetText(name, Asset), TypeSoundAssetId, Offset(m##name##AssetId, consoleClass), _set##name##Data, &defaultProtectedGetFn, arraySize, assetDoc(name, asset docs.)); #endif diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 20925ec58..efc521319 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -241,7 +241,7 @@ LightningData::LightningData() INIT_SOUNDASSET(StrikeSound); for (S32 i = 0; i < MaxThunders; i++) - thunderSounds[i] = NULL; + INIT_SOUNDASSET_ARRAY(ThunderSound, MaxThunders); for (S32 i = 0; i < MaxTextures; i++) { @@ -263,10 +263,8 @@ void LightningData::initPersistFields() INITPERSISTFIELD_SOUNDASSET(StrikeSound, LightningData, "Sound to play when lightning STRIKES!"); - addField( "thunderSounds", TYPEID< SFXTrack >(), Offset(thunderSounds, LightningData), MaxThunders, - "@brief List of thunder sound effects to play.\n\n" - "A random one of these sounds will be played shortly after each strike " - "occurs." ); + INITPERSISTFIELD_SOUNDASSET_ARRAY(ThunderSound, MaxThunders, LightningData, "Sounds for thunder."); + addField( "strikeTextures", TypeString, Offset(strikeTextureNames, LightningData), MaxTextures, "List of textures to use to render lightning strikes." ); @@ -292,15 +290,18 @@ bool LightningData::preload(bool server, String &errorStr) //dQsort(thunderSounds, MaxThunders, sizeof(SFXTrack*), cmpSounds); for (S32 i = 0; i < MaxThunders; i++) { - if (thunderSounds[i]!= NULL) numThunders++; + if (mThunderSound[i] == NULL) + { + _setThunderSound(getThunderSound(i), i); + } } if (server == false) { String sfxErrorStr; for (U32 i = 0; i < MaxThunders; i++) { - if( !sfxResolve( &thunderSounds[ i ], sfxErrorStr ) ) - Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid packet: %s", sfxErrorStr.c_str()); + if (!getThunderProfile(i)) + Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Cant get an sfxProfile for thunder."); } if(!getSFXProfile()) @@ -330,8 +331,7 @@ void LightningData::packData(BitStream* stream) U32 i; for (i = 0; i < MaxThunders; i++) { - if (stream->writeFlag(thunderSounds[i])) - sfxWrite(stream, thunderSounds[i]); + PACKDATA_SOUNDASSET_ARRAY(ThunderSound, i); } stream->writeInt(mNumStrikeTextures, 4); @@ -349,10 +349,7 @@ void LightningData::unpackData(BitStream* stream) U32 i; for (i = 0; i < MaxThunders; i++) { - if (stream->readFlag()) - sfxRead(stream, &thunderSounds[i]); - else - thunderSounds[i] = NULL; + UNPACKDATA_SOUNDASSET_ARRAY(ThunderSound, i); } mNumStrikeTextures = stream->readInt(4); @@ -585,7 +582,7 @@ void Lightning::scheduleThunder(Strike* newStrike) if (t <= 0.03f) { // If it's really close, just play it... U32 thunder = sgLightningRand.randI(0, mDataBlock->numThunders - 1); - SFX->playOnce(mDataBlock->thunderSounds[thunder]); + SFX->playOnce(mDataBlock->getThunderProfile(thunder)); } else { Thunder* pThunder = new Thunder; pThunder->tRemaining = t; @@ -652,7 +649,7 @@ void Lightning::advanceTime(F32 dt) // Play the sound... U32 thunder = sgLightningRand.randI(0, mDataBlock->numThunders - 1); - SFX->playOnce(mDataBlock->thunderSounds[thunder]); + SFX->playOnce(mDataBlock->getThunderProfile(thunder)); } else { pThunderWalker = &((*pThunderWalker)->next); } diff --git a/Engine/source/T3D/fx/lightning.h b/Engine/source/T3D/fx/lightning.h index 78ef4a20b..1e04bd61d 100644 --- a/Engine/source/T3D/fx/lightning.h +++ b/Engine/source/T3D/fx/lightning.h @@ -63,7 +63,10 @@ class LightningData : public GameBaseData //-------------------------------------- Console set variables public: - SFXTrack* thunderSounds[MaxThunders]; + //SFXTrack* thunderSounds[MaxThunders]; + + DECLARE_SOUNDASSET_ARRAY(LightningData, ThunderSound, MaxThunders); + DECLARE_SOUNDASSET_ARRAY_SETGET(LightningData, ThunderSound); DECLARE_SOUNDASSET(LightningData, StrikeSound); DECLARE_SOUNDASSET_SETGET(LightningData, StrikeSound); @@ -91,6 +94,14 @@ class LightningData : public GameBaseData DECLARE_CONOBJECT(LightningData); static void initPersistFields(); + SFXProfile* getThunderProfile(U32 id) + { + if (mThunderSoundAsset[id] != NULL) + return mThunderSoundAsset[id]->getSfxProfile(); + else + return NULL; + } + SFXProfile* getSFXProfile() { if (mStrikeSoundAsset.notNull()) return mStrikeSoundAsset->getSfxProfile(); From 704eb27600bccb34e4713b787c1470f4a093db08 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Mon, 20 Sep 2021 13:07:50 +0100 Subject: [PATCH 087/399] More Implements -Most Vehicles and FX classes -Vehicle classes may need more preloads for assets. --- Engine/source/T3D/fx/explosion.h | 1 - Engine/source/T3D/fx/lightning.cpp | 2 +- Engine/source/T3D/fx/lightning.h | 1 - Engine/source/T3D/fx/precipitation.h | 1 - Engine/source/T3D/projectile.cpp | 25 +++--- Engine/source/T3D/projectile.h | 10 ++- Engine/source/T3D/rigidShape.cpp | 58 +++++++------ Engine/source/T3D/rigidShape.h | 25 +++++- Engine/source/T3D/vehicles/hoverVehicle.cpp | 43 +++++----- Engine/source/T3D/vehicles/hoverVehicle.h | 10 ++- Engine/source/T3D/vehicles/vehicle.cpp | 86 ++++++++----------- Engine/source/T3D/vehicles/vehicle.h | 26 +++++- Engine/source/T3D/vehicles/wheeledVehicle.cpp | 38 ++++---- Engine/source/T3D/vehicles/wheeledVehicle.h | 12 ++- 14 files changed, 191 insertions(+), 147 deletions(-) diff --git a/Engine/source/T3D/fx/explosion.h b/Engine/source/T3D/fx/explosion.h index ae01c4bee..20eadcd88 100644 --- a/Engine/source/T3D/fx/explosion.h +++ b/Engine/source/T3D/fx/explosion.h @@ -70,7 +70,6 @@ class ExplosionData : public GameBaseData { S32 particleDensity; F32 particleRadius; - //SFXTrack* soundProfile; DECLARE_SOUNDASSET(ExplosionData, Sound); DECLARE_SOUNDASSET_SETGET(ExplosionData, Sound); diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index efc521319..73a63550e 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -290,7 +290,7 @@ bool LightningData::preload(bool server, String &errorStr) //dQsort(thunderSounds, MaxThunders, sizeof(SFXTrack*), cmpSounds); for (S32 i = 0; i < MaxThunders; i++) { - if (mThunderSound[i] == NULL) + if (mThunderSound[i]) { _setThunderSound(getThunderSound(i), i); } diff --git a/Engine/source/T3D/fx/lightning.h b/Engine/source/T3D/fx/lightning.h index 1e04bd61d..7f706d9f8 100644 --- a/Engine/source/T3D/fx/lightning.h +++ b/Engine/source/T3D/fx/lightning.h @@ -63,7 +63,6 @@ class LightningData : public GameBaseData //-------------------------------------- Console set variables public: - //SFXTrack* thunderSounds[MaxThunders]; DECLARE_SOUNDASSET_ARRAY(LightningData, ThunderSound, MaxThunders); DECLARE_SOUNDASSET_ARRAY_SETGET(LightningData, ThunderSound); diff --git a/Engine/source/T3D/fx/precipitation.h b/Engine/source/T3D/fx/precipitation.h index cdef0c2a8..e8114b040 100644 --- a/Engine/source/T3D/fx/precipitation.h +++ b/Engine/source/T3D/fx/precipitation.h @@ -46,7 +46,6 @@ class PrecipitationData : public GameBaseData typedef GameBaseData Parent; public: - //SFXTrack* soundProfile; DECLARE_SOUNDASSET(PrecipitationData, Sound); DECLARE_SOUNDASSET_SETGET(PrecipitationData, Sound); diff --git a/Engine/source/T3D/projectile.cpp b/Engine/source/T3D/projectile.cpp index 739daf4a5..678fde550 100644 --- a/Engine/source/T3D/projectile.cpp +++ b/Engine/source/T3D/projectile.cpp @@ -146,7 +146,7 @@ ProjectileData::ProjectileData() { INIT_SHAPEASSET(ProjectileShape); - sound = NULL; + INIT_SOUNDASSET(ProjectileSound); explosion = NULL; explosionId = 0; @@ -217,7 +217,7 @@ ProjectileData::ProjectileData(const ProjectileData& other, bool temp_clone) : G splashId = other.splashId; // -- for pack/unpack of splash ptr decal = other.decal; decalId = other.decalId; // -- for pack/unpack of decal ptr - sound = other.sound; + CLONE_SOUNDASSET(ProjectileSound); lightDesc = other.lightDesc; lightDescId = other.lightDescId; // -- for pack/unpack of lightDesc ptr CLONE_SHAPEASSET(ProjectileShape);// -- TSShape loads using mProjectileShapeName @@ -252,8 +252,7 @@ void ProjectileData::initPersistFields() "@brief Scale to apply to the projectile's size.\n\n" "@note This is applied after SceneObject::scale\n"); - addField("sound", TypeSFXTrackName, Offset(sound, ProjectileData), - "@brief SFXTrack datablock used to play sounds while in flight.\n\n"); + INITPERSISTFIELD_SOUNDASSET(ProjectileSound, ProjectileData, "The sound for the projectile."); addField("explosion", TYPEID< ExplosionData >(), Offset(explosion, ProjectileData), "@brief Explosion datablock used when the projectile explodes outside of water.\n\n"); @@ -368,9 +367,8 @@ bool ProjectileData::preload(bool server, String &errorStr) if (Sim::findObject(decalId, decal) == false) Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(decal): %d", decalId); - String sfxErrorStr; - if( !sfxResolve( &sound, sfxErrorStr ) ) - Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet: %s", sfxErrorStr.c_str()); + if( !getProjectileSound() ) + Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid asset"); if (!lightDesc && lightDescId != 0) if (Sim::findObject(lightDescId, lightDesc) == false) @@ -436,8 +434,7 @@ void ProjectileData::packData(BitStream* stream) if (stream->writeFlag(decal != NULL)) stream->writeRangedU32(decal->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast); - - sfxWrite( stream, sound ); + PACKDATA_SOUNDASSET(ProjectileSound); if ( stream->writeFlag(lightDesc != NULL)) stream->writeRangedU32(lightDesc->getId(), DataBlockObjectIdFirst, @@ -497,8 +494,8 @@ void ProjectileData::unpackData(BitStream* stream) if (stream->readFlag()) decalId = stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast); - - sfxRead( stream, &sound ); + + UNPACKDATA_SOUNDASSET(ProjectileSound); if (stream->readFlag()) lightDescId = stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast); @@ -882,8 +879,8 @@ bool Projectile::onNewDataBlock( GameBaseData *dptr, bool reload ) SFX_DELETE( mSound ); - if ( mDataBlock->sound ) - mSound = SFX->createSource( mDataBlock->sound ); + if ( mDataBlock->getProjectileSound() ) + mSound = SFX->createSource( mDataBlock->getSFXProfile() ); } return true; @@ -1097,7 +1094,7 @@ void Projectile::explode( const Point3F &p, const Point3F &n, const U32 collideT void Projectile::updateSound() { - if (!mDataBlock->sound) + if (!mDataBlock->getProjectileSound()) return; if ( mSound ) diff --git a/Engine/source/T3D/projectile.h b/Engine/source/T3D/projectile.h index 6209ba531..f340d54a7 100644 --- a/Engine/source/T3D/projectile.h +++ b/Engine/source/T3D/projectile.h @@ -44,6 +44,7 @@ #include "lighting/lightInfo.h" #endif +#include "T3D/assets/SoundAsset.h" #include "T3D/assets/ShapeAsset.h" class ExplosionData; @@ -115,7 +116,14 @@ public: DecalData *decal; // (impact) Decal Datablock S32 decalId; // (impact) Decal ID - SFXTrack* sound; // Projectile Sound + DECLARE_SOUNDASSET(ProjectileData, ProjectileSound); + DECLARE_SOUNDASSET_SETGET(ProjectileData, ProjectileSound); + SFXProfile* getSFXProfile() { + if (mProjectileSoundAsset.notNull()) + return mProjectileSoundAsset->getSfxProfile(); + else + return NULL; + } LightDescription *lightDesc; S32 lightDescId; diff --git a/Engine/source/T3D/rigidShape.cpp b/Engine/source/T3D/rigidShape.cpp index cf26f8ea9..73c8925cf 100644 --- a/Engine/source/T3D/rigidShape.cpp +++ b/Engine/source/T3D/rigidShape.cpp @@ -238,7 +238,7 @@ RigidShapeData::RigidShapeData() density = 4; for (S32 i = 0; i < Body::MaxSounds; i++) - body.sound[i] = 0; + INIT_SOUNDASSET_ARRAY(BodySounds, i); dustEmitter = NULL; dustID = 0; @@ -256,7 +256,8 @@ RigidShapeData::RigidShapeData() hardSplashSoundVel = 3.0; enablePhysicsRep = true; - dMemset(waterSound, 0, sizeof(waterSound)); + for (S32 i = 0; i < Sounds::MaxSounds; i++) + INIT_SOUNDASSET_ARRAY(WaterSounds, i); dragForce = 0; vertFactor = 0.25; @@ -299,7 +300,10 @@ bool RigidShapeData::preload(bool server, String &errorStr) // Resolve objects transmitted from server if (!server) { for (S32 i = 0; i < Body::MaxSounds; i++) - sfxResolve( &body.sound[ i ], errorStr ); + if (mBodySounds[i]) + { + _setBodySounds(getBodySounds(i), i); + } } if( !dustEmitter && dustID != 0 ) @@ -354,8 +358,10 @@ void RigidShapeData::packData(BitStream* stream) stream->write(body.restitution); stream->write(body.friction); - for( U32 i = 0; i < Body::MaxSounds; ++ i ) - sfxWrite( stream, body.sound[ i ] ); + for (U32 i = 0; i < Body::MaxSounds; ++i) + { + PACKDATA_SOUNDASSET_ARRAY(BodySounds, i); + } stream->write(minImpactSpeed); stream->write(softImpactSpeed); @@ -384,8 +390,10 @@ void RigidShapeData::packData(BitStream* stream) stream->write(enablePhysicsRep); // write the water sound profiles - for( U32 i = 0; i < MaxSounds; ++ i ) - sfxWrite( stream, waterSound[ i ] ); + for (U32 i = 0; i < Sounds::MaxSounds; ++i) + { + PACKDATA_SOUNDASSET_ARRAY(WaterSounds, i); + } if (stream->writeFlag( dustEmitter )) stream->writeRangedU32( dustEmitter->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast ); @@ -413,8 +421,10 @@ void RigidShapeData::unpackData(BitStream* stream) stream->read(&body.restitution); stream->read(&body.friction); - for( U32 i = 0; i < Body::MaxSounds; i++) - sfxRead( stream, &body.sound[ i ] ); + for (U32 i = 0; i < Body::Sounds::MaxSounds; i++) + { + UNPACKDATA_SOUNDASSET_ARRAY(BodySounds, i); + } stream->read(&minImpactSpeed); stream->read(&softImpactSpeed); @@ -443,8 +453,10 @@ void RigidShapeData::unpackData(BitStream* stream) stream->read(&enablePhysicsRep); // write the water sound profiles - for( U32 i = 0; i < MaxSounds; ++ i ) - sfxRead( stream, &waterSound[ i ] ); + for (U32 i = 0; i < Sounds::MaxSounds; ++i) + { + UNPACKDATA_SOUNDASSET_ARRAY(WaterSounds, i); + } if( stream->readFlag() ) dustID = (S32) stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast); @@ -516,21 +528,15 @@ void RigidShapeData::initPersistFields() addGroup( "Sounds" ); - addField("softImpactSound", TypeSFXTrackName, Offset(body.sound[Body::SoftImpactSound], RigidShapeData), - "Sound to play when body impacts with at least softImageSpeed but less than hardImpactSpeed." ); - addField("hardImpactSound", TypeSFXTrackName, Offset(body.sound[Body::HardImpactSound], RigidShapeData), - "Sound to play when body impacts with at least hardImpactSpeed." ); + INITPERSISTFIELD_SOUNDASSET_ARRAY(BodySounds, Body::Sounds::MaxSounds, RigidShapeData, "Sounds for body."); addField("exitSplashSoundVelocity", TypeF32, Offset(exitSplashSoundVel, RigidShapeData), "The minimum velocity at which the exit splash sound will be played when emerging from water.\n"); addField("softSplashSoundVelocity", TypeF32, Offset(softSplashSoundVel, RigidShapeData),"The minimum velocity at which the soft splash sound will be played when impacting water.\n"); addField("mediumSplashSoundVelocity", TypeF32, Offset(medSplashSoundVel, RigidShapeData), "The minimum velocity at which the medium splash sound will be played when impacting water.\n"); addField("hardSplashSoundVelocity", TypeF32, Offset(hardSplashSoundVel, RigidShapeData), "The minimum velocity at which the hard splash sound will be played when impacting water.\n"); - addField("exitingWater", TypeSFXTrackName, Offset(waterSound[ExitWater], RigidShapeData), "The AudioProfile will be used to produce sounds when emerging from water.\n"); - addField("impactWaterEasy", TypeSFXTrackName, Offset(waterSound[ImpactSoft], RigidShapeData), "The AudioProfile will be used to produce sounds when a soft impact with water occurs.\n"); - addField("impactWaterMedium", TypeSFXTrackName, Offset(waterSound[ImpactMedium], RigidShapeData), "The AudioProfile will be used to produce sounds when a medium impact with water occurs.\n"); - addField("impactWaterHard", TypeSFXTrackName, Offset(waterSound[ImpactHard], RigidShapeData), "The AudioProfile will be used to produce sounds when a hard impact with water occurs.\n"); - addField("waterWakeSound", TypeSFXTrackName, Offset(waterSound[Wake], RigidShapeData), "The AudioProfile will be used to produce sounds when a water wake is displayed.\n"); + INITPERSISTFIELD_SOUNDASSET_ARRAY(WaterSounds, Sounds::MaxSounds, RigidShapeData, "Sounds for interacting with water."); + endGroup( "Sounds" ); addGroup( "Camera" ); @@ -1155,27 +1161,27 @@ void RigidShape::updatePos(F32 dt) if (collSpeed >= mDataBlock->softImpactSpeed) impactSound = RigidShapeData::Body::SoftImpactSound; - if (impactSound != -1 && mDataBlock->body.sound[impactSound] != NULL) - SFX->playOnce(mDataBlock->body.sound[impactSound], &getTransform()); + if (impactSound != -1 && mDataBlock->getBodySounds(impactSound) != NULL) + SFX->playOnce(mDataBlock->getBodySoundProfile(impactSound), &getTransform()); } // Water volume sounds F32 vSpeed = getVelocity().len(); if (!inLiquid && mWaterCoverage >= 0.8f) { if (vSpeed >= mDataBlock->hardSplashSoundVel) - SFX->playOnce(mDataBlock->waterSound[RigidShapeData::ImpactHard], &getTransform()); + SFX->playOnce(mDataBlock->getWaterSoundProfile(RigidShapeData::ImpactHard), &getTransform()); else if (vSpeed >= mDataBlock->medSplashSoundVel) - SFX->playOnce(mDataBlock->waterSound[RigidShapeData::ImpactMedium], &getTransform()); + SFX->playOnce(mDataBlock->getWaterSoundProfile(RigidShapeData::ImpactMedium), &getTransform()); else if (vSpeed >= mDataBlock->softSplashSoundVel) - SFX->playOnce(mDataBlock->waterSound[RigidShapeData::ImpactSoft], &getTransform()); + SFX->playOnce(mDataBlock->getWaterSoundProfile(RigidShapeData::ImpactSoft), &getTransform()); inLiquid = true; } else if (inLiquid && mWaterCoverage < 0.8f) { if (vSpeed >= mDataBlock->exitSplashSoundVel) - SFX->playOnce(mDataBlock->waterSound[RigidShapeData::ExitWater], &getTransform()); + SFX->playOnce(mDataBlock->getWaterSoundProfile(RigidShapeData::ExitWater), &getTransform()); inLiquid = false; } } diff --git a/Engine/source/T3D/rigidShape.h b/Engine/source/T3D/rigidShape.h index 0389f2a72..5fc6ee786 100644 --- a/Engine/source/T3D/rigidShape.h +++ b/Engine/source/T3D/rigidShape.h @@ -35,6 +35,8 @@ #include "T3D/physics/physicsBody.h" #endif +#include "T3D/assets/SoundAsset.h" + class ParticleEmitter; class ParticleEmitterData; class ClippedPolyList; @@ -57,11 +59,21 @@ class RigidShapeData : public ShapeBaseData HardImpactSound, MaxSounds, }; - SFXTrack* sound[MaxSounds]; F32 restitution; F32 friction; } body; + DECLARE_SOUNDASSET_ARRAY(RigidShapeData, BodySounds, Body::Sounds::MaxSounds) + DECLARE_SOUNDASSET_ARRAY_SETGET(RigidShapeData, BodySounds); + + SFXProfile* getBodySoundProfile(U32 id) + { + if (mBodySoundsAsset[id] != NULL) + return mBodySoundsAsset[id]->getSfxProfile(); + else + return NULL; + } + enum RigidShapeConsts { VC_NUM_DUST_EMITTERS = 1, @@ -79,7 +91,16 @@ class RigidShapeData : public ShapeBaseData Wake, MaxSounds }; - SFXTrack* waterSound[MaxSounds]; + DECLARE_SOUNDASSET_ARRAY(RigidShapeData, WaterSounds, Sounds::MaxSounds) + DECLARE_SOUNDASSET_ARRAY_SETGET(RigidShapeData, WaterSounds); + + SFXProfile* getWaterSoundProfile(U32 id) + { + if (mWaterSoundsAsset[id] != NULL) + return mWaterSoundsAsset[id]->getSfxProfile(); + else + return NULL; + } F32 exitSplashSoundVel; F32 softSplashSoundVel; diff --git a/Engine/source/T3D/vehicles/hoverVehicle.cpp b/Engine/source/T3D/vehicles/hoverVehicle.cpp index ee49b917f..404f54506 100644 --- a/Engine/source/T3D/vehicles/hoverVehicle.cpp +++ b/Engine/source/T3D/vehicles/hoverVehicle.cpp @@ -152,7 +152,7 @@ HoverVehicleData::HoverVehicleData() jetEmitter[j] = 0; for (S32 i = 0; i < MaxSounds; i++) - sound[i] = 0; + INIT_SOUNDASSET_ARRAY(HoverSounds, i); } HoverVehicleData::~HoverVehicleData() @@ -232,14 +232,8 @@ void HoverVehicleData::initPersistFields() addField( "pitchForce", TypeF32, Offset(pitchForce, HoverVehicleData), "Pitch (rotation about the X-axis) force applied when steering in the y-axis direction." ); - addField( "jetSound", TYPEID< SFXProfile >(), Offset(sound[JetSound], HoverVehicleData), - "Looping sound played when the vehicle is jetting." ); - addField( "engineSound", TYPEID< SFXProfile >(), Offset(sound[EngineSound], HoverVehicleData), - "Looping engine sound.\nThe volume is dynamically adjusted based on the " - "current thrust level." ); - addField( "floatSound", TYPEID< SFXProfile >(), Offset(sound[FloatSound], HoverVehicleData), - "Looping sound played while the vehicle is floating.\n\n@see stabMinLen" ); - + INITPERSISTFIELD_SOUNDASSET_ARRAY(HoverSounds, Sounds::MaxSounds, HoverVehicleData, "Sounds for hover vehicle."); + addField( "dustTrailEmitter", TYPEID< ParticleEmitterData >(), Offset(dustTrailEmitter, HoverVehicleData), "Emitter to generate particles for the vehicle's dust trail.\nThe trail " "of dust particles is generated only while the vehicle is moving." ); @@ -312,8 +306,11 @@ bool HoverVehicleData::preload(bool server, String &errorStr) // Resolve objects transmitted from server if (!server) { for (S32 i = 0; i < MaxSounds; i++) - if (sound[i]) - Sim::findObject(SimObjectId((uintptr_t)sound[i]),sound[i]); + if (mHoverSounds[i]) + { + _setHoverSounds(getHoverSounds(i), i); + } + for (S32 j = 0; j < MaxJetEmitters; j++) if (jetEmitter[j]) Sim::findObject(SimObjectId((uintptr_t)jetEmitter[j]),jetEmitter[j]); @@ -361,9 +358,9 @@ void HoverVehicleData::packData(BitStream* stream) stream->write(dustTrailFreqMod); for (S32 i = 0; i < MaxSounds; i++) - if (stream->writeFlag(sound[i])) - stream->writeRangedU32(mPacked ? SimObjectId((uintptr_t)sound[i]): - sound[i]->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast); + { + PACKDATA_SOUNDASSET_ARRAY(HoverSounds, i); + } for (S32 j = 0; j < MaxJetEmitters; j++) { @@ -410,9 +407,9 @@ void HoverVehicleData::unpackData(BitStream* stream) stream->read(&dustTrailFreqMod); for (S32 i = 0; i < MaxSounds; i++) - sound[i] = stream->readFlag()? - (SFXProfile*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst, - DataBlockObjectIdLast): 0; + { + UNPACKDATA_SOUNDASSET_ARRAY(HoverSounds, i); + } for (S32 j = 0; j < MaxJetEmitters; j++) { jetEmitter[j] = NULL; @@ -539,14 +536,14 @@ bool HoverVehicle::onNewDataBlock(GameBaseData* dptr, bool reload) SFX_DELETE( mFloatSound ); SFX_DELETE( mJetSound ); - if ( mDataBlock->sound[HoverVehicleData::EngineSound] ) - mEngineSound = SFX->createSource( mDataBlock->sound[HoverVehicleData::EngineSound], &getTransform() ); + if ( mDataBlock->getHoverSounds(HoverVehicleData::EngineSound) ) + mEngineSound = SFX->createSource( mDataBlock->getHoverSoundProfile(HoverVehicleData::EngineSound), &getTransform() ); - if ( !mDataBlock->sound[HoverVehicleData::FloatSound] ) - mFloatSound = SFX->createSource( mDataBlock->sound[HoverVehicleData::FloatSound], &getTransform() ); + if ( !mDataBlock->getHoverSounds(HoverVehicleData::FloatSound) ) + mFloatSound = SFX->createSource( mDataBlock->getHoverSoundProfile(HoverVehicleData::FloatSound), &getTransform() ); - if ( mDataBlock->sound[HoverVehicleData::JetSound] ) - mJetSound = SFX->createSource( mDataBlock->sound[HoverVehicleData::JetSound], &getTransform() ); + if ( mDataBlock->getHoverSounds(HoverVehicleData::JetSound) ) + mJetSound = SFX->createSource( mDataBlock->getHoverSoundProfile(HoverVehicleData::JetSound), &getTransform() ); } // Todo: Uncomment if this is a "leaf" class diff --git a/Engine/source/T3D/vehicles/hoverVehicle.h b/Engine/source/T3D/vehicles/hoverVehicle.h index 7b44e5987..63ff65977 100644 --- a/Engine/source/T3D/vehicles/hoverVehicle.h +++ b/Engine/source/T3D/vehicles/hoverVehicle.h @@ -46,7 +46,15 @@ class HoverVehicleData : public VehicleData FloatSound, MaxSounds }; - SFXProfile* sound[MaxSounds]; + DECLARE_SOUNDASSET_ARRAY(HoverVehicleData, HoverSounds, Sounds::MaxSounds); + DECLARE_SOUNDASSET_ARRAY_SETGET(HoverVehicleData, HoverSounds); + SFXProfile* getHoverSoundProfile(U32 id) + { + if (mHoverSoundsAsset[id] != NULL) + return mHoverSoundsAsset[id]->getSfxProfile(); + else + return NULL; + } enum Jets { // These enums index into a static name list. diff --git a/Engine/source/T3D/vehicles/vehicle.cpp b/Engine/source/T3D/vehicles/vehicle.cpp index c673cd3b7..3aaac0646 100644 --- a/Engine/source/T3D/vehicles/vehicle.cpp +++ b/Engine/source/T3D/vehicles/vehicle.cpp @@ -166,7 +166,9 @@ VehicleData::VehicleData() powerSteering = false; for (S32 i = 0; i < Body::MaxSounds; i++) - body.sound[i] = 0; + { + INIT_SOUNDASSET_ARRAY(VehicleBodySounds, i); + } dustEmitter = NULL; dustID = 0; @@ -189,7 +191,8 @@ VehicleData::VehicleData() medSplashSoundVel = 2.0; hardSplashSoundVel = 3.0; - dMemset(waterSound, 0, sizeof(waterSound)); + for (S32 i = 0; i < Sounds::MaxSounds; i++) + INIT_SOUNDASSET_ARRAY(VehicleWaterSounds, i); collDamageThresholdVel = 20; collDamageMultiplier = 0.05f; @@ -215,8 +218,10 @@ bool VehicleData::preload(bool server, String &errorStr) // Resolve objects transmitted from server if (!server) { for (S32 i = 0; i < Body::MaxSounds; i++) - if (body.sound[i]) - Sim::findObject(SimObjectId((uintptr_t)body.sound[i]),body.sound[i]); + if (mVehicleBodySounds[i]) + { + _setVehicleBodySounds(getVehicleBodySounds(i), i); + } } if( !dustEmitter && dustID != 0 ) @@ -264,10 +269,9 @@ void VehicleData::packData(BitStream* stream) stream->write(body.restitution); stream->write(body.friction); for (i = 0; i < Body::MaxSounds; i++) - if (stream->writeFlag(body.sound[i])) - stream->writeRangedU32(mPacked ? SimObjectId((uintptr_t)body.sound[i]): - body.sound[i]->getId(),DataBlockObjectIdFirst, - DataBlockObjectIdLast); + { + PACKDATA_SOUNDASSET_ARRAY(VehicleBodySounds, i); + } stream->write(minImpactSpeed); stream->write(softImpactSpeed); @@ -308,9 +312,10 @@ void VehicleData::packData(BitStream* stream) stream->write(enablePhysicsRep); // write the water sound profiles - for(i = 0; i < MaxSounds; i++) - if(stream->writeFlag(waterSound[i])) - stream->writeRangedU32(waterSound[i]->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast); + for (i = 0; i < MaxSounds; i++) + { + PACKDATA_SOUNDASSET_ARRAY(VehicleWaterSounds, i); + } if (stream->writeFlag( dustEmitter )) { @@ -359,11 +364,9 @@ void VehicleData::unpackData(BitStream* stream) stream->read(&body.restitution); stream->read(&body.friction); S32 i; - for (i = 0; i < Body::MaxSounds; i++) { - body.sound[i] = NULL; - if (stream->readFlag()) - body.sound[i] = (SFXProfile*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst, - DataBlockObjectIdLast); + for (i = 0; i < Body::MaxSounds; i++) + { + UNPACKDATA_SOUNDASSET_ARRAY(VehicleBodySounds, i); } stream->read(&minImpactSpeed); @@ -405,12 +408,10 @@ void VehicleData::unpackData(BitStream* stream) stream->read(&enablePhysicsRep); // write the water sound profiles - for(i = 0; i < MaxSounds; i++) - if(stream->readFlag()) - { - U32 id = stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast); - waterSound[i] = dynamic_cast( Sim::findObject(id) ); - } + for (i = 0; i < Sounds::MaxSounds; i++) + { + UNPACKDATA_SOUNDASSET_ARRAY(VehicleWaterSounds, i); + } if( stream->readFlag() ) { @@ -491,15 +492,8 @@ void VehicleData::initPersistFields() addField( "bodyFriction", TypeF32, Offset(body.friction, VehicleData), "Collision friction coefficient.\nHow well this object will slide against " "objects it collides with." ); - addField( "softImpactSound", TYPEID< SFXProfile >(), Offset(body.sound[Body::SoftImpactSound], VehicleData), - "@brief Sound to play on a 'soft' impact.\n\n" - "This sound is played if the impact speed is < hardImpactSpeed and >= " - "softImpactSpeed.\n\n" - "@see softImpactSpeed" ); - addField( "hardImpactSound", TYPEID< SFXProfile >(), Offset(body.sound[Body::HardImpactSound], VehicleData), - "@brief Sound to play on a 'hard' impact.\n\n" - "This sound is played if the impact speed >= hardImpactSpeed.\n\n" - "@see hardImpactSpeed" ); + + INITPERSISTFIELD_SOUNDASSET_ARRAY(VehicleBodySounds, Body::Sounds::MaxSounds, VehicleData, "Sounds for vehicle body impacts."); addField( "minImpactSpeed", TypeF32, Offset(minImpactSpeed, VehicleData), "Minimum collision speed for the onImpact callback to be invoked." ); @@ -596,18 +590,8 @@ void VehicleData::initPersistFields() addField( "hardSplashSoundVelocity", TypeF32, Offset(hardSplashSoundVel, VehicleData), "Minimum velocity when entering the water for the imapactWaterHard sound " "to play.\n\n@see impactWaterHard" ); - addField( "exitingWater", TYPEID< SFXProfile >(), Offset(waterSound[ExitWater], VehicleData), - "Sound to play when exiting the water." ); - addField( "impactWaterEasy", TYPEID< SFXProfile >(), Offset(waterSound[ImpactSoft], VehicleData), - "Sound to play when entering the water with speed >= softSplashSoundVelocity " - "and < mediumSplashSoundVelocity." ); - addField( "impactWaterMedium", TYPEID< SFXProfile >(), Offset(waterSound[ImpactMedium], VehicleData), - "Sound to play when entering the water with speed >= mediumSplashSoundVelocity " - "and < hardSplashSoundVelocity." ); - addField( "impactWaterHard", TYPEID< SFXProfile >(), Offset(waterSound[ImpactHard], VehicleData), - "Sound to play when entering the water with speed >= hardSplashSoundVelocity." ); - addField( "waterWakeSound", TYPEID< SFXProfile >(), Offset(waterSound[Wake], VehicleData), - "Looping sound to play while moving through the water." ); + + INITPERSISTFIELD_SOUNDASSET_ARRAY(WaterSounds, Sounds::MaxSounds, VehicleData, "Sounds for interacting with water."); addField( "collDamageThresholdVel", TypeF32, Offset(collDamageThresholdVel, VehicleData), "Minimum collision velocity to cause damage to this vehicle.\nCurrently unused." ); @@ -876,8 +860,8 @@ bool Vehicle::onNewDataBlock(GameBaseData* dptr,bool reload) // costs and makes the system easier to understand. SFX_DELETE( mWakeSound ); - if ( mDataBlock->waterSound[VehicleData::Wake] ) - mWakeSound = SFX->createSource( mDataBlock->waterSound[VehicleData::Wake], &getTransform() ); + if ( mDataBlock->getVehicleWaterSounds(VehicleData::Wake) != NULL ) + mWakeSound = SFX->createSource( mDataBlock->getVehicleWaterSoundProfile(VehicleData::Wake), &getTransform() ); } return true; @@ -1140,27 +1124,27 @@ void Vehicle::updatePos(F32 dt) if (collSpeed >= mDataBlock->softImpactSpeed) impactSound = VehicleData::Body::SoftImpactSound; - if (impactSound != -1 && mDataBlock->body.sound[impactSound] != NULL) - SFX->playOnce( mDataBlock->body.sound[impactSound], &getTransform() ); + if (impactSound != -1 && mDataBlock->getVehicleBodySounds(impactSound) != NULL) + SFX->playOnce( mDataBlock->getVehicleBodySoundProfile(impactSound), &getTransform() ); } // Water volume sounds F32 vSpeed = getVelocity().len(); if (!inLiquid && mWaterCoverage >= 0.8f) { if (vSpeed >= mDataBlock->hardSplashSoundVel) - SFX->playOnce( mDataBlock->waterSound[VehicleData::ImpactHard], &getTransform() ); + SFX->playOnce( mDataBlock->getVehicleWaterSoundProfile(VehicleData::ImpactHard), &getTransform() ); else if (vSpeed >= mDataBlock->medSplashSoundVel) - SFX->playOnce( mDataBlock->waterSound[VehicleData::ImpactMedium], &getTransform() ); + SFX->playOnce( mDataBlock->getVehicleWaterSoundProfile(VehicleData::ImpactMedium), &getTransform() ); else if (vSpeed >= mDataBlock->softSplashSoundVel) - SFX->playOnce( mDataBlock->waterSound[VehicleData::ImpactSoft], &getTransform() ); + SFX->playOnce( mDataBlock->getVehicleWaterSoundProfile(VehicleData::ImpactSoft), &getTransform() ); inLiquid = true; } else if(inLiquid && mWaterCoverage < 0.8f) { if (vSpeed >= mDataBlock->exitSplashSoundVel) - SFX->playOnce( mDataBlock->waterSound[VehicleData::ExitWater], &getTransform() ); + SFX->playOnce( mDataBlock->getVehicleWaterSoundProfile(VehicleData::ExitWater), &getTransform() ); inLiquid = false; } } diff --git a/Engine/source/T3D/vehicles/vehicle.h b/Engine/source/T3D/vehicles/vehicle.h index 585f81b90..1c26f6cba 100644 --- a/Engine/source/T3D/vehicles/vehicle.h +++ b/Engine/source/T3D/vehicles/vehicle.h @@ -45,11 +45,22 @@ struct VehicleData : public RigidShapeData HardImpactSound, MaxSounds, }; - SFXProfile* sound[MaxSounds]; F32 restitution; F32 friction; } body; + DECLARE_SOUNDASSET_ARRAY(VehicleData, VehicleBodySounds, Body::Sounds::MaxSounds) + DECLARE_SOUNDASSET_ARRAY_SETGET(VehicleData, VehicleBodySounds); + + SFXProfile* getVehicleBodySoundProfile(U32 id) + { + if (mVehicleBodySoundsAsset[id] != NULL) + return mVehicleBodySoundsAsset[id]->getSfxProfile(); + else + return NULL; + } + + enum VehicleConsts { VC_NUM_DUST_EMITTERS = 1, @@ -69,7 +80,18 @@ struct VehicleData : public RigidShapeData Wake, MaxSounds }; - SFXProfile* waterSound[MaxSounds]; + + DECLARE_SOUNDASSET_ARRAY(VehicleData, VehicleWaterSounds, Sounds::MaxSounds) + DECLARE_SOUNDASSET_ARRAY_SETGET(VehicleData, VehicleWaterSounds); + + SFXProfile* getVehicleWaterSoundProfile(U32 id) + { + if (mVehicleWaterSoundsAsset[id] != NULL) + return mVehicleWaterSoundsAsset[id]->getSfxProfile(); + else + return NULL; + } + F32 exitSplashSoundVel; F32 softSplashSoundVel; F32 medSplashSoundVel; diff --git a/Engine/source/T3D/vehicles/wheeledVehicle.cpp b/Engine/source/T3D/vehicles/wheeledVehicle.cpp index 36a355cdb..3fbde4af7 100644 --- a/Engine/source/T3D/vehicles/wheeledVehicle.cpp +++ b/Engine/source/T3D/vehicles/wheeledVehicle.cpp @@ -301,7 +301,7 @@ WheeledVehicleData::WheeledVehicleData() wheelCount = 0; dMemset(&wheel, 0, sizeof(wheel)); for (S32 i = 0; i < MaxSounds; i++) - sound[i] = 0; + INIT_SOUNDASSET_ARRAY(WheeledVehicleSounds, i); } @@ -335,10 +335,9 @@ bool WheeledVehicleData::preload(bool server, String &errorStr) if (!server) { for (S32 i = 0; i < MaxSounds; i++) { - if (!sfxResolve(&sound[i], errorStr)) + if (mWheeledVehicleSounds[i]) { - delete si; - return false; + _setWheeledVehicleSounds(getWheeledVehicleSounds(i), i); } } @@ -438,16 +437,7 @@ bool WheeledVehicleData::mirrorWheel(Wheel* we) void WheeledVehicleData::initPersistFields() { - addField( "jetSound", TYPEID< SFXTrack >(), Offset(sound[JetSound], WheeledVehicleData), - "Looping sound played when the vehicle is jetting." ); - addField( "engineSound", TYPEID< SFXTrack >(), Offset(sound[EngineSound], WheeledVehicleData), - "@brief Looping engine sound.\n\n" - "The pitch is dynamically adjusted based on the current engine RPM" ); - addField("squealSound", TYPEID< SFXTrack >(), Offset(sound[SquealSound], WheeledVehicleData), - "@brief Looping sound played while any of the wheels is slipping.\n\n" - "The volume is dynamically adjusted based on how much the wheels are slipping." ); - addField("WheelImpactSound", TYPEID< SFXTrack >(), Offset(sound[WheelImpactSound], WheeledVehicleData), - "Sound played when the wheels impact the ground.\nCurrently unused." ); + INITPERSISTFIELD_SOUNDASSET_ARRAY(WheeledVehicleSounds, Sounds::MaxSounds, WheeledVehicleData, "Sounds related to wheeled vehicle."); addField("tireEmitter",TYPEID< ParticleEmitterData >(), Offset(tireEmitter, WheeledVehicleData), "ParticleEmitterData datablock used to generate particles from each wheel " @@ -481,7 +471,9 @@ void WheeledVehicleData::packData(BitStream* stream) tireEmitter->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast); for (S32 i = 0; i < MaxSounds; i++) - sfxWrite( stream, sound[ i ] ); + { + PACKDATA_SOUNDASSET_ARRAY(WheeledVehicleSounds, i); + } stream->write(maxWheelSpeed); stream->write(engineTorque); @@ -498,7 +490,9 @@ void WheeledVehicleData::unpackData(BitStream* stream) DataBlockObjectIdLast): 0; for (S32 i = 0; i < MaxSounds; i++) - sfxRead( stream, &sound[ i ] ); + { + UNPACKDATA_SOUNDASSET_ARRAY(WheeledVehicleSounds, i); + } stream->read(&maxWheelSpeed); stream->read(&engineTorque); @@ -683,14 +677,14 @@ bool WheeledVehicle::onNewDataBlock(GameBaseData* dptr, bool reload) SFX_DELETE( mSquealSound ); SFX_DELETE( mJetSound ); - if ( mDataBlock->sound[WheeledVehicleData::EngineSound] ) - mEngineSound = SFX->createSource( mDataBlock->sound[WheeledVehicleData::EngineSound], &getTransform() ); + if ( mDataBlock->getWheeledVehicleSounds(WheeledVehicleData::EngineSound) ) + mEngineSound = SFX->createSource( mDataBlock->getWheeledVehicleSound(WheeledVehicleData::EngineSound), &getTransform() ); - if ( mDataBlock->sound[WheeledVehicleData::SquealSound] ) - mSquealSound = SFX->createSource( mDataBlock->sound[WheeledVehicleData::SquealSound], &getTransform() ); + if ( mDataBlock->getWheeledVehicleSounds(WheeledVehicleData::SquealSound) ) + mSquealSound = SFX->createSource( mDataBlock->getWheeledVehicleSound(WheeledVehicleData::SquealSound), &getTransform() ); - if ( mDataBlock->sound[WheeledVehicleData::JetSound] ) - mJetSound = SFX->createSource( mDataBlock->sound[WheeledVehicleData::JetSound], &getTransform() ); + if ( mDataBlock->getWheeledVehicleSounds(WheeledVehicleData::JetSound) ) + mJetSound = SFX->createSource( mDataBlock->getWheeledVehicleSound(WheeledVehicleData::JetSound), &getTransform() ); } scriptOnNewDataBlock(); diff --git a/Engine/source/T3D/vehicles/wheeledVehicle.h b/Engine/source/T3D/vehicles/wheeledVehicle.h index b096670ca..f5fe52fef 100644 --- a/Engine/source/T3D/vehicles/wheeledVehicle.h +++ b/Engine/source/T3D/vehicles/wheeledVehicle.h @@ -118,7 +118,17 @@ struct WheeledVehicleData: public VehicleData WheelImpactSound, MaxSounds, }; - SFXTrack* sound[MaxSounds]; + DECLARE_SOUNDASSET_ARRAY(WheeledVehicleData, WheeledVehicleSounds, Sounds::MaxSounds); + DECLARE_SOUNDASSET_ARRAY_SETGET(WheeledVehicleData, WheeledVehicleSounds); + + SFXProfile* getWheeledVehicleSound(U32 id) + { + if (mWheeledVehicleSoundsAsset[id] != NULL) + return mWheeledVehicleSoundsAsset[id]->getSfxProfile(); + else + return NULL; + } + ParticleEmitterData* tireEmitter; From 30b57c0f95c91f2f576b8dcf3933c1c0d3b28329 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Mon, 20 Sep 2021 14:17:10 +0100 Subject: [PATCH 088/399] More turns -Flying Vehicle -Proximinity Mine --- Engine/source/T3D/proximityMine.cpp | 42 ++++++++++---------- Engine/source/T3D/proximityMine.h | 8 +++- Engine/source/T3D/vehicles/flyingVehicle.cpp | 36 +++++++---------- Engine/source/T3D/vehicles/flyingVehicle.h | 10 ++++- 4 files changed, 50 insertions(+), 46 deletions(-) diff --git a/Engine/source/T3D/proximityMine.cpp b/Engine/source/T3D/proximityMine.cpp index 2102ef7e1..12eb60a1a 100644 --- a/Engine/source/T3D/proximityMine.cpp +++ b/Engine/source/T3D/proximityMine.cpp @@ -74,16 +74,16 @@ IMPLEMENT_CALLBACK( ProximityMineData, onExplode, void, ( ProximityMine* obj, Po ProximityMineData::ProximityMineData() : armingDelay( 0 ), armingSequence( -1 ), - armingSound( NULL ), triggerRadius( 5.0f ), triggerSpeed( 1.0f ), autoTriggerDelay( 0 ), triggerOnOwner( false ), triggerDelay( 0 ), triggerSequence( -1 ), - triggerSound( NULL ), explosionOffset( 0.05f ) { + INIT_SOUNDASSET(ArmSound); + INIT_SOUNDASSET(TriggerSound); } void ProximityMineData::initPersistFields() @@ -91,9 +91,9 @@ void ProximityMineData::initPersistFields() addGroup( "Arming" ); addField( "armingDelay", TypeF32, Offset(armingDelay, ProximityMineData), "Delay (in seconds) from when the mine is placed to when it becomes active." ); - addField( "armingSound", TypeSFXTrackName, Offset(armingSound, ProximityMineData), - "Sound to play when the mine is armed (starts at the same time as " - "the armed sequence if defined)." ); + + INITPERSISTFIELD_SOUNDASSET(ArmSound, ProximityMineData, "Arming sound for this proximity mine."); + endGroup( "Arming" ); addGroup( "Triggering" ); @@ -111,9 +111,9 @@ void ProximityMineData::initPersistFields() "Speed above which moving objects within the trigger radius will trigger the mine" ); addField( "triggerDelay", TypeF32, Offset(triggerDelay, ProximityMineData), "Delay (in seconds) from when the mine is triggered until it explodes." ); - addField( "triggerSound", TypeSFXTrackName, Offset(triggerSound, ProximityMineData), - "Sound to play when the mine is triggered (starts at the same time as " - "the triggered sequence if defined)." ); + + INITPERSISTFIELD_SOUNDASSET(TriggerSound, ProximityMineData, "Arming sound for this proximity mine."); + endGroup( "Triggering" ); addGroup( "Explosion" ); @@ -135,12 +135,10 @@ bool ProximityMineData::preload( bool server, String& errorStr ) if ( !server ) { - // Resolve sounds - String sfxErrorStr; - if( !sfxResolve( &armingSound, sfxErrorStr ) ) - Con::errorf( ConsoleLogEntry::General, "ProximityMineData::preload: Invalid packet: %s", sfxErrorStr.c_str() ); - if( !sfxResolve( &triggerSound, sfxErrorStr ) ) - Con::errorf( ConsoleLogEntry::General, "ProximityMineData::preload: Invalid packet: %s", sfxErrorStr.c_str() ); + if( !getArmSound() ) + Con::errorf( ConsoleLogEntry::General, "ProximityMineData::preload: Invalid arming sound." ); + if( !getTriggerSound() ) + Con::errorf( ConsoleLogEntry::General, "ProximityMineData::preload: Invalid trigger sound." ); } if ( mShape ) @@ -158,14 +156,14 @@ void ProximityMineData::packData( BitStream* stream ) Parent::packData( stream ); stream->write( armingDelay ); - sfxWrite( stream, armingSound ); + PACKDATA_SOUNDASSET(ArmSound); stream->write( autoTriggerDelay ); stream->writeFlag( triggerOnOwner ); stream->write( triggerRadius ); stream->write( triggerSpeed ); stream->write( triggerDelay ); - sfxWrite( stream, triggerSound ); + PACKDATA_SOUNDASSET(TriggerSound); } void ProximityMineData::unpackData( BitStream* stream ) @@ -173,14 +171,14 @@ void ProximityMineData::unpackData( BitStream* stream ) Parent::unpackData(stream); stream->read( &armingDelay ); - sfxRead( stream, &armingSound ); + UNPACKDATA_SOUNDASSET(ArmSound); stream->read( &autoTriggerDelay ); triggerOnOwner = stream->readFlag(); stream->read( &triggerRadius ); stream->read( &triggerSpeed ); stream->read( &triggerDelay ); - sfxRead( stream, &triggerSound ); + UNPACKDATA_SOUNDASSET(TriggerSound); } //---------------------------------------------------------------------------- @@ -428,8 +426,8 @@ void ProximityMine::processTick( const Move* move ) mAnimThread = mShapeInstance->addThread(); mShapeInstance->setSequence( mAnimThread, mDataBlock->armingSequence, 0.0f ); } - if ( mDataBlock->armingSound ) - SFX->playOnce( mDataBlock->armingSound, &getRenderTransform() ); + if ( mDataBlock->getArmSound() ) + SFX->playOnce( mDataBlock->getArmSoundAsset()->getSfxProfile(), &getRenderTransform() ); } break; @@ -469,8 +467,8 @@ void ProximityMine::processTick( const Move* move ) mAnimThread = mShapeInstance->addThread(); mShapeInstance->setSequence( mAnimThread, mDataBlock->triggerSequence, 0.0f ); } - if ( mDataBlock->triggerSound ) - SFX->playOnce( mDataBlock->triggerSound, &getRenderTransform() ); + if ( mDataBlock->getTriggerSound() ) + SFX->playOnce( mDataBlock->getTriggerSoundAsset()->getSfxProfile(), &getRenderTransform() ); if ( isServerObject() ) mDataBlock->onTriggered_callback( this, sql.mList[0] ); diff --git a/Engine/source/T3D/proximityMine.h b/Engine/source/T3D/proximityMine.h index 7b448e628..4736c0e16 100644 --- a/Engine/source/T3D/proximityMine.h +++ b/Engine/source/T3D/proximityMine.h @@ -27,6 +27,8 @@ #include "T3D/item.h" #endif +#include "T3D/assets/SoundAsset.h" + class ExplosionData; class SFXTrack; class ProximityMine; @@ -43,7 +45,8 @@ struct ProximityMineData: public ItemData public: F32 armingDelay; S32 armingSequence; - SFXTrack* armingSound; + DECLARE_SOUNDASSET(ProximityMineData, ArmSound); + DECLARE_SOUNDASSET_SETGET(ProximityMineData, ArmSound); F32 autoTriggerDelay; bool triggerOnOwner; @@ -51,7 +54,8 @@ public: F32 triggerSpeed; F32 triggerDelay; S32 triggerSequence; - SFXTrack* triggerSound; + DECLARE_SOUNDASSET(ProximityMineData, TriggerSound); + DECLARE_SOUNDASSET_SETGET(ProximityMineData, TriggerSound); F32 explosionOffset; diff --git a/Engine/source/T3D/vehicles/flyingVehicle.cpp b/Engine/source/T3D/vehicles/flyingVehicle.cpp index e092668d8..64ec41fd6 100644 --- a/Engine/source/T3D/vehicles/flyingVehicle.cpp +++ b/Engine/source/T3D/vehicles/flyingVehicle.cpp @@ -116,7 +116,7 @@ FlyingVehicleData::FlyingVehicleData() jetEmitter[j] = 0; for (S32 i = 0; i < MaxSounds; i++) - sound[i] = 0; + INIT_SOUNDASSET_ARRAY(FlyingSounds, i); vertThrustMultiple = 1.0; } @@ -131,8 +131,10 @@ bool FlyingVehicleData::preload(bool server, String &errorStr) // Resolve objects transmitted from server if (!server) { for (S32 i = 0; i < MaxSounds; i++) - if (sound[i]) - Sim::findObject(SimObjectId((uintptr_t)sound[i]),sound[i]); + if (mFlyingSounds[i]) + { + _setFlyingSounds(getFlyingSounds(i), i); + } for (S32 j = 0; j < MaxJetEmitters; j++) if (jetEmitter[j]) @@ -163,10 +165,8 @@ bool FlyingVehicleData::preload(bool server, String &errorStr) void FlyingVehicleData::initPersistFields() { - addField( "jetSound", TYPEID< SFXProfile >(), Offset(sound[JetSound], FlyingVehicleData), - "Looping sound to play while the vehicle is jetting." ); - addField( "engineSound", TYPEID< SFXProfile >(), Offset(sound[EngineSound], FlyingVehicleData), - "Looping engine sound." ); + + INITPERSISTFIELD_SOUNDASSET_ARRAY(FlyingSounds, Sounds::MaxSounds, FlyingVehicleData, "Sounds for flying vehicle"); addField( "maneuveringForce", TypeF32, Offset(maneuveringForce, FlyingVehicleData), "@brief Maximum X and Y (horizontal plane) maneuvering force.\n\n" @@ -240,11 +240,7 @@ void FlyingVehicleData::packData(BitStream* stream) for (S32 i = 0; i < MaxSounds; i++) { - if (stream->writeFlag(sound[i])) - { - SimObjectId writtenId = mPacked ? SimObjectId((uintptr_t)sound[i]) : sound[i]->getId(); - stream->writeRangedU32(writtenId, DataBlockObjectIdFirst, DataBlockObjectIdLast); - } + PACKDATA_SOUNDASSET_ARRAY(FlyingSounds, i); } for (S32 j = 0; j < MaxJetEmitters; j++) @@ -277,11 +273,9 @@ void FlyingVehicleData::unpackData(BitStream* stream) { Parent::unpackData(stream); - for (S32 i = 0; i < MaxSounds; i++) { - sound[i] = NULL; - if (stream->readFlag()) - sound[i] = (SFXProfile*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst, - DataBlockObjectIdLast); + for (S32 i = 0; i < MaxSounds; i++) + { + UNPACKDATA_SOUNDASSET_ARRAY(FlyingSounds, i); } for (S32 j = 0; j < MaxJetEmitters; j++) { @@ -374,11 +368,11 @@ bool FlyingVehicle::onNewDataBlock(GameBaseData* dptr, bool reload) SFX_DELETE( mJetSound ); SFX_DELETE( mEngineSound ); - if ( mDataBlock->sound[FlyingVehicleData::EngineSound] ) - mEngineSound = SFX->createSource( mDataBlock->sound[FlyingVehicleData::EngineSound], &getTransform() ); + if ( mDataBlock->getFlyingSounds(FlyingVehicleData::EngineSound) ) + mEngineSound = SFX->createSource( mDataBlock->getFlyingSoundProfile(FlyingVehicleData::EngineSound), &getTransform() ); - if ( mDataBlock->sound[FlyingVehicleData::JetSound] ) - mJetSound = SFX->createSource( mDataBlock->sound[FlyingVehicleData::JetSound], &getTransform() ); + if ( mDataBlock->getFlyingSounds(FlyingVehicleData::JetSound)) + mJetSound = SFX->createSource( mDataBlock->getFlyingSoundProfile(FlyingVehicleData::JetSound), &getTransform() ); } // Jet Sequences diff --git a/Engine/source/T3D/vehicles/flyingVehicle.h b/Engine/source/T3D/vehicles/flyingVehicle.h index 814b66250..18c3379e1 100644 --- a/Engine/source/T3D/vehicles/flyingVehicle.h +++ b/Engine/source/T3D/vehicles/flyingVehicle.h @@ -45,7 +45,15 @@ struct FlyingVehicleData: public VehicleData { EngineSound, MaxSounds, }; - SFXProfile* sound[MaxSounds]; + DECLARE_SOUNDASSET_ARRAY(FlyingVehicleData, FlyingSounds, Sounds::MaxSounds); + DECLARE_SOUNDASSET_ARRAY_SETGET(FlyingVehicleData, FlyingSounds); + SFXProfile* getFlyingSoundProfile(U32 id) + { + if (mFlyingSoundsAsset[id] != NULL) + return mFlyingSoundsAsset[id]->getSfxProfile(); + else + return NULL; + } enum Jets { // These enums index into a static name list. From e9d0f68b55a08e8036c1f858265ed3eb88891714 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Mon, 20 Sep 2021 17:05:11 +0100 Subject: [PATCH 089/399] Preload all soundAsset -Fixed: Preloads need to preload all soundAssets not just the ones it was preloading before. --- Engine/source/T3D/fx/lightning.cpp | 26 ++++++++++---------- Engine/source/T3D/rigidShape.cpp | 11 +++++++++ Engine/source/T3D/vehicles/flyingVehicle.cpp | 3 ++- Engine/source/T3D/vehicles/hoverVehicle.cpp | 1 + Engine/source/T3D/vehicles/vehicle.cpp | 10 ++++++++ 5 files changed, 37 insertions(+), 14 deletions(-) diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 73a63550e..7586602d4 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -289,18 +289,18 @@ bool LightningData::preload(bool server, String &errorStr) //dQsort(thunderSounds, MaxThunders, sizeof(SFXTrack*), cmpSounds); - for (S32 i = 0; i < MaxThunders; i++) { - if (mThunderSound[i]) - { - _setThunderSound(getThunderSound(i), i); - } - } - + if (server == false) { - String sfxErrorStr; - for (U32 i = 0; i < MaxThunders; i++) { - if (!getThunderProfile(i)) + for (S32 i = 0; i < MaxThunders; i++) { + if (mThunderSound[i]) + { + _setThunderSound(getThunderSound(i), i); + } + } + + for (U32 j = 0; j < MaxThunders; j++) { + if (!getThunderProfile(j)) Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Cant get an sfxProfile for thunder."); } @@ -308,11 +308,11 @@ bool LightningData::preload(bool server, String &errorStr) Con::errorf(ConsoleLogEntry::General, "LightningData::preload: can't get sfxProfile from asset"); mNumStrikeTextures = 0; - for (U32 i = 0; i < MaxTextures; i++) + for (U32 k = 0; k < MaxTextures; k++) { - if (strikeTextureNames[i][0]) + if (strikeTextureNames[k][0]) { - strikeTextures[i] = GFXTexHandle(strikeTextureNames[i], &GFXStaticTextureProfile, avar("%s() - strikeTextures[%d] (line %d)", __FUNCTION__, i, __LINE__)); + strikeTextures[k] = GFXTexHandle(strikeTextureNames[i], &GFXStaticTextureProfile, avar("%s() - strikeTextures[%d] (line %d)", __FUNCTION__, k, __LINE__)); mNumStrikeTextures++; } } diff --git a/Engine/source/T3D/rigidShape.cpp b/Engine/source/T3D/rigidShape.cpp index 73c8925cf..475854bbb 100644 --- a/Engine/source/T3D/rigidShape.cpp +++ b/Engine/source/T3D/rigidShape.cpp @@ -300,10 +300,21 @@ bool RigidShapeData::preload(bool server, String &errorStr) // Resolve objects transmitted from server if (!server) { for (S32 i = 0; i < Body::MaxSounds; i++) + { if (mBodySounds[i]) { _setBodySounds(getBodySounds(i), i); } + } + + for (S32 j = 0; j < Sounds::MaxSounds; j++) + { + if (mWaterSounds[j]) + { + _setWaterSounds(getWaterSounds(j), j); + } + } + } if( !dustEmitter && dustID != 0 ) diff --git a/Engine/source/T3D/vehicles/flyingVehicle.cpp b/Engine/source/T3D/vehicles/flyingVehicle.cpp index 64ec41fd6..dcc1f8dd2 100644 --- a/Engine/source/T3D/vehicles/flyingVehicle.cpp +++ b/Engine/source/T3D/vehicles/flyingVehicle.cpp @@ -131,11 +131,12 @@ bool FlyingVehicleData::preload(bool server, String &errorStr) // Resolve objects transmitted from server if (!server) { for (S32 i = 0; i < MaxSounds; i++) + { if (mFlyingSounds[i]) { _setFlyingSounds(getFlyingSounds(i), i); } - + } for (S32 j = 0; j < MaxJetEmitters; j++) if (jetEmitter[j]) Sim::findObject(SimObjectId((uintptr_t)jetEmitter[j]),jetEmitter[j]); diff --git a/Engine/source/T3D/vehicles/hoverVehicle.cpp b/Engine/source/T3D/vehicles/hoverVehicle.cpp index 404f54506..0cddc2c72 100644 --- a/Engine/source/T3D/vehicles/hoverVehicle.cpp +++ b/Engine/source/T3D/vehicles/hoverVehicle.cpp @@ -305,6 +305,7 @@ bool HoverVehicleData::preload(bool server, String &errorStr) // Resolve objects transmitted from server if (!server) { + for (S32 i = 0; i < MaxSounds; i++) if (mHoverSounds[i]) { diff --git a/Engine/source/T3D/vehicles/vehicle.cpp b/Engine/source/T3D/vehicles/vehicle.cpp index 3aaac0646..b773dd58f 100644 --- a/Engine/source/T3D/vehicles/vehicle.cpp +++ b/Engine/source/T3D/vehicles/vehicle.cpp @@ -218,10 +218,20 @@ bool VehicleData::preload(bool server, String &errorStr) // Resolve objects transmitted from server if (!server) { for (S32 i = 0; i < Body::MaxSounds; i++) + { if (mVehicleBodySounds[i]) { _setVehicleBodySounds(getVehicleBodySounds(i), i); } + } + + for (S32 j = 0; j < Sounds::MaxSounds; j++) + { + if (mVehicleWaterSounds[j]) + { + _setVehicleWaterSounds(getVehicleWaterSounds(j), j); + } + } } if( !dustEmitter && dustID != 0 ) From 57aceb60fb0b83bc531b328e70a5ec9c730d9d1f Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Mon, 20 Sep 2021 17:57:16 +0100 Subject: [PATCH 090/399] QOC Code cleaning of unnecessary else' Remove unnecessary dynamic_casts --- Engine/source/T3D/fx/explosion.cpp | 2 +- Engine/source/T3D/fx/explosion.h | 4 ++-- Engine/source/T3D/fx/lightning.cpp | 2 ++ Engine/source/T3D/fx/lightning.h | 8 ++++---- Engine/source/T3D/fx/precipitation.h | 4 ++-- Engine/source/T3D/fx/splash.cpp | 4 +++- Engine/source/T3D/fx/splash.h | 4 ++-- Engine/source/T3D/projectile.h | 5 +++-- Engine/source/T3D/rigidShape.h | 8 ++++---- Engine/source/T3D/vehicles/flyingVehicle.h | 4 ++-- Engine/source/T3D/vehicles/hoverVehicle.h | 4 ++-- Engine/source/T3D/vehicles/vehicle.h | 8 ++++---- Engine/source/T3D/vehicles/wheeledVehicle.h | 4 ++-- 13 files changed, 33 insertions(+), 28 deletions(-) diff --git a/Engine/source/T3D/fx/explosion.cpp b/Engine/source/T3D/fx/explosion.cpp index e842f73e4..6fc59b825 100644 --- a/Engine/source/T3D/fx/explosion.cpp +++ b/Engine/source/T3D/fx/explosion.cpp @@ -1382,7 +1382,7 @@ bool Explosion::explode() resetWorldBox(); } - SFXProfile* sound_prof = dynamic_cast(mDataBlock->getSFXProfile()); + SFXProfile* sound_prof = mDataBlock->getSFXProfile(); if (sound_prof) { soundProfile_clone = sound_prof->cloneAndPerformSubstitutions(ss_object, ss_index); diff --git a/Engine/source/T3D/fx/explosion.h b/Engine/source/T3D/fx/explosion.h index 20eadcd88..37694dd1e 100644 --- a/Engine/source/T3D/fx/explosion.h +++ b/Engine/source/T3D/fx/explosion.h @@ -76,8 +76,8 @@ class ExplosionData : public GameBaseData { SFXProfile* getSFXProfile() { if (mSoundAsset.notNull()) return mSoundAsset->getSfxProfile(); - else - return NULL; + + return NULL; } ParticleEmitterData* particleEmitter; diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 7586602d4..16e234818 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -241,7 +241,9 @@ LightningData::LightningData() INIT_SOUNDASSET(StrikeSound); for (S32 i = 0; i < MaxThunders; i++) + { INIT_SOUNDASSET_ARRAY(ThunderSound, MaxThunders); + } for (S32 i = 0; i < MaxTextures; i++) { diff --git a/Engine/source/T3D/fx/lightning.h b/Engine/source/T3D/fx/lightning.h index 7f706d9f8..f639db3b2 100644 --- a/Engine/source/T3D/fx/lightning.h +++ b/Engine/source/T3D/fx/lightning.h @@ -97,15 +97,15 @@ class LightningData : public GameBaseData { if (mThunderSoundAsset[id] != NULL) return mThunderSoundAsset[id]->getSfxProfile(); - else - return NULL; + + return NULL; } SFXProfile* getSFXProfile() { if (mStrikeSoundAsset.notNull()) return mStrikeSoundAsset->getSfxProfile(); - else - return NULL; + + return NULL; } }; diff --git a/Engine/source/T3D/fx/precipitation.h b/Engine/source/T3D/fx/precipitation.h index e8114b040..f9eb4bf02 100644 --- a/Engine/source/T3D/fx/precipitation.h +++ b/Engine/source/T3D/fx/precipitation.h @@ -75,8 +75,8 @@ class PrecipitationData : public GameBaseData SFXProfile* getSFXProfile() { if (mSoundAsset.notNull()) return mSoundAsset->getSfxProfile(); - else - return NULL; + + return NULL; } }; diff --git a/Engine/source/T3D/fx/splash.cpp b/Engine/source/T3D/fx/splash.cpp index 6af8a0c1a..c046ef1a0 100644 --- a/Engine/source/T3D/fx/splash.cpp +++ b/Engine/source/T3D/fx/splash.cpp @@ -97,7 +97,9 @@ SplashData::SplashData() U32 i; for (i = 0; i < NUM_TEX; i++) + { INIT_IMAGEASSET_ARRAY(Texture, i); + } for( i=0; i(mDataBlock->getSFXProfile()); + SFXProfile* sound_prof = mDataBlock->getSFXProfile(); if (sound_prof) { SFX->playOnce(sound_prof, &getTransform()); diff --git a/Engine/source/T3D/fx/splash.h b/Engine/source/T3D/fx/splash.h index 40c6838fc..fec9f601e 100644 --- a/Engine/source/T3D/fx/splash.h +++ b/Engine/source/T3D/fx/splash.h @@ -102,8 +102,8 @@ public: SFXProfile* getSFXProfile() { if (mSoundAsset.notNull()) return mSoundAsset->getSfxProfile(); - else - return NULL; + + return NULL; } ParticleEmitterData* emitterList[NUM_EMITTERS]; diff --git a/Engine/source/T3D/projectile.h b/Engine/source/T3D/projectile.h index f340d54a7..69bb84001 100644 --- a/Engine/source/T3D/projectile.h +++ b/Engine/source/T3D/projectile.h @@ -118,11 +118,12 @@ public: DECLARE_SOUNDASSET(ProjectileData, ProjectileSound); DECLARE_SOUNDASSET_SETGET(ProjectileData, ProjectileSound); + SFXProfile* getSFXProfile() { if (mProjectileSoundAsset.notNull()) return mProjectileSoundAsset->getSfxProfile(); - else - return NULL; + + return NULL; } LightDescription *lightDesc; diff --git a/Engine/source/T3D/rigidShape.h b/Engine/source/T3D/rigidShape.h index 5fc6ee786..49e8c1fd6 100644 --- a/Engine/source/T3D/rigidShape.h +++ b/Engine/source/T3D/rigidShape.h @@ -70,8 +70,8 @@ class RigidShapeData : public ShapeBaseData { if (mBodySoundsAsset[id] != NULL) return mBodySoundsAsset[id]->getSfxProfile(); - else - return NULL; + + return NULL; } enum RigidShapeConsts @@ -98,8 +98,8 @@ class RigidShapeData : public ShapeBaseData { if (mWaterSoundsAsset[id] != NULL) return mWaterSoundsAsset[id]->getSfxProfile(); - else - return NULL; + + return NULL; } F32 exitSplashSoundVel; diff --git a/Engine/source/T3D/vehicles/flyingVehicle.h b/Engine/source/T3D/vehicles/flyingVehicle.h index 18c3379e1..573d10ccc 100644 --- a/Engine/source/T3D/vehicles/flyingVehicle.h +++ b/Engine/source/T3D/vehicles/flyingVehicle.h @@ -51,8 +51,8 @@ struct FlyingVehicleData: public VehicleData { { if (mFlyingSoundsAsset[id] != NULL) return mFlyingSoundsAsset[id]->getSfxProfile(); - else - return NULL; + + return NULL; } enum Jets { diff --git a/Engine/source/T3D/vehicles/hoverVehicle.h b/Engine/source/T3D/vehicles/hoverVehicle.h index 63ff65977..da22da280 100644 --- a/Engine/source/T3D/vehicles/hoverVehicle.h +++ b/Engine/source/T3D/vehicles/hoverVehicle.h @@ -52,8 +52,8 @@ class HoverVehicleData : public VehicleData { if (mHoverSoundsAsset[id] != NULL) return mHoverSoundsAsset[id]->getSfxProfile(); - else - return NULL; + + return NULL; } enum Jets { diff --git a/Engine/source/T3D/vehicles/vehicle.h b/Engine/source/T3D/vehicles/vehicle.h index 1c26f6cba..3e9636027 100644 --- a/Engine/source/T3D/vehicles/vehicle.h +++ b/Engine/source/T3D/vehicles/vehicle.h @@ -56,8 +56,8 @@ struct VehicleData : public RigidShapeData { if (mVehicleBodySoundsAsset[id] != NULL) return mVehicleBodySoundsAsset[id]->getSfxProfile(); - else - return NULL; + + return NULL; } @@ -88,8 +88,8 @@ struct VehicleData : public RigidShapeData { if (mVehicleWaterSoundsAsset[id] != NULL) return mVehicleWaterSoundsAsset[id]->getSfxProfile(); - else - return NULL; + + return NULL; } F32 exitSplashSoundVel; diff --git a/Engine/source/T3D/vehicles/wheeledVehicle.h b/Engine/source/T3D/vehicles/wheeledVehicle.h index f5fe52fef..2f37b6c13 100644 --- a/Engine/source/T3D/vehicles/wheeledVehicle.h +++ b/Engine/source/T3D/vehicles/wheeledVehicle.h @@ -125,8 +125,8 @@ struct WheeledVehicleData: public VehicleData { if (mWheeledVehicleSoundsAsset[id] != NULL) return mWheeledVehicleSoundsAsset[id]->getSfxProfile(); - else - return NULL; + + return NULL; } From c150afebaac2a72558dcf9997138151baf8561bf Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 20 Sep 2021 13:50:47 -0500 Subject: [PATCH 091/399] particle cleanups misc dupe code cleanup bits. safeties for the varous flavors of void ParticleEmitter::setup ideally we circle back to break some of that logic on out to shared steps --- Engine/source/T3D/fx/particleEmitter.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Engine/source/T3D/fx/particleEmitter.cpp b/Engine/source/T3D/fx/particleEmitter.cpp index 5f7b0829d..45acd1ecb 100644 --- a/Engine/source/T3D/fx/particleEmitter.cpp +++ b/Engine/source/T3D/fx/particleEmitter.cpp @@ -1551,13 +1551,10 @@ void ParticleEmitter::updateBBox() for (Particle* part = part_list_head.next; part != NULL; part = part->next) { - for (Particle* part = part_list_head.next; part != NULL; part = part->next) - { - Point3F particleSize(part->size * 0.5f); - F32 motion = getMax((part->vel.len() * part->totalLifetime / 1000.0f), 1.0f); - minPt.setMin(part->pos - particleSize - Point3F(motion)); - maxPt.setMax(part->pos + particleSize + Point3F(motion)); - } + Point3F particleSize(part->size * 0.5f); + F32 motion = getMax((part->vel.len() * part->totalLifetime / 1000.0f), 1.0f); + minPt.setMin(part->pos - particleSize - Point3F(motion)); + maxPt.setMax(part->pos + particleSize + Point3F(motion)); } mObjBox = Box3F(minPt, maxPt); @@ -1675,8 +1672,8 @@ void ParticleEmitter::addParticle(const Point3F& pos, const Point3F& axis, const } else { - U32 dBlockIndex = gRandGen.randI() % mDataBlock->particleDataBlocks.size(); - mDataBlock->particleDataBlocks[dBlockIndex]->initializeParticle(pNew, vel); + dBlockIndex = gRandGen.randI() % mDataBlock->particleDataBlocks.size(); + mDataBlock->particleDataBlocks[dBlockIndex]->initializeParticle(pNew, vel); } updateKeyData( pNew ); @@ -2220,7 +2217,7 @@ void ParticleEmitter::setupOriented( Particle *part, LinearColorF partCol = mLerp( part->color, ( part->color * ambientColor ), ambientLerp ); const ColorI color = partCol.toColorI(); // Here we deal with UVs for animated particle (oriented) - if (part->dataBlock->animateTexture) + if (part->dataBlock->animateTexture && !part->dataBlock->animTexFrames.empty()) { // Let particle compute the UV indices for current frame S32 fm = (S32)(part->currentAge*(1.0f/1000.0f)*part->dataBlock->framesPerSec); @@ -2331,7 +2328,7 @@ void ParticleEmitter::setupAligned( const Particle *part, LinearColorF partCol = mLerp( part->color, ( part->color * ambientColor ), ambientLerp ); const ColorI color = partCol.toColorI(); // Here we deal with UVs for animated particle - if (part->dataBlock->animateTexture) + if (part->dataBlock->animateTexture && !part->dataBlock->animTexFrames.empty()) { // Let particle compute the UV indices for current frame S32 fm = (S32)(part->currentAge*(1.0f/1000.0f)*part->dataBlock->framesPerSec); @@ -2520,7 +2517,7 @@ void ParticleEmitter::setupRibbon(Particle *part, ColorI pCol = partCol.toColorI(); // Here we deal with UVs for animated particle (oriented) - if (part->dataBlock->animateTexture) + if (part->dataBlock->animateTexture && !part->dataBlock->animTexFrames.empty()) { // Let particle compute the UV indices for current frame S32 fm = (S32)(part->currentAge*(1.0f / 1000.0f)*part->dataBlock->framesPerSec); From 8ce207561e487bd3495dbe4ed3b8cd9bbcc9c51f Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 20 Sep 2021 16:56:53 -0500 Subject: [PATCH 092/399] revert a bit causing crashes on certain 'nix boxes. --- Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp | 4 ++-- Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp index 3ee76ffdf..0cf46277c 100644 --- a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp +++ b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp @@ -455,12 +455,12 @@ Var* ShaderFeatureGLSL::addOutVpos( MultiLine *meta, outVpos = connectComp->getElement( RT_TEXCOORD ); outVpos->setName( "outVpos" ); outVpos->setStructName( "OUT" ); - outVpos->setType( "vec3" ); + outVpos->setType( "vec4" ); Var *outPosition = (Var*) LangElement::find( "gl_Position" ); AssertFatal( outPosition, "ShaderFeatureGLSL::addOutVpos - Didn't find the output position." ); - meta->addStatement( new GenOp( " @ = @.xyz;\r\n", outVpos, outPosition ) ); + meta->addStatement( new GenOp( " @ = @;\r\n", outVpos, outPosition ) ); } return outVpos; diff --git a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp index 2fe171aba..1ebc3982a 100644 --- a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp +++ b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp @@ -453,12 +453,12 @@ Var* ShaderFeatureHLSL::addOutVpos( MultiLine *meta, outVpos = connectComp->getElement( RT_TEXCOORD ); outVpos->setName( "outVpos" ); outVpos->setStructName( "OUT" ); - outVpos->setType( "float3" ); + outVpos->setType( "float4" ); Var *outPosition = (Var*) LangElement::find( "hpos" ); AssertFatal( outPosition, "ShaderFeatureHLSL::addOutVpos - Didn't find the output position." ); - meta->addStatement( new GenOp( " @ = @.xyz;\r\n", outVpos, outPosition ) ); + meta->addStatement( new GenOp( " @ = @;\r\n", outVpos, outPosition ) ); } return outVpos; From 2d50f52cf135fd8e6ebed638767dd60fd34d01c0 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Mon, 20 Sep 2021 21:00:33 -0400 Subject: [PATCH 093/399] Allow local variables to be used in eval. --- Engine/source/console/astNodes.cpp | 55 ++------------------------ Engine/source/console/codeBlock.cpp | 15 ++++++- Engine/source/console/compiledEval.cpp | 3 +- Engine/source/console/compiler.cpp | 42 ++++++++++++++++++++ Engine/source/console/compiler.h | 29 ++++++++++++++ 5 files changed, 90 insertions(+), 54 deletions(-) diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index 091f6cf1c..aaca1ea06 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -56,57 +56,7 @@ namespace Compiler using namespace Compiler; -class FuncVars -{ - struct Var - { - S32 reg; - TypeReq currentType; - StringTableEntry name; - bool isConstant; - }; - -public: - S32 assign(StringTableEntry var, TypeReq currentType, S32 lineNumber, bool isConstant = false) - { - std::unordered_map::iterator found = vars.find(var); - if (found != vars.end()) - { - AssertISV(!found->second.isConstant, avar("Reassigning variable %s when it is a constant. File: %s Line : %d", var, CodeBlock::smCurrentParser->getCurrentFile(), lineNumber)); - return found->second.reg; - } - - S32 id = counter++; - vars[var] = { id, currentType, var, isConstant }; - variableNameMap[id] = var; - - return id; - } - - S32 lookup(StringTableEntry var, S32 lineNumber) - { - std::unordered_map::iterator found = vars.find(var); - AssertISV(found != vars.end(), avar("Variable %s referenced before used when compiling script. File: %s Line: %d", var, CodeBlock::smCurrentParser->getCurrentFile(), lineNumber)); - return found->second.reg; - } - - TypeReq lookupType(StringTableEntry var, S32 lineNumber) - { - std::unordered_map::iterator found = vars.find(var); - - AssertISV(found != vars.end(), avar("Variable %s referenced before used when compiling script. File: %s Line: %d", var, CodeBlock::smCurrentParser->getCurrentFile(), lineNumber)); - return found->second.currentType; - } - - inline S32 count() { return counter; } - - std::unordered_map variableNameMap; - -private: - std::unordered_map vars; - S32 counter = 0; -}; - +FuncVars gEvalFuncVars; FuncVars* gFuncVars = NULL; inline FuncVars* getFuncVars(S32 lineNumber) @@ -1602,7 +1552,8 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream& codeStream, U32 ip) tbl->add(fnName, nameSpace, varName); } - gFuncVars = NULL; + // In eval mode, global func vars are allowed. + gFuncVars = gIsEvalCompile ? &gEvalFuncVars : NULL; return ip; } diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index 1d1ad7593..f03ec25f6 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -37,6 +37,9 @@ CodeBlock * CodeBlock::smCodeBlockList = NULL; CodeBlock * CodeBlock::smCurrentCodeBlock = NULL; ConsoleParser *CodeBlock::smCurrentParser = NULL; +extern FuncVars gEvalFuncVars; +extern FuncVars* gFuncVars; + //------------------------------------------------------------------------- CodeBlock::CodeBlock() @@ -491,6 +494,8 @@ bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, con chompUTF8BOM(inScript, &script); gSyntaxError = false; + gIsEvalCompile = false; + gFuncVars = NULL; consoleAllocReset(); @@ -629,6 +634,11 @@ ConsoleValue CodeBlock::compileExec(StringTableEntry fileName, const char *inStr addToCodeList(); gStatementList = NULL; + + // we are an eval compile if we don't have a file name associated (no exec) + gIsEvalCompile = fileName == NULL; + // In eval mode, global func vars are allowed. + gFuncVars = gIsEvalCompile ? &gEvalFuncVars : NULL; // Set up the parser. smCurrentParser = getParserForFile(fileName); @@ -667,6 +677,8 @@ ConsoleValue CodeBlock::compileExec(StringTableEntry fileName, const char *inStr codeStream.emit(OP_RETURN_VOID); codeStream.emitCodeStream(&codeSize, &code, &lineBreakPairs); + + S32 localRegisterCount = gIsEvalCompile ? gEvalFuncVars.count() : 0; consoleAllocReset(); @@ -683,7 +695,8 @@ ConsoleValue CodeBlock::compileExec(StringTableEntry fileName, const char *inStr if (lastIp + 1 != codeSize) Con::warnf(ConsoleLogEntry::General, "precompile size mismatch, precompile: %d compile: %d", codeSize, lastIp); - return std::move(exec(0, fileName, NULL, 0, 0, noCalls, NULL, setFrame)); + // repurpose argc as local register counter for global state + return std::move(exec(0, fileName, NULL, localRegisterCount, 0, noCalls, NULL, setFrame)); } //------------------------------------------------------------------------- diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 561e1f04a..360c13c90 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -693,7 +693,8 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // Do we want this code to execute using a new stack frame? if (setFrame < 0) { - gEvalState.pushFrame(NULL, NULL, 0); + // argc is the local count for eval + gEvalState.pushFrame(NULL, NULL, argc); gCallStack.pushFrame(0); popFrame = true; } diff --git a/Engine/source/console/compiler.cpp b/Engine/source/console/compiler.cpp index 1ab6e7b22..13839feda 100644 --- a/Engine/source/console/compiler.cpp +++ b/Engine/source/console/compiler.cpp @@ -34,6 +34,8 @@ #include "console/simBase.h" +extern FuncVars gEvalFuncVars; + namespace Compiler { @@ -86,6 +88,7 @@ namespace Compiler //------------------------------------------------------------ bool gSyntaxError = false; + bool gIsEvalCompile = false; //------------------------------------------------------------ @@ -121,6 +124,7 @@ namespace Compiler getFunctionStringTable().reset(); getIdentTable().reset(); getFunctionVariableMappingTable().reset(); + gEvalFuncVars.clear(); } void *consoleAlloc(U32 size) { return gConsoleAllocator.alloc(size); } @@ -132,6 +136,44 @@ namespace Compiler using namespace Compiler; +S32 FuncVars::assign(StringTableEntry var, TypeReq currentType, S32 lineNumber, bool isConstant) +{ + std::unordered_map::iterator found = vars.find(var); + if (found != vars.end()) + { + AssertISV(!found->second.isConstant, avar("Reassigning variable %s when it is a constant. File: %s Line : %d", var, CodeBlock::smCurrentParser->getCurrentFile(), lineNumber)); + return found->second.reg; + } + + S32 id = counter++; + vars[var] = { id, currentType, var, isConstant }; + variableNameMap[id] = var; + + return id; +} + +S32 FuncVars::lookup(StringTableEntry var, S32 lineNumber) +{ + std::unordered_map::iterator found = vars.find(var); + AssertISV(found != vars.end(), avar("Variable %s referenced before used when compiling script. File: %s Line: %d", var, CodeBlock::smCurrentParser->getCurrentFile(), lineNumber)); + return found->second.reg; +} + +TypeReq FuncVars::lookupType(StringTableEntry var, S32 lineNumber) +{ + std::unordered_map::iterator found = vars.find(var); + + AssertISV(found != vars.end(), avar("Variable %s referenced before used when compiling script. File: %s Line: %d", var, CodeBlock::smCurrentParser->getCurrentFile(), lineNumber)); + return found->second.currentType; +} + +void FuncVars::clear() +{ + vars.clear(); + variableNameMap.clear(); + counter = 0; +} + //------------------------------------------------------------------------- diff --git a/Engine/source/console/compiler.h b/Engine/source/console/compiler.h index 117576a61..24067257f 100644 --- a/Engine/source/console/compiler.h +++ b/Engine/source/console/compiler.h @@ -276,6 +276,35 @@ namespace Compiler void consoleAllocReset(); extern bool gSyntaxError; + extern bool gIsEvalCompile; +}; + +class FuncVars +{ + struct Var + { + S32 reg; + TypeReq currentType; + StringTableEntry name; + bool isConstant; + }; + +public: + S32 assign(StringTableEntry var, TypeReq currentType, S32 lineNumber, bool isConstant = false); + + S32 lookup(StringTableEntry var, S32 lineNumber); + + TypeReq lookupType(StringTableEntry var, S32 lineNumber); + + inline S32 count() { return counter; } + + std::unordered_map variableNameMap; + + void clear(); + +private: + std::unordered_map vars; + S32 counter = 0; }; /// Utility class to emit and patch bytecode From 9775d69988fc1ca269e13ef9d6e8b1caae8f8a58 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Tue, 21 Sep 2021 17:10:07 -0500 Subject: [PATCH 094/399] pad shader uniform length pipe by 1 to avoid a bug with some integrated chips clipping --- Engine/source/gfx/gl/gfxGLShader.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Engine/source/gfx/gl/gfxGLShader.cpp b/Engine/source/gfx/gl/gfxGLShader.cpp index d2f2edd22..eed45b3e1 100644 --- a/Engine/source/gfx/gl/gfxGLShader.cpp +++ b/Engine/source/gfx/gl/gfxGLShader.cpp @@ -561,6 +561,7 @@ void GFXGLShader::initConstantDescs() if(!maxNameLength) return; + maxNameLength++; FrameTemp uniformName(maxNameLength); From 901228c3a8f2208227e077472fdc73053672e434 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Tue, 21 Sep 2021 23:19:00 -0500 Subject: [PATCH 095/399] kill splashscreen on nonwindows was worth a shot, but it's playing up way too much to focus on at present --- Templates/BaseGame/game/main.tscript.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Templates/BaseGame/game/main.tscript.in b/Templates/BaseGame/game/main.tscript.in index 4e83ff2b2..800e9625a 100644 --- a/Templates/BaseGame/game/main.tscript.in +++ b/Templates/BaseGame/game/main.tscript.in @@ -19,9 +19,14 @@ ModuleDatabase.LoadExplicit( "CoreModule" ); // Display a splash window immediately to improve app responsiveness before // engine is initialized and main window created. if ($Server::Dedicated == false) - displaySplashWindow($Core::splashWindowImage); +{ + if ($platform $= "windows") + displaySplashWindow($Core::splashWindowImage); +} else +{ $Video::forceDisplayAdapter = -1; +} //----------------------------------------------------------------------------- // Load any gameplay modules @@ -45,7 +50,7 @@ else } } -if ($Server::Dedicated == false) +if ( ($Server::Dedicated == false) && ($platform $= "windows") ) closeSplashWindow(); echo("Engine initialized..."); \ No newline at end of file From c86cc489458cc4c1d32fbf40d08d996a6b91351c Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Wed, 22 Sep 2021 18:27:42 -0500 Subject: [PATCH 096/399] use srgb sapce for backbuffer --- Engine/source/postFx/postEffectManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/postFx/postEffectManager.cpp b/Engine/source/postFx/postEffectManager.cpp index 7904c522d..d65e25e25 100644 --- a/Engine/source/postFx/postEffectManager.cpp +++ b/Engine/source/postFx/postEffectManager.cpp @@ -141,7 +141,7 @@ GFXTextureObject* PostEffectManager::getBackBufferTex() mBackBufferCopyTex.set( targetSize.x, targetSize.y, targetFormat, - &PostFxTargetProfile, "mBackBufferCopyTex" ); + &PostFxTextureSRGBProfile, "mBackBufferCopyTex" ); target->resolveTo( mBackBufferCopyTex ); mLastBackBufferTarget = target; From 5682bafb291fe7a5a865d256153d6229e74f4d4a Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Wed, 22 Sep 2021 18:28:19 -0500 Subject: [PATCH 097/399] kills off that second buffer in terrain rendering when in forward mode --- .../source/terrain/glsl/terrFeatureGLSL.cpp | 132 ++++++++-------- Engine/source/terrain/glsl/terrFeatureGLSL.h | 1 - .../source/terrain/hlsl/terrFeatureHLSL.cpp | 141 +++++++++--------- Engine/source/terrain/hlsl/terrFeatureHLSL.h | 2 - 4 files changed, 142 insertions(+), 134 deletions(-) diff --git a/Engine/source/terrain/glsl/terrFeatureGLSL.cpp b/Engine/source/terrain/glsl/terrFeatureGLSL.cpp index 14f321cce..d30e639ec 100644 --- a/Engine/source/terrain/glsl/terrFeatureGLSL.cpp +++ b/Engine/source/terrain/glsl/terrFeatureGLSL.cpp @@ -304,29 +304,28 @@ void TerrainBaseMapFeatGLSL::processPix( Vector &componentLis baseColor->setName( "baseColor" ); meta->addStatement( new GenOp( " @ = tex2D( @, @.xy );\r\n", new DecOp( baseColor ), diffuseMap, texCoord ) ); - ShaderFeature::OutputTarget target = ShaderFeature::DefaultTarget; + ShaderFeature::OutputTarget target = (fd.features[MFT_isDeferred]) ? RenderTarget1 : DefaultTarget; + meta->addStatement(new GenOp(" @;\r\n", assignColor(baseColor, Material::Mul, NULL, target))); - if(fd.features.hasFeature(MFT_isDeferred)) - { - target= ShaderFeature::RenderTarget1; - } - meta->addStatement( new GenOp( " @;\r\n", assignColor( baseColor, Material::Mul,NULL,target ) ) ); - - // Set base ORM info Var* ormConfig; - OutputTarget targ = RenderTarget1; - if (fd.features[MFT_isDeferred]) + if ((fd.features[MFT_isDeferred])) { - targ = RenderTarget2; + // Set base ORM info + ormConfig = (Var*)LangElement::find(getOutputTargetVarName(RenderTarget2)); + + if (!ormConfig) + { + // create color var + ormConfig = new Var; + ormConfig->setType("fragout"); + ormConfig->setName(getOutputTargetVarName(RenderTarget2)); + ormConfig->setStructName("OUT"); + } } - ormConfig = (Var*)LangElement::find(getOutputTargetVarName(targ)); - if (!ormConfig) + else { - // create color var - ormConfig = new Var; - ormConfig->setType("fragout"); - ormConfig->setName(getOutputTargetVarName(targ)); - ormConfig->setStructName("OUT"); + ormConfig = new Var("ORMConfig", "float4"); + meta->addStatement(new GenOp(" @;\r\n", new DecOp(ormConfig))); } meta->addStatement(new GenOp(" @ = float4(0.0, 1.0, 1.0, 0.0);\r\n", ormConfig)); @@ -347,7 +346,7 @@ ShaderFeature::Resources TerrainBaseMapFeatGLSL::getResources( const MaterialFea U32 TerrainBaseMapFeatGLSL::getOutputTargets( const MaterialFeatureData &fd ) const { - return fd.features[MFT_isDeferred] ? ShaderFeature::RenderTarget1 | ShaderFeature::RenderTarget2 : ShaderFeature::DefaultTarget | ShaderFeature::RenderTarget1; + return fd.features[MFT_isDeferred] ? ShaderFeature::RenderTarget2 | ShaderFeature::RenderTarget1 : ShaderFeature::DefaultTarget; } TerrainDetailMapFeatGLSL::TerrainDetailMapFeatGLSL() @@ -1167,24 +1166,36 @@ void TerrainORMMapFeatGLSL::processPix(Vector &componentList, else texOp = new GenOp("tex2D(@, vec3(@.xy, @.x))", ormConfigMap, inDet, new IndexOp(detailInfo, compositeIndex)); - // search for material var - Var * ormConfig; - OutputTarget targ = RenderTarget1; - if (fd.features[MFT_isDeferred]) - { - targ = RenderTarget2; - } - ormConfig = (Var*)LangElement::find(getOutputTargetVarName(targ)); + MultiLine* meta = new MultiLine; + // search for material var + Var* ormConfig; + if ((fd.features[MFT_isDeferred])) + { + // Set base ORM info + ormConfig = (Var*)LangElement::find(getOutputTargetVarName(RenderTarget2)); - MultiLine * meta = new MultiLine; - if (!ormConfig) - { - // create color var - ormConfig = new Var; - ormConfig->setType("fragout"); - ormConfig->setName(getOutputTargetVarName(targ)); - ormConfig->setStructName("OUT"); - } + if (!ormConfig) + { + // create color var + ormConfig = new Var; + ormConfig->setType("fragout"); + ormConfig->setName(getOutputTargetVarName(RenderTarget2)); + ormConfig->setStructName("OUT"); + } + } + else + { + ormConfig = (Var*)LangElement::find("ORMConfig"); + if (!ormConfig) + { + ormConfig = new Var("ORMConfig", "vec4"); + meta->addStatement(new GenOp(" @;\r\n", new DecOp(ormConfig))); + } + } + if (compositeIndex == 0) + { + meta->addStatement(new GenOp(" @ = vec4(0.0, 0.0, 0.0, 0.0);\r\n", ormConfig)); + } Var *detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", compositeIndex)); AssertFatal(detailBlend, "The detail blend is missing!"); @@ -1192,11 +1203,6 @@ void TerrainORMMapFeatGLSL::processPix(Vector &componentList, String matinfoName(String::ToString("matinfoCol%d", compositeIndex)); Var *matinfoCol = new Var(matinfoName, "vec3"); - if (compositeIndex == 0) - { - meta->addStatement(new GenOp(" @ = vec4(0.0, 0.0, 0.0, 0.0);\r\n", ormConfig)); - } - meta->addStatement(new GenOp(" @ = @.rgb;\r\n", new DecOp(matinfoCol), texOp)); if (fd.features.hasFeature(MFT_InvertRoughness, compositeIndex)) @@ -1236,40 +1242,40 @@ ShaderFeature::Resources TerrainORMMapFeatGLSL::getResources(const MaterialFeatu return res; } - -U32 TerrainBlankInfoMapFeatGLSL::getOutputTargets(const MaterialFeatureData &fd) const -{ - return fd.features[MFT_isDeferred] ? ShaderFeature::RenderTarget2 : ShaderFeature::RenderTarget1; -} - // reminder, the matinfo buffer is flags, smooth, ao, metal void TerrainBlankInfoMapFeatGLSL::processPix(Vector &componentList, const MaterialFeatureData &fd) { S32 compositeIndex = getProcessIndex(); - // search for material var - Var *material; - OutputTarget targ = DefaultTarget; - if (fd.features[MFT_isDeferred]) + MultiLine* meta = new MultiLine; Var* ormConfig; + if ((fd.features[MFT_isDeferred])) { - targ = RenderTarget2; - } - material = (Var*)LangElement::find(getOutputTargetVarName(targ)); + // Set base ORM info + ormConfig = (Var*)LangElement::find(getOutputTargetVarName(RenderTarget2)); - MultiLine * meta = new MultiLine; - if (!material) + if (!ormConfig) + { + // create color var + ormConfig = new Var; + ormConfig->setType("fragout"); + ormConfig->setName(getOutputTargetVarName(RenderTarget2)); + ormConfig->setStructName("OUT"); + } + } + else { - // create color var - material = new Var; - material->setType("vec4"); - material->setName(getOutputTargetVarName(targ)); - material->setStructName("OUT"); + ormConfig = (Var*)LangElement::find("ORMConfig"); + if (!ormConfig) + { + ormConfig = new Var("ORMConfig", "vec4"); + meta->addStatement(new GenOp(" @;\r\n", new DecOp(ormConfig))); + } } if (compositeIndex == 0) { - meta->addStatement(new GenOp(" @ = vec4(0.0, 0.0, 0.0, 0.0);\r\n", material)); + meta->addStatement(new GenOp(" @ = float4(0.0, 0.0, 0.0, 0.0);\r\n", ormConfig)); } Var* detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", compositeIndex)); @@ -1277,7 +1283,7 @@ void TerrainBlankInfoMapFeatGLSL::processPix(Vector &component String matinfoName(String::ToString("matinfoCol%d", compositeIndex)); - meta->addStatement(new GenOp(" @.gba += vec3(@, @, 0.0);\r\n", material, detailBlend, detailBlend)); + meta->addStatement(new GenOp(" @.gba += vec3(@, @, 0.0);\r\n", ormConfig, detailBlend, detailBlend)); output = meta; } diff --git a/Engine/source/terrain/glsl/terrFeatureGLSL.h b/Engine/source/terrain/glsl/terrFeatureGLSL.h index 5b48c0a51..7d56a75bf 100644 --- a/Engine/source/terrain/glsl/terrFeatureGLSL.h +++ b/Engine/source/terrain/glsl/terrFeatureGLSL.h @@ -174,7 +174,6 @@ public: virtual void processPix(Vector &componentList, const MaterialFeatureData &fd); - virtual U32 getOutputTargets(const MaterialFeatureData &fd) const; virtual String getName() { return "Blank Matinfo map"; } }; diff --git a/Engine/source/terrain/hlsl/terrFeatureHLSL.cpp b/Engine/source/terrain/hlsl/terrFeatureHLSL.cpp index e136c82eb..362a012a3 100644 --- a/Engine/source/terrain/hlsl/terrFeatureHLSL.cpp +++ b/Engine/source/terrain/hlsl/terrFeatureHLSL.cpp @@ -337,27 +337,27 @@ void TerrainBaseMapFeatHLSL::processVert( Vector &componentLis new DecOp( inTanget ), squareSize, inTangentZ ) ); } -void TerrainBaseMapFeatHLSL::processPix( Vector &componentList, - const MaterialFeatureData &fd ) +void TerrainBaseMapFeatHLSL::processPix(Vector& componentList, + const MaterialFeatureData& fd) { // grab connector texcoord register - Var *texCoord = getInTexCoord( "texCoord", "float3", componentList ); + Var* texCoord = getInTexCoord("texCoord", "float3", componentList); // create texture var - Var *diffuseMap = new Var; - diffuseMap->setType( "SamplerState" ); - diffuseMap->setName( "baseTexMap" ); + Var* diffuseMap = new Var; + diffuseMap->setType("SamplerState"); + diffuseMap->setName("baseTexMap"); diffuseMap->uniform = true; diffuseMap->sampler = true; diffuseMap->constNum = Var::getTexUnitNum(); // used as texture unit num here - MultiLine *meta = new MultiLine; + MultiLine* meta = new MultiLine; - Var *baseColor = new Var; - baseColor->setType( "float4" ); - baseColor->setName( "baseColor" ); + Var* baseColor = new Var; + baseColor->setType("float4"); + baseColor->setName("baseColor"); - Var *diffuseTex = new Var; + Var* diffuseTex = new Var; diffuseTex->setType("Texture2D"); diffuseTex->setName("baseTexture"); diffuseTex->uniform = true; @@ -365,33 +365,31 @@ void TerrainBaseMapFeatHLSL::processPix( Vector &componentLis diffuseTex->constNum = diffuseMap->constNum; meta->addStatement(new GenOp(" @ = @.Sample( @, @.xy );\r\n", new DecOp(baseColor), diffuseTex, diffuseMap, texCoord)); - ShaderFeature::OutputTarget target = ShaderFeature::DefaultTarget; + ShaderFeature::OutputTarget target = (fd.features[MFT_isDeferred]) ? RenderTarget1 : DefaultTarget; + meta->addStatement(new GenOp(" @;\r\n", assignColor(baseColor, Material::Mul, NULL, target))); - if (fd.features.hasFeature(MFT_isDeferred)) - { - target= ShaderFeature::RenderTarget1; - } - - meta->addStatement( new GenOp( " @;\r\n", assignColor( baseColor, Material::Mul,NULL,target ) ) ); - - if (fd.features[MFT_isDeferred]) + Var* ormConfig; + if ((fd.features[MFT_isDeferred])) { // Set base ORM info - Var* ormConfig; - OutputTarget targ = RenderTarget1; - targ = RenderTarget2; - ormConfig = (Var*)LangElement::find(getOutputTargetVarName(targ)); + ormConfig = (Var*)LangElement::find(getOutputTargetVarName(RenderTarget2)); + if (!ormConfig) { // create color var ormConfig = new Var; ormConfig->setType("fragout"); - ormConfig->setName(getOutputTargetVarName(targ)); + ormConfig->setName(getOutputTargetVarName(RenderTarget2)); ormConfig->setStructName("OUT"); } - - meta->addStatement(new GenOp(" @ = float4(0.0, 1.0, 1.0, 0.0);\r\n", ormConfig)); } + else + { + ormConfig = new Var("ORMConfig", "float4"); + meta->addStatement(new GenOp(" @;\r\n", new DecOp(ormConfig))); + } + + meta->addStatement(new GenOp(" @ = float4(0.0, 1.0, 1.0, 0.0);\r\n", ormConfig)); output = meta; } @@ -407,7 +405,7 @@ ShaderFeature::Resources TerrainBaseMapFeatHLSL::getResources( const MaterialFea U32 TerrainBaseMapFeatHLSL::getOutputTargets( const MaterialFeatureData &fd ) const { - return fd.features[MFT_isDeferred] ? ShaderFeature::RenderTarget1 | ShaderFeature::RenderTarget2 : ShaderFeature::DefaultTarget; + return fd.features[MFT_isDeferred] ? ShaderFeature::RenderTarget2 | ShaderFeature::RenderTarget1 : ShaderFeature::DefaultTarget; } TerrainDetailMapFeatHLSL::TerrainDetailMapFeatHLSL() @@ -1259,23 +1257,35 @@ void TerrainORMMapFeatHLSL::processPix(Vector &componentList, else texOp = new GenOp("@.Sample(@, float3(@.xy, @.x))", ormMapArray, ormMapSampler, inDet, new IndexOp(detailInfo, compositeIndex)); + MultiLine* meta = new MultiLine; // search for material var - Var * ormConfig; - OutputTarget targ = RenderTarget1; - if (fd.features[MFT_isDeferred]) + Var* ormConfig; + if ((fd.features[MFT_isDeferred])) { - targ = RenderTarget2; - } - ormConfig = (Var*)LangElement::find(getOutputTargetVarName(targ)); + // Set base ORM info + ormConfig = (Var*)LangElement::find(getOutputTargetVarName(RenderTarget2)); - MultiLine * meta = new MultiLine; - if (!ormConfig) + if (!ormConfig) + { + // create color var + ormConfig = new Var; + ormConfig->setType("fragout"); + ormConfig->setName(getOutputTargetVarName(RenderTarget2)); + ormConfig->setStructName("OUT"); + } + } + else { - // create color var - ormConfig = new Var; - ormConfig->setType("fragout"); - ormConfig->setName(getOutputTargetVarName(targ)); - ormConfig->setStructName("OUT"); + ormConfig = (Var*)LangElement::find("ORMConfig"); + if (!ormConfig) + { + ormConfig = new Var("ORMConfig", "float4"); + meta->addStatement(new GenOp(" @;\r\n", new DecOp(ormConfig))); + } + } + if (compositeIndex == 0) + { + meta->addStatement(new GenOp(" @ = float4(0.0, 0.0, 0.0, 0.0);\r\n", ormConfig)); } Var *detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", compositeIndex)); @@ -1284,11 +1294,6 @@ void TerrainORMMapFeatHLSL::processPix(Vector &componentList, String matinfoName(String::ToString("matinfoCol%d", compositeIndex)); Var *matinfoCol = new Var(matinfoName, "float3"); - if (compositeIndex == 0) - { - meta->addStatement(new GenOp(" @ = float4(0.0, 0.0, 0.0, 0.0);\r\n", ormConfig)); - } - meta->addStatement(new GenOp(" @ = @.rgb;\r\n", new DecOp(matinfoCol), texOp)); if (fd.features.hasFeature(MFT_InvertRoughness, compositeIndex)) @@ -1313,39 +1318,39 @@ ShaderFeature::Resources TerrainORMMapFeatHLSL::getResources(const MaterialFeatu return res; } -// reminder, the matinfo buffer is flags, smooth, ao, metal -U32 TerrainBlankInfoMapFeatHLSL::getOutputTargets(const MaterialFeatureData &fd) const -{ - return fd.features[MFT_isDeferred] ? ShaderFeature::RenderTarget2 : ShaderFeature::RenderTarget1; -} - void TerrainBlankInfoMapFeatHLSL::processPix(Vector &componentList, const MaterialFeatureData &fd) { S32 compositeIndex = getProcessIndex(); - // search for material var - Var *material; - OutputTarget ormConfig = RenderTarget1; - if (fd.features[MFT_isDeferred]) + MultiLine * meta = new MultiLine; Var* ormConfig; + if ((fd.features[MFT_isDeferred])) { - ormConfig = RenderTarget2; - } - material = (Var*)LangElement::find(getOutputTargetVarName(ormConfig)); + // Set base ORM info + ormConfig = (Var*)LangElement::find(getOutputTargetVarName(RenderTarget2)); - MultiLine * meta = new MultiLine; - if (!material) + if (!ormConfig) + { + // create color var + ormConfig = new Var; + ormConfig->setType("fragout"); + ormConfig->setName(getOutputTargetVarName(RenderTarget2)); + ormConfig->setStructName("OUT"); + } + } + else { - // create color var - material = new Var; - material->setType("fragout"); - material->setName(getOutputTargetVarName(ormConfig)); - material->setStructName("OUT"); + ormConfig = (Var*)LangElement::find("ORMConfig"); + if (!ormConfig) + { + ormConfig = new Var("ORMConfig", "float4"); + meta->addStatement(new GenOp(" @;\r\n", new DecOp(ormConfig))); + } } if (compositeIndex == 0) { - meta->addStatement(new GenOp(" @ = float4(0.0, 0.0, 0.0, 0.0);\r\n", material)); + meta->addStatement(new GenOp(" @ = float4(0.0, 0.0, 0.0, 0.0);\r\n", ormConfig)); } Var* detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", compositeIndex)); @@ -1355,7 +1360,7 @@ void TerrainBlankInfoMapFeatHLSL::processPix(Vector &component if (!fd.features.hasFeature(MFT_TerrainHeightBlend)) { - meta->addStatement(new GenOp(" @.gba += float3(@, @, 0.0);\r\n", material, detailBlend, detailBlend)); + meta->addStatement(new GenOp(" @.gba += float3(@, @, 0.0);\r\n", ormConfig, detailBlend, detailBlend)); } output = meta; diff --git a/Engine/source/terrain/hlsl/terrFeatureHLSL.h b/Engine/source/terrain/hlsl/terrFeatureHLSL.h index 829af9c6f..f3803f2d9 100644 --- a/Engine/source/terrain/hlsl/terrFeatureHLSL.h +++ b/Engine/source/terrain/hlsl/terrFeatureHLSL.h @@ -179,8 +179,6 @@ public: virtual void processPix(Vector &componentList, const MaterialFeatureData &fd); - - virtual U32 getOutputTargets(const MaterialFeatureData &fd) const; virtual String getName() { return "Blank Matinfo map"; } }; From 4cfb3c4f04bb5ab0c239bc733508295ae1a6c16a Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Wed, 22 Sep 2021 20:28:39 -0400 Subject: [PATCH 098/399] * [Linux] BugFix: Corrections to allow the Linux win console (Ie. the terminal you ran the game from) to act as a console input. --- Engine/source/platformX86UNIX/x86UNIXConsole.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Engine/source/platformX86UNIX/x86UNIXConsole.cpp b/Engine/source/platformX86UNIX/x86UNIXConsole.cpp index 88e17f38e..85828b202 100644 --- a/Engine/source/platformX86UNIX/x86UNIXConsole.cpp +++ b/Engine/source/platformX86UNIX/x86UNIXConsole.cpp @@ -41,7 +41,10 @@ StdConsole *stdConsole = NULL; DefineEngineFunction(enableWinConsole, void, (bool _enable),, "enableWinConsole(bool);") { if (stdConsole) - stdConsole->enable(_enable); + { + stdConsole->enable(_enable); + stdConsole->enableInput(_enable); + } } void StdConsole::create() @@ -141,6 +144,9 @@ StdConsole::StdConsole() stdIn = dup(0); stdErr = dup(2); + // Ensure in buffer is null terminated after allocation + inbuf[0] = 0x00; + iCmdIndex = 0; stdConsoleEnabled = false; stdConsoleInputEnabled = false; @@ -195,11 +201,14 @@ void StdConsole::processConsoleLine(const char *consoleLine) { if(stdConsoleEnabled) { - inbuf[inpos] = 0; if(lineOutput) printf("%s\n", consoleLine); else - printf("%c%s\n%s%s", '\r', consoleLine, Con::getVariable("Con::Prompt"), inbuf); + { + // Clear current line before outputting the console line. This prevents prompt text from overflowing onto normal output. + printf("%c[2K", 27); + printf("%c%s\n%s%s", '\r', consoleLine, Con::getVariable("Con::Prompt"), inbuf); + } } } @@ -323,6 +332,7 @@ void StdConsole::process() printf("%s", Con::getVariable("Con::Prompt")); inpos = outpos = 0; + inbuf[0] = 0x00; // Ensure inbuf is NULL terminated after sending out command break; case 27: // JMQTODO: are these magic numbers keyboard map specific? From e784b0140c32f2de6c5ca7ac5d23d3961cb28d00 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Wed, 22 Sep 2021 21:41:38 -0400 Subject: [PATCH 099/399] Let's fix the texcoord alignment for RT Lighting. --- .../source/shaderGen/GLSL/shaderFeatureGLSL.cpp | 16 +++++++--------- .../source/shaderGen/HLSL/shaderFeatureHLSL.cpp | 12 +++++------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp index 0cf46277c..e9604eb77 100644 --- a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp +++ b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp @@ -2090,12 +2090,15 @@ void RTLightingFeatGLSL::processVert( Vector &componentList, return; } - + + addOutWsPosition( componentList, fd.features[MFT_UseInstancing], meta ); + getOutWorldToTangent(componentList, meta, fd); + + output = meta; + // Find the incoming vertex normal. Var *inNormal = (Var*)LangElement::find( "normal" ); - - // Skip out on realtime lighting if we don't have a normal - // or we're doing some sort of baked lighting. + if ( !inNormal || fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || @@ -2119,11 +2122,6 @@ void RTLightingFeatGLSL::processVert( Vector &componentList, meta->addStatement( new GenOp( " @ = tMul( @, vec4( normalize( @ ), 0.0 ) ).xyz;\r\n", outNormal, objTrans, inNormal ) ); }*/ - addOutWsPosition( componentList, fd.features[MFT_UseInstancing], meta ); - - getOutWorldToTangent(componentList, meta, fd); - - output = meta; } void RTLightingFeatGLSL::processPix( Vector &componentList, diff --git a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp index 1ebc3982a..dfdb5439c 100644 --- a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp +++ b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp @@ -2178,11 +2178,14 @@ void RTLightingFeatHLSL::processVert( Vector &componentList, return; } + addOutWsPosition( componentList, fd.features[MFT_UseInstancing], meta ); + getOutWorldToTangent(componentList, meta, fd); + output = meta; + + // Find the incoming vertex normal. Var *inNormal = (Var*)LangElement::find( "normal" ); - // Skip out on realtime lighting if we don't have a normal - // or we're doing some sort of baked lighting. if ( !inNormal || fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || @@ -2205,11 +2208,6 @@ void RTLightingFeatHLSL::processVert( Vector &componentList, // Transform the normal to world space. meta->addStatement( new GenOp( " @ = mul( @, float4( normalize( @ ), 0.0 ) ).xyz;\r\n", outNormal, objTrans, inNormal ) ); } - - addOutWsPosition( componentList, fd.features[MFT_UseInstancing], meta ); - getOutWorldToTangent(componentList, meta, fd); - - output = meta; } void RTLightingFeatHLSL::processPix( Vector &componentList, From 55063601e6aacc6aca62855a2c575450666a57ea Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Thu, 23 Sep 2021 22:58:25 -0400 Subject: [PATCH 100/399] * [Projectile] BugFix: Correct the onAdd callback not being raised for projectiles. --- Engine/source/T3D/projectile.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Engine/source/T3D/projectile.cpp b/Engine/source/T3D/projectile.cpp index 739daf4a5..b21fe9542 100644 --- a/Engine/source/T3D/projectile.cpp +++ b/Engine/source/T3D/projectile.cpp @@ -786,6 +786,8 @@ bool Projectile::onAdd() // If we're on the server, we need to inherit some of our parent's velocity // mCurrTick = 0; + + scriptOnAdd(); } else { From 12f4af51f557cc76a4d018fe262b816eae58b119 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Fri, 24 Sep 2021 17:58:17 -0400 Subject: [PATCH 101/399] * [Editor] BugFix: Fix a crash that sometimes occurs when groups of objects are deleted in the world editor. --- Engine/source/gui/worldEditor/worldEditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/gui/worldEditor/worldEditor.cpp b/Engine/source/gui/worldEditor/worldEditor.cpp index d6642cd1c..dfccf8533 100644 --- a/Engine/source/gui/worldEditor/worldEditor.cpp +++ b/Engine/source/gui/worldEditor/worldEditor.cpp @@ -1993,12 +1993,12 @@ void WorldEditor::on3DMouseMove(const Gui3DMouseEvent & event) if ( !mHitObject ) { SceneObject *hitObj = NULL; - if ( collide(event, &hitObj) && hitObj->isSelectionEnabled() && !objClassIgnored(hitObj) ) + if ( collide(event, &hitObj) && !hitObj->isDeleted() && hitObj->isSelectionEnabled() && !objClassIgnored(hitObj) ) { mHitObject = hitObj; } } - + mLastMouseEvent = event; } From d7919950bfbe217650fbb457f13fe31bcbf6e4a0 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Fri, 24 Sep 2021 18:34:57 -0400 Subject: [PATCH 102/399] * [Editor] BugFix: Correct an object spawning error when attempting to drag and drop datablocks from the asset browser where they would always spawn at origin. --- .../game/tools/worldEditor/scripts/editors/creator.ed.tscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/editors/creator.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/editors/creator.ed.tscript index 08bd46598..8fce4a3fd 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/editors/creator.ed.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/editors/creator.ed.tscript @@ -227,7 +227,7 @@ function EWCreatorWindow::createObject( %this, %cmd ) %this.setNewObjectGroup( getScene(0) ); pushInstantGroup(); - %objId = eval(%cmd); + %objId = eval("return " @ %cmd); popInstantGroup(); if( isObject( %objId ) ) From f1ee4f781b2ead4f881665784cd4751d7b87cb69 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Fri, 24 Sep 2021 19:09:43 -0400 Subject: [PATCH 103/399] Material editor fixes from eval cleanup. --- .../scripts/materialEditor.ed.tscript | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript b/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript index bdca293da..8a21c9907 100644 --- a/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript +++ b/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript @@ -1097,9 +1097,6 @@ function MaterialEditorGui::updateActiveMaterial(%this, %propertyField, %value, { MaterialEditorGui.setMaterialDirty(); - if(%value $= "") - %value = "\"\""; - // Here is where we handle undo actions with slider controls. We want to be able to // undo every onMouseUp; so we overrite the same undo action when necessary in order // to achieve this desired effect. @@ -1130,7 +1127,7 @@ function MaterialEditorGui::updateActiveMaterial(%this, %propertyField, %value, if (MaterialEditorGui.livePreview == true) { - MaterialEditorGui.setFieldValue(%propertyField, %value); + MaterialEditorGui.currentMaterial.setFieldValue(%propertyField, %value); MaterialEditorGui.currentMaterial.flush(); MaterialEditorGui.currentMaterial.reload(); } @@ -1263,8 +1260,8 @@ function MaterialEditorGui::doUpdateTextureMap( %this, %assetId ) %bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/",""); %bitmapCtrl.setBitmap(%bitmap); %textCtrl.setText(%assetId); - MaterialEditorGui.updateActiveMaterial(%type @ "Map[" @ %layer @ "]","\"\""); - MaterialEditorGui.updateActiveMaterial(%type @ "MapAsset[" @ %layer @ "]","\"" @ %assetId @ "\""); + MaterialEditorGui.updateActiveMaterial(%type @ "Map[" @ %layer @ "]",""); + MaterialEditorGui.updateActiveMaterial(%type @ "MapAsset[" @ %layer @ "]", %assetId); } } @@ -1276,7 +1273,7 @@ function MaterialEditorGui::updateDetailScale(%this,%newScale) { %layer = MaterialEditorGui.currentLayer; - %detailScale = "\"" @ %newScale SPC %newScale @ "\""; + %detailScale = %newScale SPC %newScale; MaterialEditorGui.updateActiveMaterial("detailScale[" @ %layer @ "]", %detailScale); } @@ -1284,7 +1281,7 @@ function MaterialEditorGui::updateDetailNormalStrength(%this,%newStrength) { %layer = MaterialEditorGui.currentLayer; - %detailStrength = "\"" @ %newStrength @ "\""; + %detailStrength = %newStrength; MaterialEditorGui.updateActiveMaterial("detailNormalMapStrength[" @ %layer @ "]", %detailStrength); } @@ -1295,7 +1292,7 @@ function MaterialEditorGui::updateRotationOffset(%this, %isSlider, %onMouseUp) %Y = MaterialEditorPropertiesWindow-->RotationTextEditV.getText(); MaterialEditorPropertiesWindow-->RotationCrosshair.setPosition(45*mAbs(%X)-2, 45*mAbs(%Y)-2); - MaterialEditorGui.updateActiveMaterial("rotPivotOffset[" @ %layer @ "]","\"" @ %X SPC %Y @ "\"",%isSlider,%onMouseUp); + MaterialEditorGui.updateActiveMaterial("rotPivotOffset[" @ %layer @ "]", %X SPC %Y,%isSlider,%onMouseUp); } function MaterialEditorGui::updateRotationSpeed(%this, %isSlider, %onMouseUp) @@ -1457,7 +1454,7 @@ function MaterialEditorGui::syncGuiColor(%this, %guiCtrl, %propname, %color) %a = getWord(%color,3); %colorSwatch = (%r SPC %g SPC %b SPC %a); - %color = "\"" @ %r SPC %g SPC %b SPC %a @ "\""; + %color = %r SPC %g SPC %b SPC %a; %guiCtrl.color = %colorSwatch; MaterialEditorGui.updateActiveMaterial(%propName, %color); From 755bbacaa0ee10a5b91c27ab29e604947c7a4adb Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Fri, 24 Sep 2021 19:32:57 -0400 Subject: [PATCH 104/399] Fix specific usage of Con::executef where it was not being assigned to a ConsoleValue before getting it's data out of it. --- Engine/source/Verve/Core/Persistence/VPersistence.h | 5 +++-- Engine/source/afx/afxEffectron.cpp | 3 ++- Engine/source/afx/afxSelectron.cpp | 6 ++++-- Engine/source/console/arrayObject.cpp | 6 ++++-- Engine/source/console/simObjectList.cpp | 3 ++- Engine/source/environment/editors/guiRiverEditorCtrl.cpp | 3 ++- Engine/source/forest/editor/forestBrushTool.cpp | 5 +++-- Engine/source/gui/controls/guiTreeViewCtrl.cpp | 4 +++- Engine/source/gui/editor/guiPopupMenuCtrl.cpp | 4 +++- Engine/source/gui/editor/popupMenu.cpp | 3 ++- Engine/source/gui/worldEditor/worldEditor.cpp | 4 +++- Engine/source/module/moduleManager.cpp | 6 ++++-- Engine/source/util/messaging/scriptMsgListener.cpp | 4 ---- 13 files changed, 35 insertions(+), 21 deletions(-) diff --git a/Engine/source/Verve/Core/Persistence/VPersistence.h b/Engine/source/Verve/Core/Persistence/VPersistence.h index edbc892c8..a350005fc 100644 --- a/Engine/source/Verve/Core/Persistence/VPersistence.h +++ b/Engine/source/Verve/Core/Persistence/VPersistence.h @@ -250,8 +250,9 @@ namespace VPersistence if ( object->isMethod( "onAdd" ) ) { // Callback. - const char *retValue = Con::executef( object, "onAdd" ); - if ( !dAtob( retValue ) ) + ConsoleValue cValue = Con::executef( object, "onAdd" ); + + if ( !cValue.getBool() ) { // Delete. object->deleteObject(); diff --git a/Engine/source/afx/afxEffectron.cpp b/Engine/source/afx/afxEffectron.cpp index 1c68256c1..f90d20f73 100644 --- a/Engine/source/afx/afxEffectron.cpp +++ b/Engine/source/afx/afxEffectron.cpp @@ -989,9 +989,10 @@ afxEffectron::start_effect(afxEffectronData* datablock, SimObject* extra) } // CALL SCRIPT afxEffectronData::onPreactivate(%params, %extra) - const char* result = Con::executef(datablock, "onPreactivate", + ConsoleValue cValue = Con::executef(datablock, "onPreactivate", Con::getIntArg(param_holder->getId()), (extra) ? Con::getIntArg(extra->getId()) : ""); + const char* result = cValue.getString(); if (result && result[0] != '\0' && !dAtob(result)) { #if defined(TORQUE_DEBUG) diff --git a/Engine/source/afx/afxSelectron.cpp b/Engine/source/afx/afxSelectron.cpp index 63157a4f1..1b6194b9a 100644 --- a/Engine/source/afx/afxSelectron.cpp +++ b/Engine/source/afx/afxSelectron.cpp @@ -1068,9 +1068,11 @@ afxSelectron::start_selectron(SceneObject* picked, U8 subcode, SimObject* extra) } // CALL SCRIPT afxSelectronData::onPreactivate(%params, %extra) - const char* result = Con::executef(datablock, "onPreactivate", + ConsoleValue cValue = Con::executef(datablock, "onPreactivate", Con::getIntArg(param_holder->getId()), - (extra) ? Con::getIntArg(extra->getId()) : "").getString(); + (extra) ? Con::getIntArg(extra->getId()) : ""); + + const char* result = cValue.getString(); if (result && result[0] != '\0' && !dAtob(result)) { #if defined(TORQUE_DEBUG) diff --git a/Engine/source/console/arrayObject.cpp b/Engine/source/console/arrayObject.cpp index 92458852d..68b34059e 100644 --- a/Engine/source/console/arrayObject.cpp +++ b/Engine/source/console/arrayObject.cpp @@ -103,7 +103,8 @@ S32 QSORT_CALLBACK ArrayObject::_keyFunctionCompare( const void* a, const void* ArrayObject::Element* ea = ( ArrayObject::Element* )( a ); ArrayObject::Element* eb = ( ArrayObject::Element* )( b ); - S32 result = dAtoi(Con::executef((const char*)smCompareFunction, ea->key, eb->key)); + ConsoleValue cValue = Con::executef((const char*)smCompareFunction, ea->key, eb->key); + S32 result = cValue.getInt(); S32 res = result < 0 ? -1 : ( result > 0 ? 1 : 0 ); return ( smDecreasing ? -res : res ); } @@ -113,7 +114,8 @@ S32 QSORT_CALLBACK ArrayObject::_valueFunctionCompare( const void* a, const void ArrayObject::Element* ea = ( ArrayObject::Element* )( a ); ArrayObject::Element* eb = ( ArrayObject::Element* )( b ); - S32 result = dAtoi( Con::executef( (const char*)smCompareFunction, ea->value, eb->value ) ); + ConsoleValue cValue = Con::executef( (const char*)smCompareFunction, ea->value, eb->value ); + S32 result = cValue.getInt(); S32 res = result < 0 ? -1 : ( result > 0 ? 1 : 0 ); return ( smDecreasing ? -res : res ); } diff --git a/Engine/source/console/simObjectList.cpp b/Engine/source/console/simObjectList.cpp index 8388f6e9d..ac286f22b 100644 --- a/Engine/source/console/simObjectList.cpp +++ b/Engine/source/console/simObjectList.cpp @@ -118,7 +118,8 @@ S32 QSORT_CALLBACK SimObjectList::_callbackSort( const void *a, const void *b ) static char idB[64]; dSprintf( idB, sizeof( idB ), "%d", objB->getId() ); - return dAtoi( Con::executef( (const char*)smSortScriptCallbackFn, idA, idB ) ); + ConsoleValue cValue = Con::executef( (const char*)smSortScriptCallbackFn, idA, idB ); + return cValue.getInt(); } void SimObjectList::scriptSort( const String &scriptCallback ) diff --git a/Engine/source/environment/editors/guiRiverEditorCtrl.cpp b/Engine/source/environment/editors/guiRiverEditorCtrl.cpp index ae9084588..e650fdf59 100644 --- a/Engine/source/environment/editors/guiRiverEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiRiverEditorCtrl.cpp @@ -438,7 +438,8 @@ void GuiRiverEditorCtrl::_process3DMouseDown( const Gui3DMouseEvent& event ) return; } - const char *res = Con::executef( this, "createRiver" ); + ConsoleValue cValue = Con::executef( this, "createRiver" ); + const char* res = cValue.getString(); River *newRiver; if ( !Sim::findObject( res, newRiver ) ) diff --git a/Engine/source/forest/editor/forestBrushTool.cpp b/Engine/source/forest/editor/forestBrushTool.cpp index d0d64d517..5b9278ea6 100644 --- a/Engine/source/forest/editor/forestBrushTool.cpp +++ b/Engine/source/forest/editor/forestBrushTool.cpp @@ -588,7 +588,8 @@ void ForestBrushTool::_collectElements() if ( !Sim::findObject( "ForestEditBrushTree", brushTree ) ) return; - const char* objectIdList = Con::executef( brushTree, "getSelectedObjectList" ); + ConsoleValue cValue = Con::executef( brushTree, "getSelectedObjectList" ); + const char* objectIdList = cValue.getString(); // Collect those objects in a vector and mark them as selected. @@ -685,4 +686,4 @@ bool ForestBrushTool::getGroundAt( const Point3F &worldPt, F32 *zValueOut, Vecto DefineEngineMethod( ForestBrushTool, collectElements, void, (), , "" ) { object->collectElements(); -} \ No newline at end of file +} diff --git a/Engine/source/gui/controls/guiTreeViewCtrl.cpp b/Engine/source/gui/controls/guiTreeViewCtrl.cpp index e2804b1f1..aaed67a78 100644 --- a/Engine/source/gui/controls/guiTreeViewCtrl.cpp +++ b/Engine/source/gui/controls/guiTreeViewCtrl.cpp @@ -637,7 +637,9 @@ void GuiTreeViewCtrl::Item::getTooltipText(U32 bufLen, char *buf) method += pClassName; if(mParentControl->isMethod(method.c_str())) { - const char* tooltip = Con::executef( mParentControl, method.c_str(), pObject->getIdString() ); + ConsoleValue cValue = Con::executef( mParentControl, method.c_str(), pObject->getIdString() ); + const char* tooltip = cValue.getString(); + dsize_t len = dStrlen(buf); S32 newBufLen = bufLen-len; if(dStrlen(tooltip) > 0 && newBufLen > 0) diff --git a/Engine/source/gui/editor/guiPopupMenuCtrl.cpp b/Engine/source/gui/editor/guiPopupMenuCtrl.cpp index 7c63ebe52..ba04467c2 100644 --- a/Engine/source/gui/editor/guiPopupMenuCtrl.cpp +++ b/Engine/source/gui/editor/guiPopupMenuCtrl.cpp @@ -226,7 +226,9 @@ void GuiPopupMenuTextListCtrl::onMouseUp(const GuiEvent &event) if (item) { if (item->mEnabled) - dAtob(Con::executef(mPopup, "onSelectItem", Con::getIntArg(getSelectedCell().y), item->mText.isNotEmpty() ? item->mText : "")); + { + Con::executef(mPopup, "onSelectItem", Con::getIntArg(getSelectedCell().y), item->mText.isNotEmpty() ? item->mText : ""); + } } } diff --git a/Engine/source/gui/editor/popupMenu.cpp b/Engine/source/gui/editor/popupMenu.cpp index 14fff6844..6e7cb39ee 100644 --- a/Engine/source/gui/editor/popupMenu.cpp +++ b/Engine/source/gui/editor/popupMenu.cpp @@ -288,7 +288,8 @@ bool PopupMenu::canHandleID(U32 id) bool PopupMenu::handleSelect(U32 command, const char *text /* = NULL */) { - return dAtob(Con::executef(this, "onSelectItem", Con::getIntArg(command), text ? text : "")); + ConsoleValue cValue = Con::executef(this, "onSelectItem", Con::getIntArg(command), text ? text : ""); + return cValue.getBool(); } ////////////////////////////////////////////////////////////////////////// diff --git a/Engine/source/gui/worldEditor/worldEditor.cpp b/Engine/source/gui/worldEditor/worldEditor.cpp index d6642cd1c..d2aa75c4d 100644 --- a/Engine/source/gui/worldEditor/worldEditor.cpp +++ b/Engine/source/gui/worldEditor/worldEditor.cpp @@ -461,7 +461,9 @@ bool WorldEditor::pasteSelection( bool dropSel ) SimGroup *targetGroup = NULL; if( isMethod( "getNewObjectGroup" ) ) { - const char* targetGroupName = Con::executef( this, "getNewObjectGroup" ); + ConsoleValue cValue = Con::executef( this, "getNewObjectGroup" ); + const char* targetGroupName = cValue.getString(); + if( targetGroupName && targetGroupName[ 0 ] && !Sim::findObject( targetGroupName, targetGroup) ) Con::errorf( "WorldEditor::pasteSelection() - no SimGroup called '%s'", targetGroupName ); } diff --git a/Engine/source/module/moduleManager.cpp b/Engine/source/module/moduleManager.cpp index f91ae060d..08db0da6c 100644 --- a/Engine/source/module/moduleManager.cpp +++ b/Engine/source/module/moduleManager.cpp @@ -397,7 +397,8 @@ bool ModuleManager::loadModuleGroup( const char* pModuleGroup ) if ( pLoadReadyModuleDefinition->getModuleScriptFilePath() != StringTable->EmptyString() ) { // Yes, so execute the script file. - const bool scriptFileExecuted = dAtob( Con::executef("exec", pLoadReadyModuleDefinition->getModuleScriptFilePath() ) ); + ConsoleValue cValue = Con::executef("exec", pLoadReadyModuleDefinition->getModuleScriptFilePath()); + const bool scriptFileExecuted = cValue.getBool(); // Did we execute the script file? if ( scriptFileExecuted ) @@ -784,7 +785,8 @@ bool ModuleManager::loadModuleExplicit( const char* pModuleId, const U32 version if ( pLoadReadyModuleDefinition->getModuleScriptFilePath() != StringTable->EmptyString() ) { // Yes, so execute the script file. - const bool scriptFileExecuted = dAtob( Con::executef("exec", pLoadReadyModuleDefinition->getModuleScriptFilePath() ) ); + ConsoleValue cValue = Con::executef("exec", pLoadReadyModuleDefinition->getModuleScriptFilePath()); + const bool scriptFileExecuted = cValue.getBool(); // Did we execute the script file? if ( !scriptFileExecuted ) diff --git a/Engine/source/util/messaging/scriptMsgListener.cpp b/Engine/source/util/messaging/scriptMsgListener.cpp index fa47b7e7c..f64d2a6b2 100644 --- a/Engine/source/util/messaging/scriptMsgListener.cpp +++ b/Engine/source/util/messaging/scriptMsgListener.cpp @@ -121,7 +121,6 @@ IMPLEMENT_CALLBACK( ScriptMsgListener, onMessageReceived, bool, ( const char* qu bool ScriptMsgListener::onMessageReceived(StringTableEntry queue, const char* event, const char* data) { return onMessageReceived_callback(queue, event, data); - //return dAtob(Con::executef(this, "onMessageReceived", queue, event, data)); } IMPLEMENT_CALLBACK( ScriptMsgListener, onMessageObjectReceived, bool, ( const char* queue, Message *msg ), ( queue, msg ), @@ -135,7 +134,6 @@ IMPLEMENT_CALLBACK( ScriptMsgListener, onMessageObjectReceived, bool, ( const ch bool ScriptMsgListener::onMessageObjectReceived(StringTableEntry queue, Message *msg) { return onMessageObjectReceived_callback(queue, msg); - //return dAtob(Con::executef(this, "onMessageObjectReceived", queue, Con::getIntArg(msg->getId()))); } //----------------------------------------------------------------------------- @@ -150,7 +148,6 @@ IMPLEMENT_CALLBACK( ScriptMsgListener, onAddToQueue, void, ( const char* queue), void ScriptMsgListener::onAddToQueue(StringTableEntry queue) { - //Con::executef(this, "onAddToQueue", queue); onAddToQueue_callback(queue); IMLParent::onAddToQueue(queue); } @@ -176,7 +173,6 @@ IMPLEMENT_CALLBACK( ScriptMsgListener, onRemoveFromQueue, void, ( const char* qu void ScriptMsgListener::onRemoveFromQueue(StringTableEntry queue) { - //Con::executef(this, "onRemoveFromQueue", queue); onRemoveFromQueue_callback(queue); IMLParent::onRemoveFromQueue(queue); } From 58a79e0105a6a88848e4f21c77cf3b6220b2d1b3 Mon Sep 17 00:00:00 2001 From: OTHGMars Date: Fri, 24 Sep 2021 22:55:59 -0400 Subject: [PATCH 105/399] inputTest Module Update Updates the input event monitor to work with the current BaseGame template. --- Templates/Modules/inputTest/inputTest.tscript | 17 +++++++++++------ .../inputTest/scripts/gui/inputMonitor.gui | 2 +- .../inputTest/scripts/menuButtons.tscript | 8 +++++++- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Templates/Modules/inputTest/inputTest.tscript b/Templates/Modules/inputTest/inputTest.tscript index 7dad50618..07f27fc9f 100644 --- a/Templates/Modules/inputTest/inputTest.tscript +++ b/Templates/Modules/inputTest/inputTest.tscript @@ -4,6 +4,11 @@ function inputTest::create( %this ) { + // If addToMainMenu is true, a button to display the input monitor will be + // added to the MainMenu gui. If false, you will need to call + // "$GameCanvas.pushDialog(InputMonitorDlg);" from the console or add a + // shortcut somewhere else to access the Input Event Monitor. + %this.addToMainMenu = true; } function inputTest::destroy( %this ) @@ -13,12 +18,12 @@ function inputTest::destroy( %this ) function inputTest::initClient( %this ) { - %this.queueExec("/scripts/customProfiles." @ $TorqueScriptFileExtension); - %this.queueExec("/scripts/inputMonitor." @ $TorqueScriptFileExtension); - %this.queueExec("/scripts/gui/inputMonitor.gui"); - %this.queueExec("/scripts/joystickSettings." @ $TorqueScriptFileExtension); - %this.queueExec("/scripts/gui/joystickSettings.gui"); - %this.queueExec("/scripts/menuButtons." @ $TorqueScriptFileExtension); + %this.queueExec("./scripts/customProfiles." @ $TorqueScriptFileExtension); + %this.queueExec("./scripts/inputMonitor." @ $TorqueScriptFileExtension); + %this.queueExec("./scripts/gui/inputMonitor.gui"); + %this.queueExec("./scripts/joystickSettings." @ $TorqueScriptFileExtension); + %this.queueExec("./scripts/gui/joystickSettings.gui"); + %this.queueExec("./scripts/menuButtons." @ $TorqueScriptFileExtension); } function onSDLDeviceConnected(%sdlIndex, %deviceName, %deviceType) diff --git a/Templates/Modules/inputTest/scripts/gui/inputMonitor.gui b/Templates/Modules/inputTest/scripts/gui/inputMonitor.gui index 67708cf2e..c695016af 100644 --- a/Templates/Modules/inputTest/scripts/gui/inputMonitor.gui +++ b/Templates/Modules/inputTest/scripts/gui/inputMonitor.gui @@ -55,7 +55,7 @@ $guiContent = new GuiControl(InputMonitorDlg) { canSaveDynamicFields = "0"; }; new GuiChunkedBitmapCtrl() { - bitmap = "data/ui/art/hudfill.png"; + bitmap = "data/ui/images/hudfill.png"; useVariable = "0"; tile = "0"; position = "0 0"; diff --git a/Templates/Modules/inputTest/scripts/menuButtons.tscript b/Templates/Modules/inputTest/scripts/menuButtons.tscript index 471676a07..8f97d2262 100644 --- a/Templates/Modules/inputTest/scripts/menuButtons.tscript +++ b/Templates/Modules/inputTest/scripts/menuButtons.tscript @@ -2,6 +2,8 @@ // Add buttons to the MainMenu after all other scripts have been exec'ed. //----------------------------------------------------------------------------- +function inputTest::addMenuButton( %this ) +{ if (isObject(MainMenuGui)) { %testBtn = new GuiButtonCtrl() { @@ -56,4 +58,8 @@ } MMTestContainer.add(%testBtn); - } \ No newline at end of file + } +} + +if (inputTest.addToMainMenu) + inputTest.addMenuButton(); \ No newline at end of file From 666065ce6c59b917700c0c606843beb424212fe4 Mon Sep 17 00:00:00 2001 From: OTHGMars Date: Sat, 25 Sep 2021 02:48:30 -0400 Subject: [PATCH 106/399] GuiGameListMenuCtrl Update Methods to simplify managing localized option lists. Adds a text key to each option in an option row. Adds methods for getting the current selections index or key value. Adds methods for setting the current selection by index or key value. This change is backward compatible. If the new methods are not called, the control behavior is unaffected. --- .../gui/controls/guiGameListMenuCtrl.cpp | 144 +++++++++++++++++- .../source/gui/controls/guiGameListMenuCtrl.h | 54 ++++++- 2 files changed, 189 insertions(+), 9 deletions(-) diff --git a/Engine/source/gui/controls/guiGameListMenuCtrl.cpp b/Engine/source/gui/controls/guiGameListMenuCtrl.cpp index 61833a8d0..72b3d02f2 100644 --- a/Engine/source/gui/controls/guiGameListMenuCtrl.cpp +++ b/Engine/source/gui/controls/guiGameListMenuCtrl.cpp @@ -237,7 +237,7 @@ void GuiGameListMenuCtrl::onRenderListOption(Row* row, Point2I currentOffset) // calculate text to be at the center between the arrows GFont* font = profile->mFont; - StringTableEntry text = row->mOptions[row->mSelectedOption]; + StringTableEntry text = row->mOptions[row->mSelectedOption].mDisplayText; S32 textWidth = font->getStrWidth(text); S32 columnWidth = profile->mHitAreaLowerRight.x * xScale - profile->mRightPad - columnSplit; S32 columnCenter = columnSplit + (columnWidth >> 1); @@ -489,15 +489,18 @@ void GuiGameListMenuCtrl::addRow(const char* label, const char* optionsList, boo { static StringTableEntry DELIM = StringTable->insert("\t", true); Row* row = new Row(); - Vector options(__FILE__, __LINE__); + Vector options(__FILE__, __LINE__); S32 defaultOption = 0; S32 count = StringUnit::getUnitCount(optionsList, DELIM); for (S32 i = 0; i < count; ++i) { + OptionEntry e; const char* option = StringUnit::getUnit(optionsList, i, DELIM); - options.push_back(StringTable->insert(option, true)); + e.mDisplayText = StringTable->insert(option, true); + e.mKeyString = e.mDisplayText; + options.push_back(e); if (String::compare(option, defaultValue) == 0) defaultOption = options.size() - 1; @@ -1075,12 +1078,38 @@ StringTableEntry GuiGameListMenuCtrl::getCurrentOption(S32 rowIndex) const Row* row = (Row*)mRows[rowIndex]; if (row->mSelectedOption != NO_OPTION) { - return row->mOptions[row->mSelectedOption]; + return row->mOptions[row->mSelectedOption].mDisplayText; } } return StringTable->insert("", false); } +StringTableEntry GuiGameListMenuCtrl::getCurrentOptionKey(S32 rowIndex) const +{ + if (isValidRowIndex(rowIndex)) + { + Row* row = (Row*)mRows[rowIndex]; + if (row->mSelectedOption != NO_OPTION) + { + return row->mOptions[row->mSelectedOption].mKeyString; + } + } + return StringTable->insert("", false); +} + +S32 GuiGameListMenuCtrl::getCurrentOptionIndex(S32 rowIndex) const +{ + if (isValidRowIndex(rowIndex)) + { + Row* row = (Row*)mRows[rowIndex]; + if (row->mSelectedOption != NO_OPTION) + { + return row->mSelectedOption; + } + } + return S32(-1); +} + bool GuiGameListMenuCtrl::selectOption(S32 rowIndex, const char* theOption) { if (!isValidRowIndex(rowIndex)) @@ -1090,9 +1119,9 @@ bool GuiGameListMenuCtrl::selectOption(S32 rowIndex, const char* theOption) Row* row = (Row*)mRows[rowIndex]; - for (Vector::iterator anOption = row->mOptions.begin(); anOption < row->mOptions.end(); ++anOption) + for (Vector::iterator anOption = row->mOptions.begin(); anOption < row->mOptions.end(); ++anOption) { - if (String::compare(*anOption, theOption) == 0) + if (String::compare((*anOption).mDisplayText, theOption) == 0) { S32 newIndex = anOption - row->mOptions.begin(); row->mSelectedOption = newIndex; @@ -1103,6 +1132,45 @@ bool GuiGameListMenuCtrl::selectOption(S32 rowIndex, const char* theOption) return false; } +bool GuiGameListMenuCtrl::selectOptionByKey(S32 rowIndex, const char* optionKey) +{ + if (!isValidRowIndex(rowIndex)) + { + return false; + } + + Row* row = (Row*)mRows[rowIndex]; + + for (Vector::iterator anOption = row->mOptions.begin(); anOption < row->mOptions.end(); ++anOption) + { + if (String::compare((*anOption).mKeyString, optionKey) == 0) + { + S32 newIndex = anOption - row->mOptions.begin(); + row->mSelectedOption = newIndex; + return true; + } + } + + return false; +} + +bool GuiGameListMenuCtrl::selectOptionByIndex(S32 rowIndex, S32 optionIndex) +{ + if (!isValidRowIndex(rowIndex) || (optionIndex < 0)) + { + return false; + } + + Row* row = (Row*)mRows[rowIndex]; + if (optionIndex < row->mOptions.size()) + { + row->mSelectedOption = optionIndex; + return true; + } + + return false; +} + void GuiGameListMenuCtrl::setOptions(S32 rowIndex, const char* optionsList) { static StringTableEntry DELIM = StringTable->insert("\t", true); @@ -1119,7 +1187,10 @@ void GuiGameListMenuCtrl::setOptions(S32 rowIndex, const char* optionsList) for (S32 i = 0; i < count; ++i) { const char* option = StringUnit::getUnit(optionsList, i, DELIM); - row->mOptions[i] = StringTable->insert(option, true); + OptionEntry e; + e.mDisplayText = StringTable->insert(option, true); + e.mKeyString = e.mDisplayText; + row->mOptions[i] = e; } if (row->mSelectedOption >= row->mOptions.size()) @@ -1128,6 +1199,21 @@ void GuiGameListMenuCtrl::setOptions(S32 rowIndex, const char* optionsList) } } +void GuiGameListMenuCtrl::addOption(S32 rowIndex, const char* displayText, const char* keyText) +{ + if (!isValidRowIndex(rowIndex)) + { + return; + } + + OptionEntry e; + e.mDisplayText = StringTable->insert(displayText, true); + e.mKeyString = (keyText[0] == '\0') ? e.mDisplayText : StringTable->insert(keyText, true); + + Row* row = (Row*)mRows[rowIndex]; + row->mOptions.push_back(e); +} + void GuiGameListMenuCtrl::clickOption(Row* row, S32 xPos) { GuiGameListMenuProfile* profile = (GuiGameListMenuProfile*)mProfile; @@ -1566,6 +1652,22 @@ DefineEngineMethod(GuiGameListMenuCtrl, getCurrentOption, const char*, (S32 row) return object->getCurrentOption(row); } +DefineEngineMethod(GuiGameListMenuCtrl, getCurrentOptionKey, const char*, (S32 row), , + "Gets the key string for the currently selected option of the given row.\n\n" + "@param row Index of the row to get the option from.\n" + "@return The key (or id) that was assigned to the selected option on the given row. If there is no selected option then the empty string is returned.") +{ + return object->getCurrentOptionKey(row); +} + +DefineEngineMethod(GuiGameListMenuCtrl, getCurrentOptionIndex, S32, (S32 row), , + "Gets the index into the option list for the currently selected option of the given row.\n\n" + "@param row Index of the row to get the option from.\n" + "@return The index of the selected option on the given row. If there is no selected option then -1 is returned.") +{ + return object->getCurrentOptionIndex(row); +} + DefineEngineMethod(GuiGameListMenuCtrl, selectOption, bool, (S32 row, const char* option), , "Set the row's current option to the one specified\n\n" "@param row Index of the row to set an option on.\n" @@ -1575,6 +1677,24 @@ DefineEngineMethod(GuiGameListMenuCtrl, selectOption, bool, (S32 row, const char return object->selectOption(row, option); } +DefineEngineMethod(GuiGameListMenuCtrl, selectOptionByKey, bool, (S32 row, const char* optionKey), , + "Set the row's current option to the one with the specified key.\n\n" + "@param row Index of the row to set an option on.\n" + "@param optionKey The key string that was assigned to the option to be made active.\n" + "@return True if the row contained the key and the option and was set, false otherwise.") +{ + return object->selectOptionByKey(row, optionKey); +} + +DefineEngineMethod(GuiGameListMenuCtrl, selectOptionByIndex, bool, (S32 row, S32 optionIndex), , + "Set the row's current option to the one at the specified index.\n\n" + "@param row Index of the row to set an option on.\n" + "@param optionIndex The index of the option to be made active.\n" + "@return True if the index was valid and the option and was set, false otherwise.") +{ + return object->selectOptionByIndex(row, optionIndex); +} + DefineEngineMethod(GuiGameListMenuCtrl, setOptions, void, (S32 row, const char* optionsList), , "Sets the list of options on the given row.\n\n" "@param row Index of the row to set options on." @@ -1583,6 +1703,16 @@ DefineEngineMethod(GuiGameListMenuCtrl, setOptions, void, (S32 row, const char* object->setOptions(row, optionsList); } +DefineEngineMethod(GuiGameListMenuCtrl, addOption, void, (S32 row, const char* displayText, const char* keyText), (""), + "Adds an option to the list of options on the given row.\n\n" + "@param row Index of the row to add the option on.\n" + "@param displayText The text to display for this option.\n" + "@param keyText [Optional] The id string to associate with this value. " + "If unset, the id will be the same as the display text.\n") +{ + object->addOption(row, displayText, keyText); +} + DefineEngineMethod(GuiGameListMenuCtrl, getValue, F32, (S32 row), , "Sets the list of options on the given row.\n\n" "@param row Index of the row to set options on." diff --git a/Engine/source/gui/controls/guiGameListMenuCtrl.h b/Engine/source/gui/controls/guiGameListMenuCtrl.h index 15bbf49a3..3e6c3c7b0 100644 --- a/Engine/source/gui/controls/guiGameListMenuCtrl.h +++ b/Engine/source/gui/controls/guiGameListMenuCtrl.h @@ -37,6 +37,18 @@ public: typedef GuiGameListMenuProfile Profile; protected: + + /// \struct OptionEntry + /// Display text and ID key for each entry in an option row. + struct OptionEntry + { + StringTableEntry mDisplayText; ///< The text that is displayed for the option + StringTableEntry mKeyString; ///< Key value that is associated with this option + OptionEntry() : mDisplayText(StringTable->EmptyString()), mKeyString(StringTable->EmptyString()) {} + virtual ~OptionEntry() {} + }; + + /// \struct Row /// Internal data representation of a single row in the control. struct Row @@ -60,7 +72,7 @@ protected: Mode mMode; //List options - Vector mOptions; ///< Collection of options available to display + Vector mOptions; ///< Collection of options available to display S32 mSelectedOption; ///< Index into mOptions pointing at the selected option bool mWrapOptions; ///< Determines if options should "wrap around" at the ends @@ -174,13 +186,43 @@ public: /// string is returned. StringTableEntry getCurrentOption(S32 rowIndex) const; + /// Gets the key string for the currently selected option of the given row + /// + /// \param rowIndex Index of the row to get the option from. + /// \return The key (or id) that was assigned to the selected option on the + /// given row. If there is no selected option then the empty string is returned. + StringTableEntry getCurrentOptionKey(S32 rowIndex) const; + + /// Gets the index into the option list for the currently selected option of the given row. + /// + /// \param rowIndex Index of the row to get the option from. + /// \return The index of the selected option on the given row. If there is no + /// selected option then -1 is returned. + S32 getCurrentOptionIndex(S32 rowIndex) const; + /// Attempts to set the given row to the specified selected option. The option /// will only be set if the option exists in the control. /// /// \param rowIndex Index of the row to set an option on. /// \param option The option to be made active. /// \return True if the row contained the option and was set, false otherwise. - bool selectOption(S32 rowIndex, StringTableEntry option); + bool selectOption(S32 rowIndex, const char* option); + + /// Attempts to set the given row to the option with the specified key. The + /// option will only be set if the key exists in the control. + /// + /// \param rowIndex Index of the row to set an option on. + /// \param optionKey The key string that was assigned to the option to be made active. + /// \return True if the row contained the key and the option and was set, false otherwise. + bool selectOptionByKey(S32 rowIndex, const char* optionKey); + + /// Attempts to set the given row to the option at the specified index. The option + /// will only be set if the index is valid. + /// + /// \param rowIndex Index of the row to set an option on. + /// \param optionIndex The index of the option to be made active. + /// \return True if the index was valid and the option and was set, false otherwise. + bool selectOptionByIndex(S32 rowIndex, S32 optionIndex); /// Sets the list of options on the given row. /// @@ -188,6 +230,14 @@ public: /// \param optionsList A tab separated list of options for the control. void setOptions(S32 rowIndex, const char* optionsList); + /// Adds an option to the list of options on the given row. + /// + /// \param rowIndex Index of the row to set options on. + /// \param displayText The text to display for this option. + /// \param keyText The id string to associate with this value. If NULL the + /// id will be the same as the display text. + void addOption(S32 rowIndex, const char* displayText, const char* keyText); + /// Activates the current row. The script callback of the current row will /// be called (if it has one). virtual void activateRow(); From 7cb306b65a3b5551b4ae4c80a001e27e3c162bcc Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 25 Sep 2021 22:39:40 -0400 Subject: [PATCH 107/399] macos platform fixes for intel macs --- Engine/source/platform/platform.h | 6 +- Engine/source/platform/platformCPU.cpp | 53 +- Engine/source/platform/platformCPUCount.cpp | 657 ------------------ Engine/source/platform/platformCPUCount.h | 11 +- Engine/source/platform/threads/threadPool.cpp | 3 +- Engine/source/platformMac/macCPU.mm | 287 ++++---- 6 files changed, 132 insertions(+), 885 deletions(-) delete mode 100644 Engine/source/platform/platformCPUCount.cpp diff --git a/Engine/source/platform/platform.h b/Engine/source/platform/platform.h index 35cd1a687..4d8d22f3c 100644 --- a/Engine/source/platform/platform.h +++ b/Engine/source/platform/platform.h @@ -73,9 +73,10 @@ enum ProcessorProperties CPU_PROP_RDTSC = (1<<5), ///< Supports Read Time Stamp Counter op. CPU_PROP_SSE2 = (1<<6), ///< Supports SSE2 instruction set extension. CPU_PROP_SSE3 = (1<<7), ///< Supports SSE3 instruction set extension. - CPU_PROP_SSE3xt = (1<<8), ///< Supports extended SSE3 instruction set + CPU_PROP_SSE3ex = (1<<8), ///< Supports extended SSE3 instruction set CPU_PROP_SSE4_1 = (1<<9), ///< Supports SSE4_1 instruction set extension. - CPU_PROP_SSE4_2 = (1<<10), ///< Supports SSE4_2 instruction set extension. + CPU_PROP_SSE4_2 = (1<<10), ///< Supports SSE4_2 instruction set extension. + CPU_PROP_AVX = (1<<11), ///< Supports AVX256 instruction set extension. CPU_PROP_MP = (1<<11), ///< This is a multi-processor system. CPU_PROP_LE = (1<<12), ///< This processor is LITTLE ENDIAN. CPU_PROP_64bit = (1<<13), ///< This processor is 64-bit capable @@ -297,7 +298,6 @@ namespace Platform bool isHyperThreaded; U32 numLogicalProcessors; U32 numPhysicalProcessors; - U32 numAvailableCores; U32 properties; // CPU type specific enum } processor; }; diff --git a/Engine/source/platform/platformCPU.cpp b/Engine/source/platform/platformCPU.cpp index d0a852431..8449d1daa 100644 --- a/Engine/source/platform/platformCPU.cpp +++ b/Engine/source/platform/platformCPU.cpp @@ -28,48 +28,8 @@ Signal Platform::SystemInfoReady; -enum CPUFlags +void SetProcessoInfo(Platform::SystemInfo_struct::Processor& pInfo, char* vendor, char* brand) { - // EDX Register flags - BIT_RDTSC = BIT(4), - BIT_MMX = BIT(23), - BIT_SSE = BIT(25), - BIT_SSE2 = BIT(26), - BIT_3DNOW = BIT(31), // only available for amd cpus in x86 - - // These use a different value for comparison than the above flags (ECX Register) - BIT_SSE3 = BIT(0), - BIT_SSE3xt = BIT(9), - BIT_SSE4_1 = BIT(19), - BIT_SSE4_2 = BIT(20), -}; - -// fill the specified structure with information obtained from asm code -void SetProcessorInfo(Platform::SystemInfo_struct::Processor& pInfo, - char* vendor, char* brand, U32 processor, U32 properties, U32 properties2) -{ - // always assume FPU is available in 2021... - pInfo.properties |= CPU_PROP_FPU; - -#if defined(TORQUE_CPU_X86) || defined(TORQUE_CPU_X64) || defined(TORQUE_CPU_ARM64) - pInfo.properties |= CPU_PROP_LE; -#endif - -#if defined(TORQUE_CPU_X64) || defined(TORQUE_CPU_ARM64) - pInfo.properties |= CPU_PROP_64bit; -#endif - -#if defined(TORQUE_CPU_X86) || defined(TORQUE_CPU_X64) - pInfo.properties |= (properties & BIT_RDTSC) ? CPU_PROP_RDTSC : 0; - pInfo.properties |= (properties & BIT_MMX) ? CPU_PROP_MMX : 0; - pInfo.properties |= (properties & BIT_SSE) ? CPU_PROP_SSE : 0; - pInfo.properties |= (properties & BIT_SSE2) ? CPU_PROP_SSE2 : 0; - pInfo.properties |= (properties2 & BIT_SSE3) ? CPU_PROP_SSE3 : 0; - pInfo.properties |= (properties2 & BIT_SSE3xt) ? CPU_PROP_SSE3xt : 0; - pInfo.properties |= (properties2 & BIT_SSE4_1) ? CPU_PROP_SSE4_1 : 0; - pInfo.properties |= (properties2 & BIT_SSE4_2) ? CPU_PROP_SSE4_2 : 0; -#endif - if (dStricmp(vendor, "GenuineIntel") == 0) { pInfo.type = CPU_Intel; @@ -80,9 +40,6 @@ void SetProcessorInfo(Platform::SystemInfo_struct::Processor& pInfo, { pInfo.name = StringTable->insert(brand ? brand : "AMD (unknown)"); pInfo.type = CPU_AMD; - - // 3dnow! is only available in AMD cpus on x86. Otherwise its not reliably set. - pInfo.properties |= (properties & BIT_3DNOW) ? CPU_PROP_3DNOW : 0; } else if (dStricmp(vendor, "Apple") == 0) { @@ -92,18 +49,22 @@ void SetProcessorInfo(Platform::SystemInfo_struct::Processor& pInfo, else { #if defined(TORQUE_CPU_X86) || defined(TORQUE_CPU_X64) + pInfo.name = StringTable->insert(brand ? brand : "x86 Compatible (unknown)"); pInfo.type = CPU_X86Compatible; + #elif defined(TORQUE_CPU_ARM64) pInfo.name = StringTable->insert(brand ? brand : "Arm Compatible (unknown)"); pInfo.type = CPU_ArmCompatible; + #else #error "Unknown CPU Architecture" + #endif } - + // Get multithreading caps. - CPUInfo::EConfig config = CPUInfo::CPUCount( pInfo.numLogicalProcessors, pInfo.numAvailableCores, pInfo.numPhysicalProcessors ); + CPUInfo::EConfig config = CPUInfo::CPUCount( pInfo.numLogicalProcessors, pInfo.numPhysicalProcessors ); pInfo.isHyperThreaded = CPUInfo::isHyperThreaded( config ); pInfo.isMultiCore = CPUInfo::isMultiCore( config ); diff --git a/Engine/source/platform/platformCPUCount.cpp b/Engine/source/platform/platformCPUCount.cpp deleted file mode 100644 index a3fe99d67..000000000 --- a/Engine/source/platform/platformCPUCount.cpp +++ /dev/null @@ -1,657 +0,0 @@ -// Original code is: -// Copyright (c) 2005 Intel Corporation -// All Rights Reserved -// -// CPUCount.cpp : Detects three forms of hardware multi-threading support across IA-32 platform -// The three forms of HW multithreading are: Multi-processor, Multi-core, and -// HyperThreading Technology. -// This application enumerates all the logical processors enabled by OS and BIOS, -// determine the HW topology of these enabled logical processors in the system -// using information provided by CPUID instruction. -// A multi-processing system can support any combination of the three forms of HW -// multi-threading support. The relevant topology can be identified using a -// three level decomposition of the "initial APIC ID" into -// Package_id, core_id, and SMT_id. Such decomposition provides a three-level map of -// the topology of hardware resources and -// allow multi-threaded software to manage shared hardware resources in -// the platform to reduce resource contention - -// Multicore detection algorithm for processor and cache topology requires -// all leaf functions of CPUID instructions be available. System administrator -// must ensure BIOS settings is not configured to restrict CPUID functionalities. -//------------------------------------------------------------------------------------------------- - -#if defined(TORQUE_OS_LINUX) || defined(LINUX) - -// TODO GCC code don't compile on Release with optimizations, mover code to platform layer - -#else - -#include "platform/platform.h" -#include "platform/platformCPUCount.h" - -#if defined(TORQUE_OS_LINUX) || defined(TORQUE_OS_OSX) - -#ifdef TORQUE_OS_LINUX -// The Linux source code listing can be compiled using Linux kernel verison 2.6 -// or higher (e.g. RH 4AS-2.8 using GCC 3.4.4). -// Due to syntax variances of Linux affinity APIs with earlier kernel versions -// and dependence on glibc library versions, compilation on Linux environment -// with older kernels and compilers may require kernel patches or compiler upgrades. - -#include -#include -#include -#include -#define DWORD unsigned long -#elif defined( TORQUE_OS_WIN ) -#include -#elif defined( TORQUE_OS_MAC ) -# include -# include -#else -#error Not implemented on platform. -#endif -#include -#include - -namespace CPUInfo { - -#define HWD_MT_BIT 0x10000000 // EDX[28] Bit 28 is set if HT or multi-core is supported -#define NUM_LOGICAL_BITS 0x00FF0000 // EBX[23:16] Bit 16-23 in ebx contains the number of logical - // processors per physical processor when execute cpuid with - // eax set to 1 -#define NUM_CORE_BITS 0xFC000000 // EAX[31:26] Bit 26-31 in eax contains the number of cores minus one - // per physical processor when execute cpuid with - // eax set to 4. - - -#define INITIAL_APIC_ID_BITS 0xFF000000 // EBX[31:24] Bits 24-31 (8 bits) return the 8-bit unique - // initial APIC ID for the processor this code is running on. - - - #ifndef TORQUE_OS_MAC - static U32 CpuIDSupported(void); - static U32 find_maskwidth(unsigned int); - static U32 HWD_MTSupported(void); - static U32 MaxLogicalProcPerPhysicalProc(void); - static U32 MaxCorePerPhysicalProc(void); - static U8 GetAPIC_ID(void); - static U8 GetNzbSubID(U8, U8, U8); - #endif - - static char g_s3Levels[2048]; - -#ifndef TORQUE_OS_MAC - - // - // CpuIDSupported will return 0 if CPUID instruction is unavailable. Otherwise, it will return - // the maximum supported standard function. - // - static U32 CpuIDSupported(void) - { - U32 maxInputValue = 0; - // If CPUID instruction is supported -#ifdef TORQUE_COMPILER_GCC - try - { - // call cpuid with eax = 0 - asm - ( - "pushl %%ebx\n\t" - "xorl %%eax,%%eax\n\t" - "cpuid\n\t" - "popl %%ebx\n\t" - : "=a" (maxInputValue) - : - : "%ecx", "%edx" - ); - } - catch (...) - { - return(0); // cpuid instruction is unavailable - } -#elif defined( TORQUE_COMPILER_VISUALC ) - try - { - // call cpuid with eax = 0 - __asm - { - xor eax, eax - cpuid - mov maxInputValue, eax - } - } - catch (...) - { - // cpuid instruction is unavailable - } -#else -# error Not implemented. -#endif - - return maxInputValue; - } - - - - // - // Function returns the maximum cores per physical package. Note that the number of - // AVAILABLE cores per physical to be used by an application might be less than this - // maximum value. - // - - static U32 MaxCorePerPhysicalProc(void) - { - - U32 Regeax = 0; - - if (!HWD_MTSupported()) return (U32) 1; // Single core -#ifdef TORQUE_COMPILER_GCC - { - asm - ( - "pushl %ebx\n\t" - "xorl %eax, %eax\n\t" - "cpuid\n\t" - "cmpl $4, %eax\n\t" // check if cpuid supports leaf 4 - "jl .single_core\n\t" // Single core - "movl $4, %eax\n\t" - "movl $0, %ecx\n\t" // start with index = 0; Leaf 4 reports - "popl %ebx\n\t" - ); // at least one valid cache level - asm - ( - "cpuid" - : "=a" (Regeax) - : - : "%ecx", "%edx" - ); - asm - ( - "jmp .multi_core\n" - ".single_core:\n\t" - "xor %eax, %eax\n" - ".multi_core:" - ); - } -#elif defined( TORQUE_COMPILER_VISUALC ) - __asm - { - xor eax, eax - cpuid - cmp eax, 4 // check if cpuid supports leaf 4 - jl single_core // Single core - mov eax, 4 - mov ecx, 0 // start with index = 0; Leaf 4 reports - cpuid // at least one valid cache level - mov Regeax, eax - jmp multi_core - -single_core: - xor eax, eax - -multi_core: - - } -#else -# error Not implemented. -#endif - return (U32)((Regeax & NUM_CORE_BITS) >> 26)+1; - - } - - - - // - // The function returns 0 when the hardware multi-threaded bit is not set. - // - static U32 HWD_MTSupported(void) - { - - - U32 Regedx = 0; - - - if ((CpuIDSupported() >= 1)) - { -#ifdef TORQUE_COMPILER_GCC - asm - ( - "pushl %%ebx\n\t" - "movl $1,%%eax\n\t" - "cpuid\n\t" - "popl %%ebx\n\t" - : "=d" (Regedx) - : - : "%eax","%ecx" - ); -#elif defined( TORQUE_COMPILER_VISUALC ) - __asm - { - mov eax, 1 - cpuid - mov Regedx, edx - } -#else -# error Not implemented. -#endif - } - - return (Regedx & HWD_MT_BIT); - - - } - - - - // - // Function returns the maximum logical processors per physical package. Note that the number of - // AVAILABLE logical processors per physical to be used by an application might be less than this - // maximum value. - // - static U32 MaxLogicalProcPerPhysicalProc(void) - { - - U32 Regebx = 0; - - if (!HWD_MTSupported()) return (U32) 1; -#ifdef TORQUE_COMPILER_GCC - asm - ( - "movl $1,%%eax\n\t" - "cpuid" - : "=b" (Regebx) - : - : "%eax","%ecx","%edx" - ); -#elif defined( TORQUE_COMPILER_VISUALC ) - __asm - { - mov eax, 1 - cpuid - mov Regebx, ebx - } -#else -# error Not implemented. -#endif - return (unsigned int) ((Regebx & NUM_LOGICAL_BITS) >> 16); - - } - - - static U8 GetAPIC_ID(void) - { - - U32 Regebx = 0; -#ifdef TORQUE_COMPILER_GCC - asm - ( - "movl $1, %%eax\n\t" - "cpuid" - : "=b" (Regebx) - : - : "%eax","%ecx","%edx" - ); - -#elif defined( TORQUE_COMPILER_VISUALC ) - __asm - { - mov eax, 1 - cpuid - mov Regebx, ebx - } -#else -# error Not implemented. -#endif - - return (unsigned char) ((Regebx & INITIAL_APIC_ID_BITS) >> 24); - - } - - // - // Determine the width of the bit field that can represent the value count_item. - // - U32 find_maskwidth(U32 CountItem) - { - U32 MaskWidth, - count = CountItem; -#ifdef TORQUE_COMPILER_GCC - asm - ( -#ifdef __x86_64__ // define constant to compile - "push %%rcx\n\t" // under 64-bit Linux - "push %%rax\n\t" -#else - "pushl %%ecx\n\t" - "pushl %%eax\n\t" -#endif - // "movl $count, %%eax\n\t" //done by Assembler below - "xorl %%ecx, %%ecx" - // "movl %%ecx, MaskWidth\n\t" //done by Assembler below - : "=c" (MaskWidth) - : "a" (count) - // : "%ecx", "%eax" We don't list these as clobbered because we don't want the assembler - //to put them back when we are done - ); - asm - ( - "decl %%eax\n\t" - "bsrw %%ax,%%cx\n\t" - "jz next\n\t" - "incw %%cx\n\t" - // "movl %%ecx, MaskWidth\n" //done by Assembler below - : "=c" (MaskWidth) - : - ); - asm - ( - "next:\n\t" -#ifdef __x86_64__ - "pop %rax\n\t" - "pop %rcx" -#else - "popl %eax\n\t" - "popl %ecx" -#endif - ); - -#elif defined( TORQUE_COMPILER_VISUALC ) - __asm - { - mov eax, count - mov ecx, 0 - mov MaskWidth, ecx - dec eax - bsr cx, ax - jz next - inc cx - mov MaskWidth, ecx -next: - - } -#else -# error Not implemented. -#endif - return MaskWidth; - } - - - // - // Extract the subset of bit field from the 8-bit value FullID. It returns the 8-bit sub ID value - // - static U8 GetNzbSubID(U8 FullID, - U8 MaxSubIDValue, - U8 ShiftCount) - { - U32 MaskWidth; - U8 MaskBits; - - MaskWidth = find_maskwidth((U32) MaxSubIDValue); - MaskBits = (0xff << ShiftCount) ^ - ((U8) (0xff << (ShiftCount + MaskWidth))); - - return (FullID & MaskBits); - } - -#endif - - - // - // - // - EConfig CPUCount(U32& TotAvailLogical, U32& TotAvailCore, U32& PhysicalNum) - { - EConfig StatusFlag = CONFIG_UserConfigIssue; - - g_s3Levels[0] = 0; - TotAvailCore = 1; - PhysicalNum = 1; - - U32 numLPEnabled = 0; - S32 MaxLPPerCore = 1; - -#ifdef TORQUE_OS_MAC - - //FIXME: This isn't a proper port but more or less just some sneaky cheating - // to get around having to mess with yet another crap UNIX-style API. Seems - // like there isn't a way to do this that's working across all OSX incarnations - // and machine configurations anyway. - - S32 numCPUs; - S32 numPackages; - - // Get the number of CPUs. - - size_t len = sizeof( numCPUs ); - if( sysctlbyname( "hw.ncpu", &numCPUs, &len, 0, 0 ) == -1 ) - return CONFIG_UserConfigIssue; - - // Get the number of packages. - len = sizeof( numPackages ); - if( sysctlbyname( "hw.packages", &numPackages, &len, 0, 0 ) == -1 ) - return CONFIG_UserConfigIssue; - - TotAvailCore = numCPUs; - TotAvailLogical = numCPUs; - PhysicalNum = numPackages; -#else - - U32 dwAffinityMask; - S32 j = 0; - U8 apicID, PackageIDMask; - U8 tblPkgID[256], tblCoreID[256], tblSMTID[256]; - char tmp[256]; - -#ifdef TORQUE_OS_LINUX - //we need to make sure that this process is allowed to run on - //all of the logical processors that the OS itself can run on. - //A process could acquire/inherit affinity settings that restricts the - // current process to run on a subset of all logical processor visible to OS. - - // Linux doesn't easily allow us to look at the Affinity Bitmask directly, - // but it does provide an API to test affinity maskbits of the current process - // against each logical processor visible under OS. - S32 sysNumProcs = sysconf(_SC_NPROCESSORS_CONF); //This will tell us how many - //CPUs are currently enabled. - - //this will tell us which processors this process can run on. - cpu_set_t allowedCPUs; - sched_getaffinity(0, sizeof(allowedCPUs), &allowedCPUs); - - for (S32 i = 0; i < sysNumProcs; i++ ) - { - if ( CPU_ISSET(i, &allowedCPUs) == 0 ) - return CONFIG_UserConfigIssue; - } -#elif defined( TORQUE_OS_WIN ) - DWORD dwProcessAffinity, dwSystemAffinity; - GetProcessAffinityMask(GetCurrentProcess(), - &dwProcessAffinity, - &dwSystemAffinity); - if (dwProcessAffinity != dwSystemAffinity) // not all CPUs are enabled - return CONFIG_UserConfigIssue; -#else -# error Not implemented. -#endif - - // Assume that cores within a package have the SAME number of - // logical processors. Also, values returned by - // MaxLogicalProcPerPhysicalProc and MaxCorePerPhysicalProc do not have - // to be power of 2. - - MaxLPPerCore = MaxLogicalProcPerPhysicalProc() / MaxCorePerPhysicalProc(); - dwAffinityMask = 1; - -#ifdef TORQUE_OS_LINUX - cpu_set_t currentCPU; - while ( j < sysNumProcs ) - { - CPU_ZERO(¤tCPU); - CPU_SET(j, ¤tCPU); - if ( sched_setaffinity (0, sizeof(currentCPU), ¤tCPU) == 0 ) - { - sleep(0); // Ensure system to switch to the right CPU -#elif defined( TORQUE_OS_WIN ) - while (dwAffinityMask && dwAffinityMask <= dwSystemAffinity) - { - if (SetThreadAffinityMask(GetCurrentThread(), dwAffinityMask)) - { - Sleep(0); // Ensure system to switch to the right CPU -#else -# error Not implemented. -#endif - apicID = GetAPIC_ID(); - - - // Store SMT ID and core ID of each logical processor - // Shift vlaue for SMT ID is 0 - // Shift value for core ID is the mask width for maximum logical - // processors per core - - tblSMTID[j] = GetNzbSubID(apicID, MaxLPPerCore, 0); - U8 maxCorePPP = MaxCorePerPhysicalProc(); - U8 maskWidth = find_maskwidth(MaxLPPerCore); - tblCoreID[j] = GetNzbSubID(apicID, maxCorePPP, maskWidth); - - // Extract package ID, assume single cluster. - // Shift value is the mask width for max Logical per package - - PackageIDMask = (unsigned char) (0xff << - find_maskwidth(MaxLogicalProcPerPhysicalProc())); - - tblPkgID[j] = apicID & PackageIDMask; - sprintf(tmp," AffinityMask = %d; Initial APIC = %d; Physical ID = %d, Core ID = %d, SMT ID = %d\n", - dwAffinityMask, apicID, tblPkgID[j], tblCoreID[j], tblSMTID[j]); - dStrcat(g_s3Levels, tmp, 2048); - - numLPEnabled ++; // Number of available logical processors in the system. - - } // if - - j++; - dwAffinityMask = 1 << j; - } // while - - // restore the affinity setting to its original state -#ifdef TORQUE_OS_LINUX - sched_setaffinity (0, sizeof(allowedCPUs), &allowedCPUs); - sleep(0); -#elif defined( TORQUE_OS_WIN ) - SetThreadAffinityMask(GetCurrentThread(), dwProcessAffinity); - Sleep(0); -#else -# error Not implemented. -#endif - TotAvailLogical = numLPEnabled; - - // - // Count available cores (TotAvailCore) in the system - // - U8 CoreIDBucket[256]; - DWORD ProcessorMask, pCoreMask[256]; - U32 i, ProcessorNum; - - CoreIDBucket[0] = tblPkgID[0] | tblCoreID[0]; - ProcessorMask = 1; - pCoreMask[0] = ProcessorMask; - - for (ProcessorNum = 1; ProcessorNum < numLPEnabled; ProcessorNum++) - { - ProcessorMask <<= 1; - for (i = 0; i < TotAvailCore; i++) - { - // Comparing bit-fields of logical processors residing in different packages - // Assuming the bit-masks are the same on all processors in the system. - if ((tblPkgID[ProcessorNum] | tblCoreID[ProcessorNum]) == CoreIDBucket[i]) - { - pCoreMask[i] |= ProcessorMask; - break; - } - - } // for i - - if (i == TotAvailCore) // did not match any bucket. Start a new one. - { - CoreIDBucket[i] = tblPkgID[ProcessorNum] | tblCoreID[ProcessorNum]; - pCoreMask[i] = ProcessorMask; - - TotAvailCore++; // Number of available cores in the system - - } - - } // for ProcessorNum - - - // - // Count physical processor (PhysicalNum) in the system - // - U8 PackageIDBucket[256]; - DWORD pPackageMask[256]; - - PackageIDBucket[0] = tblPkgID[0]; - ProcessorMask = 1; - pPackageMask[0] = ProcessorMask; - - for (ProcessorNum = 1; ProcessorNum < numLPEnabled; ProcessorNum++) - { - ProcessorMask <<= 1; - for (i = 0; i < PhysicalNum; i++) - { - // Comparing bit-fields of logical processors residing in different packages - // Assuming the bit-masks are the same on all processors in the system. - if (tblPkgID[ProcessorNum]== PackageIDBucket[i]) - { - pPackageMask[i] |= ProcessorMask; - break; - } - - } // for i - - if (i == PhysicalNum) // did not match any bucket. Start a new one. - { - PackageIDBucket[i] = tblPkgID[ProcessorNum]; - pPackageMask[i] = ProcessorMask; - - PhysicalNum++; // Total number of physical processors in the system - - } - - } // for ProcessorNum -#endif - - // - // Check to see if the system is multi-core - // Check if the system is hyper-threading - // - if (TotAvailCore > PhysicalNum) - { - // Multi-core - if (MaxLPPerCore == 1) - StatusFlag = CONFIG_MultiCoreAndHTNotCapable; - else if (numLPEnabled > TotAvailCore) - StatusFlag = CONFIG_MultiCoreAndHTEnabled; - else StatusFlag = CONFIG_MultiCoreAndHTDisabled; - - } - else - { - // Single-core - if (MaxLPPerCore == 1) - StatusFlag = CONFIG_SingleCoreAndHTNotCapable; - else if (numLPEnabled > TotAvailCore) - StatusFlag = CONFIG_SingleCoreHTEnabled; - else StatusFlag = CONFIG_SingleCoreHTDisabled; - - - } - - - - return StatusFlag; - } - -} // namespace CPUInfo -#endif - -#endif diff --git a/Engine/source/platform/platformCPUCount.h b/Engine/source/platform/platformCPUCount.h index 2ee07c2eb..d008201b3 100644 --- a/Engine/source/platform/platformCPUCount.h +++ b/Engine/source/platform/platformCPUCount.h @@ -29,13 +29,10 @@ namespace CPUInfo { enum EConfig { - CONFIG_UserConfigIssue, CONFIG_SingleCoreHTEnabled, - CONFIG_SingleCoreHTDisabled, CONFIG_SingleCoreAndHTNotCapable, CONFIG_MultiCoreAndHTNotCapable, CONFIG_MultiCoreAndHTEnabled, - CONFIG_MultiCoreAndHTDisabled, }; inline bool isMultiCore( EConfig config ) @@ -44,7 +41,6 @@ namespace CPUInfo { case CONFIG_MultiCoreAndHTNotCapable: case CONFIG_MultiCoreAndHTEnabled: - case CONFIG_MultiCoreAndHTDisabled: return true; default: @@ -65,11 +61,10 @@ namespace CPUInfo } } - EConfig CPUCount( U32& totalAvailableLogical, - U32& totalAvailableCores, - U32& numPhysical ); - + EConfig CPUCount( U32& totalAvailableLogical, U32& totalAvailableCores ); } // namespace CPUInfo +void SetProcessoInfo(Platform::SystemInfo_struct::Processor& pInfo, char* vendor, char* brand); + #endif // _TORQUE_PLATFORM_PLATFORMCOUNT_H_ diff --git a/Engine/source/platform/threads/threadPool.cpp b/Engine/source/platform/threads/threadPool.cpp index 86402522f..1cad50dda 100644 --- a/Engine/source/platform/threads/threadPool.cpp +++ b/Engine/source/platform/threads/threadPool.cpp @@ -322,10 +322,9 @@ ThreadPool::ThreadPool( const char* name, U32 numThreads ) // Platform::SystemInfo will not yet have been initialized. U32 numLogical = 0; - U32 numPhysical = 0; U32 numCores = 0; - CPUInfo::CPUCount( numLogical, numCores, numPhysical ); + CPUInfo::CPUCount( numLogical, numCores ); const U32 baseCount = getMax( numLogical, numCores ); mNumThreads = (baseCount > 0) ? baseCount : 2; diff --git a/Engine/source/platformMac/macCPU.mm b/Engine/source/platformMac/macCPU.mm index 24a1a8a62..8987cff75 100644 --- a/Engine/source/platformMac/macCPU.mm +++ b/Engine/source/platformMac/macCPU.mm @@ -35,15 +35,6 @@ // we now have to use NSProcessInfo #import -//recently removed in Xcode 8 - most likely don't need these anymore -#ifndef CPUFAMILY_INTEL_YONAH -#define CPUFAMILY_INTEL_YONAH 0x73d67300 -#endif - -#ifndef CPUFAMILY_INTEL_MEROM -#define CPUFAMILY_INTEL_MEROM 0x426f69ef -#endif - // Original code by Sean O'Brien (http://www.garagegames.com/community/forums/viewthread/81815). @@ -89,8 +80,58 @@ int _getSysCTLvalue(const char key[], T * dest) { Platform::SystemInfo_struct Platform::SystemInfo; -#define BASE_MHZ_SPEED 0 -//TODO update cpu list +#define BASE_MHZ_SPEED 1000 + +static void detectCpuFeatures(U32 &procflags) +{ + // Now we can directly query the system about a litany of "Optional" processor capabilities + // and determine the status by using BOTH the 'err' value and the 'lraw' value. If we request + // a non-existant feature from SYSCTL(), the 'err' result will be -1; 0 denotes it exists + // >>>> BUT <<<<< + // it may not be supported, only defined. Thus we need to check 'lraw' to determine if it's + // actually supported/implemented by the processor: 0 = no, 1 = yes, others are undefined. + + int err; + U32 lraw; + + // List of chip-specific features + err = _getSysCTLvalue("hw.optional.mmx", &lraw); + if ((err==0)&&(lraw==1)) + procflags |= CPU_PROP_MMX; + err = _getSysCTLvalue("hw.optional.sse", &lraw); + if ((err==0)&&(lraw==1)) + procflags |= CPU_PROP_SSE; + err = _getSysCTLvalue("hw.optional.sse2", &lraw); + if ((err==0)&&(lraw==1)) + procflags |= CPU_PROP_SSE2; + err = _getSysCTLvalue("hw.optional.sse3", &lraw); + if ((err==0)&&(lraw==1)) + procflags |= CPU_PROP_SSE3; + err = _getSysCTLvalue("hw.optional.supplementalsse3", &lraw); + if ((err==0)&&(lraw==1)) + procflags |= CPU_PROP_SSE3ex; + err = _getSysCTLvalue("hw.optional.sse4_1", &lraw); + if ((err==0)&&(lraw==1)) + procflags |= CPU_PROP_SSE4_1; + err = _getSysCTLvalue("hw.optional.sse4_2", &lraw); + if ((err==0)&&(lraw==1)) + procflags |= CPU_PROP_SSE4_2; + err = _getSysCTLvalue("hw.optional.avx1_0", &lraw); + if ((err==0)&&(lraw==1)) + procflags |= CPU_PROP_AVX; + + err = _getSysCTLvalue("hw.ncpu", &lraw); + if ((err==0)&&(lraw>1)) + procflags |= CPU_PROP_MP; + err = _getSysCTLvalue("hw.cpu64bit_capable", &lraw); + if ((err==0)&&(lraw==1)) + procflags |= CPU_PROP_64bit; + err = _getSysCTLvalue("hw.byteorder", &lraw); + if ((err==0)&&(lraw==1234)) + procflags |= CPU_PROP_LE; + +} + void Processor::init() { U32 procflags; @@ -98,178 +139,64 @@ void Processor::init() char buf[255]; U32 lraw; U64 llraw; - - Con::printf( "System & Processor Information:" ); - // Gestalt has been deprecated since Mac OSX Mountain Lion and has stopped working on - // Mac OSX Yosemite. we have to use NSProcessInfo now. // Availability: Mac OS 10.2 or greater. NSString *osVersionStr = [[NSProcessInfo processInfo] operatingSystemVersionString]; - Con::printf( " OSX Version: %s", [osVersionStr UTF8String]); - - err = _getSysCTLstring("kern.ostype", buf, sizeof(buf)); - if (err) - Con::printf( " Unable to determine OS type\n" ); - else - Con::printf( " Mac OS Kernel name: %s", buf); - - err = _getSysCTLstring("kern.osrelease", buf, sizeof(buf)); - if (err) - Con::printf( " Unable to determine OS release number\n" ); - else - Con::printf( " Mac OS Kernel version: %s", buf ); - + + S32 ramMB; err = _getSysCTLvalue("hw.memsize", &llraw); if (err) - Con::printf( " Unable to determine amount of physical RAM\n" ); + ramMB = 512; else - Con::printf( " Physical memory installed: %d MB", (llraw >> 20)); - - err = _getSysCTLvalue("hw.usermem", &lraw); - if (err) - Con::printf( " Unable to determine available user address space\n"); - else - Con::printf( " Addressable user memory: %d MB", (lraw >> 20)); - - //////////////////////////////// - // Values for the Family Type, CPU Type and CPU Subtype are defined in the - // SDK files for the Mach Kernel ==> mach/machine.h - //////////////////////////////// - - // CPU Family, Type, and Subtype - cpufam = 0; - cputype = 0; - cpusub = 0; - err = _getSysCTLvalue("hw.cpufamily", &lraw); - if (err) - Con::printf( " Unable to determine 'family' of CPU\n"); - else { - cpufam = (int) lraw; - err = _getSysCTLvalue("hw.cputype", &lraw); - if (err) - Con::printf( " Unable to determine CPU type\n"); - else { - cputype = (int) lraw; - err = _getSysCTLvalue("hw.cpusubtype", &lraw); - if (err) - Con::printf( " Unable to determine CPU subtype\n"); - else - cpusub = (int) lraw; - // If we've made it this far, - Con::printf( " Installed processor ID: Family 0x%08x Type %d Subtype %d",cpufam, cputype,cpusub); - } - } + ramMB = llraw >> 20; + char brandString[256]; + err = _getSysCTLstring("machdep.cpu.brand_string", brandString, sizeof(brandString)); + if (err) + brandString[0] = '\0'; + + char vendor[256]; + err = _getSysCTLstring("machdep.cpu.vendor", vendor, sizeof(vendor)); + if (err) + vendor[0] = '\0'; + // The Gestalt version was known to have issues with some Processor Upgrade cards // but it is uncertain whether this version has similar issues. err = _getSysCTLvalue("hw.cpufrequency", &llraw); if (err) { llraw = BASE_MHZ_SPEED; - Con::printf( " Unable to determine CPU Frequency. Defaulting to %d MHz\n", llraw); } else { llraw /= 1000000; - Con::printf( " Installed processor clock frequency: %d MHz", llraw); } Platform::SystemInfo.processor.mhz = (unsigned int)llraw; - // Here's one that the original version of this routine couldn't do -- number - // of processors (cores) - U32 ncpu = 1; - err = _getSysCTLvalue("hw.ncpu", &lraw); - if (err) - Con::printf( " Unable to determine number of processor cores\n"); - else - { - ncpu = lraw; - Con::printf( " Installed/available processor cores: %d", lraw); - } - - // Now use CPUFAM to determine and then store the processor type - // and 'friendly name' in GG-accessible structure. Note that since - // we have access to the Family code, the Type and Subtypes are useless. - // - // NOTE: Even this level of detail is almost assuredly not needed anymore - // and the Optional Capability flags (further down) should be more than enough. - switch(cpufam) - { - case CPUFAMILY_INTEL_YONAH: - Platform::SystemInfo.processor.type = CPU_Intel_Core; - if( ncpu == 2 ) - Platform::SystemInfo.processor.name = StringTable->insert("Intel Core Duo"); - else - Platform::SystemInfo.processor.name = StringTable->insert("Intel Core"); - break; - case CPUFAMILY_INTEL_PENRYN: - case CPUFAMILY_INTEL_MEROM: - Platform::SystemInfo.processor.type = CPU_Intel_Core2; - if( ncpu == 4 ) - Platform::SystemInfo.processor.name = StringTable->insert("Intel Core 2 Quad"); - else - Platform::SystemInfo.processor.name = StringTable->insert("Intel Core 2 Duo"); - break; - - case CPUFAMILY_INTEL_NEHALEM: - Platform::SystemInfo.processor.type = CPU_Intel_Core2; - Platform::SystemInfo.processor.name = StringTable->insert( "Intel 'Nehalem' Core Processor" ); - break; - - default: - // explain why we can't get the processor type. - Con::warnf( " Unknown Processor (family, type, subtype): 0x%x\t%d %d", cpufam, cputype, cpusub); - // for now, identify it as an x86 processor, because Apple is moving to Intel chips... - Platform::SystemInfo.processor.type = CPU_X86Compatible; - Platform::SystemInfo.processor.name = StringTable->insert("Unknown Processor, assuming x86 Compatible"); - break; - } - // Now we can directly query the system about a litany of "Optional" processor capabilities - // and determine the status by using BOTH the 'err' value and the 'lraw' value. If we request - // a non-existant feature from SYSCTL(), the 'err' result will be -1; 0 denotes it exists - // >>>> BUT <<<<< - // it may not be supported, only defined. Thus we need to check 'lraw' to determine if it's - // actually supported/implemented by the processor: 0 = no, 1 = yes, others are undefined. - procflags = 0; - // Seriously this one should be an Assert() - err = _getSysCTLvalue("hw.optional.floatingpoint", &lraw); - if ((err==0)&&(lraw==1)) procflags |= CPU_PROP_FPU; - // List of chip-specific features - err = _getSysCTLvalue("hw.optional.mmx", &lraw); - if ((err==0)&&(lraw==1)) procflags |= CPU_PROP_MMX; - err = _getSysCTLvalue("hw.optional.sse", &lraw); - if ((err==0)&&(lraw==1)) procflags |= CPU_PROP_SSE; - err = _getSysCTLvalue("hw.optional.sse2", &lraw); - if ((err==0)&&(lraw==1)) procflags |= CPU_PROP_SSE2; - err = _getSysCTLvalue("hw.optional.sse3", &lraw); - if ((err==0)&&(lraw==1)) procflags |= CPU_PROP_SSE3; - err = _getSysCTLvalue("hw.optional.supplementalsse3", &lraw); - if ((err==0)&&(lraw==1)) procflags |= CPU_PROP_SSE3xt; - err = _getSysCTLvalue("hw.optional.sse4_1", &lraw); - if ((err==0)&&(lraw==1)) procflags |= CPU_PROP_SSE4_1; - err = _getSysCTLvalue("hw.optional.sse4_2", &lraw); - if ((err==0)&&(lraw==1)) procflags |= CPU_PROP_SSE4_2; - - // Finally some architecture-wide settings - err = _getSysCTLvalue("hw.ncpu", &lraw); - if ((err==0)&&(lraw>1)) procflags |= CPU_PROP_MP; - err = _getSysCTLvalue("hw.cpu64bit_capable", &lraw); - if ((err==0)&&(lraw==1)) procflags |= CPU_PROP_64bit; - err = _getSysCTLvalue("hw.byteorder", &lraw); - if ((err==0)&&(lraw==1234)) procflags |= CPU_PROP_LE; - - Platform::SystemInfo.processor.properties = procflags; - - Con::printf( "%s, %2.2f GHz", Platform::SystemInfo.processor.name, F32( Platform::SystemInfo.processor.mhz ) / 1000.0 ); + procflags = CPU_PROP_FPU; + detectCpuFeatures(procflags); + + Platform::SystemInfo.processor.properties = procflags; + SetProcessoInfo(Platform::SystemInfo.processor, vendor, brandString); + + + Con::printf("System & Processor Information:"); + Con::printf(" MacOS Version: %s", [osVersionStr UTF8String]); + Con::printf(" Physical memory installed: %d MB", ramMB); + Con::printf(" Processor: %s", Platform::SystemInfo.processor.name); if (Platform::SystemInfo.processor.properties & CPU_PROP_MMX) - Con::printf( " MMX detected"); + Con::printf(" MMX detected"); if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE) - Con::printf( " SSE detected"); + Con::printf(" SSE detected"); if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE2) - Con::printf( " SSE2 detected"); + Con::printf(" SSE2 detected"); if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE3) - Con::printf( " SSE3 detected"); + Con::printf(" SSE3 detected"); + if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE3ex) + Con::printf(" SSE3ex detected"); if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE4_1) - Con::printf( " SSE4.1 detected"); + Con::printf(" SSE4.1 detected"); if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE4_2) - Con::printf( " SSE4.2 detected"); + Con::printf(" SSE4.2 detected"); + if (Platform::SystemInfo.processor.properties & CPU_PROP_AVX) + Con::printf(" AVX detected"); Con::printf( "" ); @@ -277,16 +204,38 @@ void Processor::init() Platform::SystemInfoReady.trigger(); } + namespace CPUInfo { - EConfig CPUCount(U32 &logical, U32 &numCores, U32 &numPhysical) { - // todo properly implement this - logical = [[NSProcessInfo processInfo] activeProcessorCount]; - numCores = [[NSProcessInfo processInfo] activeProcessorCount]; - numPhysical = [[NSProcessInfo processInfo] processorCount]; + EConfig CPUCount(U32 &logical, U32 &physical) { + U32 lraw; + int err; - // todo check for hyperthreading - if (numCores > 1) - return CONFIG_MultiCoreAndHTNotCapable; - return CONFIG_SingleCoreAndHTNotCapable; + err = _getSysCTLvalue("hw.physicalcpu", &lraw); + if (err == 0) + physical = lraw; + else + physical = 1; + + err = _getSysCTLvalue("hw.logicalcpu", &lraw); + if (err == 0) + { + logical = lraw; + } + else + { + // fallback to querying the number of cpus. If that fails, then assume same as number of cores + err = _getSysCTLvalue("hw.ncpu", &lraw); + if (err == 0) + logical = lraw; + else + logical = physical; + } + + const bool smtEnabled = logical > physical; + + if (physical == 1) + return smtEnabled ? CONFIG_SingleCoreHTEnabled : CONFIG_SingleCoreAndHTNotCapable; + + return smtEnabled ? CONFIG_MultiCoreAndHTEnabled : CONFIG_MultiCoreAndHTNotCapable; } } From 960ea2aa5a2e74f88e6452c200d692f434cde12c Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 25 Sep 2021 22:53:34 -0400 Subject: [PATCH 108/399] Add support for Neon. --- Engine/source/platform/platform.h | 1 + Engine/source/platformMac/macCPU.mm | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Engine/source/platform/platform.h b/Engine/source/platform/platform.h index 4d8d22f3c..2944e596c 100644 --- a/Engine/source/platform/platform.h +++ b/Engine/source/platform/platform.h @@ -80,6 +80,7 @@ enum ProcessorProperties CPU_PROP_MP = (1<<11), ///< This is a multi-processor system. CPU_PROP_LE = (1<<12), ///< This processor is LITTLE ENDIAN. CPU_PROP_64bit = (1<<13), ///< This processor is 64-bit capable + CPU_PROP_NEON = (1<<14), ///< Supports the Arm Neon instruction set extension. }; /// Processor info manager. diff --git a/Engine/source/platformMac/macCPU.mm b/Engine/source/platformMac/macCPU.mm index 8987cff75..e961542e9 100644 --- a/Engine/source/platformMac/macCPU.mm +++ b/Engine/source/platformMac/macCPU.mm @@ -94,6 +94,11 @@ static void detectCpuFeatures(U32 &procflags) int err; U32 lraw; + // All Cpus have fpu + procflags = CPU_PROP_FPU; + +#if defined(TORQUE_CPU_X86) || defined(TORQUE_CPU_X64) + // List of chip-specific features err = _getSysCTLvalue("hw.optional.mmx", &lraw); if ((err==0)&&(lraw==1)) @@ -119,6 +124,12 @@ static void detectCpuFeatures(U32 &procflags) err = _getSysCTLvalue("hw.optional.avx1_0", &lraw); if ((err==0)&&(lraw==1)) procflags |= CPU_PROP_AVX; + +#elif defined(TORQUE_CPU_ARM64) + // All Apple Cpus have Neon + procflags |= CPU_PROP_NEON; + +#endif err = _getSysCTLvalue("hw.ncpu", &lraw); if ((err==0)&&(lraw>1)) @@ -129,12 +140,11 @@ static void detectCpuFeatures(U32 &procflags) err = _getSysCTLvalue("hw.byteorder", &lraw); if ((err==0)&&(lraw==1234)) procflags |= CPU_PROP_LE; - } void Processor::init() { - U32 procflags; + U32 procflags = 0; int err, cpufam, cputype, cpusub; char buf[255]; U32 lraw; @@ -170,7 +180,6 @@ void Processor::init() } Platform::SystemInfo.processor.mhz = (unsigned int)llraw; - procflags = CPU_PROP_FPU; detectCpuFeatures(procflags); Platform::SystemInfo.processor.properties = procflags; @@ -197,7 +206,9 @@ void Processor::init() Con::printf(" SSE4.2 detected"); if (Platform::SystemInfo.processor.properties & CPU_PROP_AVX) Con::printf(" AVX detected"); - + if (Platform::SystemInfo.processor.properties & CPU_PROP_NEON) + Con::printf(" Neon detected"); + Con::printf( "" ); // Trigger the signal From 2181ce08c3264a2809c4a3e7c51a282f1e89a20e Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 26 Sep 2021 03:12:14 -0500 Subject: [PATCH 109/399] lightning ref fixes --- Engine/source/T3D/fx/lightning.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 16e234818..13051d7f4 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -242,7 +242,7 @@ LightningData::LightningData() for (S32 i = 0; i < MaxThunders; i++) { - INIT_SOUNDASSET_ARRAY(ThunderSound, MaxThunders); + INIT_SOUNDASSET_ARRAY(ThunderSound, i); } for (S32 i = 0; i < MaxTextures; i++) @@ -295,7 +295,7 @@ bool LightningData::preload(bool server, String &errorStr) if (server == false) { for (S32 i = 0; i < MaxThunders; i++) { - if (mThunderSound[i]) + if (getThunderSound(i)) { _setThunderSound(getThunderSound(i), i); } @@ -314,7 +314,7 @@ bool LightningData::preload(bool server, String &errorStr) { if (strikeTextureNames[k][0]) { - strikeTextures[k] = GFXTexHandle(strikeTextureNames[i], &GFXStaticTextureProfile, avar("%s() - strikeTextures[%d] (line %d)", __FUNCTION__, k, __LINE__)); + strikeTextures[k] = GFXTexHandle(strikeTextureNames[k], &GFXStaticTextureProfile, avar("%s() - strikeTextures[%d] (line %d)", __FUNCTION__, k, __LINE__)); mNumStrikeTextures++; } } From dba08998874f1b843535a9cbde36862cebfc4506 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 26 Sep 2021 17:30:13 -0500 Subject: [PATCH 110/399] soundasset augments: getProfile methods, test for emptystring, initialize asset arrays lightning provides a conversion sample (attempt. it's still yelling) --- Engine/source/T3D/assets/SoundAsset.h | 15 +++++++++++++++ Engine/source/T3D/fx/lightning.cpp | 12 ++++++------ Engine/source/T3D/fx/lightning.h | 16 ---------------- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index adacf2d9b..df0ac0d6b 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -262,6 +262,12 @@ public: \ Resource get##name##Resource() \ {\ return m##name;\ + }\ + SFXProfile* get##name##Profile()\ + {\ + if (get##name() != StringTable->EmptyString() && m##name##Asset.notNull())\ + return m##name##Asset->getSfxProfile();\ + return NULL;\ } #define DECLARE_SOUNDASSET_SETGET(className, name)\ @@ -436,6 +442,8 @@ public: \ {\ m##name[index] = NULL;\ }\ + if(get##name(index) == StringTable->EmptyString())\ + return true;\ \ if (m##name##Asset[index].notNull() && m##name##Asset[index]->getStatus() != SoundAsset::Ok)\ {\ @@ -466,6 +474,12 @@ public: \ if(id >= sm##name##Count || id < 0)\ return ResourceManager::get().load( "" );\ return m##name[id];\ + }\ + SFXProfile* get##name##Profile(const U32& id)\ + {\ + if (get##name(id) != StringTable->EmptyString() && m##name##Asset[id].notNull())\ + return m##name##Asset[id]->getSfxProfile();\ + return NULL;\ } #define DECLARE_SOUNDASSET_ARRAY_SETGET(className, name)\ @@ -517,6 +531,7 @@ DefineEngineMethod(className, set##name, bool, (const char* map, S32 index), , a m##name##Name[index] = StringTable->EmptyString(); \ m##name##AssetId[index] = StringTable->EmptyString(); \ m##name##Asset[index] = NULL;\ + m##name[index] = NULL;\ } #ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 13051d7f4..2f16f4cc0 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -302,11 +302,11 @@ bool LightningData::preload(bool server, String &errorStr) } for (U32 j = 0; j < MaxThunders; j++) { - if (!getThunderProfile(j)) + if (!getThunderSoundProfile(j)) Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Cant get an sfxProfile for thunder."); } - if(!getSFXProfile()) + if(!getStrikeSoundProfile()) Con::errorf(ConsoleLogEntry::General, "LightningData::preload: can't get sfxProfile from asset"); mNumStrikeTextures = 0; @@ -584,7 +584,7 @@ void Lightning::scheduleThunder(Strike* newStrike) if (t <= 0.03f) { // If it's really close, just play it... U32 thunder = sgLightningRand.randI(0, mDataBlock->numThunders - 1); - SFX->playOnce(mDataBlock->getThunderProfile(thunder)); + SFX->playOnce(mDataBlock->getThunderSoundProfile(thunder)); } else { Thunder* pThunder = new Thunder; pThunder->tRemaining = t; @@ -651,7 +651,7 @@ void Lightning::advanceTime(F32 dt) // Play the sound... U32 thunder = sgLightningRand.randI(0, mDataBlock->numThunders - 1); - SFX->playOnce(mDataBlock->getThunderProfile(thunder)); + SFX->playOnce(mDataBlock->getThunderSoundProfile(thunder)); } else { pThunderWalker = &((*pThunderWalker)->next); } @@ -735,9 +735,9 @@ void Lightning::processEvent(LightningStrikeEvent* pEvent) MatrixF trans(true); trans.setPosition( strikePoint ); - if (mDataBlock->getSFXProfile()) + if (mDataBlock->getStrikeSoundProfile()) { - SFX->playOnce(mDataBlock->getSFXProfile(), &trans ); + SFX->playOnce(mDataBlock->getStrikeSoundProfile(), &trans ); } } diff --git a/Engine/source/T3D/fx/lightning.h b/Engine/source/T3D/fx/lightning.h index f639db3b2..d241257b0 100644 --- a/Engine/source/T3D/fx/lightning.h +++ b/Engine/source/T3D/fx/lightning.h @@ -92,22 +92,6 @@ class LightningData : public GameBaseData DECLARE_CONOBJECT(LightningData); static void initPersistFields(); - - SFXProfile* getThunderProfile(U32 id) - { - if (mThunderSoundAsset[id] != NULL) - return mThunderSoundAsset[id]->getSfxProfile(); - - return NULL; - } - - SFXProfile* getSFXProfile() { - if (mStrikeSoundAsset.notNull()) - return mStrikeSoundAsset->getSfxProfile(); - - return NULL; - } - }; From 7b137c2ee8127511c98abedfa35a139338b12a6b Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 26 Sep 2021 17:30:57 -0500 Subject: [PATCH 111/399] genProcessor("LightningData"... attempt. will need to re-review. --- .../projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript | 1 + 1 file changed, 1 insertion(+) diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript index 645bd38ca..d9eec5f2e 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript @@ -845,6 +845,7 @@ T3Dpre4ProjectImporter::genProcessor("afxModelData", "shapeName shapeAsset shape T3Dpre4ProjectImporter::genProcessor("afxZodiacData", "texture textureAsset"); T3Dpre4ProjectImporter::genProcessor("afxZodiacPlaneData", "texture textureAsset"); T3Dpre4ProjectImporter::genProcessor("sfxEmitter", "track soundAsset filename soundAsset"); +T3Dpre4ProjectImporter::genProcessor("LightningData", "thunderSounds ThunderSoundAsset strikeSound StrikeSoundAsset"); //============================================================================== // Levels //============================================================================== From eb92a8927e37f782d785a2201b46d9c28b43689b Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sun, 26 Sep 2021 19:36:12 -0400 Subject: [PATCH 112/399] M1 Support for cpu detection --- Engine/source/platform/platform.h | 8 ++++---- Engine/source/platformMac/macCPU.mm | 15 +++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Engine/source/platform/platform.h b/Engine/source/platform/platform.h index 2944e596c..f8239f817 100644 --- a/Engine/source/platform/platform.h +++ b/Engine/source/platform/platform.h @@ -77,10 +77,10 @@ enum ProcessorProperties CPU_PROP_SSE4_1 = (1<<9), ///< Supports SSE4_1 instruction set extension. CPU_PROP_SSE4_2 = (1<<10), ///< Supports SSE4_2 instruction set extension. CPU_PROP_AVX = (1<<11), ///< Supports AVX256 instruction set extension. - CPU_PROP_MP = (1<<11), ///< This is a multi-processor system. - CPU_PROP_LE = (1<<12), ///< This processor is LITTLE ENDIAN. - CPU_PROP_64bit = (1<<13), ///< This processor is 64-bit capable - CPU_PROP_NEON = (1<<14), ///< Supports the Arm Neon instruction set extension. + CPU_PROP_MP = (1<<12), ///< This is a multi-processor system. + CPU_PROP_LE = (1<<13), ///< This processor is LITTLE ENDIAN. + CPU_PROP_64bit = (1<<14), ///< This processor is 64-bit capable + CPU_PROP_NEON = (1<<15), ///< Supports the Arm Neon instruction set extension. }; /// Processor info manager. diff --git a/Engine/source/platformMac/macCPU.mm b/Engine/source/platformMac/macCPU.mm index e961542e9..96cf068a9 100644 --- a/Engine/source/platformMac/macCPU.mm +++ b/Engine/source/platformMac/macCPU.mm @@ -81,6 +81,7 @@ int _getSysCTLvalue(const char key[], T * dest) { Platform::SystemInfo_struct Platform::SystemInfo; #define BASE_MHZ_SPEED 1000 +#define BASE_APPLE_SILICON_MHZ_SPEED 3200 static void detectCpuFeatures(U32 &procflags) { @@ -126,8 +127,10 @@ static void detectCpuFeatures(U32 &procflags) procflags |= CPU_PROP_AVX; #elif defined(TORQUE_CPU_ARM64) - // All Apple Cpus have Neon - procflags |= CPU_PROP_NEON; + + err = _getSysCTLvalue("hw.optional.neon", &lraw); + if ((err==0)&&(lraw==1)) + procflags |= CPU_PROP_NEON; #endif @@ -170,11 +173,15 @@ void Processor::init() if (err) vendor[0] = '\0'; - // The Gestalt version was known to have issues with some Processor Upgrade cards - // but it is uncertain whether this version has similar issues. + // Note: hw.cpufrequency seems to be missing on the M1. For Apple Silicon, + // we will assume the base frequency of the M1 which is 3.2ghz err = _getSysCTLvalue("hw.cpufrequency", &llraw); if (err) { +#if defined(TORQUE_CPU_ARM64) + llraw = BASE_APPLE_SILICON_MHZ_SPEED; +#else llraw = BASE_MHZ_SPEED; +#endif } else { llraw /= 1000000; } From ef652ad8b9ee12d9ab11e000aa85335bc97a28e2 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 26 Sep 2021 20:07:49 -0500 Subject: [PATCH 113/399] clean out of the manual getSFXProfile() methods --- Engine/source/T3D/fx/explosion.cpp | 4 ++-- Engine/source/T3D/fx/explosion.h | 7 ------- Engine/source/T3D/fx/precipitation.cpp | 6 +++--- Engine/source/T3D/fx/precipitation.h | 7 ------- Engine/source/T3D/fx/splash.cpp | 4 ++-- Engine/source/T3D/fx/splash.h | 8 -------- Engine/source/T3D/projectile.cpp | 2 +- Engine/source/T3D/projectile.h | 7 ------- 8 files changed, 8 insertions(+), 37 deletions(-) diff --git a/Engine/source/T3D/fx/explosion.cpp b/Engine/source/T3D/fx/explosion.cpp index 6fc59b825..d770e2f36 100644 --- a/Engine/source/T3D/fx/explosion.cpp +++ b/Engine/source/T3D/fx/explosion.cpp @@ -859,7 +859,7 @@ bool ExplosionData::preload(bool server, String &errorStr) if (Parent::preload(server, errorStr) == false) return false; - if (!server && !getSFXProfile()) + if (!server && !getSoundProfile()) return false; if( !server ) @@ -1382,7 +1382,7 @@ bool Explosion::explode() resetWorldBox(); } - SFXProfile* sound_prof = mDataBlock->getSFXProfile(); + SFXProfile* sound_prof = mDataBlock->getSoundProfile(); if (sound_prof) { soundProfile_clone = sound_prof->cloneAndPerformSubstitutions(ss_object, ss_index); diff --git a/Engine/source/T3D/fx/explosion.h b/Engine/source/T3D/fx/explosion.h index 37694dd1e..41116cd32 100644 --- a/Engine/source/T3D/fx/explosion.h +++ b/Engine/source/T3D/fx/explosion.h @@ -73,13 +73,6 @@ class ExplosionData : public GameBaseData { DECLARE_SOUNDASSET(ExplosionData, Sound); DECLARE_SOUNDASSET_SETGET(ExplosionData, Sound); - SFXProfile* getSFXProfile() { - if (mSoundAsset.notNull()) - return mSoundAsset->getSfxProfile(); - - return NULL; - } - ParticleEmitterData* particleEmitter; S32 particleEmitterId; diff --git a/Engine/source/T3D/fx/precipitation.cpp b/Engine/source/T3D/fx/precipitation.cpp index 4356cd45f..bf3246dc9 100644 --- a/Engine/source/T3D/fx/precipitation.cpp +++ b/Engine/source/T3D/fx/precipitation.cpp @@ -189,7 +189,7 @@ bool PrecipitationData::preload( bool server, String &errorStr ) if( Parent::preload( server, errorStr) == false) return false; - if (!server && !getSFXProfile()) + if (!server && !getSoundProfile()) return false; return true; @@ -597,9 +597,9 @@ bool Precipitation::onNewDataBlock( GameBaseData *dptr, bool reload ) { SFX_DELETE( mAmbientSound ); - if ( mDataBlock->getSFXProfile()) + if ( mDataBlock->getSoundProfile()) { - mAmbientSound = SFX->createSource(mDataBlock->getSFXProfile(), &getTransform() ); + mAmbientSound = SFX->createSource(mDataBlock->getSoundProfile(), &getTransform() ); if ( mAmbientSound ) mAmbientSound->play(); } diff --git a/Engine/source/T3D/fx/precipitation.h b/Engine/source/T3D/fx/precipitation.h index f9eb4bf02..719613384 100644 --- a/Engine/source/T3D/fx/precipitation.h +++ b/Engine/source/T3D/fx/precipitation.h @@ -71,13 +71,6 @@ class PrecipitationData : public GameBaseData void onDropChanged() {} void onSplashChanged() {} - - SFXProfile* getSFXProfile() { - if (mSoundAsset.notNull()) - return mSoundAsset->getSfxProfile(); - - return NULL; - } }; struct Raindrop diff --git a/Engine/source/T3D/fx/splash.cpp b/Engine/source/T3D/fx/splash.cpp index c046ef1a0..d1230e5c5 100644 --- a/Engine/source/T3D/fx/splash.cpp +++ b/Engine/source/T3D/fx/splash.cpp @@ -276,7 +276,7 @@ bool SplashData::preload(bool server, String &errorStr) if (Parent::preload(server, errorStr) == false) return false; - if (!server && !getSFXProfile()) + if (!server && !getSoundProfile()) return false; if (!server) @@ -681,7 +681,7 @@ void Splash::spawnExplosion() /// could just play the explosion one, but explosion could be weapon specific, /// splash sound could be liquid specific. food for thought. - SFXProfile* sound_prof = mDataBlock->getSFXProfile(); + SFXProfile* sound_prof = mDataBlock->getSoundProfile(); if (sound_prof) { SFX->playOnce(sound_prof, &getTransform()); diff --git a/Engine/source/T3D/fx/splash.h b/Engine/source/T3D/fx/splash.h index fec9f601e..4cde2db00 100644 --- a/Engine/source/T3D/fx/splash.h +++ b/Engine/source/T3D/fx/splash.h @@ -98,14 +98,6 @@ public: DECLARE_SOUNDASSET(SplashData, Sound); DECLARE_SOUNDASSET_SETGET(SplashData, Sound); - /// this should probably be added as a function higher up to stop repeats. - SFXProfile* getSFXProfile() { - if (mSoundAsset.notNull()) - return mSoundAsset->getSfxProfile(); - - return NULL; - } - ParticleEmitterData* emitterList[NUM_EMITTERS]; S32 emitterIDList[NUM_EMITTERS]; diff --git a/Engine/source/T3D/projectile.cpp b/Engine/source/T3D/projectile.cpp index d7532e368..a88276f73 100644 --- a/Engine/source/T3D/projectile.cpp +++ b/Engine/source/T3D/projectile.cpp @@ -882,7 +882,7 @@ bool Projectile::onNewDataBlock( GameBaseData *dptr, bool reload ) SFX_DELETE( mSound ); if ( mDataBlock->getProjectileSound() ) - mSound = SFX->createSource( mDataBlock->getSFXProfile() ); + mSound = SFX->createSource( mDataBlock->getProjectileSoundProfile() ); } return true; diff --git a/Engine/source/T3D/projectile.h b/Engine/source/T3D/projectile.h index 69bb84001..e633e3fd4 100644 --- a/Engine/source/T3D/projectile.h +++ b/Engine/source/T3D/projectile.h @@ -118,13 +118,6 @@ public: DECLARE_SOUNDASSET(ProjectileData, ProjectileSound); DECLARE_SOUNDASSET_SETGET(ProjectileData, ProjectileSound); - - SFXProfile* getSFXProfile() { - if (mProjectileSoundAsset.notNull()) - return mProjectileSoundAsset->getSfxProfile(); - - return NULL; - } LightDescription *lightDesc; S32 lightDescId; From 24e5db942be6a33c2946ba20d846249efb6e4540 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sun, 26 Sep 2021 23:43:06 -0400 Subject: [PATCH 114/399] flush out windows cpu detection. --- Engine/source/platform/platform.h | 21 +- Engine/source/platform/platformCPUInfo.asm | 128 ------------ Engine/source/platformMac/macCPU.mm | 5 +- Engine/source/platformWin32/winCPUInfo.cpp | 192 ++++++++++-------- .../platformWin32/winPlatformCPUCount.cpp | 38 ++-- 5 files changed, 136 insertions(+), 248 deletions(-) delete mode 100644 Engine/source/platform/platformCPUInfo.asm diff --git a/Engine/source/platform/platform.h b/Engine/source/platform/platform.h index f8239f817..6073786b7 100644 --- a/Engine/source/platform/platform.h +++ b/Engine/source/platform/platform.h @@ -70,17 +70,16 @@ enum ProcessorProperties CPU_PROP_MMX = (1<<2), ///< Supports MMX instruction set extension. CPU_PROP_3DNOW = (1<<3), ///< Supports AMD 3dNow! instruction set extension. CPU_PROP_SSE = (1<<4), ///< Supports SSE instruction set extension. - CPU_PROP_RDTSC = (1<<5), ///< Supports Read Time Stamp Counter op. - CPU_PROP_SSE2 = (1<<6), ///< Supports SSE2 instruction set extension. - CPU_PROP_SSE3 = (1<<7), ///< Supports SSE3 instruction set extension. - CPU_PROP_SSE3ex = (1<<8), ///< Supports extended SSE3 instruction set - CPU_PROP_SSE4_1 = (1<<9), ///< Supports SSE4_1 instruction set extension. - CPU_PROP_SSE4_2 = (1<<10), ///< Supports SSE4_2 instruction set extension. - CPU_PROP_AVX = (1<<11), ///< Supports AVX256 instruction set extension. - CPU_PROP_MP = (1<<12), ///< This is a multi-processor system. - CPU_PROP_LE = (1<<13), ///< This processor is LITTLE ENDIAN. - CPU_PROP_64bit = (1<<14), ///< This processor is 64-bit capable - CPU_PROP_NEON = (1<<15), ///< Supports the Arm Neon instruction set extension. + CPU_PROP_SSE2 = (1<<5), ///< Supports SSE2 instruction set extension. + CPU_PROP_SSE3 = (1<<6), ///< Supports SSE3 instruction set extension. + CPU_PROP_SSE3ex = (1<<7), ///< Supports Supplemental SSE3 instruction set + CPU_PROP_SSE4_1 = (1<<8), ///< Supports SSE4_1 instruction set extension. + CPU_PROP_SSE4_2 = (1<<9), ///< Supports SSE4_2 instruction set extension. + CPU_PROP_AVX = (1<<10), ///< Supports AVX256 instruction set extension. + CPU_PROP_MP = (1<<11), ///< This is a multi-processor system. + CPU_PROP_LE = (1<<12), ///< This processor is LITTLE ENDIAN. + CPU_PROP_64bit = (1<<13), ///< This processor is 64-bit capable + CPU_PROP_NEON = (1<<14), ///< Supports the Arm Neon instruction set extension. }; /// Processor info manager. diff --git a/Engine/source/platform/platformCPUInfo.asm b/Engine/source/platform/platformCPUInfo.asm deleted file mode 100644 index bce39d220..000000000 --- a/Engine/source/platform/platformCPUInfo.asm +++ /dev/null @@ -1,128 +0,0 @@ -;----------------------------------------------------------------------------- -; Copyright (c) 2012 GarageGames, LLC -; -; Permission is hereby granted, free of charge, to any person obtaining a copy -; of this software and associated documentation files (the "Software"), to -; deal in the Software without restriction, including without limitation the -; rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -; sell copies of the Software, and to permit persons to whom the Software is -; furnished to do so, subject to the following conditions: -; -; The above copyright notice and this permission notice shall be included in -; all copies or substantial portions of the Software. -; -; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -; IN THE SOFTWARE. -;----------------------------------------------------------------------------- - - -segment .text - -; syntax: export_fn -%macro export_fn 1 - %ifidn __OUTPUT_FORMAT__, elf - ; No underscore needed for ELF object files - global %1 - %1: - %else - global _%1 - _%1: - %endif -%endmacro - -; push registers -%macro pushreg 0 -; pushad - push ebx - push ebp - push esi - push edi -%endmacro - -; pop registers -%macro popreg 0 - pop edi - pop esi - pop ebp - pop ebx -; popad -%endmacro - -; void detectX86CPUInfo(char *vendor, U32 *processor, U32 *properties); -export_fn detectX86CPUInfo - push ebp - mov ebp, esp - - pushreg - - push edx - push ecx - pushfd - pushfd ; save EFLAGS to stack - pop eax ; move EFLAGS into EAX - mov ebx, eax - xor eax, 0x200000 ; flip bit 21 - push eax - popfd ; restore EFLAGS - pushfd - pop eax - cmp eax, ebx - jz EXIT ; doesn't support CPUID instruction - - ; - ; get vendor information using CPUID eax == 0 - xor eax, eax - cpuid - - ; store the vendor tag (12 bytes in ebx, edx, ecx) in the first parameter, - ; which should be a char[13] - push eax ; save eax - mov eax, [ebp+8] ; store the char* address in eax - mov [eax], ebx ; move ebx into the first 4 bytes - add eax, 4 ; advance the char* 4 bytes - mov [eax], edx ; move edx into the next 4 bytes - add eax, 4 ; advance the char* 4 bytes - mov [eax], ecx ; move ecx into the last 4 bytes - pop eax ; restore eax - - ; get generic extended CPUID info - mov eax, 1 - cpuid ; eax=1, so cpuid queries feature information - - and eax, 0x0fff3fff - push ecx - mov ecx, [ebp+12] - mov [ecx], eax ; just store the model bits in processor param - mov ecx, [ebp+16] - mov [ecx], edx ; set properties param - pop ecx - - ; want to check for 3DNow(tm). - ; need to see if extended cpuid functions present. - mov eax, 0x80000000 - cpuid - cmp eax, 0x80000000 - jbe MAYBE_3DLATER - mov eax, 0x80000001 - cpuid - ; 3DNow if bit 31 set -> put bit in our properties - and edx, 0x80000000 - push eax - mov eax, [ebp+16] - or [eax], edx - pop eax -MAYBE_3DLATER: -EXIT: - popfd - pop ecx - pop edx - - popreg - - pop ebp - ret diff --git a/Engine/source/platformMac/macCPU.mm b/Engine/source/platformMac/macCPU.mm index 96cf068a9..d93bcf25f 100644 --- a/Engine/source/platformMac/macCPU.mm +++ b/Engine/source/platformMac/macCPU.mm @@ -96,7 +96,7 @@ static void detectCpuFeatures(U32 &procflags) U32 lraw; // All Cpus have fpu - procflags = CPU_PROP_FPU; + procflags = CPU_PROP_C | CPU_PROP_FPU; #if defined(TORQUE_CPU_X86) || defined(TORQUE_CPU_X64) @@ -215,6 +215,9 @@ void Processor::init() Con::printf(" AVX detected"); if (Platform::SystemInfo.processor.properties & CPU_PROP_NEON) Con::printf(" Neon detected"); + + if (Platform::SystemInfo.processor.properties & CPU_PROP_MP) + Con::printf(" MultiCore CPU detected [%i cores, %i logical]", Platform::SystemInfo.processor.numPhysicalProcessors, Platform::SystemInfo.processor.numLogicalProcessors); Con::printf( "" ); diff --git a/Engine/source/platformWin32/winCPUInfo.cpp b/Engine/source/platformWin32/winCPUInfo.cpp index 3765f5c51..f8ea9ab2d 100644 --- a/Engine/source/platformWin32/winCPUInfo.cpp +++ b/Engine/source/platformWin32/winCPUInfo.cpp @@ -24,49 +24,15 @@ #include "platformWin32/platformWin32.h" #include "console/console.h" #include "core/stringTable.h" +#include "platform/platformCPUCount.h" #include #include Platform::SystemInfo_struct Platform::SystemInfo; extern void PlatformBlitInit(); -extern void SetProcessorInfo(Platform::SystemInfo_struct::Processor& pInfo, - char* vendor, char* brand, U32 processor, U32 properties, U32 properties2); // platform/platformCPU.cc -void Processor::init() +static void getBrand(char* brand) { - // Reference: - // www.cyrix.com - // www.amd.com - // www.intel.com - // http://developer.intel.com/design/PentiumII/manuals/24512701.pdf - - Con::printf("Processor Init:"); - - Platform::SystemInfo.processor.type = CPU_X86Compatible; - Platform::SystemInfo.processor.name = StringTable->insert("Unknown x86 Compatible"); - Platform::SystemInfo.processor.mhz = 0; - Platform::SystemInfo.processor.properties = CPU_PROP_C; - - char vendor[0x20]; - dMemset(vendor, 0, sizeof(vendor)); - U32 properties = 0; - U32 processor = 0; - U32 properties2 = 0; - - S32 vendorInfo[4]; - __cpuid(vendorInfo, 0); - *reinterpret_cast(vendor) = vendorInfo[1]; // ebx - *reinterpret_cast(vendor + 4) = vendorInfo[3]; // edx - *reinterpret_cast(vendor + 8) = vendorInfo[2]; // ecx - - S32 cpuInfo[4]; - __cpuid(cpuInfo, 1); - processor = cpuInfo[0]; // eax - properties = cpuInfo[3]; // edx - properties2 = cpuInfo[2]; // ecx - - char brand[0x40]; - dMemset(brand, 0, sizeof(brand)); S32 extendedInfo[4]; __cpuid(extendedInfo, 0x80000000); S32 numberExtendedIds = extendedInfo[0]; @@ -88,12 +54,93 @@ void Processor::init() offset += sizeof(S32) * 4; } } +} - SetProcessorInfo(Platform::SystemInfo.processor, vendor, brand, processor, properties, properties2); +enum CpuFlags +{ + // EDX Register flags + BIT_MMX = BIT(23), + BIT_SSE = BIT(25), + BIT_SSE2 = BIT(26), + BIT_3DNOW = BIT(31), // only available for amd cpus in x86 -// now calculate speed of processor... - U32 nearmhz = 0; // nearest rounded mhz - U32 mhz = 0; // calculated value. + // These use a different value for comparison than the above flags (ECX Register) + BIT_SSE3 = BIT(0), + BIT_SSE3ex = BIT(9), + BIT_SSE4_1 = BIT(19), + BIT_SSE4_2 = BIT(20), + + BIT_XSAVE_RESTORE = BIT(27), + BIT_AVX = BIT(28), +}; + +static void detectCpuFeatures(Platform::SystemInfo_struct::Processor &processor) +{ + S32 cpuInfo[4]; + __cpuid(cpuInfo, 1); + U32 eax = cpuInfo[0]; // eax + U32 edx = cpuInfo[3]; // edx + U32 ecx = cpuInfo[2]; // ecx + + if (processor.type == ProcessorType::CPU_AMD) + processor.properties |= (edx & BIT_3DNOW) ? CPU_PROP_3DNOW : 0; + + processor.properties |= (edx & BIT_MMX) ? CPU_PROP_MMX : 0; + processor.properties |= (edx & BIT_SSE) ? CPU_PROP_SSE : 0; + processor.properties |= (edx & BIT_SSE2) ? CPU_PROP_SSE2 : 0; + processor.properties |= (ecx & BIT_SSE3) ? CPU_PROP_SSE3 : 0; + processor.properties |= (ecx & BIT_SSE3ex) ? CPU_PROP_SSE3ex : 0; + processor.properties |= (ecx & BIT_SSE4_1) ? CPU_PROP_SSE4_1 : 0; + processor.properties |= (ecx & BIT_SSE4_2) ? CPU_PROP_SSE4_2 : 0; + + // AVX detection requires that xsaverestore is supported + if (ecx & BIT_XSAVE_RESTORE && ecx & BIT_AVX) + { + bool supportsAVX = _xgetbv(_XCR_XFEATURE_ENABLED_MASK) & 0x6; + if (supportsAVX) + { + processor.properties |= CPU_PROP_AVX; + } + } + + if (processor.isMultiCore) + processor.properties |= CPU_PROP_MP; + +#ifdef TORQUE_CPU_X64 + processor.properties |= CPU_PROP_64bit; +#endif +} + +void Processor::init() +{ + // Reference: + // www.cyrix.com + // www.amd.com + // www.intel.com + // http://developer.intel.com/design/PentiumII/manuals/24512701.pdf + + Platform::SystemInfo.processor.type = CPU_X86Compatible; + Platform::SystemInfo.processor.name = StringTable->insert("Unknown x86 Compatible"); + Platform::SystemInfo.processor.mhz = 0; + Platform::SystemInfo.processor.properties = CPU_PROP_C | CPU_PROP_FPU | CPU_PROP_LE; + + char vendor[0x20]; + dMemset(vendor, 0, sizeof(vendor)); + + S32 vendorInfo[4]; + __cpuid(vendorInfo, 0); + *reinterpret_cast(vendor) = vendorInfo[1]; // ebx + *reinterpret_cast(vendor + 4) = vendorInfo[3]; // edx + *reinterpret_cast(vendor + 8) = vendorInfo[2]; // ecx + + char brand[0x40]; + dMemset(brand, 0, sizeof(brand)); + getBrand(brand); + + SetProcessoInfo(Platform::SystemInfo.processor, vendor, brand); + detectCpuFeatures(Platform::SystemInfo.processor); + + U32 mhz = 1000; // default if it can't be found LONG result; DWORD data = 0; @@ -107,64 +154,37 @@ void Processor::init() result = ::RegQueryValueExA (hKey, "~MHz",NULL, NULL,(LPBYTE)&data, &dataSize); if (result == ERROR_SUCCESS) - nearmhz = mhz = data; + mhz = data; ::RegCloseKey(hKey); } Platform::SystemInfo.processor.mhz = mhz; - if (mhz==0) - { - Con::printf(" %s, (Unknown) Mhz", Platform::SystemInfo.processor.name); - // stick SOMETHING in so it isn't ZERO. - Platform::SystemInfo.processor.mhz = 200; // seems a decent value. - } - else - { - if (nearmhz >= 1000) - Con::printf(" %s, ~%.2f Ghz", Platform::SystemInfo.processor.name, ((float)nearmhz)/1000.0f); - else - Con::printf(" %s, ~%d Mhz", Platform::SystemInfo.processor.name, nearmhz); - if (nearmhz != mhz) - { - if (mhz >= 1000) - Con::printf(" (timed at roughly %.2f Ghz)", ((float)mhz)/1000.0f); - else - Con::printf(" (timed at roughly %d Mhz)", mhz); - } - } - - if( Platform::SystemInfo.processor.numAvailableCores > 0 - || Platform::SystemInfo.processor.numPhysicalProcessors > 0 - || Platform::SystemInfo.processor.isHyperThreaded ) - Platform::SystemInfo.processor.properties |= CPU_PROP_MP; - - if (Platform::SystemInfo.processor.properties & CPU_PROP_FPU) - Con::printf( " FPU detected" ); + Con::printf("Processor Init:"); + Con::printf(" Processor: %s", Platform::SystemInfo.processor.name); if (Platform::SystemInfo.processor.properties & CPU_PROP_MMX) - Con::printf( " MMX detected" ); + Con::printf(" MMX detected" ); if (Platform::SystemInfo.processor.properties & CPU_PROP_3DNOW) - Con::printf( " 3DNow detected" ); + Con::printf(" 3DNow detected" ); if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE) - Con::printf( " SSE detected" ); - if( Platform::SystemInfo.processor.properties & CPU_PROP_SSE2 ) - Con::printf( " SSE2 detected" ); + Con::printf(" SSE detected" ); + if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE2) + Con::printf(" SSE2 detected" ); if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE3) - Con::printf( " SSE3 detected" ); - if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE3xt) - Con::printf( " SSE3ex detected "); + Con::printf(" SSE3 detected" ); + if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE3ex) + Con::printf(" SSE3ex detected "); if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE4_1) - Con::printf( " SSE4.1 detected" ); + Con::printf(" SSE4.1 detected" ); if (Platform::SystemInfo.processor.properties & CPU_PROP_SSE4_2) - Con::printf( " SSE4.2 detected" ); - if( Platform::SystemInfo.processor.isHyperThreaded ) - Con::printf( " HT detected" ); - if( Platform::SystemInfo.processor.properties & CPU_PROP_MP ) - Con::printf( " MP detected [%i cores, %i logical, %i physical]", - Platform::SystemInfo.processor.numAvailableCores, - Platform::SystemInfo.processor.numLogicalProcessors, - Platform::SystemInfo.processor.numPhysicalProcessors ); + Con::printf(" SSE4.2 detected" ); + if (Platform::SystemInfo.processor.properties & CPU_PROP_AVX) + Con::printf(" AVX detected"); + + if (Platform::SystemInfo.processor.properties & CPU_PROP_MP) + Con::printf(" MultiCore CPU detected [%i cores, %i logical]", Platform::SystemInfo.processor.numPhysicalProcessors, Platform::SystemInfo.processor.numLogicalProcessors); + Con::printf(" "); PlatformBlitInit(); diff --git a/Engine/source/platformWin32/winPlatformCPUCount.cpp b/Engine/source/platformWin32/winPlatformCPUCount.cpp index e4a5d54d6..e4b113c67 100644 --- a/Engine/source/platformWin32/winPlatformCPUCount.cpp +++ b/Engine/source/platformWin32/winPlatformCPUCount.cpp @@ -26,6 +26,7 @@ #if defined( TORQUE_OS_WIN ) #include "platform/platformCPUCount.h" +#include "console/console.h" #include #include #include @@ -52,12 +53,10 @@ namespace CPUInfo { return bitSetCount; } - EConfig CPUCount( U32& TotAvailLogical, U32& TotAvailCore, U32& PhysicalNum ) + EConfig CPUCount( U32& TotAvailLogical, U32& TotAvailCore ) { - EConfig StatusFlag = CONFIG_UserConfigIssue; TotAvailLogical = 0; TotAvailCore = 0; - PhysicalNum = 0; PSYSTEM_LOGICAL_PROCESSOR_INFORMATION buffer = NULL; DWORD returnLength = 0; @@ -68,42 +67,37 @@ namespace CPUInfo { rc = GetLogicalProcessorInformation( buffer, &returnLength ); + // if we fail, assume single threaded if( FALSE == rc ) { free( buffer ); - return StatusFlag; + Con::errorf("Unable to determine CPU Count, assuming 1 core"); + TotAvailCore = 1; + TotAvailLogical = 1; + return CONFIG_SingleCoreAndHTNotCapable; } +#pragma push +#pragma warning (disable: 6011) PSYSTEM_LOGICAL_PROCESSOR_INFORMATION ptr = buffer; DWORD byteOffset = 0; while( byteOffset + sizeof( SYSTEM_LOGICAL_PROCESSOR_INFORMATION ) <= returnLength ) { - switch( ptr->Relationship ) - { - - case RelationProcessorCore: + if (ptr->Relationship == RelationProcessorCore) + { TotAvailCore++; - - // A hyperthreaded core supplies more than one logical processor. - TotAvailLogical += CountSetBits( ptr->ProcessorMask ); - break; - - case RelationProcessorPackage: - // Logical processors share a physical package. - PhysicalNum++; - break; - - default: - break; + TotAvailLogical += CountSetBits(ptr->ProcessorMask); } + byteOffset += sizeof( SYSTEM_LOGICAL_PROCESSOR_INFORMATION ); ptr++; - } + } free( buffer ); +#pragma pop - StatusFlag = CONFIG_SingleCoreAndHTNotCapable; + EConfig StatusFlag = CONFIG_SingleCoreAndHTNotCapable; if( TotAvailCore == 1 && TotAvailLogical > TotAvailCore ) StatusFlag = CONFIG_SingleCoreHTEnabled; From 737fd70c6946f4fa6763d4597c14962bf738c28d Mon Sep 17 00:00:00 2001 From: Areloch Date: Mon, 27 Sep 2021 18:46:20 -0500 Subject: [PATCH 115/399] Adjusted handling of field converts in the project importer to deal with fields that didn't contain quotation marks --- .../scripts/projectImporter.tscript | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript index 039a71238..eca0e0b07 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript @@ -516,31 +516,24 @@ function testFilenameExtensions(%filename) function processLegacyField(%line, %originalFieldName, %newFieldName) { - if(!strIsMatchExpr("*"@%originalFieldName@"=*\"*\";*", %line) && - !strIsMatchExpr("*"@%originalFieldName@"[*=*\"*\";*", %line) && - !strIsMatchExpr("*"@%originalFieldName@" *=*\"*\";*", %line)) + if(!strIsMatchExpr("*"@%originalFieldName@"=*;*", %line) && + !strIsMatchExpr("*"@%originalFieldName@"[*=*;*", %line) && + !strIsMatchExpr("*"@%originalFieldName@" *=*;*", %line)) return %line; %outLine = strreplace(%line, %originalFieldName, %newFieldName); //get the value %value = ""; - %pos = strpos(%outLine, "= \""); + %pos = strpos(%outLine, "="); if(%pos != -1) { - %endPos = strpos(%outLine, "\";", %pos); + %endPos = strpos(%outLine, ";", %pos); + %value = getSubStr(%outLine, %pos+1, %endPos-%pos-1); - %value = getSubStr(%outLine, %pos+3, %endPos-%pos-3); - } - else - { - %pos = strpos(%outLine, "=\""); - if(%pos != -1) - { - %endPos = strpos(%outLine, "\";", %pos); - - %value = getSubStr(%outLine, %pos+2, %endPos-%pos-2); - } + %originalValue = %value; + %value = trim(%value); + %value = strreplace(%value, "\"", ""); } if(%outLine !$= %line && %pos != -1 && %endPos != -1 && %value !$= "") @@ -557,8 +550,13 @@ function processLegacyField(%line, %originalFieldName, %newFieldName) if(isObject(%targetFilename)) { - if(%originalFieldName $= "soundProfile") + //likely a material name, so handle it that way + %assetId = MaterialAsset::getAssetIdByMaterialName(%targetFilename); + + if(%assetId $= "" || %assetId $= "Core_Rendering:NoMaterial") { + //if not, just do a lookup directly to see if it was another asset by that name + //e.g. sound profiles when converted will match names $ProjectImporter::assetQuery.clear(); %foundAssets = AssetDatabase.findAssetName($ProjectImporter::assetQuery, %targetFilename); if(%foundAssets != 0) @@ -566,11 +564,6 @@ function processLegacyField(%line, %originalFieldName, %newFieldName) %assetId = $ProjectImporter::assetQuery.getAsset(0); } } - else - { - //likely a material name, so handle it that way - %assetId = MaterialAsset::getAssetIdByMaterialName(%targetFilename); - } } else { @@ -605,6 +598,11 @@ function processLegacyField(%line, %originalFieldName, %newFieldName) if(%assetId !$= "" && AssetDatabase.isDeclaredAsset(%assetId)) { echo("Legacy Project Importer - processing of legacy field line's value: " @ %value @ " has found a matching AssetId: " @ %assetId); + + //double check if this already had the quotes around the value or not + if(!strIsMatchExpr("*\"*\"*", %originalValue)) + %assetId = "\"" @ %assetId @ "\""; + //if (%assetId.getStatusString() $= "Ok") %outLine = strReplace(%outLine, %value, %assetId); //else From 44b81ace69b3141d1c4a5f8c261d55a7cf2307b9 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 27 Sep 2021 20:04:58 -0500 Subject: [PATCH 116/399] don't check a profile if we don't have a sound asset --- Engine/source/T3D/fx/lightning.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 2f16f4cc0..8f1ba8bf6 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -294,19 +294,17 @@ bool LightningData::preload(bool server, String &errorStr) if (server == false) { - for (S32 i = 0; i < MaxThunders; i++) { + for (S32 i = 0; i < MaxThunders; i++) + { if (getThunderSound(i)) { _setThunderSound(getThunderSound(i), i); + if (!getThunderSoundProfile(i)) + Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Cant get an sfxProfile for thunder."); } } - for (U32 j = 0; j < MaxThunders; j++) { - if (!getThunderSoundProfile(j)) - Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Cant get an sfxProfile for thunder."); - } - - if(!getStrikeSoundProfile()) + if(getStrikeSound() && !getStrikeSoundProfile()) Con::errorf(ConsoleLogEntry::General, "LightningData::preload: can't get sfxProfile from asset"); mNumStrikeTextures = 0; From ad0c141189a8ecfe74331115eadee0dc0f75b736 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 27 Sep 2021 21:12:27 -0500 Subject: [PATCH 117/399] use _set for all network recipts of shapes, sounds, images and materials to ensure we at least try and fill that out whichever way is ghosted to us --- Engine/source/T3D/assets/ImageAsset.h | 12 +++++++++--- Engine/source/T3D/assets/MaterialAsset.h | 5 ++++- Engine/source/T3D/assets/ShapeAsset.h | 10 ++++++++-- Engine/source/T3D/assets/SoundAsset.h | 5 ++++- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Engine/source/T3D/assets/ImageAsset.h b/Engine/source/T3D/assets/ImageAsset.h index ff50ef655..b79dc5f5d 100644 --- a/Engine/source/T3D/assets/ImageAsset.h +++ b/Engine/source/T3D/assets/ImageAsset.h @@ -345,7 +345,6 @@ if (m##name##AssetId != StringTable->EmptyString())\ if (stream->writeFlag(m##name##Asset.notNull()))\ {\ stream->writeString(m##name##Asset.getAssetId());\ - _set##name(m##name##AssetId);\ }\ else\ stream->writeString(m##name##Name); @@ -354,9 +353,13 @@ if (m##name##AssetId != StringTable->EmptyString())\ if (stream->readFlag())\ {\ m##name##AssetId = stream->readSTString();\ + _set##name(m##name##AssetId);\ }\ else\ - m##name##Name = stream->readSTString(); + {\ + m##name##Name = stream->readSTString();\ + _set##name(m##name##Name);\ + }\ #define PACK_IMAGEASSET(netconn, name)\ if (stream->writeFlag(m##name##Asset.notNull()))\ @@ -591,7 +594,10 @@ if (m##name##AssetId[index] != StringTable->EmptyString())\ _set##name(m##name##AssetId[index], index);\ }\ else\ - m##name##Name[index] = stream->readSTString(); + {\ + m##name##Name[index] = stream->readSTString();\ + _set##name(m##name##Name[index], index);\ + }\ #define PACK_IMAGEASSET_ARRAY(netconn, name, index)\ if (stream->writeFlag(m##name##Asset[index].notNull()))\ diff --git a/Engine/source/T3D/assets/MaterialAsset.h b/Engine/source/T3D/assets/MaterialAsset.h index 07ec0227a..c747be793 100644 --- a/Engine/source/T3D/assets/MaterialAsset.h +++ b/Engine/source/T3D/assets/MaterialAsset.h @@ -346,7 +346,10 @@ if (m##name##AssetId != StringTable->EmptyString())\ _set##name(m##name##AssetId);\ }\ else\ - m##name##Name = stream->readSTString(); + {\ + m##name##Name = stream->readSTString();\ + _set##name(m##name##Name);\ + }\ #define PACK_MATERIALASSET(netconn, name)\ if (stream->writeFlag(m##name##Asset.notNull()))\ diff --git a/Engine/source/T3D/assets/ShapeAsset.h b/Engine/source/T3D/assets/ShapeAsset.h index d5c899564..d3af516c5 100644 --- a/Engine/source/T3D/assets/ShapeAsset.h +++ b/Engine/source/T3D/assets/ShapeAsset.h @@ -397,7 +397,10 @@ DefineEngineMethod(className, set##name, bool, (const char* shape), , assetText _set##name(m##name##AssetId);\ }\ else\ - m##name##Name = stream->readSTString(); + {\ + m##name##Name = stream->readSTString();\ + _set##name(m##name##Name);\ + } #define PACK_SHAPEASSET(netconn, name)\ if (stream->writeFlag(m##name##Asset.notNull()))\ @@ -609,7 +612,10 @@ DefineEngineMethod(className, set##name, bool, (const char* shape, S32 index), _set##name(m##name##AssetId[index], index);\ }\ else\ - m##name##Name[index] = stream->readSTString(); + {\ + m##name##Name[index] = stream->readSTString();\ + _set##name(m##name##Name[index], index);\ + } #define PACK_SHAPEASSET_ARRAY(netconn, name, index)\ if (stream->writeFlag(m##name##Asset[index].notNull()))\ diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index df0ac0d6b..ca83e477b 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -344,7 +344,10 @@ DefineEngineMethod(className, set##name, bool, (const char* shape), , assetText _set##name(m##name##AssetId);\ }\ else\ - m##name##Name = stream->readSTString(); + {\ + m##name##Name = stream->readSTString();\ + _set##name(m##name##Name);\ + } #define PACK_SOUNDASSET(netconn, name)\ if (stream->writeFlag(m##name##Asset.notNull()))\ From e035aa911481d237a40c0467089df536f00883c0 Mon Sep 17 00:00:00 2001 From: OTHGMars Date: Tue, 28 Sep 2021 05:38:17 -0400 Subject: [PATCH 118/399] GuiCanvas Callbacks Adds handler modes for keyboard translations and native accelerators. This is needed so APIs that provide software keyboards can be notified when controls that require text input become active. This was previously hardcoded in OpenVROverlay, but is also needed by Steam Input and Big Picture so moving to GuiCanvas will make it accessible there as well. Handler mode for both settings default to "Platform" so there is no change to the default behavior. If the setting is changed to "Callback", callbacks will be triggered to allow script to determine if the request should fall through to the platform window. The script callback is also the appropriate place to display a software keyboard and attach it to the input control. --- Engine/source/gui/core/guiCanvas.cpp | 60 +++++++++++++++++++++++++--- Engine/source/gui/core/guiCanvas.h | 19 +++++++++ 2 files changed, 73 insertions(+), 6 deletions(-) diff --git a/Engine/source/gui/core/guiCanvas.cpp b/Engine/source/gui/core/guiCanvas.cpp index 967c3e7d7..8ad674474 100644 --- a/Engine/source/gui/core/guiCanvas.cpp +++ b/Engine/source/gui/core/guiCanvas.cpp @@ -94,6 +94,33 @@ ConsoleDocClass( GuiCanvas, "@ingroup GuiCore\n"); + ImplementEnumType(KeyboardTranslationMode, + "Modes for handling keyboard translation or native accelerator requests.\n\n") + { GuiCanvas::TranslationMode_Platform, "Platform", + "Requests will be passed to the platform window for handling." }, + { GuiCanvas::TranslationMode_Callback, "Callback", + "Script callbacks will be issued to notify and allow override of these events." }, + { GuiCanvas::TranslationMode_Ignore, "Ignore", + "Requsts to enable/disable keyboard translations or native accelerators will be ignored " + "with no callback triggered." }, + EndImplementEnumType; + + IMPLEMENT_CALLBACK(GuiCanvas, onSetKeyboardTranslationEnabled, bool, (bool enable), (enable), + "Called when the canvas receives an enableKeyboardTranslation request. This is usually the " + "result of a GuitTextInputCtrl gaining or losing focus. Return false to allow the request " + "to be passed to the platform window. Return true to override the request and handle it in script.\n\n" + "@note This callback is only issued if keyTranslationMode is set to \"Callback\" for this canvas.\n" + "@param enable Requested keyboard translation state.\n" + "@see KeyboardTranslationMode\n"); + + IMPLEMENT_CALLBACK(GuiCanvas, onSetNativeAcceleratorsEnabled, bool, (bool enable), (enable), + "Called when the canvas receives a setNativeAcceleratorsEnabled request. This is usually the " + "result of a GuitTextInputCtrl gaining or losing focus. Return false to allow the request to " + "be passed to the platform window. Return true to override the request and handle it in script.\n\n" + "@note This callback is only issued if nativeAcceleratorMode is set to \"Callback\" for this canvas.\n" + "@param enable Requested accelerator state.\n" + "@see KeyboardTranslationMode\n"); + ColorI gCanvasClearColor( 255, 0, 255 ); ///< For GFX->clear extern InputModifiers convertModifierBits(const U32 in); @@ -127,6 +154,8 @@ GuiCanvas::GuiCanvas(): GuiControl(), mHoverPositionSet(false), mLeftMouseLast(false), mHoverLeftControlTime(0), + mKeyTranslationMode(TranslationMode_Platform), + mNativeAcceleratorMode(TranslationMode_Platform), mMiddleMouseLast(false), mRightMouseLast(false), mMouseDownPoint(0.0f,0.0f), @@ -183,6 +212,13 @@ void GuiCanvas::initPersistFields() addField("displayWindow", TypeBool, Offset(mDisplayWindow, GuiCanvas), "Controls if the canvas window is rendered or not." ); endGroup("Canvas Rendering"); + addGroup("KeyboardMode Callbacks"); + addField("keyTranslationMode", TYPEID< KeyTranslationMode >(), Offset(mKeyTranslationMode, GuiCanvas), + "How to handle enable/disable keyboard translation requests. \"Platform\", \"Callback\" or \"Ignore\".\n"); + addField("nativeAcceleratorMode", TYPEID< KeyTranslationMode >(), Offset(mNativeAcceleratorMode, GuiCanvas), + "How to handle enable/disable native accelerator requests. \"Platform\", \"Callback\" or \"Ignore\".\n"); + endGroup("KeyboardMode Callbacks"); + Parent::initPersistFields(); } @@ -442,20 +478,32 @@ Point2I GuiCanvas::getWindowSize() void GuiCanvas::enableKeyboardTranslation() { - AssertISV(mPlatformWindow, "GuiCanvas::enableKeyboardTranslation - no window present!"); - mPlatformWindow->setKeyboardTranslation(true); + if ((mKeyTranslationMode == TranslationMode_Platform) || + ((mKeyTranslationMode == TranslationMode_Callback) && onSetKeyboardTranslationEnabled_callback(true))) + { + AssertISV(mPlatformWindow, "GuiCanvas::enableKeyboardTranslation - no window present!"); + mPlatformWindow->setKeyboardTranslation(true); + } } void GuiCanvas::disableKeyboardTranslation() { - AssertISV(mPlatformWindow, "GuiCanvas::disableKeyboardTranslation - no window present!"); - mPlatformWindow->setKeyboardTranslation(false); + if ((mKeyTranslationMode == TranslationMode_Platform) || + ((mKeyTranslationMode == TranslationMode_Callback) && onSetKeyboardTranslationEnabled_callback(false))) + { + AssertISV(mPlatformWindow, "GuiCanvas::disableKeyboardTranslation - no window present!"); + mPlatformWindow->setKeyboardTranslation(false); + } } void GuiCanvas::setNativeAcceleratorsEnabled( bool enabled ) { - AssertISV(mPlatformWindow, "GuiCanvas::setNativeAcceleratorsEnabled - no window present!"); - mPlatformWindow->setAcceleratorsEnabled( enabled ); + if ((mNativeAcceleratorMode == TranslationMode_Platform) || + ((mNativeAcceleratorMode == TranslationMode_Callback) && onSetNativeAcceleratorsEnabled_callback(enabled))) + { + AssertISV(mPlatformWindow, "GuiCanvas::setNativeAcceleratorsEnabled - no window present!"); + mPlatformWindow->setAcceleratorsEnabled(enabled); + } } void GuiCanvas::setForceMouseToGUI(bool onOff) diff --git a/Engine/source/gui/core/guiCanvas.h b/Engine/source/gui/core/guiCanvas.h index f9f4a37af..fdb1cfd25 100644 --- a/Engine/source/gui/core/guiCanvas.h +++ b/Engine/source/gui/core/guiCanvas.h @@ -178,6 +178,19 @@ protected: bool mHoverPositionSet; U32 mHoverLeftControlTime; +public: + /// Setting for how to handle 'enableKeyboardTranslation' and 'setNativeAcceleratorsEnabled' requests. + enum KeyTranslationMode + { + TranslationMode_Platform, + TranslationMode_Callback, + TranslationMode_Ignore, + }; + +protected: + KeyTranslationMode mKeyTranslationMode; + KeyTranslationMode mNativeAcceleratorMode; + /// @} // Internal event handling callbacks for use with PlatformWindow. @@ -454,6 +467,10 @@ public: virtual void setWindowTitle(const char *newTitle); + DECLARE_CALLBACK(bool, onSetKeyboardTranslationEnabled, (bool enable)); + DECLARE_CALLBACK(bool, onSetNativeAcceleratorsEnabled, (bool enable)); + + private: static const U32 MAX_GAMEPADS = 4; ///< The maximum number of supported gamepads protected: @@ -464,5 +481,7 @@ private: void setConsumeLastInputEvent(bool flag) { mConsumeLastInputEvent = flag; } bool getLastCursorPoint(Point2I& pt) const { pt = mLastCursorPt; return mLastCursorEnabled; } }; +typedef GuiCanvas::KeyTranslationMode KeyboardTranslationMode; +DefineEnumType(KeyboardTranslationMode); #endif From 37c924512c4bb7856de65d35b8fa8ff4204214b1 Mon Sep 17 00:00:00 2001 From: OTHGMars Date: Tue, 28 Sep 2021 05:52:45 -0400 Subject: [PATCH 119/399] Corrects console documentation. --- Engine/source/gui/core/guiCanvas.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Engine/source/gui/core/guiCanvas.cpp b/Engine/source/gui/core/guiCanvas.cpp index 8ad674474..96022edaa 100644 --- a/Engine/source/gui/core/guiCanvas.cpp +++ b/Engine/source/gui/core/guiCanvas.cpp @@ -107,16 +107,16 @@ ConsoleDocClass( GuiCanvas, IMPLEMENT_CALLBACK(GuiCanvas, onSetKeyboardTranslationEnabled, bool, (bool enable), (enable), "Called when the canvas receives an enableKeyboardTranslation request. This is usually the " - "result of a GuitTextInputCtrl gaining or losing focus. Return false to allow the request " - "to be passed to the platform window. Return true to override the request and handle it in script.\n\n" + "result of a GuitTextInputCtrl gaining or losing focus. Return true to allow the request " + "to be passed to the platform window. Return false to override the request and handle it in script.\n\n" "@note This callback is only issued if keyTranslationMode is set to \"Callback\" for this canvas.\n" "@param enable Requested keyboard translation state.\n" "@see KeyboardTranslationMode\n"); IMPLEMENT_CALLBACK(GuiCanvas, onSetNativeAcceleratorsEnabled, bool, (bool enable), (enable), "Called when the canvas receives a setNativeAcceleratorsEnabled request. This is usually the " - "result of a GuitTextInputCtrl gaining or losing focus. Return false to allow the request to " - "be passed to the platform window. Return true to override the request and handle it in script.\n\n" + "result of a GuitTextInputCtrl gaining or losing focus. Return true to allow the request to " + "be passed to the platform window. Return false to override the request and handle it in script.\n\n" "@note This callback is only issued if nativeAcceleratorMode is set to \"Callback\" for this canvas.\n" "@param enable Requested accelerator state.\n" "@see KeyboardTranslationMode\n"); From 8a1d3f2021cab0a8e3db7f68a7e534a981ae8c1b Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Tue, 28 Sep 2021 13:56:35 +0100 Subject: [PATCH 120/399] Working thunder. These changes may need to be applied to other sound arrays or image arrays. --- Engine/source/T3D/assets/SoundAsset.cpp | 10 +++++----- Engine/source/T3D/fx/lightning.cpp | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Engine/source/T3D/assets/SoundAsset.cpp b/Engine/source/T3D/assets/SoundAsset.cpp index 72a3a2526..45f78bc48 100644 --- a/Engine/source/T3D/assets/SoundAsset.cpp +++ b/Engine/source/T3D/assets/SoundAsset.cpp @@ -279,18 +279,18 @@ StringTableEntry SoundAsset::getAssetIdByFileName(StringTableEntry fileName) return materialAssetId; } -U32 SoundAsset::getAssetById(StringTableEntry assetId, AssetPtr* materialAsset) +U32 SoundAsset::getAssetById(StringTableEntry assetId, AssetPtr* soundAsset) { - (*materialAsset) = assetId; + (*soundAsset) = assetId; - if (materialAsset->notNull()) + if (soundAsset->notNull()) { - return (*materialAsset)->mLoadedState; + return (*soundAsset)->mLoadedState; } else { //Well that's bad, loading the fallback failed. - Con::warnf("MaterialAsset::getAssetById - Finding of asset with id %s failed with no fallback asset", assetId); + Con::warnf("SoundAsset::getAssetById - Finding of asset with id %s failed with no fallback asset", assetId); return AssetErrCode::Failed; } } diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 8f1ba8bf6..e032284e7 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -265,7 +265,9 @@ void LightningData::initPersistFields() INITPERSISTFIELD_SOUNDASSET(StrikeSound, LightningData, "Sound to play when lightning STRIKES!"); + addArray("Thunders", MaxThunders); INITPERSISTFIELD_SOUNDASSET_ARRAY(ThunderSound, MaxThunders, LightningData, "Sounds for thunder."); + endArray("Thunders"); addField( "strikeTextures", TypeString, Offset(strikeTextureNames, LightningData), MaxTextures, "List of textures to use to render lightning strikes." ); @@ -299,9 +301,13 @@ bool LightningData::preload(bool server, String &errorStr) if (getThunderSound(i)) { _setThunderSound(getThunderSound(i), i); + Con::printf("Thunder sound: %d %s", i, getThunderSound(i)); + if (!getThunderSoundProfile(i)) Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Cant get an sfxProfile for thunder."); + } + } if(getStrikeSound() && !getStrikeSoundProfile()) From 4429de59b04a0631721a64a3485103983dca314a Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Tue, 28 Sep 2021 14:08:27 +0100 Subject: [PATCH 121/399] okay so addArray isn't even required. --- Engine/source/T3D/fx/lightning.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index e032284e7..6726c5183 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -265,9 +265,7 @@ void LightningData::initPersistFields() INITPERSISTFIELD_SOUNDASSET(StrikeSound, LightningData, "Sound to play when lightning STRIKES!"); - addArray("Thunders", MaxThunders); INITPERSISTFIELD_SOUNDASSET_ARRAY(ThunderSound, MaxThunders, LightningData, "Sounds for thunder."); - endArray("Thunders"); addField( "strikeTextures", TypeString, Offset(strikeTextureNames, LightningData), MaxTextures, "List of textures to use to render lightning strikes." ); From 76addc52eb73fdb631380c27beb3e7a6f61f8e89 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Tue, 28 Sep 2021 21:10:48 +0100 Subject: [PATCH 122/399] Checks for emptyString in preload Sound asset out for emptyString --- Engine/source/T3D/assets/SoundAsset.h | 2 ++ Engine/source/T3D/fx/explosion.cpp | 10 +++++++++- Engine/source/T3D/fx/lightning.cpp | 11 ++++++++--- Engine/source/T3D/fx/precipitation.cpp | 11 +++++++++-- Engine/source/T3D/fx/splash.cpp | 12 +++++++++--- Engine/source/T3D/projectile.cpp | 9 +++++++-- 6 files changed, 44 insertions(+), 11 deletions(-) diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index ca83e477b..502732fee 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -235,6 +235,8 @@ public: \ m##name = NULL;\ }\ \ + if(get##name() == StringTable->EmptyString())\ + return true;\ if (m##name##Asset.notNull() && m##name##Asset->getStatus() != SoundAsset::Ok)\ {\ Con::errorf("%s(%s)::_set%s() - sound asset failure\"%s\" due to [%s]", macroText(className), getName(), macroText(name), _in, SoundAsset::getAssetErrstrn(m##name##Asset->getStatus()).c_str());\ diff --git a/Engine/source/T3D/fx/explosion.cpp b/Engine/source/T3D/fx/explosion.cpp index d770e2f36..17aa6017c 100644 --- a/Engine/source/T3D/fx/explosion.cpp +++ b/Engine/source/T3D/fx/explosion.cpp @@ -864,7 +864,15 @@ bool ExplosionData::preload(bool server, String &errorStr) if( !server ) { - String sfxErrorStr; + + if (getSound() != StringTable->EmptyString()) + { + _setSound(getSound()); + + if (!getSoundProfile()) + Con::errorf(ConsoleLogEntry::General, "SplashData::preload: Cant get an sfxProfile for splash."); + } + if (!particleEmitter && particleEmitterId != 0) if (Sim::findObject(particleEmitterId, particleEmitter) == false) Con::errorf(ConsoleLogEntry::General, "Error, unable to load particle emitter for explosion datablock"); diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 6726c5183..a53a1f540 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -296,7 +296,7 @@ bool LightningData::preload(bool server, String &errorStr) { for (S32 i = 0; i < MaxThunders; i++) { - if (getThunderSound(i)) + if (getThunderSound(i) != StringTable->EmptyString()) { _setThunderSound(getThunderSound(i), i); Con::printf("Thunder sound: %d %s", i, getThunderSound(i)); @@ -308,8 +308,13 @@ bool LightningData::preload(bool server, String &errorStr) } - if(getStrikeSound() && !getStrikeSoundProfile()) - Con::errorf(ConsoleLogEntry::General, "LightningData::preload: can't get sfxProfile from asset"); + if (getStrikeSound() != StringTable->EmptyString()) + { + _setStrikeSound(getStrikeSound()); + + if(!getStrikeSoundProfile()) + Con::errorf(ConsoleLogEntry::General, "LightningData::preload: can't get sfxProfile from strike sound."); + } mNumStrikeTextures = 0; for (U32 k = 0; k < MaxTextures; k++) diff --git a/Engine/source/T3D/fx/precipitation.cpp b/Engine/source/T3D/fx/precipitation.cpp index bf3246dc9..68880edf4 100644 --- a/Engine/source/T3D/fx/precipitation.cpp +++ b/Engine/source/T3D/fx/precipitation.cpp @@ -188,9 +188,16 @@ bool PrecipitationData::preload( bool server, String &errorStr ) { if( Parent::preload( server, errorStr) == false) return false; + if (!server) + { + if (getSound() != StringTable->EmptyString()) + { + _setSound(getSound()); - if (!server && !getSoundProfile()) - return false; + if (!getSoundProfile()) + Con::errorf(ConsoleLogEntry::General, "SplashData::preload: Cant get an sfxProfile for splash."); + } + } return true; } diff --git a/Engine/source/T3D/fx/splash.cpp b/Engine/source/T3D/fx/splash.cpp index d1230e5c5..38a4f4e89 100644 --- a/Engine/source/T3D/fx/splash.cpp +++ b/Engine/source/T3D/fx/splash.cpp @@ -276,11 +276,17 @@ bool SplashData::preload(bool server, String &errorStr) if (Parent::preload(server, errorStr) == false) return false; - if (!server && !getSoundProfile()) - return false; - if (!server) { + + if (getSound() != StringTable->EmptyString()) + { + _setSound(getSound()); + + if(!getSoundProfile()) + Con::errorf(ConsoleLogEntry::General, "SplashData::preload: Cant get an sfxProfile for splash."); + } + S32 i; for( i=0; iEmptyString()) + { + _setProjectileSound(getProjectileSound()); + + if (!getProjectileSoundProfile()) + Con::errorf(ConsoleLogEntry::General, "SplashData::preload: Cant get an sfxProfile for splash."); + } if (!lightDesc && lightDescId != 0) if (Sim::findObject(lightDescId, lightDesc) == false) From 96891e5673ca114f3d5c5490cdc180cb0cf2b57e Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Tue, 28 Sep 2021 17:33:36 -0500 Subject: [PATCH 123/399] early out if any asset feed route results in explicitly being told to use an emptystring --- Engine/source/T3D/assets/SoundAsset.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index ca83e477b..d6baadbbf 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -234,6 +234,8 @@ public: \ {\ m##name = NULL;\ }\ + if(get##name() == StringTable->EmptyString())\ + return true;\ \ if (m##name##Asset.notNull() && m##name##Asset->getStatus() != SoundAsset::Ok)\ {\ From 6bec47d3fa9855030f5f6506c257fc0dc8a49f42 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Tue, 28 Sep 2021 23:36:04 +0100 Subject: [PATCH 124/399] -SoundAsset added init for enum types. -Vehicles updated to use enum initpersistfield. --- Engine/source/T3D/assets/SoundAsset.h | 10 +++++++ Engine/source/T3D/vehicles/hoverVehicle.cpp | 14 +++++++-- Engine/source/T3D/vehicles/vehicle.cpp | 30 ++++++++++++++++--- Engine/source/T3D/vehicles/wheeledVehicle.cpp | 15 ++++++++-- Engine/source/T3D/vehicles/wheeledVehicle.h | 1 + 5 files changed, 62 insertions(+), 8 deletions(-) diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index 502732fee..486aca6c0 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -371,6 +371,16 @@ DefineEngineMethod(className, set##name, bool, (const char* shape), , assetText #pragma endregion +#define assetEnumNameConcat(x,suff,ForT)(new std::string(std::string(#x) + suff + std::string(#ForT)))->c_str() + +#define INITPERSISTFIELD_SOUNDASSET_ENUMED(name, enumType, maxValue, consoleClass, docs) \ + for (U32 i = 0; i <= maxValue; i++)\ + {\ + const char* enumString = castConsoleTypeToString(static_cast(i));\ + addProtectedField(assetEnumNameConcat(name,enumString, File), TypeSoundFilename, Offset(m##name##Name[i], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, docs), AbstractClassRep::FIELD_HideInInspectors); \ + addProtectedField(assetEnumNameConcat(name,enumString, Asset), TypeSoundAssetId, Offset(m##name##AssetId[i], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, asset reference.));\ + }\ + #pragma region Arrayed Asset Macros #define DECLARE_SOUNDASSET_ARRAY(className,name,max) public: \ diff --git a/Engine/source/T3D/vehicles/hoverVehicle.cpp b/Engine/source/T3D/vehicles/hoverVehicle.cpp index 0cddc2c72..7deb81fe0 100644 --- a/Engine/source/T3D/vehicles/hoverVehicle.cpp +++ b/Engine/source/T3D/vehicles/hoverVehicle.cpp @@ -68,6 +68,16 @@ ConsoleDocClass( HoverVehicle, "@ingroup Vehicles\n" ); +typedef HoverVehicleData::Sounds hoverSoundsEnum; +DefineEnumType(hoverSoundsEnum); + +ImplementEnumType(hoverSoundsEnum, "enum types.\n" + "@ingroup HoverVehicleData\n\n") + { HoverVehicleData::JetSound, "JetSound", "..." }, + { HoverVehicleData::EngineSound, "EngineSound", "..." }, + { HoverVehicleData::FloatSound, "FloatSound", "..." }, +EndImplementEnumType; + namespace { const U32 sCollisionMoveMask = (TerrainObjectType | PlayerObjectType | @@ -232,7 +242,7 @@ void HoverVehicleData::initPersistFields() addField( "pitchForce", TypeF32, Offset(pitchForce, HoverVehicleData), "Pitch (rotation about the X-axis) force applied when steering in the y-axis direction." ); - INITPERSISTFIELD_SOUNDASSET_ARRAY(HoverSounds, Sounds::MaxSounds, HoverVehicleData, "Sounds for hover vehicle."); + INITPERSISTFIELD_SOUNDASSET_ENUMED(HoverSounds, hoverSoundsEnum, Sounds::MaxSounds, HoverVehicleData, "Sounds for hover vehicle."); addField( "dustTrailEmitter", TYPEID< ParticleEmitterData >(), Offset(dustTrailEmitter, HoverVehicleData), "Emitter to generate particles for the vehicle's dust trail.\nThe trail " @@ -307,7 +317,7 @@ bool HoverVehicleData::preload(bool server, String &errorStr) if (!server) { for (S32 i = 0; i < MaxSounds; i++) - if (mHoverSounds[i]) + if (getHoverSounds(i) != StringTable->EmptyString()) { _setHoverSounds(getHoverSounds(i), i); } diff --git a/Engine/source/T3D/vehicles/vehicle.cpp b/Engine/source/T3D/vehicles/vehicle.cpp index b773dd58f..8079fc163 100644 --- a/Engine/source/T3D/vehicles/vehicle.cpp +++ b/Engine/source/T3D/vehicles/vehicle.cpp @@ -80,6 +80,28 @@ static U32 sTriggerMask = ItemObjectType | IMPLEMENT_CONOBJECT(VehicleData); +typedef VehicleData::Body::Sounds bodySounds; +DefineEnumType(bodySounds); + +ImplementEnumType(bodySounds, "enum types.\n" + "@ingroup VehicleData\n\n") + { VehicleData::Body::SoftImpactSound, "SoftImpactSound", "..." }, + { VehicleData::Body::HardImpactSound, "HardImpactSound", "..." }, +EndImplementEnumType; + + +typedef VehicleData::Sounds vehSoundsEnum; +DefineEnumType(vehSoundsEnum); + +ImplementEnumType(vehSoundsEnum, "enum types.\n" + "@ingroup VehicleData\n\n") + { VehicleData::ExitWater, "ExitWater", "..." }, + { VehicleData::ImpactSoft, "ImpactSoft", "..." }, + { VehicleData::ImpactMedium, "ImpactMedium", "..." }, + { VehicleData::ImpactHard, "ImpactHard", "..." }, + { VehicleData::Wake, "Wake", "..." }, +EndImplementEnumType; + ConsoleDocClass( VehicleData, "@brief Base properties shared by all Vehicles (FlyingVehicle, HoverVehicle, " "WheeledVehicle).\n\n" @@ -219,7 +241,7 @@ bool VehicleData::preload(bool server, String &errorStr) if (!server) { for (S32 i = 0; i < Body::MaxSounds; i++) { - if (mVehicleBodySounds[i]) + if (getVehicleBodySounds(i) != StringTable->EmptyString() ) { _setVehicleBodySounds(getVehicleBodySounds(i), i); } @@ -227,7 +249,7 @@ bool VehicleData::preload(bool server, String &errorStr) for (S32 j = 0; j < Sounds::MaxSounds; j++) { - if (mVehicleWaterSounds[j]) + if (getVehicleWaterSounds(j) != StringTable->EmptyString()) { _setVehicleWaterSounds(getVehicleWaterSounds(j), j); } @@ -503,7 +525,7 @@ void VehicleData::initPersistFields() "Collision friction coefficient.\nHow well this object will slide against " "objects it collides with." ); - INITPERSISTFIELD_SOUNDASSET_ARRAY(VehicleBodySounds, Body::Sounds::MaxSounds, VehicleData, "Sounds for vehicle body impacts."); + INITPERSISTFIELD_SOUNDASSET_ENUMED(VehicleBodySounds, bodySounds, Body::Sounds::MaxSounds, VehicleData, "Sounds for vehicle body impacts."); addField( "minImpactSpeed", TypeF32, Offset(minImpactSpeed, VehicleData), "Minimum collision speed for the onImpact callback to be invoked." ); @@ -601,7 +623,7 @@ void VehicleData::initPersistFields() "Minimum velocity when entering the water for the imapactWaterHard sound " "to play.\n\n@see impactWaterHard" ); - INITPERSISTFIELD_SOUNDASSET_ARRAY(WaterSounds, Sounds::MaxSounds, VehicleData, "Sounds for interacting with water."); + INITPERSISTFIELD_SOUNDASSET_ENUMED(WaterSounds, vehSoundsEnum, VehicleData::Sounds::MaxSounds, VehicleData, "Sounds for interacting with water."); addField( "collDamageThresholdVel", TypeF32, Offset(collDamageThresholdVel, VehicleData), "Minimum collision velocity to cause damage to this vehicle.\nCurrently unused." ); diff --git a/Engine/source/T3D/vehicles/wheeledVehicle.cpp b/Engine/source/T3D/vehicles/wheeledVehicle.cpp index 3fbde4af7..4e9e7201e 100644 --- a/Engine/source/T3D/vehicles/wheeledVehicle.cpp +++ b/Engine/source/T3D/vehicles/wheeledVehicle.cpp @@ -289,6 +289,17 @@ ConsoleDocClass( WheeledVehicleData, "@ingroup Vehicles\n" ); +typedef WheeledVehicleData::Sounds wheelSoundsEnum; +DefineEnumType(wheelSoundsEnum); + +ImplementEnumType(wheelSoundsEnum, "enum types.\n" + "@ingroup WheeledVehicleData\n\n") + {WheeledVehicleData::JetSound, "JetSound", "..." }, + {WheeledVehicleData::EngineSound, "EngineSound", "..." }, + {WheeledVehicleData::SquealSound, "SquealSound", "..." }, + {WheeledVehicleData::WheelImpactSound, "WheelImpactSound", "..." }, +EndImplementEnumType; + WheeledVehicleData::WheeledVehicleData() { tireEmitter = 0; @@ -335,7 +346,7 @@ bool WheeledVehicleData::preload(bool server, String &errorStr) if (!server) { for (S32 i = 0; i < MaxSounds; i++) { - if (mWheeledVehicleSounds[i]) + if (getWheeledVehicleSounds(i) != StringTable->EmptyString()) { _setWheeledVehicleSounds(getWheeledVehicleSounds(i), i); } @@ -437,7 +448,7 @@ bool WheeledVehicleData::mirrorWheel(Wheel* we) void WheeledVehicleData::initPersistFields() { - INITPERSISTFIELD_SOUNDASSET_ARRAY(WheeledVehicleSounds, Sounds::MaxSounds, WheeledVehicleData, "Sounds related to wheeled vehicle."); + INITPERSISTFIELD_SOUNDASSET_ENUMED(WheeledVehicleSounds, wheelSoundsEnum, MaxSounds, WheeledVehicleData, "Sounds related to wheeled vehicle."); addField("tireEmitter",TYPEID< ParticleEmitterData >(), Offset(tireEmitter, WheeledVehicleData), "ParticleEmitterData datablock used to generate particles from each wheel " diff --git a/Engine/source/T3D/vehicles/wheeledVehicle.h b/Engine/source/T3D/vehicles/wheeledVehicle.h index 2f37b6c13..a2ab03b11 100644 --- a/Engine/source/T3D/vehicles/wheeledVehicle.h +++ b/Engine/source/T3D/vehicles/wheeledVehicle.h @@ -118,6 +118,7 @@ struct WheeledVehicleData: public VehicleData WheelImpactSound, MaxSounds, }; + DECLARE_SOUNDASSET_ARRAY(WheeledVehicleData, WheeledVehicleSounds, Sounds::MaxSounds); DECLARE_SOUNDASSET_ARRAY_SETGET(WheeledVehicleData, WheeledVehicleSounds); From 776741770db23fb0684d81b65eddd0d1aed295c5 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Tue, 28 Sep 2021 18:16:14 -0500 Subject: [PATCH 125/399] boolean isvalid chjecks for assets. tests wether it's non-empty and reporting zero flaws --- Engine/source/T3D/assets/ImageAsset.h | 6 ++++-- Engine/source/T3D/assets/MaterialAsset.h | 3 ++- Engine/source/T3D/assets/ShapeAsset.h | 6 ++++-- Engine/source/T3D/assets/SoundAsset.h | 6 ++++-- Engine/source/T3D/fx/lightning.cpp | 4 ++-- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Engine/source/T3D/assets/ImageAsset.h b/Engine/source/T3D/assets/ImageAsset.h index b79dc5f5d..57155ff2f 100644 --- a/Engine/source/T3D/assets/ImageAsset.h +++ b/Engine/source/T3D/assets/ImageAsset.h @@ -270,7 +270,8 @@ public: \ GFXTexHandle get##name##Resource() \ {\ return m##name;\ - } + }\ + bool name##Valid() { (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok) ? true : false; } #define DECLARE_IMAGEASSET_SETGET(className, name)\ static bool _set##name##Data(void* obj, const char* index, const char* data)\ @@ -494,7 +495,8 @@ public: \ if(index >= sm##name##Count || index < 0)\ return nullptr;\ return m##name[index];\ - } + }\ + bool name##Valid(const U32& id) { (get##name(id) != StringTable->EmptyString() && m##name##Asset[id]->getStatus() == AssetBase::Ok) ? true : false; } #define DECLARE_IMAGEASSET_ARRAY_SETGET(className, name)\ static bool _set##name##Data(void* obj, const char* index, const char* data)\ diff --git a/Engine/source/T3D/assets/MaterialAsset.h b/Engine/source/T3D/assets/MaterialAsset.h index c747be793..e9a74174a 100644 --- a/Engine/source/T3D/assets/MaterialAsset.h +++ b/Engine/source/T3D/assets/MaterialAsset.h @@ -259,7 +259,8 @@ public: \ SimObjectPtr get##name##Resource() \ {\ return m##name;\ - } + }\ + bool is##name##Valid() { (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok) ? true : false; } #define DECLARE_MATERIALASSET_SETGET(className, name)\ static bool _set##name##Data(void* obj, const char* index, const char* data)\ diff --git a/Engine/source/T3D/assets/ShapeAsset.h b/Engine/source/T3D/assets/ShapeAsset.h index d3af516c5..055ecdb42 100644 --- a/Engine/source/T3D/assets/ShapeAsset.h +++ b/Engine/source/T3D/assets/ShapeAsset.h @@ -321,7 +321,8 @@ public: \ Resource get##name##Resource() \ {\ return m##name;\ - } + }\ + bool is##name##Valid() { (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok) ? true : false; } #define DECLARE_SHAPEASSET_SETGET(className, name)\ static bool _set##name##Data(void* obj, const char* index, const char* data)\ @@ -522,7 +523,8 @@ public: \ if(index >= sm##name##Count || index < 0)\ return ResourceManager::get().load( "" );\ return m##name[index];\ - } + }\ + bool is##name##Valid(const U32& id) { (get##name(id) != StringTable->EmptyString() && m##name##Asset[id]->getStatus() == AssetBase::Ok) ? true : false; } #define DECLARE_SHAPEASSET_ARRAY_SETGET(className, name)\ static bool _set##name##Data(void* obj, const char* index, const char* data)\ diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index d6baadbbf..2f70b83c7 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -270,7 +270,8 @@ public: \ if (get##name() != StringTable->EmptyString() && m##name##Asset.notNull())\ return m##name##Asset->getSfxProfile();\ return NULL;\ - } + }\ + bool is##name##Valid() { (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok) ? true : false; } #define DECLARE_SOUNDASSET_SETGET(className, name)\ static bool _set##name##Data(void* obj, const char* index, const char* data)\ @@ -485,7 +486,8 @@ public: \ if (get##name(id) != StringTable->EmptyString() && m##name##Asset[id].notNull())\ return m##name##Asset[id]->getSfxProfile();\ return NULL;\ - } + }\ + bool is##name##Valid(const U32& id) { (get##name(id) != StringTable->EmptyString() && m##name##Asset[id]->getStatus() == AssetBase::Ok) ? true : false; } #define DECLARE_SOUNDASSET_ARRAY_SETGET(className, name)\ static bool _set##name##Data(void* obj, const char* index, const char* data)\ diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 8f1ba8bf6..905615a3d 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -296,7 +296,7 @@ bool LightningData::preload(bool server, String &errorStr) { for (S32 i = 0; i < MaxThunders; i++) { - if (getThunderSound(i)) + if (isThunderSoundValid(i)) { _setThunderSound(getThunderSound(i), i); if (!getThunderSoundProfile(i)) @@ -304,7 +304,7 @@ bool LightningData::preload(bool server, String &errorStr) } } - if(getStrikeSound() && !getStrikeSoundProfile()) + if(isStrikeSoundValid() && !getStrikeSoundProfile()) Con::errorf(ConsoleLogEntry::General, "LightningData::preload: can't get sfxProfile from asset"); mNumStrikeTextures = 0; From c5d5a9135645bd87920cd4d2e091711c2e12b8dd Mon Sep 17 00:00:00 2001 From: Areloch Date: Tue, 28 Sep 2021 18:17:49 -0500 Subject: [PATCH 126/399] Add handling to RotationF's addRotation function to ensure formatted return --- Engine/source/math/mRotation.cpp | 11 +++++++++-- Engine/source/math/mathTypes.cpp | 12 ++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Engine/source/math/mRotation.cpp b/Engine/source/math/mRotation.cpp index 43b696d4a..18114c58d 100644 --- a/Engine/source/math/mRotation.cpp +++ b/Engine/source/math/mRotation.cpp @@ -325,14 +325,21 @@ TEST(Maths, RotationF_Calculations) }; #endif -DefineEngineFunction(AddRotation, RotationF, (RotationF a, RotationF b), , +DefineEngineFunction(AddRotation, RotationF, (RotationF a, RotationF b, const char* returnType), ("Euler"), "Adds two rotations together.\n" "@param a Rotation one." "@param b Rotation two." "@returns v sum of both rotations." "@ingroup Math") { - return a + b; + RotationF ret; + RotationF sum = a + b; + if (String(returnType) == String("Euler")) + ret.set(sum.asEulerF()); + else + ret.set(sum.asAxisAngle()); + + return ret; } DefineEngineFunction(SubtractRotation, RotationF, (RotationF a, RotationF b), , diff --git a/Engine/source/math/mathTypes.cpp b/Engine/source/math/mathTypes.cpp index 14c7335e8..70ac9adf7 100644 --- a/Engine/source/math/mathTypes.cpp +++ b/Engine/source/math/mathTypes.cpp @@ -620,8 +620,16 @@ ConsoleGetType(TypeRotationF) static const U32 bufSize = 256; char* returnBuffer = Con::getReturnBuffer(bufSize); - EulerF out = pt->asEulerF(RotationF::Degrees); - dSprintf(returnBuffer, bufSize, "%g %g %g", out.x, out.y, out.z); + if (pt->mRotationType == RotationF::Euler) + { + EulerF out = pt->asEulerF(RotationF::Degrees); + dSprintf(returnBuffer, bufSize, "%g %g %g", out.x, out.y, out.z); + } + else if (pt->mRotationType == RotationF::AxisAngle) + { + AngAxisF out = pt->asAxisAngle(RotationF::Degrees); + dSprintf(returnBuffer, bufSize, "%g %g %g %g", out.axis.x, out.axis.y, out.axis.z, out.angle); + } return returnBuffer; } From 2630b4ada6a97222ad1e200fa962cf426b7d4161 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Tue, 28 Sep 2021 18:50:35 -0500 Subject: [PATCH 127/399] corrected and simplified the isValid method macro injections --- Engine/source/T3D/assets/ImageAsset.h | 4 ++-- Engine/source/T3D/assets/MaterialAsset.h | 2 +- Engine/source/T3D/assets/ShapeAsset.h | 4 ++-- Engine/source/T3D/assets/SoundAsset.h | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Engine/source/T3D/assets/ImageAsset.h b/Engine/source/T3D/assets/ImageAsset.h index 57155ff2f..7afcd6da2 100644 --- a/Engine/source/T3D/assets/ImageAsset.h +++ b/Engine/source/T3D/assets/ImageAsset.h @@ -271,7 +271,7 @@ public: \ {\ return m##name;\ }\ - bool name##Valid() { (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok) ? true : false; } + bool name##Valid() {return (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok); } #define DECLARE_IMAGEASSET_SETGET(className, name)\ static bool _set##name##Data(void* obj, const char* index, const char* data)\ @@ -496,7 +496,7 @@ public: \ return nullptr;\ return m##name[index];\ }\ - bool name##Valid(const U32& id) { (get##name(id) != StringTable->EmptyString() && m##name##Asset[id]->getStatus() == AssetBase::Ok) ? true : false; } + bool name##Valid(const U32& id) {return (get##name(id) != StringTable->EmptyString() && m##name##Asset[id]->getStatus() == AssetBase::Ok); } #define DECLARE_IMAGEASSET_ARRAY_SETGET(className, name)\ static bool _set##name##Data(void* obj, const char* index, const char* data)\ diff --git a/Engine/source/T3D/assets/MaterialAsset.h b/Engine/source/T3D/assets/MaterialAsset.h index e9a74174a..fc383810f 100644 --- a/Engine/source/T3D/assets/MaterialAsset.h +++ b/Engine/source/T3D/assets/MaterialAsset.h @@ -260,7 +260,7 @@ public: \ {\ return m##name;\ }\ - bool is##name##Valid() { (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok) ? true : false; } + bool is##name##Valid() {return (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok); } #define DECLARE_MATERIALASSET_SETGET(className, name)\ static bool _set##name##Data(void* obj, const char* index, const char* data)\ diff --git a/Engine/source/T3D/assets/ShapeAsset.h b/Engine/source/T3D/assets/ShapeAsset.h index 055ecdb42..2d641a840 100644 --- a/Engine/source/T3D/assets/ShapeAsset.h +++ b/Engine/source/T3D/assets/ShapeAsset.h @@ -322,7 +322,7 @@ public: \ {\ return m##name;\ }\ - bool is##name##Valid() { (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok) ? true : false; } + bool is##name##Valid() {return (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok); } #define DECLARE_SHAPEASSET_SETGET(className, name)\ static bool _set##name##Data(void* obj, const char* index, const char* data)\ @@ -524,7 +524,7 @@ public: \ return ResourceManager::get().load( "" );\ return m##name[index];\ }\ - bool is##name##Valid(const U32& id) { (get##name(id) != StringTable->EmptyString() && m##name##Asset[id]->getStatus() == AssetBase::Ok) ? true : false; } + bool is##name##Valid(const U32& id) {return (get##name(id) != StringTable->EmptyString() && m##name##Asset[id]->getStatus() == AssetBase::Ok); } #define DECLARE_SHAPEASSET_ARRAY_SETGET(className, name)\ static bool _set##name##Data(void* obj, const char* index, const char* data)\ diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index 2f70b83c7..2f3cc4615 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -271,7 +271,7 @@ public: \ return m##name##Asset->getSfxProfile();\ return NULL;\ }\ - bool is##name##Valid() { (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok) ? true : false; } + bool is##name##Valid() { return (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok); } #define DECLARE_SOUNDASSET_SETGET(className, name)\ static bool _set##name##Data(void* obj, const char* index, const char* data)\ @@ -487,7 +487,7 @@ public: \ return m##name##Asset[id]->getSfxProfile();\ return NULL;\ }\ - bool is##name##Valid(const U32& id) { (get##name(id) != StringTable->EmptyString() && m##name##Asset[id]->getStatus() == AssetBase::Ok) ? true : false; } + bool is##name##Valid(const U32& id) {return (get##name(id) != StringTable->EmptyString() && m##name##Asset[id]->getStatus() == AssetBase::Ok); } #define DECLARE_SOUNDASSET_ARRAY_SETGET(className, name)\ static bool _set##name##Data(void* obj, const char* index, const char* data)\ From d700ea487842ed6fb614c981837c2029ea8d1324 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Wed, 29 Sep 2021 11:41:57 +0100 Subject: [PATCH 128/399] Committing player separately. shapeBase is its own beast and will require a very critical look over once its up. --- Engine/source/T3D/player.cpp | 131 ++++++++++++++--------------------- Engine/source/T3D/player.h | 5 +- 2 files changed, 56 insertions(+), 80 deletions(-) diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp index 5bfc44746..3144bfcd9 100644 --- a/Engine/source/T3D/player.cpp +++ b/Engine/source/T3D/player.cpp @@ -189,6 +189,31 @@ PlayerData::ActionAnimationDef PlayerData::ActionAnimationList[NumTableActionAni //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- +typedef PlayerData::Sounds playerSoundsEnum; +DefineEnumType(playerSoundsEnum); + +ImplementEnumType(playerSoundsEnum, "enum types.\n" + "@ingroup PlayerData\n\n") + {PlayerData::Sounds::FootSoft, "FootSoft","..." }, + {PlayerData::Sounds::FootHard, "FootHard","..." }, + {PlayerData::Sounds::FootMetal, "FootMetal","..." }, + {PlayerData::Sounds::FootSnow, "FootSnow","..." }, + {PlayerData::Sounds::FootShallowSplash, "FootShallowSplash","..." }, + {PlayerData::Sounds::FootWading, "FootWading","..." }, + {PlayerData::Sounds::FootUnderWater, "FootUnderWater","..." }, + {PlayerData::Sounds::FootBubbles, "FootBubbles","..." }, + {PlayerData::Sounds::MoveBubbles, "MoveBubbles","..." }, + {PlayerData::Sounds::WaterBreath, "WaterBreath","..." }, + {PlayerData::Sounds::ImpactStart, "ImpactStart","..." }, + {PlayerData::Sounds::ImpactHard, "ImpactHard","..." }, + {PlayerData::Sounds::ImpactMetal, "ImpactMetal","..." }, + {PlayerData::Sounds::ImpactSnow, "ImpactSnow","..." }, + {PlayerData::Sounds::ImpactWaterEasy, "ImpactWaterEasy","..." }, + {PlayerData::Sounds::ImpactWaterMedium, "ImpactWaterMedium","..." }, + {PlayerData::Sounds::ImpactWaterHard, "ImpactWaterHard","..." }, + {PlayerData::Sounds::ExitWater, "ExitWater","..." }, +EndImplementEnumType; + //---------------------------------------------------------------------------- IMPLEMENT_CO_DATABLOCK_V1(PlayerData); @@ -397,7 +422,7 @@ PlayerData::PlayerData() boxHeadFrontPercentage = 1; for (S32 i = 0; i < MaxSounds; i++) - sound[i] = NULL; + INIT_SOUNDASSET_ARRAY(PlayerSound, i); footPuffEmitter = NULL; footPuffID = 0; @@ -449,9 +474,13 @@ bool PlayerData::preload(bool server, String &errorStr) { for( U32 i = 0; i < MaxSounds; ++ i ) { - String sfxErrorStr; - if( !sfxResolve( &sound[ i ], sfxErrorStr ) ) - Con::errorf( "PlayerData::preload: %s", sfxErrorStr.c_str() ); + if (getPlayerSound(i) != StringTable->EmptyString()) + { + _setPlayerSound(getPlayerSound(i), i); + } + + if (!getPlayerSoundProfile(i)) + Con::errorf("PlayerData::Preload() - unable to find sfxProfile for asset %d %s", i, getPlayerSound(i)); } } @@ -1022,63 +1051,7 @@ void PlayerData::initPersistFields() addGroup( "Interaction: Sounds" ); - addField( "FootSoftSound", TypeSFXTrackName, Offset(sound[FootSoft], PlayerData), - "@brief Sound to play when walking on a surface with Material footstepSoundId 0.\n\n" ); - addField( "FootHardSound", TypeSFXTrackName, Offset(sound[FootHard], PlayerData), - "@brief Sound to play when walking on a surface with Material footstepSoundId 1.\n\n" ); - addField( "FootMetalSound", TypeSFXTrackName, Offset(sound[FootMetal], PlayerData), - "@brief Sound to play when walking on a surface with Material footstepSoundId 2.\n\n" ); - addField( "FootSnowSound", TypeSFXTrackName, Offset(sound[FootSnow], PlayerData), - "@brief Sound to play when walking on a surface with Material footstepSoundId 3.\n\n" ); - - addField( "FootShallowSound", TypeSFXTrackName, Offset(sound[FootShallowSplash], PlayerData), - "@brief Sound to play when walking in water and coverage is less than " - "footSplashHeight.\n\n" - "@see footSplashHeight\n" ); - addField( "FootWadingSound", TypeSFXTrackName, Offset(sound[FootWading], PlayerData), - "@brief Sound to play when walking in water and coverage is less than 1, " - "but > footSplashHeight.\n\n" - "@see footSplashHeight\n" ); - addField( "FootUnderwaterSound", TypeSFXTrackName, Offset(sound[FootUnderWater], PlayerData), - "@brief Sound to play when walking in water and coverage equals 1.0 " - "(fully underwater).\n\n" ); - addField( "FootBubblesSound", TypeSFXTrackName, Offset(sound[FootBubbles], PlayerData), - "@brief Sound to play when walking in water and coverage equals 1.0 " - "(fully underwater).\n\n" ); - addField( "movingBubblesSound", TypeSFXTrackName, Offset(sound[MoveBubbles], PlayerData), - "@brief Sound to play when in water and coverage equals 1.0 (fully underwater).\n\n" - "Note that unlike FootUnderwaterSound, this sound plays even if the " - "player is not moving around in the water.\n" ); - addField( "waterBreathSound", TypeSFXTrackName, Offset(sound[WaterBreath], PlayerData), - "@brief Sound to play when in water and coverage equals 1.0 (fully underwater).\n\n" - "Note that unlike FootUnderwaterSound, this sound plays even if the " - "player is not moving around in the water.\n" ); - - addField( "impactSoftSound", TypeSFXTrackName, Offset(sound[ImpactSoft], PlayerData), - "@brief Sound to play after falling on a surface with Material footstepSoundId 0.\n\n" ); - addField( "impactHardSound", TypeSFXTrackName, Offset(sound[ImpactHard], PlayerData), - "@brief Sound to play after falling on a surface with Material footstepSoundId 1.\n\n" ); - addField( "impactMetalSound", TypeSFXTrackName, Offset(sound[ImpactMetal], PlayerData), - "@brief Sound to play after falling on a surface with Material footstepSoundId 2.\n\n" ); - addField( "impactSnowSound", TypeSFXTrackName, Offset(sound[ImpactSnow], PlayerData), - "@brief Sound to play after falling on a surface with Material footstepSoundId 3.\n\n" ); - - addField( "impactWaterEasy", TypeSFXTrackName, Offset(sound[ImpactWaterEasy], PlayerData), - "@brief Sound to play when entering the water with velocity < " - "mediumSplashSoundVelocity.\n\n" - "@see mediumSplashSoundVelocity\n"); - addField( "impactWaterMedium", TypeSFXTrackName, Offset(sound[ImpactWaterMedium], PlayerData), - "@brief Sound to play when entering the water with velocity >= " - "mediumSplashSoundVelocity and < hardSplashSoundVelocity.\n\n" - "@see mediumSplashSoundVelocity\n" - "@see hardSplashSoundVelocity\n"); - addField( "impactWaterHard", TypeSFXTrackName, Offset(sound[ImpactWaterHard], PlayerData), - "@brief Sound to play when entering the water with velocity >= " - "hardSplashSoundVelocity.\n\n" - "@see hardSplashSoundVelocity\n"); - addField( "exitingWater", TypeSFXTrackName, Offset(sound[ExitWater], PlayerData), - "@brief Sound to play when exiting the water with velocity >= exitSplashSoundVelocity.\n\n" - "@see exitSplashSoundVelocity\n"); + INITPERSISTFIELD_SOUNDASSET_ENUMED(PlayerSound, playerSoundsEnum, PlayerData::Sounds::MaxSounds, PlayerData, "Sounds related to player interaction."); endGroup( "Interaction: Sounds" ); @@ -1303,8 +1276,8 @@ void PlayerData::packData(BitStream* stream) stream->write(minImpactSpeed); stream->write(minLateralImpactSpeed); - for( U32 i = 0; i < MaxSounds; i++) - sfxWrite( stream, sound[ i ] ); + for (U32 i = 0; i < MaxSounds; i++) + PACKDATA_SOUNDASSET_ARRAY(PlayerSound, i); mathWrite(*stream, boxSize); mathWrite(*stream, crouchBoxSize); @@ -1484,8 +1457,8 @@ void PlayerData::unpackData(BitStream* stream) stream->read(&minImpactSpeed); stream->read(&minLateralImpactSpeed); - for( U32 i = 0; i < MaxSounds; i++) - sfxRead( stream, &sound[ i ] ); + for (U32 i = 0; i < MaxSounds; i++) + UNPACKDATA_SOUNDASSET_ARRAY(PlayerSound, i); mathRead(*stream, &boxSize); mathRead(*stream, &crouchBoxSize); @@ -1932,11 +1905,11 @@ bool Player::onNewDataBlock( GameBaseData *dptr, bool reload ) SFX_DELETE( mMoveBubbleSound ); SFX_DELETE( mWaterBreathSound ); - if ( mDataBlock->sound[PlayerData::MoveBubbles] ) - mMoveBubbleSound = SFX->createSource( mDataBlock->sound[PlayerData::MoveBubbles] ); + if ( mDataBlock->getPlayerSound(PlayerData::MoveBubbles) ) + mMoveBubbleSound = SFX->createSource( mDataBlock->getPlayerSoundProfile(PlayerData::MoveBubbles) ); - if ( mDataBlock->sound[PlayerData::WaterBreath] ) - mWaterBreathSound = SFX->createSource( mDataBlock->sound[PlayerData::WaterBreath] ); + if ( mDataBlock->getPlayerSound(PlayerData::WaterBreath) ) + mWaterBreathSound = SFX->createSource( mDataBlock->getPlayerSoundProfile(PlayerData::WaterBreath) ); } mObjBox.maxExtents.x = mDataBlock->boxSize.x * 0.5f; @@ -3300,7 +3273,7 @@ void Player::updateMove(const Move* move) { // exit-water splash sound happens for client only if ( getSpeed() >= mDataBlock->exitSplashSoundVel && !isMounted() ) - SFX->playOnce( mDataBlock->sound[PlayerData::ExitWater], &getTransform() ); + SFX->playOnce( mDataBlock->getPlayerSoundProfile(PlayerData::ExitWater), &getTransform() ); } } @@ -7060,17 +7033,17 @@ void Player::playFootstepSound( bool triggeredLeft, Material* contactMaterial, S // Treading water. if ( mWaterCoverage < mDataBlock->footSplashHeight ) - SFX->playOnce( mDataBlock->sound[ PlayerData::FootShallowSplash ], &footMat ); + SFX->playOnce( mDataBlock->getPlayerSoundProfile( PlayerData::FootShallowSplash ), &footMat ); else { if ( mWaterCoverage < 1.0 ) - SFX->playOnce( mDataBlock->sound[ PlayerData::FootWading ], &footMat ); + SFX->playOnce( mDataBlock->getPlayerSoundProfile( PlayerData::FootWading ), &footMat ); else { if ( triggeredLeft ) { - SFX->playOnce( mDataBlock->sound[ PlayerData::FootUnderWater ], &footMat ); - SFX->playOnce( mDataBlock->sound[ PlayerData::FootBubbles ], &footMat ); + SFX->playOnce( mDataBlock->getPlayerSoundProfile( PlayerData::FootUnderWater ), &footMat ); + SFX->playOnce( mDataBlock->getPlayerSoundProfile( PlayerData::FootBubbles ), &footMat ); } } } @@ -7092,7 +7065,7 @@ void Player::playFootstepSound( bool triggeredLeft, Material* contactMaterial, S sound = 2; if (sound>=0) - SFX->playOnce(mDataBlock->sound[sound], &footMat); + SFX->playOnce(mDataBlock->getPlayerSoundProfile(sound), &footMat); } } @@ -7123,7 +7096,7 @@ void Player:: playImpactSound() sound = 2; // Play metal; if (sound >= 0) - SFX->playOnce(mDataBlock->sound[PlayerData::ImpactStart + sound], &getTransform()); + SFX->playOnce(mDataBlock->getPlayerSoundProfile(PlayerData::ImpactStart + sound), &getTransform()); } } } @@ -7277,11 +7250,11 @@ bool Player::collidingWithWater( Point3F &waterHeight ) void Player::createSplash( Point3F &pos, F32 speed ) { if ( speed >= mDataBlock->hardSplashSoundVel ) - SFX->playOnce( mDataBlock->sound[PlayerData::ImpactWaterHard], &getTransform() ); + SFX->playOnce( mDataBlock->getPlayerSoundProfile(PlayerData::ImpactWaterHard), &getTransform() ); else if ( speed >= mDataBlock->medSplashSoundVel ) - SFX->playOnce( mDataBlock->sound[PlayerData::ImpactWaterMedium], &getTransform() ); + SFX->playOnce( mDataBlock->getPlayerSoundProfile(PlayerData::ImpactWaterMedium), &getTransform() ); else - SFX->playOnce( mDataBlock->sound[PlayerData::ImpactWaterEasy], &getTransform() ); + SFX->playOnce( mDataBlock->getPlayerSoundProfile(PlayerData::ImpactWaterEasy), &getTransform() ); if( mDataBlock->splash ) { diff --git a/Engine/source/T3D/player.h b/Engine/source/T3D/player.h index 042f45b37..5b775a79f 100644 --- a/Engine/source/T3D/player.h +++ b/Engine/source/T3D/player.h @@ -35,6 +35,7 @@ #include "collision/boxConvex.h" #endif +#include "T3D/assets/SoundAsset.h" #include "T3D/gameBase/gameProcess.h" class Material; @@ -218,7 +219,9 @@ struct PlayerData: public ShapeBaseData { ExitWater, MaxSounds }; - SFXTrack* sound[MaxSounds]; + + DECLARE_SOUNDASSET_ARRAY(PlayerData, PlayerSound, Sounds::MaxSounds); + DECLARE_SOUNDASSET_ARRAY_SETGET(PlayerData, PlayerSound); Point3F boxSize; ///< Width, depth, height Point3F crouchBoxSize; From 1c14dc5ec451543a95fdff7323abc1d96e0d227c Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Wed, 29 Sep 2021 12:36:02 +0100 Subject: [PATCH 129/399] The beast is ready for a look over. Can't have a soundAsset inside a struct. If we could this might work better. PrevState needs to be kept track of for clearing looping sounds before the next state is loaded in. This might cause issues when switching weapons. --- Engine/source/T3D/shapeBase.h | 15 ++++++++---- Engine/source/T3D/shapeImage.cpp | 39 ++++++++++++++++++++------------ 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/Engine/source/T3D/shapeBase.h b/Engine/source/T3D/shapeBase.h index 4d3286b5c..bdfb68e4f 100644 --- a/Engine/source/T3D/shapeBase.h +++ b/Engine/source/T3D/shapeBase.h @@ -73,6 +73,7 @@ // Need full definition visible for SimObjectPtr #include "T3D/fx/particleEmitter.h" +#include "T3D/assets/SoundAsset.h" class GFXCubemap; class TSShapeInstance; @@ -259,11 +260,12 @@ struct ShapeBaseImageData: public GameBaseData { /// the imageSlot. ParticleEmitterData* emitter; ///< A particle emitter; this emitter will emit as long as the gun is in this /// this state. - SFXTrack* sound; + + //SFXTrack* sound; F32 emitterTime; ///< S32 emitterNode[MaxShapes]; ///< Node ID on the shape to emit from + //DECLARE_SOUNDASSET(StateData, Sound); }; - /// @name State Data /// Individual state data used to initialize struct array /// @{ @@ -321,7 +323,10 @@ struct ShapeBaseImageData: public GameBaseData { bool stateIgnoreLoadedForReady [MaxStates]; - SFXTrack* stateSound [MaxStates]; + DECLARE_SOUNDASSET_ARRAY(ShapeBaseImageData, stateSound, MaxStates); + DECLARE_SOUNDASSET_ARRAY_SETGET(ShapeBaseImageData, stateSound); + + //SFXTrack* stateSound [MaxStates]; const char* stateScript [MaxStates]; ParticleEmitterData* stateEmitter [MaxStates]; @@ -662,7 +667,7 @@ public: DECLARE_CALLBACK( void, onCollision, ( ShapeBase* obj, SceneObject* collObj, VectorF vec, F32 len ) ); DECLARE_CALLBACK( void, onDamage, ( ShapeBase* obj, F32 delta ) ); DECLARE_CALLBACK( void, onTrigger, ( ShapeBase* obj, S32 index, bool state ) ); - DECLARE_CALLBACK(void, onEndSequence, (ShapeBase* obj, S32 slot, const char* name)); + DECLARE_CALLBACK( void, onEndSequence, (ShapeBase* obj, S32 slot, const char* name)); DECLARE_CALLBACK( void, onForceUncloak, ( ShapeBase* obj, const char* reason ) ); /// @} struct TextureTagRemapping @@ -1070,6 +1075,8 @@ protected: /// @param imageSlot Image slot id /// @param state State id /// @param force Force image to state or let it finish then change + + U32 prevState = 0; void setImageState(U32 imageSlot, U32 state, bool force = false); void updateAnimThread(U32 imageSlot, S32 imageShapeIndex, ShapeBaseImageData::StateData* lastState=NULL); diff --git a/Engine/source/T3D/shapeImage.cpp b/Engine/source/T3D/shapeImage.cpp index 7bd42bea5..b60105329 100644 --- a/Engine/source/T3D/shapeImage.cpp +++ b/Engine/source/T3D/shapeImage.cpp @@ -132,7 +132,7 @@ ShapeBaseImageData::StateData::StateData() loaded = IgnoreLoaded; spin = IgnoreSpin; recoil = NoRecoil; - sound = 0; + //sound = 0; emitter = NULL; shapeSequence = NULL; shapeSequenceScale = true; @@ -256,7 +256,7 @@ ShapeBaseImageData::ShapeBaseImageData() stateShapeSequence[i] = 0; stateScaleShapeSequence[i] = false; - stateSound[i] = 0; + INIT_SOUNDASSET_ARRAY(stateSound, i); stateScript[i] = 0; stateEmitter[i] = 0; stateEmitterTime[i] = 0; @@ -303,6 +303,7 @@ ShapeBaseImageData::ShapeBaseImageData() camShakeDuration = 1.5f; camShakeRadius = 3.0f; camShakeFalloff = 10.0f; + } ShapeBaseImageData::~ShapeBaseImageData() @@ -368,7 +369,7 @@ bool ShapeBaseImageData::onAdd() s.shapeSequence = stateShapeSequence[i]; s.shapeSequenceScale = stateScaleShapeSequence[i]; - s.sound = stateSound[i]; + _setstateSound(getstateSound(i),i); s.script = stateScript[i]; s.emitter = stateEmitter[i]; s.emitterTime = stateEmitterTime[i]; @@ -419,10 +420,14 @@ bool ShapeBaseImageData::preload(bool server, String &errorStr) if (state[i].emitter) if (!Sim::findObject(SimObjectId((uintptr_t)state[i].emitter), state[i].emitter)) Con::errorf(ConsoleLogEntry::General, "Error, unable to load emitter for image datablock"); - - String str; - if( !sfxResolve( &state[ i ].sound, str ) ) - Con::errorf( ConsoleLogEntry::General, str.c_str() ); + + if (getstateSound(i) != StringTable->EmptyString()) + { + _setstateSound(getstateSound(i), i); + if (!getstateSoundProfile(i)) + Con::errorf("ShapeBaseImageData::preload() - Could not find profile for asset %s on state %d", getstateSound(i), i); + } + } } @@ -922,8 +927,8 @@ void ShapeBaseImageData::initPersistFields() addField( "stateScaleShapeSequence", TypeBool, Offset(stateScaleShapeSequence, ShapeBaseImageData), MaxStates, "Indicates if the sequence to be played on the mounting shape should be scaled to the length of the state." ); - addField( "stateSound", TypeSFXTrackName, Offset(stateSound, ShapeBaseImageData), MaxStates, - "Sound to play on entry to this state." ); + INITPERSISTFIELD_SOUNDASSET_ARRAY(stateSound, MaxStates, ShapeBaseImageData, "State sound."); + addField( "stateScript", TypeCaseString, Offset(stateScript, ShapeBaseImageData), MaxStates, "@brief Method to execute on entering this state.\n\n" "Scoped to this image class name, then ShapeBaseImageData. The script " @@ -1140,7 +1145,7 @@ void ShapeBaseImageData::packData(BitStream* stream) } } - sfxWrite( stream, s.sound ); + PACKDATA_SOUNDASSET_ARRAY(stateSound, i); } stream->write(maxConcurrentSounds); stream->writeFlag(useRemainderDT); @@ -1345,7 +1350,7 @@ void ShapeBaseImageData::unpackData(BitStream* stream) else s.emitter = 0; - sfxRead( stream, &s.sound ); + UNPACKDATA_SOUNDASSET_ARRAY(stateSound, i); } } @@ -2753,9 +2758,10 @@ void ShapeBase::setImageState(U32 imageSlot, U32 newState,bool force) { onImageStateAnimation(imageSlot, stateData.shapeSequence, stateData.direction, stateData.shapeSequenceScale, stateData.timeoutValue); } - // Delete any loooping sounds that were in the previous state. - if (lastState->sound && lastState->sound->getDescription()->mIsLooping) + // this is the crazy bit =/ needs to know prev state in order to stop sounds. + // lastState does not return an id for the prev state so we keep track of it. + if (image.dataBlock->getstateSound(prevState) && image.dataBlock->getstateSoundProfile(prevState)->getDescription()->mIsLooping) { for(Vector::iterator i = image.mSoundSources.begin(); i != image.mSoundSources.end(); i++) SFX_DELETE((*i)); @@ -2764,12 +2770,15 @@ void ShapeBase::setImageState(U32 imageSlot, U32 newState,bool force) } // Play sound - if( stateData.sound && isGhost() ) + if( image.dataBlock->getstateSound(newState) && isGhost() ) { const Point3F& velocity = getVelocity(); - image.addSoundSource(SFX->createSource( stateData.sound, &getRenderTransform(), &velocity )); + image.addSoundSource(SFX->createSource(image.dataBlock->getstateSoundProfile(newState), &getRenderTransform(), &velocity )); } + /// update our prevState. + prevState = newState; + // Play animation updateAnimThread(imageSlot, imageShapeIndex, lastState); for (U32 i=0; i Date: Wed, 29 Sep 2021 12:48:37 +0100 Subject: [PATCH 130/399] Another way of doing shapeBase, this requires fewer changes but will have an empty asset in each stateData until it is filled with an asset. Both these will need to be tested to see which one is better. --- Engine/source/T3D/shapeBase.h | 4 +--- Engine/source/T3D/shapeImage.cpp | 15 +++++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Engine/source/T3D/shapeBase.h b/Engine/source/T3D/shapeBase.h index bdfb68e4f..a2696819e 100644 --- a/Engine/source/T3D/shapeBase.h +++ b/Engine/source/T3D/shapeBase.h @@ -264,7 +264,7 @@ struct ShapeBaseImageData: public GameBaseData { //SFXTrack* sound; F32 emitterTime; ///< S32 emitterNode[MaxShapes]; ///< Node ID on the shape to emit from - //DECLARE_SOUNDASSET(StateData, Sound); + SoundAsset* sound; }; /// @name State Data /// Individual state data used to initialize struct array @@ -1075,8 +1075,6 @@ protected: /// @param imageSlot Image slot id /// @param state State id /// @param force Force image to state or let it finish then change - - U32 prevState = 0; void setImageState(U32 imageSlot, U32 state, bool force = false); void updateAnimThread(U32 imageSlot, S32 imageShapeIndex, ShapeBaseImageData::StateData* lastState=NULL); diff --git a/Engine/source/T3D/shapeImage.cpp b/Engine/source/T3D/shapeImage.cpp index b60105329..ab43a0ba3 100644 --- a/Engine/source/T3D/shapeImage.cpp +++ b/Engine/source/T3D/shapeImage.cpp @@ -132,7 +132,7 @@ ShapeBaseImageData::StateData::StateData() loaded = IgnoreLoaded; spin = IgnoreSpin; recoil = NoRecoil; - //sound = 0; + sound = NULL; emitter = NULL; shapeSequence = NULL; shapeSequenceScale = true; @@ -156,6 +156,7 @@ ShapeBaseImageData::StateData::StateData() flashSequence[i] = false; emitterNode[i] = -1; } + } static ShapeBaseImageData::StateData gDefaultStateData; @@ -369,7 +370,8 @@ bool ShapeBaseImageData::onAdd() s.shapeSequence = stateShapeSequence[i]; s.shapeSequenceScale = stateScaleShapeSequence[i]; - _setstateSound(getstateSound(i),i); + //_setstateSound(getstateSound(i),i); + s.sound = getstateSoundAsset(i); s.script = stateScript[i]; s.emitter = stateEmitter[i]; s.emitterTime = stateEmitterTime[i]; @@ -2761,7 +2763,7 @@ void ShapeBase::setImageState(U32 imageSlot, U32 newState,bool force) // Delete any loooping sounds that were in the previous state. // this is the crazy bit =/ needs to know prev state in order to stop sounds. // lastState does not return an id for the prev state so we keep track of it. - if (image.dataBlock->getstateSound(prevState) && image.dataBlock->getstateSoundProfile(prevState)->getDescription()->mIsLooping) + if (lastState->sound && lastState->sound->getSfxProfile()->getDescription()->mIsLooping) { for(Vector::iterator i = image.mSoundSources.begin(); i != image.mSoundSources.end(); i++) SFX_DELETE((*i)); @@ -2770,15 +2772,12 @@ void ShapeBase::setImageState(U32 imageSlot, U32 newState,bool force) } // Play sound - if( image.dataBlock->getstateSound(newState) && isGhost() ) + if( stateData.sound && isGhost() ) { const Point3F& velocity = getVelocity(); - image.addSoundSource(SFX->createSource(image.dataBlock->getstateSoundProfile(newState), &getRenderTransform(), &velocity )); + image.addSoundSource(SFX->createSource(stateData.sound->getSfxProfile(), &getRenderTransform(), &velocity )); } - /// update our prevState. - prevState = newState; - // Play animation updateAnimThread(imageSlot, imageShapeIndex, lastState); for (U32 i=0; i Date: Wed, 29 Sep 2021 12:38:47 -0500 Subject: [PATCH 131/399] conflict resolution --- Engine/source/T3D/fx/lightning.cpp | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index dc92c1647..0e28b1a42 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -296,34 +296,20 @@ bool LightningData::preload(bool server, String &errorStr) { for (S32 i = 0; i < MaxThunders; i++) { -<<<<<<< HEAD - if (getThunderSound(i) != StringTable->EmptyString()) -======= - if (isThunderSoundValid(i)) ->>>>>>> 2630b4ada6a97222ad1e200fa962cf426b7d4161 + _setThunderSound(getThunderSound(i), i); + if (isThunderSoundValid(i) && !getThunderSoundProfile(i)) { - _setThunderSound(getThunderSound(i), i); - Con::printf("Thunder sound: %d %s", i, getThunderSound(i)); - - if (!getThunderSoundProfile(i)) Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Cant get an sfxProfile for thunder."); } } -<<<<<<< HEAD - if (getStrikeSound() != StringTable->EmptyString()) + _setStrikeSound(getStrikeSound()); + if (isStrikeSoundValid() && !getStrikeSoundProfile()) { - _setStrikeSound(getStrikeSound()); - - if(!getStrikeSoundProfile()) Con::errorf(ConsoleLogEntry::General, "LightningData::preload: can't get sfxProfile from strike sound."); } -======= - if(isStrikeSoundValid() && !getStrikeSoundProfile()) - Con::errorf(ConsoleLogEntry::General, "LightningData::preload: can't get sfxProfile from asset"); ->>>>>>> 2630b4ada6a97222ad1e200fa962cf426b7d4161 mNumStrikeTextures = 0; for (U32 k = 0; k < MaxTextures; k++) From 64a87ceba8a0d76b20c2efc60039d887f0131b12 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 30 Sep 2021 13:46:03 -0500 Subject: [PATCH 132/399] trim assetEnumNameConcat to 2 values, set INITPERSISTFIELD_SOUNDASSET_ENUMED to exclude maxValue --- Engine/source/T3D/assets/SoundAsset.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index 7bbbcdc15..44817eb72 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -374,14 +374,14 @@ DefineEngineMethod(className, set##name, bool, (const char* shape), , assetText #pragma endregion -#define assetEnumNameConcat(x,suff,ForT)(new std::string(std::string(#x) + suff + std::string(#ForT)))->c_str() +#define assetEnumNameConcat(x,suff)(new std::string( x + std::string(#suff)))->c_str() #define INITPERSISTFIELD_SOUNDASSET_ENUMED(name, enumType, maxValue, consoleClass, docs) \ - for (U32 i = 0; i <= maxValue; i++)\ + for (U32 i = 0; i < maxValue; i++)\ {\ const char* enumString = castConsoleTypeToString(static_cast(i));\ - addProtectedField(assetEnumNameConcat(name,enumString, File), TypeSoundFilename, Offset(m##name##Name[i], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, docs), AbstractClassRep::FIELD_HideInInspectors); \ - addProtectedField(assetEnumNameConcat(name,enumString, Asset), TypeSoundAssetId, Offset(m##name##AssetId[i], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, asset reference.));\ + addProtectedField(assetEnumNameConcat(enumString, File), TypeSoundFilename, Offset(m##name##Name[i], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, docs), AbstractClassRep::FIELD_HideInInspectors); \ + addProtectedField(assetEnumNameConcat(enumString, Asset), TypeSoundAssetId, Offset(m##name##AssetId[i], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, asset reference.));\ }\ #pragma region Arrayed Asset Macros From 65774ff123985804c1b1b6aa7e43c6a7aacfa357 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 30 Sep 2021 14:15:42 -0500 Subject: [PATCH 133/399] converter work pt1 --- .../pre40/T3Dpre4ProjectImporter.tscript | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript index d9eec5f2e..4d368ea12 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript @@ -839,7 +839,7 @@ T3Dpre4ProjectImporter::genProcessor("LevelInfo", "accuTexture accuTextureAsset" T3Dpre4ProjectImporter::genProcessor("TSStatic", "shape shapeAsset shapeName shapeAsset"); T3Dpre4ProjectImporter::genProcessor("TSForestItemData", "shape shapeAsset shapeName shapeAsset shapeFile shapeAsset"); T3Dpre4ProjectImporter::genProcessor("TerrainBlock", "terrainFile terrainAsset"); -T3Dpre4ProjectImporter::genProcessor("afxMagicMissileData", "projectileShapeName projectileShapeAsset"); +T3Dpre4ProjectImporter::genProcessor("afxMagicMissileData", "projectileShapeName projectileShapeAsset sound soundAsset"); T3Dpre4ProjectImporter::genProcessor("afxBillboardData", "texture textureAsset"); T3Dpre4ProjectImporter::genProcessor("afxModelData", "shapeName shapeAsset shapeFile shapeAsset"); T3Dpre4ProjectImporter::genProcessor("afxZodiacData", "texture textureAsset"); @@ -921,15 +921,30 @@ T3Dpre4ProjectImporter::genProcessor("DecalData", "material materialAsset"); T3Dpre4ProjectImporter::genProcessor("ExplosionData", "explosionShape explosionShapeAsset"); T3Dpre4ProjectImporter::genProcessor("ParticleData", "texture textureAsset textureName textureAsset textureExt textureExtAsset textureExtName textureExtAsset"); T3Dpre4ProjectImporter::genProcessor("PrecipitationData", "drop dropAsset dropTexture dropAsset splash splashAsset splashTexture splashAsset soundProfile soundAsset"); -T3Dpre4ProjectImporter::genProcessor("SplashData", "texture textureAsset"); +T3Dpre4ProjectImporter::genProcessor("SplashData", "texture textureAsset soundProfile SoundAsset"); T3Dpre4ProjectImporter::genProcessor("LightFlareData", "flareTexture flareTextureAsset"); T3Dpre4ProjectImporter::genProcessor("PhysicsDebrisData", "shape shapeAsset shapeFile shapeAsset"); T3Dpre4ProjectImporter::genProcessor("PhysicsShapeData", "shape shapeAsset shapeName shapeAsset"); T3Dpre4ProjectImporter::genProcessor("PlayerData", "shapeFP shapeFPAsset shapeNameFP shapeFPAsset"); -T3Dpre4ProjectImporter::genProcessor("ProjectileData", "projectileShape projectileShapeAsset projectileShapeName projectileShapeAsset"); +T3Dpre4ProjectImporter::genProcessor("ProjectileData", "projectileShape projectileShapeAsset projectileShapeName projectileShapeAsset sound soundAsset"); T3Dpre4ProjectImporter::genProcessor("ShapeBaseData", "shapeFile shapeAsset shape shapeAsset debrisShape debrisShapeAsset debrisShapeName debrisShapeAsset"); T3Dpre4ProjectImporter::genProcessor("ShapeBaseImageData", "shape shapeAsset[0] shapeFP shapeAsset[1] shapeFile shapeAsset[0] shapeFileFP shapeAsset[1]"); T3Dpre4ProjectImporter::genProcessor("WheeledVehicleTire", "shape shapeAsset shapeFile shapeAsset"); +T3Dpre4ProjectImporter::genProcessor("WheeledVehicleData", "engineSound engineSoundAsset squealSound squealSoundAsset"); +T3Dpre4ProjectImporter::genProcessor("FlyingVehicleData", "engineSound engineSoundAsset jetSound jetSoundAsset"); +T3Dpre4ProjectImporter::genProcessor("HoverVehicleData", "engineSound engineSoundAsset jetSound jetSoundAsset floatSound floatSoundAsset"); + +//============================================================================== +// Datablocks - Long Lists +//============================================================================== + +$rigidSoundList = "softImpactSound softImpactSoundAsset hardImpactSound hardImpactSoundAsset"; +$rigidSoundList = $rigidSoundList SPC "exitingWater exitingWaterAsset impactWaterEasy impactWaterEasyAsset"; +$rigidSoundList = $rigidSoundList SPC "impactWaterMedium impactWaterMediumAsset impactWaterHard impactWaterHardAsset"; +$rigidSoundList = $rigidSoundList SPC "waterWakeSound waterWakeSoundAsset"; +T3Dpre4ProjectImporter::genProcessor("RigidShapeData",$rigidSoundList); + + //============================================================================== // Materials //============================================================================== From d3693bef8dca3d2c5948f80ee28cccb38b851e23 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 30 Sep 2021 14:40:03 -0500 Subject: [PATCH 134/399] shifted playerdata down to the Long Lists block. fix player enum ref source side --- Engine/source/T3D/player.cpp | 2 +- .../pre40/T3Dpre4ProjectImporter.tscript | 26 ++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp index 3144bfcd9..37655598f 100644 --- a/Engine/source/T3D/player.cpp +++ b/Engine/source/T3D/player.cpp @@ -204,7 +204,7 @@ ImplementEnumType(playerSoundsEnum, "enum types.\n" {PlayerData::Sounds::FootBubbles, "FootBubbles","..." }, {PlayerData::Sounds::MoveBubbles, "MoveBubbles","..." }, {PlayerData::Sounds::WaterBreath, "WaterBreath","..." }, - {PlayerData::Sounds::ImpactStart, "ImpactStart","..." }, + {PlayerData::Sounds::ImpactSoft, "ImpactSoft","..." }, {PlayerData::Sounds::ImpactHard, "ImpactHard","..." }, {PlayerData::Sounds::ImpactMetal, "ImpactMetal","..." }, {PlayerData::Sounds::ImpactSnow, "ImpactSnow","..." }, diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript index 4d368ea12..8382fa7ca 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript @@ -925,10 +925,10 @@ T3Dpre4ProjectImporter::genProcessor("SplashData", "texture textureAsset soundPr T3Dpre4ProjectImporter::genProcessor("LightFlareData", "flareTexture flareTextureAsset"); T3Dpre4ProjectImporter::genProcessor("PhysicsDebrisData", "shape shapeAsset shapeFile shapeAsset"); T3Dpre4ProjectImporter::genProcessor("PhysicsShapeData", "shape shapeAsset shapeName shapeAsset"); -T3Dpre4ProjectImporter::genProcessor("PlayerData", "shapeFP shapeFPAsset shapeNameFP shapeFPAsset"); T3Dpre4ProjectImporter::genProcessor("ProjectileData", "projectileShape projectileShapeAsset projectileShapeName projectileShapeAsset sound soundAsset"); T3Dpre4ProjectImporter::genProcessor("ShapeBaseData", "shapeFile shapeAsset shape shapeAsset debrisShape debrisShapeAsset debrisShapeName debrisShapeAsset"); -T3Dpre4ProjectImporter::genProcessor("ShapeBaseImageData", "shape shapeAsset[0] shapeFP shapeAsset[1] shapeFile shapeAsset[0] shapeFileFP shapeAsset[1]"); +T3Dpre4ProjectImporter::genProcessor("ShapeBaseImageData", "shape shapeAsset[0] shapeFP shapeAsset[1] shapeFile shapeAsset[0] shapeFileFP shapeAsset[1] stateSound stateSoundAsset"); +T3Dpre4ProjectImporter::genProcessor("ProximityMineData","armingSound ArmSoundAsset TriggerSound TriggerSoundAsset"); T3Dpre4ProjectImporter::genProcessor("WheeledVehicleTire", "shape shapeAsset shapeFile shapeAsset"); T3Dpre4ProjectImporter::genProcessor("WheeledVehicleData", "engineSound engineSoundAsset squealSound squealSoundAsset"); T3Dpre4ProjectImporter::genProcessor("FlyingVehicleData", "engineSound engineSoundAsset jetSound jetSoundAsset"); @@ -938,13 +938,25 @@ T3Dpre4ProjectImporter::genProcessor("HoverVehicleData", "engineSound engineSoun // Datablocks - Long Lists //============================================================================== -$rigidSoundList = "softImpactSound softImpactSoundAsset hardImpactSound hardImpactSoundAsset"; -$rigidSoundList = $rigidSoundList SPC "exitingWater exitingWaterAsset impactWaterEasy impactWaterEasyAsset"; -$rigidSoundList = $rigidSoundList SPC "impactWaterMedium impactWaterMediumAsset impactWaterHard impactWaterHardAsset"; -$rigidSoundList = $rigidSoundList SPC "waterWakeSound waterWakeSoundAsset"; -T3Dpre4ProjectImporter::genProcessor("RigidShapeData",$rigidSoundList); +$rigidEntriesList = "softImpactSound softImpactSoundAsset hardImpactSound hardImpactSoundAsset"; +$rigidEntriesList = $rigidEntriesList SPC "exitingWater exitingWaterAsset impactWaterEasy impactWaterEasyAsset"; +$rigidEntriesList = $rigidEntriesList SPC "impactWaterMedium impactWaterMediumAsset impactWaterHard impactWaterHardAsset"; +$rigidEntriesList = $rigidEntriesList SPC "waterWakeSound waterWakeSoundAsset"; +T3Dpre4ProjectImporter::genProcessor("RigidShapeData",$rigidEntriesList); + +$PlayerEntriesList = "shapeFP shapeFPAsset shapeNameFP shapeFPAsset"; +$PlayerEntriesList = $PlayerEntriesList SPC "FootSoftSound FootSoftAsset FootHardSound FootHardAsset"; +$PlayerEntriesList = $PlayerEntriesList SPC "FootSnowSound FootSnowAsset FootShallowSound FootShallowSplashAsset"; +$PlayerEntriesList = $PlayerEntriesList SPC "FootWadingSound FootWadingAsset FootUnderwaterSound FootUnderWaterAsset"; +$PlayerEntriesList = $PlayerEntriesList SPC "FootBubblesSound FootBubblesAsset movingBubblesSound MoveBubblesAsset"; +$PlayerEntriesList = $PlayerEntriesList SPC "waterBreathSound WaterBreathAsset"; +$PlayerEntriesList = $PlayerEntriesList SPC "impactSoftSound ImpactSoftAsset impactHardSound impactHardAsset"; +$PlayerEntriesList = $PlayerEntriesList SPC "impactMetalSound ImpactMetalAsset impactSnowSound impactSnowAsset"; +$PlayerEntriesList = $PlayerEntriesList SPC "impactWaterEasy impactWaterEasyAsset impactWaterMedium impactWaterMediumAsset impactWaterHard impactWaterHardAsset"; +$PlayerEntriesList = $PlayerEntriesList SPC "exitingWater ExitWaterAsset"; +T3Dpre4ProjectImporter::genProcessor("PlayerData", $PlayerEntriesList); //============================================================================== // Materials //============================================================================== From 5c7069555a98cbfb7833b624fbbd44e20239f80c Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 30 Sep 2021 16:00:37 -0500 Subject: [PATCH 135/399] filter out array entries without enum strings --- Engine/source/T3D/assets/SoundAsset.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index 44817eb72..97b68f745 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -380,10 +380,12 @@ DefineEngineMethod(className, set##name, bool, (const char* shape), , assetText for (U32 i = 0; i < maxValue; i++)\ {\ const char* enumString = castConsoleTypeToString(static_cast(i));\ - addProtectedField(assetEnumNameConcat(enumString, File), TypeSoundFilename, Offset(m##name##Name[i], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, docs), AbstractClassRep::FIELD_HideInInspectors); \ - addProtectedField(assetEnumNameConcat(enumString, Asset), TypeSoundAssetId, Offset(m##name##AssetId[i], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, asset reference.));\ - }\ - + if (enumString && enumString[0])\ + {\ + addProtectedField(assetEnumNameConcat(enumString, File), TypeSoundFilename, Offset(m##name##Name[i], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, docs), AbstractClassRep::FIELD_HideInInspectors); \ + addProtectedField(assetEnumNameConcat(enumString, Asset), TypeSoundAssetId, Offset(m##name##AssetId[i], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, asset reference.));\ + }\ + } #pragma region Arrayed Asset Macros #define DECLARE_SOUNDASSET_ARRAY(className,name,max) public: \ From 1676d102f35cc588bf717897ff5e5bc35125a046 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Sat, 2 Oct 2021 16:22:55 -0400 Subject: [PATCH 136/399] * [AssetBrowser] BugFix: Correct a logic error in the filtering of the asset browser causing tags queries to display all assets. --- .../game/tools/assetBrowser/scripts/assetBrowser.tscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript index 747d3e86d..660577c78 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript @@ -1802,7 +1802,7 @@ function matchesSearch(%assetName, %assetType) } else { - if(%assetName.tags !$= %word) + if(strstr(strlwr(%assetName.tags), strlwr(%word)) != -1) %matchTags = true; } } From 5e88ab25708cb9771d99fb5b1e5c02d94586a9d6 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Fri, 1 Oct 2021 21:34:45 -0400 Subject: [PATCH 137/399] * BugFix: Fix AL device listing so that functions like sfxGetAvailableDevices return the actual devices on the system. --- Engine/source/sfx/openal/aldlist.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Engine/source/sfx/openal/aldlist.cpp b/Engine/source/sfx/openal/aldlist.cpp index a453579e3..8f7c0d4a6 100644 --- a/Engine/source/sfx/openal/aldlist.cpp +++ b/Engine/source/sfx/openal/aldlist.cpp @@ -56,7 +56,7 @@ ALDeviceList::ALDeviceList( const OPENALFNTABLE &oalft ) // grab function pointers for 1.0-API functions, and if successful proceed to enumerate all devices if (ALFunction.alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT")) { - devices = (char *)ALFunction.alcGetString(NULL, ALC_DEVICE_SPECIFIER); + devices = (char *)ALFunction.alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER); defaultDeviceName = (char *)ALFunction.alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER); index = 0; // go through device list (each device terminated with a single NULL, list terminated with double NULL) @@ -70,7 +70,7 @@ ALDeviceList::ALDeviceList( const OPENALFNTABLE &oalft ) if (context) { ALFunction.alcMakeContextCurrent(context); // if new actual device name isn't already in the list, then add it... - actualDeviceName = ALFunction.alcGetString(device, ALC_DEVICE_SPECIFIER); + actualDeviceName = devices; bool bNewName = true; for (int i = 0; i < GetNumDevices(); i++) { if (String::compare(GetDeviceName(i), actualDeviceName) == 0) { @@ -313,4 +313,4 @@ unsigned int ALDeviceList::GetMaxNumSources() } return iSourceCount; -} \ No newline at end of file +} From c99c9cc3652fb6c0b86c9857587d7bbfd12bec64 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sat, 2 Oct 2021 20:58:44 -0500 Subject: [PATCH 138/399] include metal FootMetalSound oversight, include correction for mangled entries where a given varname and a given assetname match --- .../scripts/pre40/T3Dpre4ProjectImporter.tscript | 2 +- .../projectImporter/scripts/projectImporter.tscript | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript index 8382fa7ca..119ba6066 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript @@ -945,7 +945,7 @@ $rigidEntriesList = $rigidEntriesList SPC "waterWakeSound waterWakeSoundAsset"; T3Dpre4ProjectImporter::genProcessor("RigidShapeData",$rigidEntriesList); $PlayerEntriesList = "shapeFP shapeFPAsset shapeNameFP shapeFPAsset"; -$PlayerEntriesList = $PlayerEntriesList SPC "FootSoftSound FootSoftAsset FootHardSound FootHardAsset"; +$PlayerEntriesList = $PlayerEntriesList SPC "FootSoftSound FootSoftAsset FootHardSound FootHardAsset FootMetalSound FootMetal"; $PlayerEntriesList = $PlayerEntriesList SPC "FootSnowSound FootSnowAsset FootShallowSound FootShallowSplashAsset"; $PlayerEntriesList = $PlayerEntriesList SPC "FootWadingSound FootWadingAsset FootUnderwaterSound FootUnderWaterAsset"; $PlayerEntriesList = $PlayerEntriesList SPC "FootBubblesSound FootBubblesAsset movingBubblesSound MoveBubblesAsset"; diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript index eca0e0b07..cfdd7c8bf 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript @@ -515,7 +515,7 @@ function testFilenameExtensions(%filename) } function processLegacyField(%line, %originalFieldName, %newFieldName) -{ +{ if(!strIsMatchExpr("*"@%originalFieldName@"=*;*", %line) && !strIsMatchExpr("*"@%originalFieldName@"[*=*;*", %line) && !strIsMatchExpr("*"@%originalFieldName@" *=*;*", %line)) @@ -603,10 +603,10 @@ function processLegacyField(%line, %originalFieldName, %newFieldName) if(!strIsMatchExpr("*\"*\"*", %originalValue)) %assetId = "\"" @ %assetId @ "\""; - //if (%assetId.getStatusString() $= "Ok") - %outLine = strReplace(%outLine, %value, %assetId); - //else - // error("Asset assignment failure:", %assetId, getStatusString()); + %firstPart = getToken(%outLine, "=", 0); + %secondPart = getToken(%outLine, "=", 1); + %secondPart = strReplace(%secondPart, %value, %assetId); + %outLine = %firstPart @ "=" @ %secondPart; } } From 0760621212117b9e6eeeafcf133019aa4b08cb8d Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sat, 2 Oct 2021 21:01:14 -0500 Subject: [PATCH 139/399] fix item->importStatus tagging in importer --- Engine/source/T3D/assets/assetImporter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/T3D/assets/assetImporter.cpp b/Engine/source/T3D/assets/assetImporter.cpp index 5df1ca8ab..254df381d 100644 --- a/Engine/source/T3D/assets/assetImporter.cpp +++ b/Engine/source/T3D/assets/assetImporter.cpp @@ -1409,7 +1409,7 @@ void AssetImporter::processImportAssets(AssetImportObject* assetItem) Con::executef(this, processCommand.c_str(), item); } - item->importStatus == AssetImportObject::Processed; + item->importStatus = AssetImportObject::Processed; //try recusing on the children(if any) processImportAssets(item); @@ -2018,7 +2018,7 @@ void AssetImporter::validateAsset(AssetImportObject* assetItem) AssetQuery aQuery; U32 numAssetsFound = AssetDatabase.findAllAssets(&aQuery); - bool hasCollision = false; + hasCollision = false; for (U32 i = 0; i < numAssetsFound; i++) { StringTableEntry assetId = aQuery.mAssetList[i]; From 19eb3c42f015a80b09bfeb7f66181ce3af8ad8fa Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sat, 2 Oct 2021 21:05:04 -0500 Subject: [PATCH 140/399] more enum work, now with somewhat clearer boundary names, and some debug spam for initpersistfields, and pack and unpack macros to help us try and trace why those are scrambling --- Engine/source/T3D/assets/SoundAsset.h | 47 ++++++++++++++++++-- Engine/source/T3D/player.cpp | 64 +++++++++++++-------------- Engine/source/T3D/player.h | 4 +- 3 files changed, 77 insertions(+), 38 deletions(-) diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index 97b68f745..5a9af9eb3 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -381,11 +381,18 @@ DefineEngineMethod(className, set##name, bool, (const char* shape), , assetText {\ const char* enumString = castConsoleTypeToString(static_cast(i));\ if (enumString && enumString[0])\ - {\ + { Con::printf("%s", enumString);\ addProtectedField(assetEnumNameConcat(enumString, File), TypeSoundFilename, Offset(m##name##Name[i], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, docs), AbstractClassRep::FIELD_HideInInspectors); \ addProtectedField(assetEnumNameConcat(enumString, Asset), TypeSoundAssetId, Offset(m##name##AssetId[i], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, asset reference.));\ }\ } + +#define INITPERSISTFIELD_SOUNDASSET_ENUM(enumString, name, enumVal, consoleClass, docs) \ + {\ + addProtectedField(assetText(enumString, File), TypeSoundFilename, Offset(m##name##Name[enumVal], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name[enumVal], docs), AbstractClassRep::FIELD_HideInInspectors); \ + addProtectedField(assetText(enumString, Asset), TypeSoundAssetId, Offset(m##name##AssetId[enumVal], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name[enumVal], asset reference.));\ + }\ + #pragma region Arrayed Asset Macros #define DECLARE_SOUNDASSET_ARRAY(className,name,max) public: \ @@ -574,6 +581,7 @@ DefineEngineMethod(className, set##name, bool, (const char* map, S32 index), , a m##name##Name[index] = other.m##name##Name[index];\ m##name##AssetId[index] = other.m##name##AssetId[index];\ m##name##Asset[index] = other.m##name##Asset[index];\ + m##name[index] = = other.m##name[index];\ } #define LOAD_SOUNDASSET_ARRAY(name, index)\ @@ -602,7 +610,10 @@ if (m##name##AssetId[index] != StringTable->EmptyString())\ _set##name(m##name##AssetId[index], index);\ }\ else\ - m##name##Name[index] = stream->readSTString(); + {\ + m##name##Name[index] = stream->readSTString();\ + _set##name(m##name##AssetId[index], index);\ + } #define PACK_SOUNDASSET_ARRAY(netconn, name, index)\ if (stream->writeFlag(m##name##Asset[index].notNull()))\ @@ -620,8 +631,38 @@ if (m##name##AssetId[index] != StringTable->EmptyString())\ _set##name(m##name##AssetId[index], index);\ }\ else\ - m##name##Name[index] = stream->readSTString(); + {\ + m##name##Name[index] = stream->readSTString();\ + _set##name(m##name##AssetId[index], index);\ + } +#define PACKDATA_SOUNDASSET_ARRAY_ENUMED(name, enumType, index )\ +{\ + if (stream->writeFlag(m##name##Asset[index].notNull()))\ + {\ + stream->writeString(m##name##Asset[index].getAssetId());\ + const char* enumString = castConsoleTypeToString(static_cast(index));\ + Con::printf("pack: %s = %s",enumString, m##name##AssetId[index]);\ + }\ + else\ + stream->writeString(m##name##Name[index]);\ +} + +#define UNPACKDATA_SOUNDASSET_ARRAY_ENUMED(name, enumType, index )\ +{\ + if (stream->readFlag())\ + {\ + m##name##AssetId[index] = stream->readSTString();\ + _set##name(m##name##AssetId[index], index);\ + const char* enumString = castConsoleTypeToString(static_cast(index));\ + Con::printf("unpack: %s = %s",enumString, m##name##AssetId[index]);\ + }\ + else\ + {\ + m##name##Name[index] = stream->readSTString();\ + _set##name(m##name##AssetId[index], index);\ + }\ +} #pragma endregion #endif // _ASSET_BASE_H_ diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp index 37655598f..3e994995a 100644 --- a/Engine/source/T3D/player.cpp +++ b/Engine/source/T3D/player.cpp @@ -194,24 +194,24 @@ DefineEnumType(playerSoundsEnum); ImplementEnumType(playerSoundsEnum, "enum types.\n" "@ingroup PlayerData\n\n") - {PlayerData::Sounds::FootSoft, "FootSoft","..." }, - {PlayerData::Sounds::FootHard, "FootHard","..." }, - {PlayerData::Sounds::FootMetal, "FootMetal","..." }, - {PlayerData::Sounds::FootSnow, "FootSnow","..." }, - {PlayerData::Sounds::FootShallowSplash, "FootShallowSplash","..." }, - {PlayerData::Sounds::FootWading, "FootWading","..." }, - {PlayerData::Sounds::FootUnderWater, "FootUnderWater","..." }, - {PlayerData::Sounds::FootBubbles, "FootBubbles","..." }, - {PlayerData::Sounds::MoveBubbles, "MoveBubbles","..." }, - {PlayerData::Sounds::WaterBreath, "WaterBreath","..." }, - {PlayerData::Sounds::ImpactSoft, "ImpactSoft","..." }, - {PlayerData::Sounds::ImpactHard, "ImpactHard","..." }, - {PlayerData::Sounds::ImpactMetal, "ImpactMetal","..." }, - {PlayerData::Sounds::ImpactSnow, "ImpactSnow","..." }, - {PlayerData::Sounds::ImpactWaterEasy, "ImpactWaterEasy","..." }, - {PlayerData::Sounds::ImpactWaterMedium, "ImpactWaterMedium","..." }, - {PlayerData::Sounds::ImpactWaterHard, "ImpactWaterHard","..." }, - {PlayerData::Sounds::ExitWater, "ExitWater","..." }, + { playerSoundsEnum::FootSoft, "FootSoft", "..." }, + { playerSoundsEnum::FootHard, "FootHard","..." }, + { playerSoundsEnum::FootMetal, "FootMetal","..." }, + { playerSoundsEnum::FootSnow, "FootSnow","..." }, + { playerSoundsEnum::FootShallowSplash, "FootShallowSplash","..." }, + { playerSoundsEnum::FootWading, "FootWading","..." }, + { playerSoundsEnum::FootUnderWater, "FootUnderWater","..." }, + { playerSoundsEnum::FootBubbles, "FootBubbles","..." }, + { playerSoundsEnum::MoveBubbles, "MoveBubbles","..." }, + { playerSoundsEnum::WaterBreath, "WaterBreath","..." }, + { playerSoundsEnum::ImpactSoft, "ImpactSoft","..." }, + { playerSoundsEnum::ImpactHard, "ImpactHard","..." }, + { playerSoundsEnum::ImpactMetal, "ImpactMetal","..." }, + { playerSoundsEnum::ImpactSnow, "ImpactSnow","..." }, + { playerSoundsEnum::ImpactWaterEasy, "ImpactWaterEasy","..." }, + { playerSoundsEnum::ImpactWaterMedium, "ImpactWaterMedium","..." }, + { playerSoundsEnum::ImpactWaterHard, "ImpactWaterHard","..." }, + { playerSoundsEnum::ExitWater, "ExitWater","..." }, EndImplementEnumType; //---------------------------------------------------------------------------- @@ -469,18 +469,16 @@ bool PlayerData::preload(bool server, String &errorStr) if(!Parent::preload(server, errorStr)) return false; - // Resolve objects transmitted from server - if( !server ) + for (U32 i = 0; i < MaxSounds; ++i) { - for( U32 i = 0; i < MaxSounds; ++ i ) + _setPlayerSound(getPlayerSound(i), i); + if (getPlayerSound(i) != StringTable->EmptyString()) { - if (getPlayerSound(i) != StringTable->EmptyString()) - { - _setPlayerSound(getPlayerSound(i), i); - } - if (!getPlayerSoundProfile(i)) - Con::errorf("PlayerData::Preload() - unable to find sfxProfile for asset %d %s", i, getPlayerSound(i)); + Con::errorf("PlayerData::Preload() - unable to find sfxProfile for asset %d %s", i, mPlayerSoundAssetId[i]); + + const char* enumString = castConsoleTypeToString(static_cast(i)); + Con::printf("preload: %s = %s", enumString, mPlayerSoundAssetId[i]); } } @@ -1051,7 +1049,7 @@ void PlayerData::initPersistFields() addGroup( "Interaction: Sounds" ); - INITPERSISTFIELD_SOUNDASSET_ENUMED(PlayerSound, playerSoundsEnum, PlayerData::Sounds::MaxSounds, PlayerData, "Sounds related to player interaction."); + INITPERSISTFIELD_SOUNDASSET_ENUMED(PlayerSound, playerSoundsEnum, PlayerData::Sounds::MaxSounds, PlayerData, "Sounds related to player interaction."); endGroup( "Interaction: Sounds" ); @@ -1277,7 +1275,7 @@ void PlayerData::packData(BitStream* stream) stream->write(minLateralImpactSpeed); for (U32 i = 0; i < MaxSounds; i++) - PACKDATA_SOUNDASSET_ARRAY(PlayerSound, i); + PACKDATA_SOUNDASSET_ARRAY_ENUMED(PlayerSound, PlayerData::Sounds, i); mathWrite(*stream, boxSize); mathWrite(*stream, crouchBoxSize); @@ -1458,7 +1456,7 @@ void PlayerData::unpackData(BitStream* stream) stream->read(&minLateralImpactSpeed); for (U32 i = 0; i < MaxSounds; i++) - UNPACKDATA_SOUNDASSET_ARRAY(PlayerSound, i); + UNPACKDATA_SOUNDASSET_ARRAY_ENUMED(PlayerSound, PlayerData::Sounds, i); mathRead(*stream, &boxSize); mathRead(*stream, &crouchBoxSize); @@ -7059,7 +7057,7 @@ void Player::playFootstepSound( bool triggeredLeft, Material* contactMaterial, S // Play default sound. S32 sound = -1; - if (contactMaterial && (contactMaterial->mFootstepSoundId>-1 && contactMaterial->mFootstepSoundIdmFootstepSoundId > -1 && contactMaterial->mFootstepSoundId < PlayerData::WaterStart)) sound = contactMaterial->mFootstepSoundId; else if( contactObject && contactObject->getTypeMask() & VehicleObjectType ) sound = 2; @@ -7090,13 +7088,13 @@ void Player:: playImpactSound() else { S32 sound = -1; - if (material && (material->mImpactSoundId>-1 && material->mImpactSoundIdmImpactSoundId > -1 && material->mImpactSoundId < PlayerData::WaterStart)) sound = material->mImpactSoundId; else if( rInfo.object->getTypeMask() & VehicleObjectType ) sound = 2; // Play metal; if (sound >= 0) - SFX->playOnce(mDataBlock->getPlayerSoundProfile(PlayerData::ImpactStart + sound), &getTransform()); + SFX->playOnce(mDataBlock->getPlayerSoundProfile(PlayerData::ImpactSoft + sound), &getTransform()); } } } diff --git a/Engine/source/T3D/player.h b/Engine/source/T3D/player.h index 5b775a79f..55430749c 100644 --- a/Engine/source/T3D/player.h +++ b/Engine/source/T3D/player.h @@ -201,8 +201,8 @@ struct PlayerData: public ShapeBaseData { FootHard, FootMetal, FootSnow, - MaxSoundOffsets, - FootShallowSplash, + WaterStart, + FootShallowSplash = WaterStart, FootWading, FootUnderWater, FootBubbles, From 43630c31c2938efb107eca01494fd73633e56fea Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Sat, 2 Oct 2021 22:24:11 -0400 Subject: [PATCH 141/399] * BugFix: Tweaks to the ALC device listing logic to be more consistent with the AL API. --- Engine/source/sfx/openal/aldlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/sfx/openal/aldlist.cpp b/Engine/source/sfx/openal/aldlist.cpp index 8f7c0d4a6..51f5a3b51 100644 --- a/Engine/source/sfx/openal/aldlist.cpp +++ b/Engine/source/sfx/openal/aldlist.cpp @@ -55,9 +55,9 @@ ALDeviceList::ALDeviceList( const OPENALFNTABLE &oalft ) defaultDeviceIndex = 0; // grab function pointers for 1.0-API functions, and if successful proceed to enumerate all devices - if (ALFunction.alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT")) { + if (ALFunction.alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT")) { devices = (char *)ALFunction.alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER); - defaultDeviceName = (char *)ALFunction.alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER); + defaultDeviceName = (char *)ALFunction.alcGetString(NULL, ALC_DEFAULT_ALL_DEVICES_SPECIFIER); index = 0; // go through device list (each device terminated with a single NULL, list terminated with double NULL) while (*devices != 0) { From 6a94946e5b1621b2e0e2bdce45e016816f247b21 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Sat, 2 Oct 2021 22:29:34 -0400 Subject: [PATCH 142/399] * BugFix: Fallback to ALC_ENUMERATION_EXT if ALC_ENUMERATE_ALL_EXT is not available. --- Engine/source/sfx/openal/aldlist.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Engine/source/sfx/openal/aldlist.cpp b/Engine/source/sfx/openal/aldlist.cpp index 51f5a3b51..73307f50b 100644 --- a/Engine/source/sfx/openal/aldlist.cpp +++ b/Engine/source/sfx/openal/aldlist.cpp @@ -55,9 +55,20 @@ ALDeviceList::ALDeviceList( const OPENALFNTABLE &oalft ) defaultDeviceIndex = 0; // grab function pointers for 1.0-API functions, and if successful proceed to enumerate all devices - if (ALFunction.alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT")) { - devices = (char *)ALFunction.alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER); - defaultDeviceName = (char *)ALFunction.alcGetString(NULL, ALC_DEFAULT_ALL_DEVICES_SPECIFIER); + const bool enumerationExtensionPresent = ALFunction.alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT"); + const bool enumerateAllExtensionPresent = ALFunction.alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT"); + if (enumerateAllExtensionPresent || enumerationExtensionPresent) { + if (enumerateAllExtensionPresent) + { + devices = (char *)ALFunction.alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER); + defaultDeviceName = (char *)ALFunction.alcGetString(NULL, ALC_DEFAULT_ALL_DEVICES_SPECIFIER); + } + else + { + devices = (char *)ALFunction.alcGetString(NULL, ALC_DEVICE_SPECIFIER); + defaultDeviceName = (char *)ALFunction.alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER); + } + index = 0; // go through device list (each device terminated with a single NULL, list terminated with double NULL) while (*devices != 0) { From 10f2453ceede5fd9f8a9ef6648c77fef9e22d2a9 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sat, 2 Oct 2021 23:24:46 -0500 Subject: [PATCH 143/399] setget was causing active interference with INITPERSISTFIELD_SOUNDASSET_ENUMED --- Engine/source/T3D/assets/SoundAsset.h | 32 +++++++++++---------------- Engine/source/T3D/player.h | 1 - 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index 5a9af9eb3..1d98b61b1 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -374,25 +374,6 @@ DefineEngineMethod(className, set##name, bool, (const char* shape), , assetText #pragma endregion -#define assetEnumNameConcat(x,suff)(new std::string( x + std::string(#suff)))->c_str() - -#define INITPERSISTFIELD_SOUNDASSET_ENUMED(name, enumType, maxValue, consoleClass, docs) \ - for (U32 i = 0; i < maxValue; i++)\ - {\ - const char* enumString = castConsoleTypeToString(static_cast(i));\ - if (enumString && enumString[0])\ - { Con::printf("%s", enumString);\ - addProtectedField(assetEnumNameConcat(enumString, File), TypeSoundFilename, Offset(m##name##Name[i], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, docs), AbstractClassRep::FIELD_HideInInspectors); \ - addProtectedField(assetEnumNameConcat(enumString, Asset), TypeSoundAssetId, Offset(m##name##AssetId[i], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name, asset reference.));\ - }\ - } - -#define INITPERSISTFIELD_SOUNDASSET_ENUM(enumString, name, enumVal, consoleClass, docs) \ - {\ - addProtectedField(assetText(enumString, File), TypeSoundFilename, Offset(m##name##Name[enumVal], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name[enumVal], docs), AbstractClassRep::FIELD_HideInInspectors); \ - addProtectedField(assetText(enumString, Asset), TypeSoundAssetId, Offset(m##name##AssetId[enumVal], consoleClass), _set##name##Data, & defaultProtectedGetFn, assetText(name[enumVal], asset reference.));\ - }\ - #pragma region Arrayed Asset Macros #define DECLARE_SOUNDASSET_ARRAY(className,name,max) public: \ @@ -663,6 +644,19 @@ if (m##name##AssetId[index] != StringTable->EmptyString())\ _set##name(m##name##AssetId[index], index);\ }\ } + +#define assetEnumNameConcat(x,suff)(new std::string( x + std::string(#suff)))->c_str() + +#define INITPERSISTFIELD_SOUNDASSET_ENUMED(name, enumType, maxValue, consoleClass, docs) \ + for (U32 i = 0; i < maxValue; i++)\ + {\ + const char* enumString = castConsoleTypeToString(static_cast(i));\ + if (enumString && enumString[0])\ + { Con::printf("%s", enumString);\ + addField(assetEnumNameConcat(enumString, File), TypeSoundFilename, Offset(m##name##Name[i], consoleClass), assetText(name, docs), AbstractClassRep::FIELD_HideInInspectors); \ + addField(assetEnumNameConcat(enumString, Asset), TypeSoundAssetId, Offset(m##name##AssetId[i], consoleClass), assetText(name, asset reference.));\ + }\ + } #pragma endregion #endif // _ASSET_BASE_H_ diff --git a/Engine/source/T3D/player.h b/Engine/source/T3D/player.h index 55430749c..ed0cfea63 100644 --- a/Engine/source/T3D/player.h +++ b/Engine/source/T3D/player.h @@ -221,7 +221,6 @@ struct PlayerData: public ShapeBaseData { }; DECLARE_SOUNDASSET_ARRAY(PlayerData, PlayerSound, Sounds::MaxSounds); - DECLARE_SOUNDASSET_ARRAY_SETGET(PlayerData, PlayerSound); Point3F boxSize; ///< Width, depth, height Point3F crouchBoxSize; From 98a079a797c6e85bece7d9ea6ea541618a1cdf90 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 3 Oct 2021 02:56:26 -0500 Subject: [PATCH 144/399] code duplication prune. should aid in stability --- Engine/source/T3D/accumulationVolume.cpp | 6 +- Engine/source/T3D/accumulationVolume.h | 2 +- Engine/source/T3D/assets/ImageAsset.h | 135 +-------- Engine/source/T3D/assets/MaterialAsset.h | 85 +----- Engine/source/T3D/assets/ShapeAsset.h | 181 +----------- Engine/source/T3D/assets/SoundAsset.h | 214 +------------- Engine/source/T3D/assets/assetMacroHelpers.h | 274 ++++++++++++++++++ Engine/source/T3D/convexShape.cpp | 8 +- Engine/source/T3D/convexShape.h | 6 +- Engine/source/T3D/debris.cpp | 8 +- Engine/source/T3D/debris.h | 2 +- Engine/source/T3D/decal/decalData.cpp | 6 +- Engine/source/T3D/decal/decalData.h | 4 +- .../source/T3D/examples/renderMeshExample.cpp | 6 +- .../source/T3D/examples/renderMeshExample.h | 2 +- .../T3D/examples/renderShapeExample.cpp | 6 +- .../source/T3D/examples/renderShapeExample.h | 2 +- Engine/source/T3D/fx/explosion.cpp | 16 +- Engine/source/T3D/fx/explosion.h | 4 +- Engine/source/T3D/fx/groundCover.cpp | 12 +- Engine/source/T3D/fx/groundCover.h | 4 +- Engine/source/T3D/fx/lightning.cpp | 12 +- Engine/source/T3D/fx/lightning.h | 4 +- Engine/source/T3D/fx/particle.cpp | 18 +- Engine/source/T3D/fx/particle.h | 4 +- Engine/source/T3D/fx/precipitation.cpp | 18 +- Engine/source/T3D/fx/precipitation.h | 6 +- Engine/source/T3D/fx/splash.cpp | 12 +- Engine/source/T3D/fx/splash.h | 2 +- Engine/source/T3D/groundPlane.cpp | 6 +- Engine/source/T3D/groundPlane.h | 2 +- Engine/source/T3D/levelInfo.cpp | 6 +- Engine/source/T3D/levelInfo.h | 2 +- Engine/source/T3D/lightFlareData.cpp | 6 +- Engine/source/T3D/lightFlareData.h | 2 +- Engine/source/T3D/physics/physicsDebris.cpp | 6 +- Engine/source/T3D/physics/physicsDebris.h | 2 +- Engine/source/T3D/physics/physicsShape.cpp | 6 +- Engine/source/T3D/physics/physicsShape.h | 2 +- Engine/source/T3D/player.cpp | 17 +- Engine/source/T3D/player.h | 7 +- Engine/source/T3D/projectile.cpp | 16 +- Engine/source/T3D/projectile.h | 4 +- Engine/source/T3D/proximityMine.cpp | 12 +- Engine/source/T3D/proximityMine.h | 4 +- Engine/source/T3D/rigidShape.cpp | 12 +- Engine/source/T3D/rigidShape.h | 4 +- Engine/source/T3D/sfx/sfxEmitter.cpp | 6 +- Engine/source/T3D/sfx/sfxEmitter.h | 2 +- Engine/source/T3D/shapeBase.cpp | 16 +- Engine/source/T3D/shapeBase.h | 10 +- Engine/source/T3D/shapeImage.cpp | 12 +- Engine/source/T3D/tsStatic.cpp | 6 +- Engine/source/T3D/tsStatic.h | 2 +- Engine/source/T3D/vehicles/flyingVehicle.cpp | 6 +- Engine/source/T3D/vehicles/flyingVehicle.h | 2 +- Engine/source/T3D/vehicles/hoverVehicle.cpp | 6 +- Engine/source/T3D/vehicles/hoverVehicle.h | 2 +- Engine/source/T3D/vehicles/vehicle.cpp | 12 +- Engine/source/T3D/vehicles/vehicle.h | 4 +- Engine/source/T3D/vehicles/wheeledVehicle.cpp | 12 +- Engine/source/T3D/vehicles/wheeledVehicle.h | 4 +- Engine/source/afx/afxMagicMissile.cpp | 8 +- Engine/source/afx/afxMagicMissile.h | 2 +- Engine/source/afx/ce/afxBillboard.cpp | 8 +- Engine/source/afx/ce/afxBillboard.h | 2 +- Engine/source/afx/ce/afxModel.cpp | 8 +- Engine/source/afx/ce/afxModel.h | 2 +- Engine/source/afx/ce/afxZodiac.cpp | 8 +- Engine/source/afx/ce/afxZodiac.h | 2 +- Engine/source/afx/ce/afxZodiacPlane.cpp | 8 +- Engine/source/afx/ce/afxZodiacPlane.h | 2 +- Engine/source/assets/assetBase.h | 1 - Engine/source/environment/VolumetricFog.cpp | 12 +- Engine/source/environment/VolumetricFog.h | 6 +- Engine/source/environment/basicClouds.cpp | 4 +- Engine/source/environment/cloudLayer.cpp | 6 +- Engine/source/environment/cloudLayer.h | 4 +- Engine/source/environment/decalRoad.cpp | 6 +- Engine/source/environment/decalRoad.h | 2 +- .../editors/guiMeshRoadEditorCtrl.cpp | 6 +- .../editors/guiMeshRoadEditorCtrl.h | 6 +- .../environment/editors/guiRoadEditorCtrl.h | 2 +- Engine/source/environment/meshRoad.cpp | 18 +- Engine/source/environment/meshRoad.h | 6 +- Engine/source/environment/scatterSky.cpp | 6 +- Engine/source/environment/scatterSky.h | 2 +- Engine/source/environment/skyBox.cpp | 6 +- Engine/source/environment/skyBox.h | 2 +- Engine/source/environment/sun.cpp | 6 +- Engine/source/environment/sun.h | 2 +- Engine/source/environment/waterObject.cpp | 18 +- Engine/source/environment/waterObject.h | 6 +- Engine/source/forest/forestItem.cpp | 6 +- Engine/source/forest/forestItem.h | 2 +- Engine/source/gfx/sim/cubemapData.cpp | 4 +- Engine/source/gfx/sim/cubemapData.h | 2 +- .../gui/buttons/guiBitmapButtonCtrl.cpp | 4 +- .../source/gui/buttons/guiBitmapButtonCtrl.h | 2 +- .../source/gui/buttons/guiIconButtonCtrl.cpp | 4 +- Engine/source/gui/buttons/guiIconButtonCtrl.h | 2 +- .../gui/buttons/guiToolboxButtonCtrl.cpp | 12 +- .../source/gui/buttons/guiToolboxButtonCtrl.h | 6 +- Engine/source/gui/controls/guiBitmapCtrl.cpp | 2 +- Engine/source/gui/controls/guiBitmapCtrl.h | 2 +- .../source/gui/controls/guiMaterialCtrl.cpp | 2 +- Engine/source/gui/controls/guiMaterialCtrl.h | 2 +- Engine/source/gui/controls/guiPopUpCtrl.cpp | 4 +- Engine/source/gui/controls/guiPopUpCtrlEx.cpp | 4 +- Engine/source/gui/core/guiControl.cpp | 2 +- Engine/source/gui/core/guiTypes.cpp | 4 +- Engine/source/gui/core/guiTypes.h | 4 +- .../source/gui/game/guiChunkedBitmapCtrl.cpp | 2 +- Engine/source/gui/game/guiChunkedBitmapCtrl.h | 2 +- .../source/gui/game/guiProgressBitmapCtrl.cpp | 2 +- .../source/gui/game/guiProgressBitmapCtrl.h | 2 +- .../source/gui/worldEditor/guiMissionArea.cpp | 2 +- .../source/gui/worldEditor/guiMissionArea.h | 2 +- Engine/source/gui/worldEditor/worldEditor.h | 6 +- .../source/materials/materialDefinition.cpp | 24 +- Engine/source/postFx/postEffect.cpp | 2 +- Engine/source/terrain/terrMaterial.cpp | 20 +- Engine/source/terrain/terrMaterial.h | 10 +- 123 files changed, 632 insertions(+), 966 deletions(-) create mode 100644 Engine/source/T3D/assets/assetMacroHelpers.h diff --git a/Engine/source/T3D/accumulationVolume.cpp b/Engine/source/T3D/accumulationVolume.cpp index 37e9f4ae9..139a843b9 100644 --- a/Engine/source/T3D/accumulationVolume.cpp +++ b/Engine/source/T3D/accumulationVolume.cpp @@ -85,7 +85,7 @@ AccumulationVolume::AccumulationVolume() mWorldToObj.identity(); // Accumulation Texture. - INIT_IMAGEASSET(Texture); + INIT_ASSET(Texture); resetWorldBox(); } @@ -236,7 +236,7 @@ U32 AccumulationVolume::packUpdate( NetConnection *connection, U32 mask, BitStre if (stream->writeFlag(mask & InitialUpdateMask)) { - PACK_IMAGEASSET(connection, Texture); + PACK_ASSET(connection, Texture); } return retMask; @@ -248,7 +248,7 @@ void AccumulationVolume::unpackUpdate( NetConnection *connection, BitStream *str if (stream->readFlag()) { - UNPACK_IMAGEASSET(connection, Texture); + UNPACK_ASSET(connection, Texture); //setTexture(mTextureName); } } diff --git a/Engine/source/T3D/accumulationVolume.h b/Engine/source/T3D/accumulationVolume.h index 2b05fa81b..4c4049b6c 100644 --- a/Engine/source/T3D/accumulationVolume.h +++ b/Engine/source/T3D/accumulationVolume.h @@ -62,7 +62,7 @@ class AccumulationVolume : public ScenePolyhedralSpace virtual void _renderObject( ObjectRenderInst* ri, SceneRenderState* state, BaseMatInstance* overrideMat ); DECLARE_IMAGEASSET(AccumulationVolume, Texture, onTextureChanged, GFXStaticTextureSRGBProfile); - DECLARE_IMAGEASSET_NET_SETGET(AccumulationVolume, Texture, -1); + DECLARE_ASSET_NET_SETGET(AccumulationVolume, Texture, -1); void onTextureChanged() {} diff --git a/Engine/source/T3D/assets/ImageAsset.h b/Engine/source/T3D/assets/ImageAsset.h index 7afcd6da2..d4de538f7 100644 --- a/Engine/source/T3D/assets/ImageAsset.h +++ b/Engine/source/T3D/assets/ImageAsset.h @@ -47,7 +47,7 @@ #include "sim/netConnection.h" #include - +#include "assetMacroHelpers.h" //----------------------------------------------------------------------------- class ImageAsset : public AssetBase { @@ -273,45 +273,6 @@ public: \ }\ bool name##Valid() {return (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok); } -#define DECLARE_IMAGEASSET_SETGET(className, name)\ - static bool _set##name##Data(void* obj, const char* index, const char* data)\ - {\ - bool ret = false;\ - className* object = static_cast(obj);\ - ret = object->_set##name(StringTable->insert(data));\ - return ret;\ - } - -#define DECLARE_IMAGEASSET_NET_SETGET(className, name, bitmask)\ - static bool _set##name##Data(void* obj, const char* index, const char* data)\ - {\ - bool ret = false;\ - className* object = static_cast(obj);\ - ret = object->_set##name(StringTable->insert(data));\ - if(ret)\ - object->setMaskBits(bitmask);\ - return ret;\ - } - -#define DEF_IMAGEASSET_BINDS(className,name)\ -DefineEngineMethod(className, get##name, const char*, (), , "get name")\ -{\ - return object->get##name(); \ -}\ -DefineEngineMethod(className, get##name##Asset, const char*, (), , assetText(name, asset reference))\ -{\ - return object->m##name##AssetId; \ -}\ -DefineEngineMethod(className, set##name, bool, (const char* map), , assetText(name,assignment. first tries asset then flat file.))\ -{\ - return object->_set##name(StringTable->insert(map));\ -} - -#define INIT_IMAGEASSET(name) \ - m##name##Name = StringTable->EmptyString(); \ - m##name##AssetId = StringTable->EmptyString(); \ - m##name##Asset = NULL; - #ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS #define INITPERSISTFIELD_IMAGEASSET(name, consoleClass, docs) \ @@ -326,11 +287,6 @@ DefineEngineMethod(className, set##name, bool, (const char* map), , assetText(na #endif // SHOW_LEGACY_FILE_FIELDS -#define CLONE_IMAGEASSET(name) \ - m##name##Name = other.m##name##Name;\ - m##name##AssetId = other.m##name##AssetId;\ - m##name##Asset = other.m##name##Asset; - #define LOAD_IMAGEASSET(name)\ if (m##name##AssetId != StringTable->EmptyString())\ {\ @@ -342,43 +298,6 @@ if (m##name##AssetId != StringTable->EmptyString())\ else Con::warnf("Warning: %s::LOAD_IMAGEASSET(%s)-%s", mClassName, m##name##AssetId, ImageAsset::getAssetErrstrn(assetState).c_str());\ } -#define PACKDATA_IMAGEASSET(name)\ - if (stream->writeFlag(m##name##Asset.notNull()))\ - {\ - stream->writeString(m##name##Asset.getAssetId());\ - }\ - else\ - stream->writeString(m##name##Name); - -#define UNPACKDATA_IMAGEASSET(name)\ - if (stream->readFlag())\ - {\ - m##name##AssetId = stream->readSTString();\ - _set##name(m##name##AssetId);\ - }\ - else\ - {\ - m##name##Name = stream->readSTString();\ - _set##name(m##name##Name);\ - }\ - -#define PACK_IMAGEASSET(netconn, name)\ - if (stream->writeFlag(m##name##Asset.notNull()))\ - {\ - NetStringHandle assetIdStr = m##name##Asset.getAssetId();\ - netconn->packNetStringHandleU(stream, assetIdStr);\ - }\ - else\ - stream->writeString(m##name##Name); - -#define UNPACK_IMAGEASSET(netconn, name)\ - if (stream->readFlag())\ - {\ - m##name##AssetId = StringTable->insert(netconn->unpackNetStringHandleU(stream).getString());\ - _set##name(m##name##AssetId);\ - }\ - else\ - m##name##Name = stream->readSTString(); #pragma endregion @@ -542,13 +461,6 @@ DefineEngineMethod(className, set##name, bool, (const char* map, S32 index), , a return object->_set##name(StringTable->insert(map), index);\ } -#define INIT_IMAGEASSET_ARRAY(name, index) \ -{\ - m##name##Name[index] = StringTable->EmptyString(); \ - m##name##AssetId[index] = StringTable->EmptyString(); \ - m##name##Asset[index] = NULL;\ -} - #ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS #define INITPERSISTFIELD_IMAGEASSET_ARRAY(name, arraySize, consoleClass, docs) \ @@ -563,13 +475,6 @@ DefineEngineMethod(className, set##name, bool, (const char* map, S32 index), , a #endif -#define CLONE_IMAGEASSET_ARRAY(name, index) \ -{\ - m##name##Name[index] = other.m##name##Name[index];\ - m##name##AssetId[index] = other.m##name##AssetId[index];\ - m##name##Asset[index] = other.m##name##Asset[index];\ -} - #define LOAD_IMAGEASSET_ARRAY(name, index)\ if (m##name##AssetId[index] != StringTable->EmptyString())\ {\ @@ -581,44 +486,6 @@ if (m##name##AssetId[index] != StringTable->EmptyString())\ else Con::warnf("Warning: %s::LOAD_IMAGEASSET(%s)-%s", mClassName, m##name##AssetId[index], ImageAsset::getAssetErrstrn(assetState).c_str());\ } -#define PACKDATA_IMAGEASSET_ARRAY(name, index)\ - if (stream->writeFlag(m##name##Asset[index].notNull()))\ - {\ - stream->writeString(m##name##Asset[index].getAssetId());\ - }\ - else\ - stream->writeString(m##name##Name[index]); - -#define UNPACKDATA_IMAGEASSET_ARRAY(name, index)\ - if (stream->readFlag())\ - {\ - m##name##AssetId[index] = stream->readSTString();\ - _set##name(m##name##AssetId[index], index);\ - }\ - else\ - {\ - m##name##Name[index] = stream->readSTString();\ - _set##name(m##name##Name[index], index);\ - }\ - -#define PACK_IMAGEASSET_ARRAY(netconn, name, index)\ - if (stream->writeFlag(m##name##Asset[index].notNull()))\ - {\ - NetStringHandle assetIdStr = m##name##Asset[index].getAssetId();\ - netconn->packNetStringHandleU(stream, assetIdStr);\ - }\ - else\ - stream->writeString(m##name##Name[index]); - -#define UNPACK_IMAGEASSET_ARRAY(netconn, name, index)\ - if (stream->readFlag())\ - {\ - m##name##AssetId[index] = StringTable->insert(netconn->unpackNetStringHandleU(stream).getString());\ - _set##name(m##name##AssetId[index], index);\ - }\ - else\ - m##name##Name[index] = stream->readSTString(); - #pragma endregion diff --git a/Engine/source/T3D/assets/MaterialAsset.h b/Engine/source/T3D/assets/MaterialAsset.h index fc383810f..9fab8a1da 100644 --- a/Engine/source/T3D/assets/MaterialAsset.h +++ b/Engine/source/T3D/assets/MaterialAsset.h @@ -54,6 +54,7 @@ #include "materials/materialDefinition.h" #include "materials/customMaterialDefinition.h" #include "materials/materialManager.h" +#include "assetMacroHelpers.h" //----------------------------------------------------------------------------- class MaterialAsset : public AssetBase @@ -262,46 +263,6 @@ public: \ }\ bool is##name##Valid() {return (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok); } -#define DECLARE_MATERIALASSET_SETGET(className, name)\ - static bool _set##name##Data(void* obj, const char* index, const char* data)\ - {\ - bool ret = false;\ - className* object = static_cast(obj);\ - ret = object->_set##name(StringTable->insert(data));\ - return ret;\ - } - -#define DECLARE_MATERIALASSET_NET_SETGET(className, name, bitmask)\ - static bool _set##name##Data(void* obj, const char* index, const char* data)\ - {\ - bool ret = false;\ - className* object = static_cast(obj);\ - ret = object->_set##name(StringTable->insert(data));\ - if(ret)\ - object->setMaskBits(bitmask);\ - return ret;\ - } - -#define DEF_MATERIALASSET_BINDS(className,name)\ -DefineEngineMethod(className, get##name, const char*, (), , "get name")\ -{\ - return object->get##name(); \ -}\ -DefineEngineMethod(className, get##name##Asset, const char*, (), , assetText(name, asset reference))\ -{\ - return object->m##name##AssetId; \ -}\ -DefineEngineMethod(className, set##name, bool, (const char* mat), , assetText(name,assignment. first tries asset then material name.))\ -{\ - return object->_set##name(StringTable->insert(mat));\ -} - -#define INIT_MATERIALASSET(name) \ - m##name##Name = StringTable->EmptyString(); \ - m##name##AssetId = StringTable->EmptyString(); \ - m##name##Asset = NULL;\ - m##name = NULL; - #ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS #define INITPERSISTFIELD_MATERIALASSET(name, consoleClass, docs) \ @@ -316,11 +277,6 @@ DefineEngineMethod(className, set##name, bool, (const char* mat), , assetText(na #endif // SHOW_LEGACY_FILE_FIELDS -#define CLONE_MATERIALASSET(name) \ - m##name##Name = other.m##name##Name;\ - m##name##AssetId = other.m##name##AssetId;\ - m##name##Asset = other.m##name##Asset; - #define LOAD_MATERIALASSET(name)\ if (m##name##AssetId != StringTable->EmptyString())\ {\ @@ -331,45 +287,6 @@ if (m##name##AssetId != StringTable->EmptyString())\ }\ else Con::warnf("Warning: %s::LOAD_MATERIALASSET(%s)-%s", mClassName, m##name##AssetId, MaterialAsset::getAssetErrstrn(assetState).c_str());\ } - -#define PACKDATA_MATERIALASSET(name)\ - if (stream->writeFlag(m##name##Asset.notNull()))\ - {\ - stream->writeString(m##name##Asset.getAssetId());\ - }\ - else\ - stream->writeString(m##name##Name); - -#define UNPACKDATA_MATERIALASSET(name)\ - if (stream->readFlag())\ - {\ - m##name##AssetId = stream->readSTString();\ - _set##name(m##name##AssetId);\ - }\ - else\ - {\ - m##name##Name = stream->readSTString();\ - _set##name(m##name##Name);\ - }\ - -#define PACK_MATERIALASSET(netconn, name)\ - if (stream->writeFlag(m##name##Asset.notNull()))\ - {\ - NetStringHandle assetIdStr = m##name##Asset.getAssetId();\ - netconn->packNetStringHandleU(stream, assetIdStr);\ - }\ - else\ - stream->writeString(m##name##Name); - -#define UNPACK_MATERIALASSET(netconn, name)\ - if (stream->readFlag())\ - {\ - m##name##AssetId = StringTable->insert(netconn->unpackNetStringHandleU(stream).getString());\ - _set##name(m##name##AssetId);\ - }\ - else\ - m##name##Name = stream->readSTString(); - #pragma endregion #endif // _ASSET_BASE_H_ diff --git a/Engine/source/T3D/assets/ShapeAsset.h b/Engine/source/T3D/assets/ShapeAsset.h index 2d641a840..36a0a68c1 100644 --- a/Engine/source/T3D/assets/ShapeAsset.h +++ b/Engine/source/T3D/assets/ShapeAsset.h @@ -60,6 +60,7 @@ #ifndef _BITSTREAM_H_ #include "core/stream/bitStream.h" #endif +#include "assetMacroHelpers.h" //----------------------------------------------------------------------------- class ShapeAsset : public AssetBase { @@ -324,46 +325,6 @@ public: \ }\ bool is##name##Valid() {return (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok); } -#define DECLARE_SHAPEASSET_SETGET(className, name)\ - static bool _set##name##Data(void* obj, const char* index, const char* data)\ - {\ - bool ret = false;\ - className* object = static_cast(obj);\ - ret = object->_set##name(StringTable->insert(data));\ - return ret;\ - } - -#define DECLARE_SHAPEASSET_NET_SETGET(className, name, bitmask)\ - static bool _set##name##Data(void* obj, const char* index, const char* data)\ - {\ - bool ret = false;\ - className* object = static_cast(obj);\ - ret = object->_set##name(StringTable->insert(data));\ - if(ret)\ - object->setMaskBits(bitmask);\ - return ret;\ - } - -#define DEF_SHAPEASSET_BINDS(className,name)\ -DefineEngineMethod(className, get##name, String, (), , "get name")\ -{\ - return object->get##name(); \ -}\ -DefineEngineMethod(className, get##name##Asset, String, (), , assetText(name, asset reference))\ -{\ - return object->m##name##AssetId; \ -}\ -DefineEngineMethod(className, set##name, bool, (const char* shape), , assetText(name,assignment. first tries asset then flat file.))\ -{\ - return object->_set##name(StringTable->insert(shape));\ -} - -#define INIT_SHAPEASSET(name) \ - m##name##Name = StringTable->EmptyString(); \ - m##name##AssetId = StringTable->EmptyString(); \ - m##name##Asset = NULL; \ - m##name = NULL; - #ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS #define INITPERSISTFIELD_SHAPEASSET(name, consoleClass, docs) \ @@ -378,49 +339,6 @@ DefineEngineMethod(className, set##name, bool, (const char* shape), , assetText #endif // SHOW_LEGACY_FILE_FIELDS -#define CLONE_SHAPEASSET(name) \ - m##name##Name = other.m##name##Name;\ - m##name##AssetId = other.m##name##AssetId;\ - m##name##Asset = other.m##name##Asset;\ - -#define PACKDATA_SHAPEASSET(name)\ - if (stream->writeFlag(m##name##Asset.notNull()))\ - {\ - stream->writeString(m##name##Asset.getAssetId());\ - }\ - else\ - stream->writeString(m##name##Name); - -#define UNPACKDATA_SHAPEASSET(name)\ - if (stream->readFlag())\ - {\ - m##name##AssetId = stream->readSTString();\ - _set##name(m##name##AssetId);\ - }\ - else\ - {\ - m##name##Name = stream->readSTString();\ - _set##name(m##name##Name);\ - } - -#define PACK_SHAPEASSET(netconn, name)\ - if (stream->writeFlag(m##name##Asset.notNull()))\ - {\ - NetStringHandle assetIdStr = m##name##Asset.getAssetId();\ - netconn->packNetStringHandleU(stream, assetIdStr);\ - }\ - else\ - stream->writeString(m##name##Name); - -#define UNPACK_SHAPEASSET(netconn, name)\ - if (stream->readFlag())\ - {\ - m##name##AssetId = StringTable->insert(netconn->unpackNetStringHandleU(stream).getString());\ - _set##name(m##name##AssetId);\ - }\ - else\ - m##name##Name = stream->readSTString(); - #pragma endregion #pragma region Arrayed Asset Macros @@ -526,58 +444,6 @@ public: \ }\ bool is##name##Valid(const U32& id) {return (get##name(id) != StringTable->EmptyString() && m##name##Asset[id]->getStatus() == AssetBase::Ok); } -#define DECLARE_SHAPEASSET_ARRAY_SETGET(className, name)\ - static bool _set##name##Data(void* obj, const char* index, const char* data)\ - {\ - if (!index) return false;\ - U32 idx = dAtoi(index);\ - if (idx >= sm##name##Count)\ - return false;\ - bool ret = false;\ - className* object = static_cast(obj);\ - ret = object->_set##name(StringTable->insert(data), idx);\ - return ret;\ - } - -#define DECLARE_SHAPEASSET_ARRAY_NET_SETGET(className, name, bitmask)\ - static bool _set##name##Data(void* obj, const char* index, const char* data)\ - {\ - if (!index) return false;\ - U32 idx = dAtoi(index);\ - if (idx >= sm##name##Count)\ - return false;\ - bool ret = false;\ - className* object = static_cast(obj);\ - ret = object->_set##name(StringTable->insert(data), idx);\ - if(ret)\ - object->setMaskBits(bitmask);\ - return ret;\ - } - -#define DEF_SHAPEASSET_ARRAY_BINDS(className,name)\ -DefineEngineMethod(className, get##name, String, (S32 index), , "get name")\ -{\ - return object->get##name(index); \ -}\ -DefineEngineMethod(className, get##name##Asset, String, (S32 index), , assetText(name, asset reference))\ -{\ - if(index >= className::sm##name##Count || index < 0)\ - return "";\ - return object->m##name##AssetId[index]; \ -}\ -DefineEngineMethod(className, set##name, bool, (const char* shape, S32 index), , assetText(name,assignment. first tries asset then flat file.))\ -{\ - return object->_set##name(StringTable->insert(shape), index);\ -} - -#define INIT_SHAPEASSET_ARRAY(name, index) \ -{\ - m##name##Name[index] = StringTable->EmptyString(); \ - m##name##AssetId[index] = StringTable->EmptyString(); \ - m##name##Asset[index] = NULL; \ - m##name[index] = NULL;\ -} - #ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS #define INITPERSISTFIELD_SHAPEASSET_ARRAY(name, arraySize, consoleClass, docs) \ @@ -592,51 +458,6 @@ DefineEngineMethod(className, set##name, bool, (const char* shape, S32 index), #endif // SHOW_LEGACY_FILE_FIELDS -#define CLONE_SHAPEASSET_ARRAY(name, index) \ -{\ - m##name##Name[index] = other.m##name##Name[index];\ - m##name##AssetId[index] = other.m##name##AssetId[index];\ - m##name##Asset[index] = other.m##name##Asset[index];\ -} - -#define PACKDATA_SHAPEASSET_ARRAY(name, index)\ - if (stream->writeFlag(m##name##Asset[index].notNull()))\ - {\ - stream->writeString(m##name##Asset[index].getAssetId());\ - }\ - else\ - stream->writeString(m##name##Name[index]); - -#define UNPACKDATA_SHAPEASSET_ARRAY(name, index)\ - if (stream->readFlag())\ - {\ - m##name##AssetId[index] = stream->readSTString();\ - _set##name(m##name##AssetId[index], index);\ - }\ - else\ - {\ - m##name##Name[index] = stream->readSTString();\ - _set##name(m##name##Name[index], index);\ - } - -#define PACK_SHAPEASSET_ARRAY(netconn, name, index)\ - if (stream->writeFlag(m##name##Asset[index].notNull()))\ - {\ - NetStringHandle assetIdStr = m##name##Asset[index].getAssetId();\ - netconn->packNetStringHandleU(stream, assetIdStr);\ - }\ - else\ - stream->writeString(m##name##Name[index]); - -#define UNPACK_SHAPEASSET_ARRAY(netconn, name, index)\ - if (stream->readFlag())\ - {\ - m##name##AssetId[index] = StringTable->insert(netconn->unpackNetStringHandleU(stream).getString());\ - _set##name(m##name##AssetId[index], index);\ - }\ - else\ - m##name##Name[index] = stream->readSTString(); - #pragma endregion #endif diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index 1d98b61b1..77c1e7180 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -57,6 +57,7 @@ #include "sfx/sfxProfile.h" #endif // !_SFXPROFILE_H_ +#include "assetMacroHelpers.h" class SFXResource; //----------------------------------------------------------------------------- @@ -275,46 +276,6 @@ public: \ }\ bool is##name##Valid() { return (get##name() != StringTable->EmptyString() && m##name##Asset->getStatus() == AssetBase::Ok); } -#define DECLARE_SOUNDASSET_SETGET(className, name)\ - static bool _set##name##Data(void* obj, const char* index, const char* data)\ - {\ - bool ret = false;\ - className* object = static_cast(obj);\ - ret = object->_set##name(StringTable->insert(data));\ - return ret;\ - } - -#define DECLARE_SOUNDASSET_NET_SETGET(className, name, bitmask)\ - static bool _set##name##Data(void* obj, const char* index, const char* data)\ - {\ - bool ret = false;\ - className* object = static_cast(obj);\ - ret = object->_set##name(StringTable->insert(data));\ - if(ret)\ - object->setMaskBits(bitmask);\ - return ret;\ - } - -#define DEF_SOUNDASSET_BINDS(className,name)\ -DefineEngineMethod(className, get##name, String, (), , "get name")\ -{\ - return object->get##name(); \ -}\ -DefineEngineMethod(className, get##name##Asset, String, (), , assetText(name, asset reference))\ -{\ - return object->m##name##AssetId; \ -}\ -DefineEngineMethod(className, set##name, bool, (const char* shape), , assetText(name,assignment. first tries asset then flat file.))\ -{\ - return object->_set##name(StringTable->insert(shape));\ -} - -#define INIT_SOUNDASSET(name) \ - m##name##Name = StringTable->EmptyString(); \ - m##name##AssetId = StringTable->EmptyString(); \ - m##name##Asset = NULL; \ - m##name = NULL;\ - #ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS #define INITPERSISTFIELD_SOUNDASSET(name, consoleClass, docs) \ @@ -329,49 +290,6 @@ DefineEngineMethod(className, set##name, bool, (const char* shape), , assetText #endif // TORQUE_SHOW_LEGACY_FILE_FIELDS -#define CLONE_SOUNDASSET(name) \ - m##name##Name = other.m##name##Name;\ - m##name##AssetId = other.m##name##AssetId;\ - m##name##Asset = other.m##name##Asset;\ - -#define PACKDATA_SOUNDASSET(name)\ - if (stream->writeFlag(m##name##Asset.notNull()))\ - {\ - stream->writeString(m##name##Asset.getAssetId());\ - }\ - else\ - stream->writeString(m##name##Name); - -#define UNPACKDATA_SOUNDASSET(name)\ - if (stream->readFlag())\ - {\ - m##name##AssetId = stream->readSTString();\ - _set##name(m##name##AssetId);\ - }\ - else\ - {\ - m##name##Name = stream->readSTString();\ - _set##name(m##name##Name);\ - } - -#define PACK_SOUNDASSET(netconn, name)\ - if (stream->writeFlag(m##name##Asset.notNull()))\ - {\ - NetStringHandle assetIdStr = m##name##Asset.getAssetId();\ - netconn->packNetStringHandleU(stream, assetIdStr);\ - }\ - else\ - stream->writeString(m##name##Name); - -#define UNPACK_SOUNDASSET(netconn, name)\ - if (stream->readFlag())\ - {\ - m##name##AssetId = StringTable->insert(netconn->unpackNetStringHandleU(stream).getString());\ - _set##name(m##name##AssetId);\ - }\ - else\ - m##name##Name = stream->readSTString(); - #pragma endregion #pragma region Arrayed Asset Macros @@ -491,57 +409,6 @@ public: \ }\ bool is##name##Valid(const U32& id) {return (get##name(id) != StringTable->EmptyString() && m##name##Asset[id]->getStatus() == AssetBase::Ok); } -#define DECLARE_SOUNDASSET_ARRAY_SETGET(className, name)\ - static bool _set##name##Data(void* obj, const char* index, const char* data)\ - {\ - if(!index) return false;\ - U32 idx = dAtoi(index);\ - if (idx >= sm##name##Count)\ - return false;\ - bool ret = false;\ - className* object = static_cast(obj);\ - ret = object->_set##name(StringTable->insert(data), idx);\ - return ret;\ - } - -#define DECLARE_SOUNDASSET_ARRAY_NET_SETGET(className, name, bitmask)\ - static bool _set##name##Data(void* obj, const char* index, const char* data)\ - {\ - if (!index) return false;\ - U32 idx = dAtoi(index);\ - if (idx >= sm##name##Count)\ - return false;\ - bool ret = false;\ - className* object = static_cast(obj);\ - ret = object->_set##name(StringTable->insert(data, idx));\ - if(ret)\ - object->setMaskBits(bitmask);\ - return ret;\ - } - -#define DEF_SOUNDASSET_ARRAY_BINDS(className,name)\ -DefineEngineMethod(className, get##name, const char*, (S32 index), , "get name")\ -{\ - return object->get##name(index); \ -}\ -DefineEngineMethod(className, get##name##Asset, const char*, (S32 index), , assetText(name, asset reference))\ -{\ - if(index >= className::sm##name##Count || index < 0)\ - return "";\ - return object->m##name##AssetId[index]; \ -}\ -DefineEngineMethod(className, set##name, bool, (const char* map, S32 index), , assetText(name,assignment. first tries asset then flat file.))\ -{\ - return object->_set##name(StringTable->insert(map), index);\ -} - -#define INIT_SOUNDASSET_ARRAY(name, index) \ -{\ - m##name##Name[index] = StringTable->EmptyString(); \ - m##name##AssetId[index] = StringTable->EmptyString(); \ - m##name##Asset[index] = NULL;\ - m##name[index] = NULL;\ -} #ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS @@ -557,14 +424,6 @@ DefineEngineMethod(className, set##name, bool, (const char* map, S32 index), , a #endif -#define CLONE_SOUNDASSET_ARRAY(name, index) \ -{\ - m##name##Name[index] = other.m##name##Name[index];\ - m##name##AssetId[index] = other.m##name##AssetId[index];\ - m##name##Asset[index] = other.m##name##Asset[index];\ - m##name[index] = = other.m##name[index];\ -} - #define LOAD_SOUNDASSET_ARRAY(name, index)\ if (m##name##AssetId[index] != StringTable->EmptyString())\ {\ @@ -576,75 +435,6 @@ if (m##name##AssetId[index] != StringTable->EmptyString())\ else Con::warnf("Warning: %s::LOAD_IMAGEASSET(%s)-%s", mClassName, m##name##AssetId[index], ImageAsset::getAssetErrstrn(assetState).c_str());\ } -#define PACKDATA_SOUNDASSET_ARRAY(name, index)\ - if (stream->writeFlag(m##name##Asset[index].notNull()))\ - {\ - stream->writeString(m##name##Asset[index].getAssetId());\ - }\ - else\ - stream->writeString(m##name##Name[index]); - -#define UNPACKDATA_SOUNDASSET_ARRAY(name, index)\ - if (stream->readFlag())\ - {\ - m##name##AssetId[index] = stream->readSTString();\ - _set##name(m##name##AssetId[index], index);\ - }\ - else\ - {\ - m##name##Name[index] = stream->readSTString();\ - _set##name(m##name##AssetId[index], index);\ - } - -#define PACK_SOUNDASSET_ARRAY(netconn, name, index)\ - if (stream->writeFlag(m##name##Asset[index].notNull()))\ - {\ - NetStringHandle assetIdStr = m##name##Asset[index].getAssetId();\ - netconn->packNetStringHandleU(stream, assetIdStr);\ - }\ - else\ - stream->writeString(m##name##Name[index]); - -#define UNPACK_SOUNDASSET_ARRAY(netconn, name, index)\ - if (stream->readFlag())\ - {\ - m##name##AssetId[index] = StringTable->insert(netconn->unpackNetStringHandleU(stream).getString());\ - _set##name(m##name##AssetId[index], index);\ - }\ - else\ - {\ - m##name##Name[index] = stream->readSTString();\ - _set##name(m##name##AssetId[index], index);\ - } - -#define PACKDATA_SOUNDASSET_ARRAY_ENUMED(name, enumType, index )\ -{\ - if (stream->writeFlag(m##name##Asset[index].notNull()))\ - {\ - stream->writeString(m##name##Asset[index].getAssetId());\ - const char* enumString = castConsoleTypeToString(static_cast(index));\ - Con::printf("pack: %s = %s",enumString, m##name##AssetId[index]);\ - }\ - else\ - stream->writeString(m##name##Name[index]);\ -} - -#define UNPACKDATA_SOUNDASSET_ARRAY_ENUMED(name, enumType, index )\ -{\ - if (stream->readFlag())\ - {\ - m##name##AssetId[index] = stream->readSTString();\ - _set##name(m##name##AssetId[index], index);\ - const char* enumString = castConsoleTypeToString(static_cast(index));\ - Con::printf("unpack: %s = %s",enumString, m##name##AssetId[index]);\ - }\ - else\ - {\ - m##name##Name[index] = stream->readSTString();\ - _set##name(m##name##AssetId[index], index);\ - }\ -} - #define assetEnumNameConcat(x,suff)(new std::string( x + std::string(#suff)))->c_str() #define INITPERSISTFIELD_SOUNDASSET_ENUMED(name, enumType, maxValue, consoleClass, docs) \ @@ -652,7 +442,7 @@ if (m##name##AssetId[index] != StringTable->EmptyString())\ {\ const char* enumString = castConsoleTypeToString(static_cast(i));\ if (enumString && enumString[0])\ - { Con::printf("%s", enumString);\ + {\ addField(assetEnumNameConcat(enumString, File), TypeSoundFilename, Offset(m##name##Name[i], consoleClass), assetText(name, docs), AbstractClassRep::FIELD_HideInInspectors); \ addField(assetEnumNameConcat(enumString, Asset), TypeSoundAssetId, Offset(m##name##AssetId[i], consoleClass), assetText(name, asset reference.));\ }\ diff --git a/Engine/source/T3D/assets/assetMacroHelpers.h b/Engine/source/T3D/assets/assetMacroHelpers.h new file mode 100644 index 000000000..42f51e8e8 --- /dev/null +++ b/Engine/source/T3D/assets/assetMacroHelpers.h @@ -0,0 +1,274 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2013 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- +#pragma once + +//general class-injection hooks for asset support. not all cases are needed for every class/usage. + +//----------------------------------------------------------------------------- +/// INDIVIDUALIZED CLASS ENTRIES +//----------------------------------------------------------------------------- + +//iniitalization +#define INIT_ASSET(name) \ + m##name##Name = StringTable->EmptyString(); \ + m##name##AssetId = StringTable->EmptyString(); \ + m##name##Asset = NULL;\ + m##name = NULL; + +// copy constructor +#define CLONE_ASSET(name) \ + m##name##Name = other.m##name##Name;\ + m##name##AssetId = other.m##name##AssetId;\ + m##name##Asset = other.m##name##Asset;\ + m##name = other.m##name + +// addProtectedField acessors +#define DECLARE_ASSET_SETGET(className, name)\ + static bool _set##name##Data(void* obj, const char* index, const char* data)\ + {\ + bool ret = false;\ + className* object = static_cast(obj);\ + ret = object->_set##name(StringTable->insert(data));\ + return ret;\ + } + +// addProtectedField acessors for networked objects (sets a flag) +#define DECLARE_ASSET_NET_SETGET(className, name, bitmask)\ + static bool _set##name##Data(void* obj, const char* index, const char* data)\ + {\ + bool ret = false;\ + className* object = static_cast(obj);\ + ret = object->_set##name(StringTable->insert(data));\ + if(ret)\ + object->setMaskBits(bitmask);\ + return ret;\ + } + +//network send - datablock +#define PACKDATA_ASSET(name)\ + if (stream->writeFlag(m##name##Asset.notNull()))\ + {\ + stream->writeString(m##name##Asset.getAssetId());\ + }\ + else\ + stream->writeString(m##name##Name); + +//network recieve - datablock +#define UNPACKDATA_ASSET(name)\ + if (stream->readFlag())\ + {\ + m##name##AssetId = stream->readSTString();\ + _set##name(m##name##AssetId);\ + }\ + else\ + {\ + m##name##Name = stream->readSTString();\ + _set##name(m##name##Name);\ + } + +//network send - object-instance +#define PACK_ASSET(netconn, name)\ + if (stream->writeFlag(m##name##Asset.notNull()))\ + {\ + NetStringHandle assetIdStr = m##name##Asset.getAssetId();\ + netconn->packNetStringHandleU(stream, assetIdStr);\ + }\ + else\ + stream->writeString(m##name##Name); + +//network recieve - object-instance +#define UNPACK_ASSET(netconn, name)\ + if (stream->readFlag())\ + {\ + m##name##AssetId = StringTable->insert(netconn->unpackNetStringHandleU(stream).getString());\ + _set##name(m##name##AssetId);\ + }\ + else\ + m##name##Name = stream->readSTString(); + +//script methods for class.asset acces +//declare general get, getAsset and set methods +#define DEF_ASSET_BINDS(className,name)\ +DefineEngineMethod(className, get##name, String, (), , "get name")\ +{\ + return object->get##name(); \ +}\ +DefineEngineMethod(className, get##name##Asset, String, (), , assetText(name, asset reference))\ +{\ + return object->m##name##AssetId; \ +}\ +DefineEngineMethod(className, set##name, bool, (const char* assetName), , assetText(name,assignment. first tries asset then flat file.))\ +{\ + return object->_set##name(StringTable->insert(assetName));\ +} + +//----------------------------------------------------------------------------- +/// ARRAY CLASS ENTRIES +//----------------------------------------------------------------------------- + +//iniitalization +#define INIT_ASSET_ARRAY(name, index) \ +{\ + m##name##Name[index] = StringTable->EmptyString(); \ + m##name##AssetId[index] = StringTable->EmptyString(); \ + m##name##Asset[index] = NULL;\ + m##name[index] = NULL;\ +} + +// copy constructor +#define CLONE_ASSET_ARRAY(name, index) \ +{\ + m##name##Name[index] = other.m##name##Name[index];\ + m##name##AssetId[index] = other.m##name##AssetId[index];\ + m##name##Asset[index] = other.m##name##Asset[index];\ + m##name[index] = other.m##name[index];\ +} +// addProtectedField acessors +#define DECLARE_ASSET_ARRAY_SETGET(className, name)\ + static bool _set##name##Data(void* obj, const char* index, const char* data)\ + {\ + if(!index) return false;\ + U32 idx = dAtoi(index);\ + if (idx >= sm##name##Count)\ + return false;\ + bool ret = false;\ + className* object = static_cast(obj);\ + ret = object->_set##name(StringTable->insert(data), idx);\ + return ret;\ + } +// addProtectedField acessors for networked objects (sets a flag) +#define DECLARE_ASSET_ARRAY_NET_SETGET(className, name, bitmask)\ + static bool _set##name##Data(void* obj, const char* index, const char* data)\ + {\ + if (!index) return false;\ + U32 idx = dAtoi(index);\ + if (idx >= sm##name##Count)\ + return false;\ + bool ret = false;\ + className* object = static_cast(obj);\ + ret = object->_set##name(StringTable->insert(data), idx);\ + if(ret)\ + object->setMaskBits(bitmask);\ + return ret;\ + } +//network send - datablock +#define PACKDATA_ASSET_ARRAY(name, index)\ + if (stream->writeFlag(m##name##Asset[index].notNull()))\ + {\ + stream->writeString(m##name##Asset[index].getAssetId());\ + }\ + else\ + stream->writeString(m##name##Name[index]); + +//network recieve - datablock +#define UNPACKDATA_ASSET_ARRAY(name, index)\ + if (stream->readFlag())\ + {\ + m##name##AssetId[index] = stream->readSTString();\ + _set##name(m##name##AssetId[index], index);\ + }\ + else\ + {\ + m##name##Name[index] = stream->readSTString();\ + _set##name(m##name##Name[index], index);\ + } + +//network send - object-instance +#define PACK_ASSET_ARRAY(netconn, name, index)\ + if (stream->writeFlag(m##name##Asset[index].notNull()))\ + {\ + NetStringHandle assetIdStr = m##name##Asset[index].getAssetId();\ + netconn->packNetStringHandleU(stream, assetIdStr);\ + }\ + else\ + stream->writeString(m##name##Name[index]); + +//network recieve - object-instance +#define UNPACK_ASSET_ARRAY(netconn, name, index)\ + if (stream->readFlag())\ + {\ + m##name##AssetId[index] = StringTable->insert(netconn->unpackNetStringHandleU(stream).getString());\ + _set##name(m##name##AssetId[index], index);\ + }\ + else\ + {\ + m##name##Name[index] = stream->readSTString();\ + _set##name(m##name##Name[index], index);\ + } + +//script methods for class.asset acces +//declare general get, getAsset and set methods +//signatures are: +//using DiffuseMap as an example +//material.getDiffuseMap(%layer); //returns the raw file referenced +//material.getDiffuseMapAsset(%layer); //returns the asset id +//material.setDiffuseMap(%texture, %layer); //tries to set the asset and failing that attempts a flat file reference +#define DEF_ASSET_ARRAY_BINDS(className,name)\ +DefineEngineMethod(className, get##name, const char*, (S32 index), , "get name")\ +{\ + return object->get##name(index); \ +}\ +DefineEngineMethod(className, get##name##Asset, const char*, (S32 index), , assetText(name, asset reference))\ +{\ + if(index >= className::sm##name##Count || index < 0)\ + return "";\ + return object->m##name##AssetId[index]; \ +}\ +DefineEngineMethod(className, set##name, bool, (const char* assetName, S32 index), , assetText(name,assignment. first tries asset then flat file.))\ +{\ + return object->_set##name(StringTable->insert(assetName), index);\ +} + +//----------------------------------------------------------------------------- +/// ARRAYS REFERENCED VIA ENUM CLASS ENTRIES +//----------------------------------------------------------------------------- +// +// substite these in to see the enum strings and assigned values +//network send - object-instance +#define PACKDATA_ASSET_ARRAY_ENUMED(name, enumType, index )\ +{\ + if (stream->writeFlag(m##name##Asset[index].notNull()))\ + {\ + stream->writeString(m##name##Asset[index].getAssetId());\ + const char* enumString = castConsoleTypeToString(static_cast(index));\ + Con::printf("pack: %s = %s",enumString, m##name##AssetId[index]);\ + }\ + else\ + stream->writeString(m##name##Name[index]);\ +} +//network recieve - object-instance +#define UNPACKDATA_ASSET_ARRAY_ENUMED(name, enumType, index )\ +{\ + if (stream->readFlag())\ + {\ + m##name##AssetId[index] = stream->readSTString();\ + _set##name(m##name##AssetId[index], index);\ + const char* enumString = castConsoleTypeToString(static_cast(index));\ + Con::printf("unpack: %s = %s",enumString, m##name##AssetId[index]);\ + }\ + else\ + {\ + m##name##Name[index] = stream->readSTString();\ + _set##name(m##name##AssetId[index], index);\ + }\ +} + diff --git a/Engine/source/T3D/convexShape.cpp b/Engine/source/T3D/convexShape.cpp index 99f3f418a..47271fd03 100644 --- a/Engine/source/T3D/convexShape.cpp +++ b/Engine/source/T3D/convexShape.cpp @@ -290,7 +290,7 @@ ConvexShape::ConvexShape() mSurfaceUVs.clear(); mSurfaceTextures.clear(); - INIT_MATERIALASSET(Material); + INIT_ASSET(Material); } ConvexShape::~ConvexShape() @@ -528,7 +528,7 @@ U32 ConvexShape::packUpdate( NetConnection *conn, U32 mask, BitStream *stream ) if ( stream->writeFlag( mask & UpdateMask ) ) { - PACK_MATERIALASSET(conn, Material); + PACK_ASSET(conn, Material); U32 surfCount = mSurfaces.size(); stream->writeInt( surfCount, 32 ); @@ -584,7 +584,7 @@ void ConvexShape::unpackUpdate( NetConnection *conn, BitStream *stream ) if ( stream->readFlag() ) // UpdateMask { - UNPACK_MATERIALASSET(conn, Material); + UNPACK_ASSET(conn, Material); mSurfaces.clear(); mSurfaceUVs.clear(); @@ -2171,4 +2171,4 @@ void ConvexShape::Geometry::generate(const Vector< PlaneF > &planes, const Vecto } } -DEF_MATERIALASSET_BINDS(ConvexShape, Material); +DEF_ASSET_BINDS(ConvexShape, Material); diff --git a/Engine/source/T3D/convexShape.h b/Engine/source/T3D/convexShape.h index 22dc4553b..c6d74fe17 100644 --- a/Engine/source/T3D/convexShape.h +++ b/Engine/source/T3D/convexShape.h @@ -138,14 +138,14 @@ public: // The name of the Material we will use for rendering DECLARE_MATERIALASSET(surfaceMaterial, Material); - DECLARE_MATERIALASSET_SETGET(surfaceMaterial, Material); + DECLARE_ASSET_SETGET(surfaceMaterial, Material); // The actual Material instance BaseMatInstance* materialInst; surfaceMaterial() { - INIT_MATERIALASSET(Material); + INIT_ASSET(Material); materialInst = NULL; } @@ -264,7 +264,7 @@ protected: protected: DECLARE_MATERIALASSET(ConvexShape, Material); - DECLARE_MATERIALASSET_SETGET(ConvexShape, Material); + DECLARE_ASSET_SETGET(ConvexShape, Material); // The actual Material instance BaseMatInstance* mMaterialInst; diff --git a/Engine/source/T3D/debris.cpp b/Engine/source/T3D/debris.cpp index 2362fd089..ba94b0892 100644 --- a/Engine/source/T3D/debris.cpp +++ b/Engine/source/T3D/debris.cpp @@ -116,7 +116,7 @@ DebrisData::DebrisData() terminalVelocity = 0.0f; ignoreWater = true; - INIT_SHAPEASSET(Shape); + INIT_ASSET(Shape); } //#define TRACK_DEBRIS_DATA_CLONES @@ -152,7 +152,7 @@ DebrisData::DebrisData(const DebrisData& other, bool temp_clone) : GameBaseData( terminalVelocity = other.terminalVelocity; ignoreWater = other.ignoreWater; - CLONE_SHAPEASSET(Shape); + CLONE_ASSET(Shape); textureName = other.textureName; explosionId = other.explosionId; // -- for pack/unpack of explosion ptr @@ -382,7 +382,7 @@ void DebrisData::packData(BitStream* stream) stream->writeString( textureName ); - PACKDATA_SHAPEASSET(Shape); + PACKDATA_ASSET(Shape); for( S32 i=0; ireadSTString(); - UNPACKDATA_SHAPEASSET(Shape); + UNPACKDATA_ASSET(Shape); for( S32 i=0; iwrite( lookupName ); stream->write( size ); - PACKDATA_MATERIALASSET(Material); + PACKDATA_ASSET(Material); stream->write( lifeSpan ); stream->write( fadeTime ); @@ -287,7 +287,7 @@ void DecalData::unpackData( BitStream *stream ) assignName(lookupName); stream->read( &size ); - UNPACKDATA_MATERIALASSET(Material); + UNPACKDATA_ASSET(Material); _updateMaterial(); stream->read( &lifeSpan ); diff --git a/Engine/source/T3D/decal/decalData.h b/Engine/source/T3D/decal/decalData.h index 5c32c4427..4a053f303 100644 --- a/Engine/source/T3D/decal/decalData.h +++ b/Engine/source/T3D/decal/decalData.h @@ -78,7 +78,7 @@ class DecalData : public SimDataBlock F32 fadeEndPixelSize; DECLARE_MATERIALASSET(DecalData, Material); - DECLARE_MATERIALASSET_SETGET(DecalData, Material); + DECLARE_ASSET_SETGET(DecalData, Material); /// Material instance for decal. BaseMatInstance *matInst; @@ -139,4 +139,4 @@ inline SimSet* DecalData::getSet() return set; } -#endif // _DECALDATA_H_ \ No newline at end of file +#endif // _DECALDATA_H_ diff --git a/Engine/source/T3D/examples/renderMeshExample.cpp b/Engine/source/T3D/examples/renderMeshExample.cpp index 772c7bae6..fe1d099eb 100644 --- a/Engine/source/T3D/examples/renderMeshExample.cpp +++ b/Engine/source/T3D/examples/renderMeshExample.cpp @@ -59,7 +59,7 @@ RenderMeshExample::RenderMeshExample() // Set it as a "static" object that casts shadows mTypeMask |= StaticObjectType | StaticShapeObjectType; - INIT_MATERIALASSET(Material); + INIT_ASSET(Material); } RenderMeshExample::~RenderMeshExample() @@ -143,7 +143,7 @@ U32 RenderMeshExample::packUpdate( NetConnection *conn, U32 mask, BitStream *str // Write out any of the updated editable properties if (stream->writeFlag(mask & UpdateMask)) { - PACK_MATERIALASSET(conn, Material); + PACK_ASSET(conn, Material); } return retMask; @@ -164,7 +164,7 @@ void RenderMeshExample::unpackUpdate(NetConnection *conn, BitStream *stream) if ( stream->readFlag() ) // UpdateMask { - UNPACK_MATERIALASSET(conn, Material); + UNPACK_ASSET(conn, Material); if ( isProperlyAdded() ) updateMaterial(); diff --git a/Engine/source/T3D/examples/renderMeshExample.h b/Engine/source/T3D/examples/renderMeshExample.h index 1c20e4bfe..45686b4a6 100644 --- a/Engine/source/T3D/examples/renderMeshExample.h +++ b/Engine/source/T3D/examples/renderMeshExample.h @@ -74,7 +74,7 @@ class RenderMeshExample : public SceneObject BaseMatInstance* mMaterialInst; DECLARE_MATERIALASSET(RenderMeshExample, Material); - DECLARE_MATERIALASSET_NET_SETGET(RenderMeshExample, Material, UpdateMask); + DECLARE_ASSET_NET_SETGET(RenderMeshExample, Material, UpdateMask); // The GFX vertex and primitive buffers GFXVertexBufferHandle< VertexType > mVertexBuffer; diff --git a/Engine/source/T3D/examples/renderShapeExample.cpp b/Engine/source/T3D/examples/renderShapeExample.cpp index faf2f9b3f..b8aad1ebf 100644 --- a/Engine/source/T3D/examples/renderShapeExample.cpp +++ b/Engine/source/T3D/examples/renderShapeExample.cpp @@ -145,7 +145,7 @@ U32 RenderShapeExample::packUpdate( NetConnection *conn, U32 mask, BitStream *st // Write out any of the updated editable properties if ( stream->writeFlag( mask & UpdateMask ) ) { - PACK_SHAPEASSET(conn, Shape); + PACK_ASSET(conn, Shape); // Allow the server object a chance to handle a new shape createShape(); @@ -169,7 +169,7 @@ void RenderShapeExample::unpackUpdate(NetConnection *conn, BitStream *stream) if ( stream->readFlag() ) // UpdateMask { - UNPACK_SHAPEASSET(conn, Shape); + UNPACK_ASSET(conn, Shape); if ( isProperlyAdded() ) createShape(); @@ -258,4 +258,4 @@ void RenderShapeExample::prepRenderImage( SceneRenderState *state ) // Allow the shape to submit the RenderInst(s) for itself mShapeInstance->render( rdata ); -} \ No newline at end of file +} diff --git a/Engine/source/T3D/examples/renderShapeExample.h b/Engine/source/T3D/examples/renderShapeExample.h index 9c03cbc72..2b3ccf86e 100644 --- a/Engine/source/T3D/examples/renderShapeExample.h +++ b/Engine/source/T3D/examples/renderShapeExample.h @@ -62,7 +62,7 @@ class RenderShapeExample : public SceneObject // Rendering variables //-------------------------------------------------------------------------- DECLARE_SHAPEASSET(RenderShapeExample, Shape, onShapeChanged); - DECLARE_SHAPEASSET_SETGET(RenderShapeExample, Shape); + DECLARE_ASSET_SETGET(RenderShapeExample, Shape); // The actual shape instance TSShapeInstance* mShapeInstance; diff --git a/Engine/source/T3D/fx/explosion.cpp b/Engine/source/T3D/fx/explosion.cpp index 17aa6017c..88a5a9432 100644 --- a/Engine/source/T3D/fx/explosion.cpp +++ b/Engine/source/T3D/fx/explosion.cpp @@ -230,7 +230,7 @@ ExplosionData::ExplosionData() faceViewer = false; - INIT_SOUNDASSET(Sound); + INIT_ASSET(Sound); //soundProfile = NULL; particleEmitter = NULL; @@ -239,7 +239,7 @@ ExplosionData::ExplosionData() explosionScale.set(1.0f, 1.0f, 1.0f); playSpeed = 1.0f; - INIT_SHAPEASSET(ExplosionShape); + INIT_ASSET(ExplosionShape); explosionAnimation = -1; @@ -310,12 +310,12 @@ ExplosionData::ExplosionData(const ExplosionData& other, bool temp_clone) : Game faceViewer = other.faceViewer; particleDensity = other.particleDensity; particleRadius = other.particleRadius; - CLONE_SOUNDASSET(Sound); + CLONE_ASSET(Sound); particleEmitter = other.particleEmitter; particleEmitterId = other.particleEmitterId; // -- for pack/unpack of particleEmitter ptr explosionScale = other.explosionScale; playSpeed = other.playSpeed; - CLONE_SHAPEASSET(ExplosionShape); + CLONE_ASSET(ExplosionShape); explosionAnimation = other.explosionAnimation; // -- from explosionShape sequence "ambient" dMemcpy( emitterList, other.emitterList, sizeof( emitterList ) ); dMemcpy( emitterIDList, other.emitterIDList, sizeof( emitterIDList ) ); // -- for pack/unpack of emitterList ptrs @@ -650,9 +650,9 @@ void ExplosionData::packData(BitStream* stream) { Parent::packData(stream); - PACKDATA_SHAPEASSET(ExplosionShape); + PACKDATA_ASSET(ExplosionShape); - PACKDATA_SOUNDASSET(Sound); + PACKDATA_ASSET(Sound); if (stream->writeFlag(particleEmitter)) stream->writeRangedU32(particleEmitter->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast); @@ -754,9 +754,9 @@ void ExplosionData::unpackData(BitStream* stream) { Parent::unpackData(stream); - UNPACKDATA_SHAPEASSET(ExplosionShape); + UNPACKDATA_ASSET(ExplosionShape); - UNPACKDATA_SOUNDASSET(Sound); + UNPACKDATA_ASSET(Sound); if (stream->readFlag()) particleEmitterId = stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast); diff --git a/Engine/source/T3D/fx/explosion.h b/Engine/source/T3D/fx/explosion.h index 41116cd32..eac392e11 100644 --- a/Engine/source/T3D/fx/explosion.h +++ b/Engine/source/T3D/fx/explosion.h @@ -71,7 +71,7 @@ class ExplosionData : public GameBaseData { F32 particleRadius; DECLARE_SOUNDASSET(ExplosionData, Sound); - DECLARE_SOUNDASSET_SETGET(ExplosionData, Sound); + DECLARE_ASSET_SETGET(ExplosionData, Sound); ParticleEmitterData* particleEmitter; S32 particleEmitterId; @@ -80,7 +80,7 @@ class ExplosionData : public GameBaseData { F32 playSpeed; DECLARE_SHAPEASSET(ExplosionData, ExplosionShape, onShapeChanged); - DECLARE_SHAPEASSET_SETGET(ExplosionData, ExplosionShape); + DECLARE_ASSET_SETGET(ExplosionData, ExplosionShape); S32 explosionAnimation; diff --git a/Engine/source/T3D/fx/groundCover.cpp b/Engine/source/T3D/fx/groundCover.cpp index 41f8a8c1a..a9c975eec 100644 --- a/Engine/source/T3D/fx/groundCover.cpp +++ b/Engine/source/T3D/fx/groundCover.cpp @@ -459,7 +459,7 @@ GroundCover::GroundCover() mRandomSeed = 1; - INIT_MATERIALASSET(Material); + INIT_ASSET(Material); mMaterialInst = NULL; mMatParams = NULL; @@ -520,7 +520,7 @@ GroundCover::GroundCover() mBillboardRects[i].point.set( 0.0f, 0.0f ); mBillboardRects[i].extent.set( 1.0f, 1.0f ); - INIT_SHAPEASSET_ARRAY(Shape, i); + INIT_ASSET_ARRAY(Shape, i); mShapeInstances[i] = NULL; @@ -713,7 +713,7 @@ U32 GroundCover::packUpdate( NetConnection *connection, U32 mask, BitStream *str // TODO: We could probably optimize a few of these // based on reasonable units at some point. - PACK_MATERIALASSET(connection, Material); + PACK_ASSET(connection, Material); stream->write( mRadius ); stream->write( mZOffset ); @@ -766,7 +766,7 @@ U32 GroundCover::packUpdate( NetConnection *connection, U32 mask, BitStream *str stream->write( mBillboardRects[i].extent.x ); stream->write( mBillboardRects[i].extent.y ); - PACK_SHAPEASSET_ARRAY(connection, Shape, i); + PACK_ASSET_ARRAY(connection, Shape, i); } stream->writeFlag( mDebugRenderCells ); @@ -784,7 +784,7 @@ void GroundCover::unpackUpdate( NetConnection *connection, BitStream *stream ) if (stream->readFlag()) { - UNPACK_MATERIALASSET(connection, Material); + UNPACK_ASSET(connection, Material); stream->read( &mRadius ); stream->read( &mZOffset ); @@ -837,7 +837,7 @@ void GroundCover::unpackUpdate( NetConnection *connection, BitStream *stream ) stream->read( &mBillboardRects[i].extent.x ); stream->read( &mBillboardRects[i].extent.y ); - UNPACK_SHAPEASSET_ARRAY(connection, Shape, i); + UNPACK_ASSET_ARRAY(connection, Shape, i); } mDebugRenderCells = stream->readFlag(); diff --git a/Engine/source/T3D/fx/groundCover.h b/Engine/source/T3D/fx/groundCover.h index fbf6bf263..aba467810 100644 --- a/Engine/source/T3D/fx/groundCover.h +++ b/Engine/source/T3D/fx/groundCover.h @@ -269,7 +269,7 @@ protected: BaseMatInstance* mMaterialInst; DECLARE_MATERIALASSET(GroundCover, Material); - DECLARE_MATERIALASSET_NET_SETGET(GroundCover, Material, InitialUpdateMask); + DECLARE_ASSET_NET_SETGET(GroundCover, Material, InitialUpdateMask); GroundCoverShaderConstData mShaderConstData; @@ -341,7 +341,7 @@ protected: /// The cover shape filenames. DECLARE_SHAPEASSET_ARRAY(GroundCover, Shape, MAX_COVERTYPES); - DECLARE_SHAPEASSET_ARRAY_NET_SETGET(GroundCover, Shape, -1); + DECLARE_ASSET_ARRAY_NET_SETGET(GroundCover, Shape, -1); /// The cover shape instances. TSShapeInstance* mShapeInstances[MAX_COVERTYPES]; diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 0e28b1a42..8d9e20183 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -238,11 +238,11 @@ void LightningStrikeEvent::process(NetConnection*) // LightningData::LightningData() { - INIT_SOUNDASSET(StrikeSound); + INIT_ASSET(StrikeSound); for (S32 i = 0; i < MaxThunders; i++) { - INIT_SOUNDASSET_ARRAY(ThunderSound, i); + INIT_ASSET_ARRAY(ThunderSound, i); } for (S32 i = 0; i < MaxTextures; i++) @@ -335,7 +335,7 @@ void LightningData::packData(BitStream* stream) U32 i; for (i = 0; i < MaxThunders; i++) { - PACKDATA_SOUNDASSET_ARRAY(ThunderSound, i); + PACKDATA_ASSET_ARRAY(ThunderSound, i); } stream->writeInt(mNumStrikeTextures, 4); @@ -343,7 +343,7 @@ void LightningData::packData(BitStream* stream) for (i = 0; i < MaxTextures; i++) stream->writeString(strikeTextureNames[i]); - PACKDATA_SOUNDASSET(StrikeSound); + PACKDATA_ASSET(StrikeSound); } void LightningData::unpackData(BitStream* stream) @@ -353,7 +353,7 @@ void LightningData::unpackData(BitStream* stream) U32 i; for (i = 0; i < MaxThunders; i++) { - UNPACKDATA_SOUNDASSET_ARRAY(ThunderSound, i); + UNPACKDATA_ASSET_ARRAY(ThunderSound, i); } mNumStrikeTextures = stream->readInt(4); @@ -361,7 +361,7 @@ void LightningData::unpackData(BitStream* stream) for (i = 0; i < MaxTextures; i++) strikeTextureNames[i] = stream->readSTString(); - UNPACKDATA_SOUNDASSET(StrikeSound); + UNPACKDATA_ASSET(StrikeSound); } diff --git a/Engine/source/T3D/fx/lightning.h b/Engine/source/T3D/fx/lightning.h index d241257b0..be3b65319 100644 --- a/Engine/source/T3D/fx/lightning.h +++ b/Engine/source/T3D/fx/lightning.h @@ -65,10 +65,10 @@ class LightningData : public GameBaseData public: DECLARE_SOUNDASSET_ARRAY(LightningData, ThunderSound, MaxThunders); - DECLARE_SOUNDASSET_ARRAY_SETGET(LightningData, ThunderSound); + DECLARE_ASSET_ARRAY_SETGET(LightningData, ThunderSound); DECLARE_SOUNDASSET(LightningData, StrikeSound); - DECLARE_SOUNDASSET_SETGET(LightningData, StrikeSound); + DECLARE_ASSET_SETGET(LightningData, StrikeSound); StringTableEntry strikeTextureNames[MaxTextures]; diff --git a/Engine/source/T3D/fx/particle.cpp b/Engine/source/T3D/fx/particle.cpp index 7cfa7e182..090a2f119 100644 --- a/Engine/source/T3D/fx/particle.cpp +++ b/Engine/source/T3D/fx/particle.cpp @@ -122,8 +122,8 @@ ParticleData::ParticleData() animTexFramesString = NULL; // string of animation frame indices animTexUVs = NULL; // array of tile vertex UVs - INIT_IMAGEASSET(Texture); - INIT_IMAGEASSET(TextureExt); + INIT_ASSET(Texture); + INIT_ASSET(TextureExt); constrain_pos = false; start_angle = 0.0f; @@ -293,7 +293,7 @@ void ParticleData::packData(BitStream* stream) stream->writeFloat( times[i], 8); } - //PACKDATA_IMAGEASSET(Texture); + //PACKDATA_ASSET(Texture); for (i = 0; i < 4; i++) mathWrite(*stream, texCoords[i]); @@ -307,7 +307,7 @@ void ParticleData::packData(BitStream* stream) stream->writeInt(framesPerSec, 8); } - //PACKDATA_IMAGEASSET(TextureExt); + //PACKDATA_ASSET(TextureExt); stream->writeFlag(constrain_pos); stream->writeFloat(start_angle/360.0f, 11); @@ -378,7 +378,7 @@ void ParticleData::unpackData(BitStream* stream) times[i] = stream->readFloat(8); } - //UNPACKDATA_IMAGEASSET(Texture); + //UNPACKDATA_ASSET(Texture); for (i = 0; i < 4; i++) mathRead(*stream, &texCoords[i]); @@ -391,7 +391,7 @@ void ParticleData::unpackData(BitStream* stream) framesPerSec = stream->readInt(8); } - //UNPACKDATA_IMAGEASSET(Texture); + //UNPACKDATA_ASSET(Texture); constrain_pos = stream->readFlag(); start_angle = 360.0f*stream->readFloat(11); @@ -763,12 +763,12 @@ ParticleData::ParticleData(const ParticleData& other, bool temp_clone) : SimData animTexFramesString = other.animTexFramesString; animTexFrames = other.animTexFrames; // -- parsed from animTexFramesString - CLONE_IMAGEASSET(Texture); + CLONE_ASSET(Texture); spinBias = other.spinBias; randomizeSpinDir = other.randomizeSpinDir; - CLONE_IMAGEASSET(TextureExt); + CLONE_ASSET(TextureExt); constrain_pos = other.constrain_pos; start_angle = other.start_angle; @@ -804,4 +804,4 @@ void ParticleData::onPerformSubstitutions() reload(errorBuffer); } -DEF_IMAGEASSET_BINDS(ParticleData, Texture); +DEF_ASSET_BINDS(ParticleData, Texture); diff --git a/Engine/source/T3D/fx/particle.h b/Engine/source/T3D/fx/particle.h index 1d6d88c12..e05b67b88 100644 --- a/Engine/source/T3D/fx/particle.h +++ b/Engine/source/T3D/fx/particle.h @@ -87,7 +87,7 @@ class ParticleData : public SimDataBlock Vector animTexFrames; DECLARE_IMAGEASSET(ParticleData, Texture, onImageChanged, GFXStaticTextureSRGBProfile); - DECLARE_IMAGEASSET_SETGET(ParticleData, Texture); + DECLARE_ASSET_SETGET(ParticleData, Texture); static bool protectedSetSizes(void* object, const char* index, const char* data); static bool protectedSetTimes(void* object, const char* index, const char* data); @@ -118,7 +118,7 @@ public: bool randomizeSpinDir; public: DECLARE_IMAGEASSET(ParticleData, TextureExt, onImageChanged, GFXStaticTextureSRGBProfile); - DECLARE_IMAGEASSET_SETGET(ParticleData, TextureExt); + DECLARE_ASSET_SETGET(ParticleData, TextureExt); bool constrain_pos; F32 start_angle; diff --git a/Engine/source/T3D/fx/precipitation.cpp b/Engine/source/T3D/fx/precipitation.cpp index 68880edf4..1de61e8e2 100644 --- a/Engine/source/T3D/fx/precipitation.cpp +++ b/Engine/source/T3D/fx/precipitation.cpp @@ -127,13 +127,13 @@ ConsoleDocClass( PrecipitationData, //---------------------------------------------------------- PrecipitationData::PrecipitationData() { - INIT_SOUNDASSET(Sound); + INIT_ASSET(Sound); - INIT_IMAGEASSET(Drop); + INIT_ASSET(Drop); mDropShaderName = StringTable->EmptyString(); - INIT_IMAGEASSET(Splash); + INIT_ASSET(Splash); mSplashShaderName = StringTable->EmptyString(); @@ -206,13 +206,13 @@ void PrecipitationData::packData(BitStream* stream) { Parent::packData(stream); - PACKDATA_SOUNDASSET(Sound); + PACKDATA_ASSET(Sound); - PACKDATA_IMAGEASSET(Drop); + PACKDATA_ASSET(Drop); stream->writeString(mDropShaderName); - PACKDATA_IMAGEASSET(Splash); + PACKDATA_ASSET(Splash); stream->writeString(mSplashShaderName); stream->write(mDropsPerSide); @@ -223,13 +223,13 @@ void PrecipitationData::unpackData(BitStream* stream) { Parent::unpackData(stream); - UNPACKDATA_SOUNDASSET(Sound); + UNPACKDATA_ASSET(Sound); - UNPACKDATA_IMAGEASSET(Drop); + UNPACKDATA_ASSET(Drop); mDropShaderName = stream->readSTString(); - UNPACKDATA_IMAGEASSET(Splash); + UNPACKDATA_ASSET(Splash); mSplashShaderName = stream->readSTString(); stream->read(&mDropsPerSide); diff --git a/Engine/source/T3D/fx/precipitation.h b/Engine/source/T3D/fx/precipitation.h index 719613384..eb3a540e0 100644 --- a/Engine/source/T3D/fx/precipitation.h +++ b/Engine/source/T3D/fx/precipitation.h @@ -47,15 +47,15 @@ class PrecipitationData : public GameBaseData public: DECLARE_SOUNDASSET(PrecipitationData, Sound); - DECLARE_SOUNDASSET_SETGET(PrecipitationData, Sound); + DECLARE_ASSET_SETGET(PrecipitationData, Sound); DECLARE_IMAGEASSET(PrecipitationData, Drop, onDropChanged, GFXStaticTextureSRGBProfile); ///< Texture for drop particles - DECLARE_IMAGEASSET_SETGET(PrecipitationData, Drop); + DECLARE_ASSET_SETGET(PrecipitationData, Drop); StringTableEntry mDropShaderName; ///< The name of the shader used for raindrops DECLARE_IMAGEASSET(PrecipitationData, Splash, onSplashChanged, GFXStaticTextureSRGBProfile); ///< Texture for splash particles - DECLARE_IMAGEASSET_SETGET(PrecipitationData, Splash); + DECLARE_ASSET_SETGET(PrecipitationData, Splash); StringTableEntry mSplashShaderName; ///< The name of the shader used for raindrops diff --git a/Engine/source/T3D/fx/splash.cpp b/Engine/source/T3D/fx/splash.cpp index 38a4f4e89..3ae7e54b4 100644 --- a/Engine/source/T3D/fx/splash.cpp +++ b/Engine/source/T3D/fx/splash.cpp @@ -70,7 +70,7 @@ SplashData::SplashData() //soundProfile = NULL; //soundProfileId = 0; - INIT_SOUNDASSET(Sound); + INIT_ASSET(Sound); scale.set(1, 1, 1); @@ -98,7 +98,7 @@ SplashData::SplashData() U32 i; for (i = 0; i < NUM_TEX; i++) { - INIT_IMAGEASSET_ARRAY(Texture, i); + INIT_ASSET_ARRAY(Texture, i); } for( i=0; iwrite(delayMS); @@ -208,7 +208,7 @@ void SplashData::packData(BitStream* stream) for( i=0; iread(&delayMS); @@ -264,7 +264,7 @@ void SplashData::unpackData(BitStream* stream) for( i=0; iwrite( mScaleU ); stream->write( mScaleV ); - PACK_MATERIALASSET(connection, Material); + PACK_ASSET(connection, Material); return retMask; } @@ -212,7 +212,7 @@ void GroundPlane::unpackUpdate( NetConnection* connection, BitStream* stream ) stream->read( &mScaleU ); stream->read( &mScaleV ); - UNPACK_MATERIALASSET(connection, Material); + UNPACK_ASSET(connection, Material); // If we're added then something possibly changed in // the editor... do an update of the material and the diff --git a/Engine/source/T3D/groundPlane.h b/Engine/source/T3D/groundPlane.h index 752c78668..9e57c325c 100644 --- a/Engine/source/T3D/groundPlane.h +++ b/Engine/source/T3D/groundPlane.h @@ -108,7 +108,7 @@ private: BaseMatInstance* mMaterialInst; DECLARE_MATERIALASSET(GroundPlane, Material); - DECLARE_MATERIALASSET_NET_SETGET(GroundPlane, Material, -1); + DECLARE_ASSET_NET_SETGET(GroundPlane, Material, -1); PhysicsBody *mPhysicsRep; diff --git a/Engine/source/T3D/levelInfo.cpp b/Engine/source/T3D/levelInfo.cpp index 7d6905841..d10077cea 100644 --- a/Engine/source/T3D/levelInfo.cpp +++ b/Engine/source/T3D/levelInfo.cpp @@ -99,7 +99,7 @@ LevelInfo::LevelInfo() mAdvancedLightmapSupport = true; - INIT_IMAGEASSET(AccuTexture); + INIT_ASSET(AccuTexture); // Register with the light manager activation signal, and we need to do it first // so the advanced light bin manager can be instructed about MRT lightmaps @@ -215,7 +215,7 @@ U32 LevelInfo::packUpdate(NetConnection *conn, U32 mask, BitStream *stream) sfxWrite( stream, mSoundAmbience ); stream->writeInt( mSoundDistanceModel, 1 ); - PACK_IMAGEASSET(conn, AccuTexture); + PACK_ASSET(conn, AccuTexture); return retMask; } @@ -262,7 +262,7 @@ void LevelInfo::unpackUpdate(NetConnection *conn, BitStream *stream) SFX->setDistanceModel( mSoundDistanceModel ); } - UNPACK_IMAGEASSET(conn, AccuTexture); + UNPACK_ASSET(conn, AccuTexture); setLevelAccuTexture(getAccuTexture()); } diff --git a/Engine/source/T3D/levelInfo.h b/Engine/source/T3D/levelInfo.h index 5b998dada..122d7ad8d 100644 --- a/Engine/source/T3D/levelInfo.h +++ b/Engine/source/T3D/levelInfo.h @@ -105,7 +105,7 @@ class LevelInfo : public NetObject protected: DECLARE_IMAGEASSET(LevelInfo, AccuTexture, onAccuTextureChanged, GFXStaticTextureSRGBProfile); - DECLARE_IMAGEASSET_SETGET(LevelInfo, AccuTexture); + DECLARE_ASSET_SETGET(LevelInfo, AccuTexture); void onAccuTextureChanged() {} diff --git a/Engine/source/T3D/lightFlareData.cpp b/Engine/source/T3D/lightFlareData.cpp index 98f406a1b..fb8fbaa55 100644 --- a/Engine/source/T3D/lightFlareData.cpp +++ b/Engine/source/T3D/lightFlareData.cpp @@ -133,7 +133,7 @@ LightFlareData::LightFlareData() for ( U32 i = 0; i < MAX_ELEMENTS; i++ ) mElementDist[i] = -1.0f; - INIT_IMAGEASSET(FlareTexture); + INIT_ASSET(FlareTexture); } LightFlareData::~LightFlareData() @@ -219,7 +219,7 @@ void LightFlareData::packData( BitStream *stream ) stream->writeFlag( mFlareEnabled ); - PACKDATA_IMAGEASSET(FlareTexture); + PACKDATA_ASSET(FlareTexture); stream->write( mScale ); stream->write( mOcclusionRadius ); @@ -244,7 +244,7 @@ void LightFlareData::unpackData( BitStream *stream ) mFlareEnabled = stream->readFlag(); - UNPACKDATA_IMAGEASSET(FlareTexture); + UNPACKDATA_ASSET(FlareTexture); stream->read( &mScale ); stream->read( &mOcclusionRadius ); diff --git a/Engine/source/T3D/lightFlareData.h b/Engine/source/T3D/lightFlareData.h index 6d79aac7b..b2a87520c 100644 --- a/Engine/source/T3D/lightFlareData.h +++ b/Engine/source/T3D/lightFlareData.h @@ -121,7 +121,7 @@ protected: bool mFlareEnabled; DECLARE_IMAGEASSET(LightFlareData, FlareTexture, onImageChanged, GFXStaticTextureSRGBProfile); - DECLARE_IMAGEASSET_SETGET(LightFlareData, FlareTexture); + DECLARE_ASSET_SETGET(LightFlareData, FlareTexture); F32 mOcclusionRadius; bool mRenderReflectPass; diff --git a/Engine/source/T3D/physics/physicsDebris.cpp b/Engine/source/T3D/physics/physicsDebris.cpp index 835871bb5..077fcf7d8 100644 --- a/Engine/source/T3D/physics/physicsDebris.cpp +++ b/Engine/source/T3D/physics/physicsDebris.cpp @@ -74,7 +74,7 @@ PhysicsDebrisData::PhysicsDebrisData() lifetime = 5.0f; lifetimeVariance = 0.0f; - INIT_SHAPEASSET(Shape); + INIT_ASSET(Shape); } bool PhysicsDebrisData::onAdd() @@ -215,7 +215,7 @@ void PhysicsDebrisData::packData(BitStream* stream) stream->write( waterDampingScale ); stream->write( buoyancyDensity ); - PACKDATA_SHAPEASSET(Shape); + PACKDATA_ASSET(Shape); } void PhysicsDebrisData::unpackData(BitStream* stream) @@ -236,7 +236,7 @@ void PhysicsDebrisData::unpackData(BitStream* stream) stream->read( &waterDampingScale ); stream->read( &buoyancyDensity ); - UNPACKDATA_SHAPEASSET(Shape); + UNPACKDATA_ASSET(Shape); } DefineEngineMethod( PhysicsDebrisData, preload, void, (), , diff --git a/Engine/source/T3D/physics/physicsDebris.h b/Engine/source/T3D/physics/physicsDebris.h index c58d66626..2a4a3d0fc 100644 --- a/Engine/source/T3D/physics/physicsDebris.h +++ b/Engine/source/T3D/physics/physicsDebris.h @@ -87,7 +87,7 @@ public: bool castShadows; DECLARE_SHAPEASSET(PhysicsDebrisData, Shape, onShapeChanged); - DECLARE_SHAPEASSET_SETGET(PhysicsDebrisData, Shape); + DECLARE_ASSET_SETGET(PhysicsDebrisData, Shape); PhysicsDebrisData(); diff --git a/Engine/source/T3D/physics/physicsShape.cpp b/Engine/source/T3D/physics/physicsShape.cpp index 6808866ca..6e6b4e937 100644 --- a/Engine/source/T3D/physics/physicsShape.cpp +++ b/Engine/source/T3D/physics/physicsShape.cpp @@ -78,7 +78,7 @@ PhysicsShapeData::PhysicsShapeData() buoyancyDensity( 0.0f ), simType( SimType_ClientServer ) { - INIT_SHAPEASSET(Shape); + INIT_ASSET(Shape); } PhysicsShapeData::~PhysicsShapeData() @@ -180,7 +180,7 @@ void PhysicsShapeData::packData( BitStream *stream ) { Parent::packData( stream ); - PACKDATA_SHAPEASSET(Shape); + PACKDATA_ASSET(Shape); stream->write( mass ); stream->write( dynamicFriction ); @@ -204,7 +204,7 @@ void PhysicsShapeData::unpackData( BitStream *stream ) { Parent::unpackData(stream); - UNPACKDATA_SHAPEASSET(Shape); + UNPACKDATA_ASSET(Shape); stream->read( &mass ); stream->read( &dynamicFriction ); diff --git a/Engine/source/T3D/physics/physicsShape.h b/Engine/source/T3D/physics/physicsShape.h index a80d85afc..ebbad92d2 100644 --- a/Engine/source/T3D/physics/physicsShape.h +++ b/Engine/source/T3D/physics/physicsShape.h @@ -75,7 +75,7 @@ public: public: DECLARE_SHAPEASSET(PhysicsShapeData, Shape, onShapeChanged); - DECLARE_SHAPEASSET_SETGET(PhysicsShapeData, Shape); + DECLARE_ASSET_SETGET(PhysicsShapeData, Shape); /// The shared unscaled collision shape. PhysicsCollisionRef colShape; diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp index 3e994995a..7aabe0384 100644 --- a/Engine/source/T3D/player.cpp +++ b/Engine/source/T3D/player.cpp @@ -186,7 +186,6 @@ PlayerData::ActionAnimationDef PlayerData::ActionAnimationList[NumTableActionAni }; -//---------------------------------------------------------------------------- //---------------------------------------------------------------------------- typedef PlayerData::Sounds playerSoundsEnum; @@ -216,6 +215,8 @@ EndImplementEnumType; //---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- + IMPLEMENT_CO_DATABLOCK_V1(PlayerData); ConsoleDocClass( PlayerData, @@ -297,7 +298,7 @@ PlayerData::PlayerData() imageAnimPrefixFP = StringTable->EmptyString(); for (U32 i=0; iwrite(minLateralImpactSpeed); for (U32 i = 0; i < MaxSounds; i++) - PACKDATA_SOUNDASSET_ARRAY_ENUMED(PlayerSound, PlayerData::Sounds, i); + PACKDATA_ASSET_ARRAY(PlayerSound, i); mathWrite(*stream, boxSize); mathWrite(*stream, crouchBoxSize); @@ -1343,7 +1342,7 @@ void PlayerData::packData(BitStream* stream) stream->writeString(imageAnimPrefixFP); for (U32 i=0; iread(&minLateralImpactSpeed); for (U32 i = 0; i < MaxSounds; i++) - UNPACKDATA_SOUNDASSET_ARRAY_ENUMED(PlayerSound, PlayerData::Sounds, i); + UNPACKDATA_ASSET_ARRAY(PlayerSound, i); mathRead(*stream, &boxSize); mathRead(*stream, &crouchBoxSize); @@ -1523,7 +1522,7 @@ void PlayerData::unpackData(BitStream* stream) imageAnimPrefixFP = stream->readSTString(); for (U32 i=0; iwriteFlag(faceViewer); if(stream->writeFlag(scale.x != 1 || scale.y != 1 || scale.z != 1)) @@ -439,7 +439,7 @@ void ProjectileData::packData(BitStream* stream) if (stream->writeFlag(decal != NULL)) stream->writeRangedU32(decal->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast); - PACKDATA_SOUNDASSET(ProjectileSound); + PACKDATA_ASSET(ProjectileSound); if ( stream->writeFlag(lightDesc != NULL)) stream->writeRangedU32(lightDesc->getId(), DataBlockObjectIdFirst, @@ -470,7 +470,7 @@ void ProjectileData::unpackData(BitStream* stream) { Parent::unpackData(stream); - UNPACKDATA_SHAPEASSET(ProjectileShape); + UNPACKDATA_ASSET(ProjectileShape); faceViewer = stream->readFlag(); if(stream->readFlag()) @@ -500,7 +500,7 @@ void ProjectileData::unpackData(BitStream* stream) if (stream->readFlag()) decalId = stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast); - UNPACKDATA_SOUNDASSET(ProjectileSound); + UNPACKDATA_ASSET(ProjectileSound); if (stream->readFlag()) lightDescId = stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast); diff --git a/Engine/source/T3D/projectile.h b/Engine/source/T3D/projectile.h index e633e3fd4..9aa0690d0 100644 --- a/Engine/source/T3D/projectile.h +++ b/Engine/source/T3D/projectile.h @@ -72,7 +72,7 @@ protected: public: DECLARE_SHAPEASSET(ProjectileData, ProjectileShape, onShapeChanged); - DECLARE_SHAPEASSET_SETGET(ProjectileData, ProjectileShape); + DECLARE_ASSET_SETGET(ProjectileData, ProjectileShape); /// Set to true if it is a billboard and want it to always face the viewer, false otherwise bool faceViewer; @@ -117,7 +117,7 @@ public: S32 decalId; // (impact) Decal ID DECLARE_SOUNDASSET(ProjectileData, ProjectileSound); - DECLARE_SOUNDASSET_SETGET(ProjectileData, ProjectileSound); + DECLARE_ASSET_SETGET(ProjectileData, ProjectileSound); LightDescription *lightDesc; S32 lightDescId; diff --git a/Engine/source/T3D/proximityMine.cpp b/Engine/source/T3D/proximityMine.cpp index 12eb60a1a..683021255 100644 --- a/Engine/source/T3D/proximityMine.cpp +++ b/Engine/source/T3D/proximityMine.cpp @@ -82,8 +82,8 @@ ProximityMineData::ProximityMineData() triggerSequence( -1 ), explosionOffset( 0.05f ) { - INIT_SOUNDASSET(ArmSound); - INIT_SOUNDASSET(TriggerSound); + INIT_ASSET(ArmSound); + INIT_ASSET(TriggerSound); } void ProximityMineData::initPersistFields() @@ -156,14 +156,14 @@ void ProximityMineData::packData( BitStream* stream ) Parent::packData( stream ); stream->write( armingDelay ); - PACKDATA_SOUNDASSET(ArmSound); + PACKDATA_ASSET(ArmSound); stream->write( autoTriggerDelay ); stream->writeFlag( triggerOnOwner ); stream->write( triggerRadius ); stream->write( triggerSpeed ); stream->write( triggerDelay ); - PACKDATA_SOUNDASSET(TriggerSound); + PACKDATA_ASSET(TriggerSound); } void ProximityMineData::unpackData( BitStream* stream ) @@ -171,14 +171,14 @@ void ProximityMineData::unpackData( BitStream* stream ) Parent::unpackData(stream); stream->read( &armingDelay ); - UNPACKDATA_SOUNDASSET(ArmSound); + UNPACKDATA_ASSET(ArmSound); stream->read( &autoTriggerDelay ); triggerOnOwner = stream->readFlag(); stream->read( &triggerRadius ); stream->read( &triggerSpeed ); stream->read( &triggerDelay ); - UNPACKDATA_SOUNDASSET(TriggerSound); + UNPACKDATA_ASSET(TriggerSound); } //---------------------------------------------------------------------------- diff --git a/Engine/source/T3D/proximityMine.h b/Engine/source/T3D/proximityMine.h index 4736c0e16..2c748317c 100644 --- a/Engine/source/T3D/proximityMine.h +++ b/Engine/source/T3D/proximityMine.h @@ -46,7 +46,7 @@ public: F32 armingDelay; S32 armingSequence; DECLARE_SOUNDASSET(ProximityMineData, ArmSound); - DECLARE_SOUNDASSET_SETGET(ProximityMineData, ArmSound); + DECLARE_ASSET_SETGET(ProximityMineData, ArmSound); F32 autoTriggerDelay; bool triggerOnOwner; @@ -55,7 +55,7 @@ public: F32 triggerDelay; S32 triggerSequence; DECLARE_SOUNDASSET(ProximityMineData, TriggerSound); - DECLARE_SOUNDASSET_SETGET(ProximityMineData, TriggerSound); + DECLARE_ASSET_SETGET(ProximityMineData, TriggerSound); F32 explosionOffset; diff --git a/Engine/source/T3D/rigidShape.cpp b/Engine/source/T3D/rigidShape.cpp index 475854bbb..01b830db0 100644 --- a/Engine/source/T3D/rigidShape.cpp +++ b/Engine/source/T3D/rigidShape.cpp @@ -238,7 +238,7 @@ RigidShapeData::RigidShapeData() density = 4; for (S32 i = 0; i < Body::MaxSounds; i++) - INIT_SOUNDASSET_ARRAY(BodySounds, i); + INIT_ASSET_ARRAY(BodySounds, i); dustEmitter = NULL; dustID = 0; @@ -257,7 +257,7 @@ RigidShapeData::RigidShapeData() enablePhysicsRep = true; for (S32 i = 0; i < Sounds::MaxSounds; i++) - INIT_SOUNDASSET_ARRAY(WaterSounds, i); + INIT_ASSET_ARRAY(WaterSounds, i); dragForce = 0; vertFactor = 0.25; @@ -371,7 +371,7 @@ void RigidShapeData::packData(BitStream* stream) stream->write(body.friction); for (U32 i = 0; i < Body::MaxSounds; ++i) { - PACKDATA_SOUNDASSET_ARRAY(BodySounds, i); + PACKDATA_ASSET_ARRAY(BodySounds, i); } stream->write(minImpactSpeed); @@ -403,7 +403,7 @@ void RigidShapeData::packData(BitStream* stream) // write the water sound profiles for (U32 i = 0; i < Sounds::MaxSounds; ++i) { - PACKDATA_SOUNDASSET_ARRAY(WaterSounds, i); + PACKDATA_ASSET_ARRAY(WaterSounds, i); } if (stream->writeFlag( dustEmitter )) @@ -434,7 +434,7 @@ void RigidShapeData::unpackData(BitStream* stream) for (U32 i = 0; i < Body::Sounds::MaxSounds; i++) { - UNPACKDATA_SOUNDASSET_ARRAY(BodySounds, i); + UNPACKDATA_ASSET_ARRAY(BodySounds, i); } stream->read(&minImpactSpeed); @@ -466,7 +466,7 @@ void RigidShapeData::unpackData(BitStream* stream) // write the water sound profiles for (U32 i = 0; i < Sounds::MaxSounds; ++i) { - UNPACKDATA_SOUNDASSET_ARRAY(WaterSounds, i); + UNPACKDATA_ASSET_ARRAY(WaterSounds, i); } if( stream->readFlag() ) diff --git a/Engine/source/T3D/rigidShape.h b/Engine/source/T3D/rigidShape.h index 49e8c1fd6..ef3ead6e5 100644 --- a/Engine/source/T3D/rigidShape.h +++ b/Engine/source/T3D/rigidShape.h @@ -64,7 +64,7 @@ class RigidShapeData : public ShapeBaseData } body; DECLARE_SOUNDASSET_ARRAY(RigidShapeData, BodySounds, Body::Sounds::MaxSounds) - DECLARE_SOUNDASSET_ARRAY_SETGET(RigidShapeData, BodySounds); + DECLARE_ASSET_ARRAY_SETGET(RigidShapeData, BodySounds); SFXProfile* getBodySoundProfile(U32 id) { @@ -92,7 +92,7 @@ class RigidShapeData : public ShapeBaseData MaxSounds }; DECLARE_SOUNDASSET_ARRAY(RigidShapeData, WaterSounds, Sounds::MaxSounds) - DECLARE_SOUNDASSET_ARRAY_SETGET(RigidShapeData, WaterSounds); + DECLARE_ASSET_ARRAY_SETGET(RigidShapeData, WaterSounds); SFXProfile* getWaterSoundProfile(U32 id) { diff --git a/Engine/source/T3D/sfx/sfxEmitter.cpp b/Engine/source/T3D/sfx/sfxEmitter.cpp index 655e0071a..8ac0de6ad 100644 --- a/Engine/source/T3D/sfx/sfxEmitter.cpp +++ b/Engine/source/T3D/sfx/sfxEmitter.cpp @@ -109,7 +109,7 @@ SFXEmitter::SFXEmitter() mLocalProfile.mFilename = StringTable->EmptyString(); mLocalProfile._registerSignals(); - INIT_SOUNDASSET(Sound); + INIT_ASSET(Sound); mObjBox.minExtents.set( -1.f, -1.f, -1.f ); mObjBox.maxExtents.set( 1.f, 1.f, 1.f ); @@ -290,7 +290,7 @@ U32 SFXEmitter::packUpdate( NetConnection *con, U32 mask, BitStream *stream ) stream->writeAffineTransform( mObjToWorld ); // track - PACK_SOUNDASSET(con, Sound); + PACK_ASSET(con, Sound); //if (stream->writeFlag(mDirty.test(Track))) // sfxWrite( stream, mTrack ); @@ -401,7 +401,7 @@ void SFXEmitter::unpackUpdate( NetConnection *conn, BitStream *stream ) } // track - UNPACK_SOUNDASSET(conn, Sound); + UNPACK_ASSET(conn, Sound); /*if (_readDirtyFlag(stream, Track)) { String errorStr; diff --git a/Engine/source/T3D/sfx/sfxEmitter.h b/Engine/source/T3D/sfx/sfxEmitter.h index aeecd13bf..cdb93a8bf 100644 --- a/Engine/source/T3D/sfx/sfxEmitter.h +++ b/Engine/source/T3D/sfx/sfxEmitter.h @@ -105,7 +105,7 @@ class SFXEmitter : public SceneObject BitSet32 mDirty; DECLARE_SOUNDASSET(SFXEmitter, Sound); - DECLARE_SOUNDASSET_NET_SETGET(SFXEmitter, Sound, DirtyUpdateMask); + DECLARE_ASSET_NET_SETGET(SFXEmitter, Sound, DirtyUpdateMask); /// The sound source for the emitter. SFXSource *mSource; diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index c1a814f07..4730ee6b7 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -197,8 +197,8 @@ ShapeBaseData::ShapeBaseData() renderWhenDestroyed( true ), inheritEnergyFromMount( false ) { - INIT_SHAPEASSET(Shape); - INIT_SHAPEASSET(DebrisShape); + INIT_ASSET(Shape); + INIT_ASSET(DebrisShape); dMemset( mountPointNode, -1, sizeof( S32 ) * SceneObject::NumMountPoints ); remap_txr_tags = NULL; @@ -214,13 +214,13 @@ ShapeBaseData::ShapeBaseData(const ShapeBaseData& other, bool temp_clone) : Game shadowProjectionDistance = other.shadowProjectionDistance; shadowSphereAdjust = other.shadowSphereAdjust; cloakTexName = other.cloakTexName; - CLONE_SHAPEASSET(Shape); + CLONE_ASSET(Shape); cubeDescName = other.cubeDescName; cubeDescId = other.cubeDescId; reflectorDesc = other.reflectorDesc; debris = other.debris; debrisID = other.debrisID; // -- for pack/unpack of debris ptr - CLONE_SHAPEASSET(DebrisShape); + CLONE_ASSET(DebrisShape); explosion = other.explosion; explosionID = other.explosionID; // -- for pack/unpack of explosion ptr underwaterExplosion = other.underwaterExplosion; @@ -757,8 +757,8 @@ void ShapeBaseData::packData(BitStream* stream) stream->write(shadowProjectionDistance); stream->write(shadowSphereAdjust); - PACKDATA_SHAPEASSET(Shape); - PACKDATA_SHAPEASSET(DebrisShape); + PACKDATA_ASSET(Shape); + PACKDATA_ASSET(DebrisShape); stream->writeString(cloakTexName); if(stream->writeFlag(mass != gShapeBaseDataProto.mass)) @@ -835,8 +835,8 @@ void ShapeBaseData::unpackData(BitStream* stream) stream->read(&shadowProjectionDistance); stream->read(&shadowSphereAdjust); - UNPACKDATA_SHAPEASSET(Shape); - UNPACKDATA_SHAPEASSET(DebrisShape); + UNPACKDATA_ASSET(Shape); + UNPACKDATA_ASSET(DebrisShape); cloakTexName = stream->readSTString(); if(stream->readFlag()) diff --git a/Engine/source/T3D/shapeBase.h b/Engine/source/T3D/shapeBase.h index a2696819e..1670a8230 100644 --- a/Engine/source/T3D/shapeBase.h +++ b/Engine/source/T3D/shapeBase.h @@ -324,7 +324,7 @@ struct ShapeBaseImageData: public GameBaseData { bool stateIgnoreLoadedForReady [MaxStates]; DECLARE_SOUNDASSET_ARRAY(ShapeBaseImageData, stateSound, MaxStates); - DECLARE_SOUNDASSET_ARRAY_SETGET(ShapeBaseImageData, stateSound); + DECLARE_ASSET_ARRAY_SETGET(ShapeBaseImageData, stateSound); //SFXTrack* stateSound [MaxStates]; const char* stateScript [MaxStates]; @@ -379,10 +379,10 @@ struct ShapeBaseImageData: public GameBaseData { ///< when the script prefix has changed. DECLARE_SHAPEASSET_ARRAY(ShapeBaseImageData, Shape, MaxShapes); ///< Name of shape to render. - DECLARE_SHAPEASSET_ARRAY_SETGET(ShapeBaseImageData, Shape); + DECLARE_ASSET_ARRAY_SETGET(ShapeBaseImageData, Shape); //DECLARE_SHAPEASSET(ShapeBaseImageData, ShapeFP); ///< Name of shape to render in first person (optional). - //DECLARE_SHAPEASSET_SETGET(ShapeBaseImageData, ShapeFP); + //DECLARE_ASSET_SETGET(ShapeBaseImageData, ShapeFP); StringTableEntry imageAnimPrefix; ///< Passed along to the mounting shape to modify /// animation sequences played in 3rd person. [optional] @@ -546,7 +546,7 @@ public: F32 shadowSphereAdjust; DECLARE_SHAPEASSET(ShapeBaseData, Shape, onShapeChanged); - DECLARE_SHAPEASSET_SETGET(ShapeBaseData, Shape); + DECLARE_ASSET_SETGET(ShapeBaseData, Shape); StringTableEntry cloakTexName; @@ -562,7 +562,7 @@ public: S32 debrisID; DECLARE_SHAPEASSET(ShapeBaseData, DebrisShape, onDebrisChanged); - DECLARE_SHAPEASSET_SETGET(ShapeBaseData, DebrisShape); + DECLARE_ASSET_SETGET(ShapeBaseData, DebrisShape); ExplosionData* explosion; S32 explosionID; diff --git a/Engine/source/T3D/shapeImage.cpp b/Engine/source/T3D/shapeImage.cpp index ab43a0ba3..1563f3be5 100644 --- a/Engine/source/T3D/shapeImage.cpp +++ b/Engine/source/T3D/shapeImage.cpp @@ -257,7 +257,7 @@ ShapeBaseImageData::ShapeBaseImageData() stateShapeSequence[i] = 0; stateScaleShapeSequence[i] = false; - INIT_SOUNDASSET_ARRAY(stateSound, i); + INIT_ASSET_ARRAY(stateSound, i); stateScript[i] = 0; stateEmitter[i] = 0; stateEmitterTime[i] = 0; @@ -295,7 +295,7 @@ ShapeBaseImageData::ShapeBaseImageData() hasFlash[i] = false; shapeIsValid[i] = false; - INIT_SHAPEASSET_ARRAY(Shape, i); + INIT_ASSET_ARRAY(Shape, i); } shakeCamera = false; @@ -983,7 +983,7 @@ void ShapeBaseImageData::packData(BitStream* stream) for (U32 j = 0; j < MaxShapes; ++j) { - PACKDATA_SHAPEASSET_ARRAY(Shape, j); // shape 0 for normal use, shape 1 for first person use (optional) + PACKDATA_ASSET_ARRAY(Shape, j); // shape 0 for normal use, shape 1 for first person use (optional) } stream->writeString(imageAnimPrefix); @@ -1147,7 +1147,7 @@ void ShapeBaseImageData::packData(BitStream* stream) } } - PACKDATA_SOUNDASSET_ARRAY(stateSound, i); + PACKDATA_ASSET_ARRAY(stateSound, i); } stream->write(maxConcurrentSounds); stream->writeFlag(useRemainderDT); @@ -1167,7 +1167,7 @@ void ShapeBaseImageData::unpackData(BitStream* stream) for (U32 j = 0; j < MaxShapes; ++j) { - UNPACKDATA_SHAPEASSET_ARRAY(Shape, j); // shape 0 for normal use, shape 1 for first person use (optional) + UNPACKDATA_ASSET_ARRAY(Shape, j); // shape 0 for normal use, shape 1 for first person use (optional) } imageAnimPrefix = stream->readSTString(); @@ -1352,7 +1352,7 @@ void ShapeBaseImageData::unpackData(BitStream* stream) else s.emitter = 0; - UNPACKDATA_SOUNDASSET_ARRAY(stateSound, i); + UNPACKDATA_ASSET_ARRAY(stateSound, i); } } diff --git a/Engine/source/T3D/tsStatic.cpp b/Engine/source/T3D/tsStatic.cpp index 9028653b8..169e6d806 100644 --- a/Engine/source/T3D/tsStatic.cpp +++ b/Engine/source/T3D/tsStatic.cpp @@ -149,7 +149,7 @@ TSStatic::TSStatic() mAnimOffset = 0.0f; mAnimSpeed = 1.0f; - INIT_SHAPEASSET(Shape); + INIT_ASSET(Shape); } TSStatic::~TSStatic() @@ -958,7 +958,7 @@ U32 TSStatic::packUpdate(NetConnection* con, U32 mask, BitStream* stream) if (stream->writeFlag(mask & AdvancedStaticOptionsMask)) { - PACK_SHAPEASSET(con, Shape); + PACK_ASSET(con, Shape); stream->write((U32)mDecalType); @@ -1073,7 +1073,7 @@ void TSStatic::unpackUpdate(NetConnection* con, BitStream* stream) if (stream->readFlag()) // AdvancedStaticOptionsMask { - UNPACK_SHAPEASSET(con, Shape); + UNPACK_ASSET(con, Shape); stream->read((U32*)&mDecalType); diff --git a/Engine/source/T3D/tsStatic.h b/Engine/source/T3D/tsStatic.h index 1c82671cb..03c74c651 100644 --- a/Engine/source/T3D/tsStatic.h +++ b/Engine/source/T3D/tsStatic.h @@ -192,7 +192,7 @@ protected: Convex* mConvexList; DECLARE_SHAPEASSET(TSStatic, Shape, onShapeChanged); - DECLARE_SHAPEASSET_NET_SETGET(TSStatic, Shape, AdvancedStaticOptionsMask); + DECLARE_ASSET_NET_SETGET(TSStatic, Shape, AdvancedStaticOptionsMask); U32 mShapeHash; Vector mCollisionDetails; diff --git a/Engine/source/T3D/vehicles/flyingVehicle.cpp b/Engine/source/T3D/vehicles/flyingVehicle.cpp index dcc1f8dd2..8426da2c3 100644 --- a/Engine/source/T3D/vehicles/flyingVehicle.cpp +++ b/Engine/source/T3D/vehicles/flyingVehicle.cpp @@ -116,7 +116,7 @@ FlyingVehicleData::FlyingVehicleData() jetEmitter[j] = 0; for (S32 i = 0; i < MaxSounds; i++) - INIT_SOUNDASSET_ARRAY(FlyingSounds, i); + INIT_ASSET_ARRAY(FlyingSounds, i); vertThrustMultiple = 1.0; } @@ -241,7 +241,7 @@ void FlyingVehicleData::packData(BitStream* stream) for (S32 i = 0; i < MaxSounds; i++) { - PACKDATA_SOUNDASSET_ARRAY(FlyingSounds, i); + PACKDATA_ASSET_ARRAY(FlyingSounds, i); } for (S32 j = 0; j < MaxJetEmitters; j++) @@ -276,7 +276,7 @@ void FlyingVehicleData::unpackData(BitStream* stream) for (S32 i = 0; i < MaxSounds; i++) { - UNPACKDATA_SOUNDASSET_ARRAY(FlyingSounds, i); + UNPACKDATA_ASSET_ARRAY(FlyingSounds, i); } for (S32 j = 0; j < MaxJetEmitters; j++) { diff --git a/Engine/source/T3D/vehicles/flyingVehicle.h b/Engine/source/T3D/vehicles/flyingVehicle.h index 573d10ccc..f0a45edd3 100644 --- a/Engine/source/T3D/vehicles/flyingVehicle.h +++ b/Engine/source/T3D/vehicles/flyingVehicle.h @@ -46,7 +46,7 @@ struct FlyingVehicleData: public VehicleData { MaxSounds, }; DECLARE_SOUNDASSET_ARRAY(FlyingVehicleData, FlyingSounds, Sounds::MaxSounds); - DECLARE_SOUNDASSET_ARRAY_SETGET(FlyingVehicleData, FlyingSounds); + DECLARE_ASSET_ARRAY_SETGET(FlyingVehicleData, FlyingSounds); SFXProfile* getFlyingSoundProfile(U32 id) { if (mFlyingSoundsAsset[id] != NULL) diff --git a/Engine/source/T3D/vehicles/hoverVehicle.cpp b/Engine/source/T3D/vehicles/hoverVehicle.cpp index 7deb81fe0..dbaee9993 100644 --- a/Engine/source/T3D/vehicles/hoverVehicle.cpp +++ b/Engine/source/T3D/vehicles/hoverVehicle.cpp @@ -162,7 +162,7 @@ HoverVehicleData::HoverVehicleData() jetEmitter[j] = 0; for (S32 i = 0; i < MaxSounds; i++) - INIT_SOUNDASSET_ARRAY(HoverSounds, i); + INIT_ASSET_ARRAY(HoverSounds, i); } HoverVehicleData::~HoverVehicleData() @@ -370,7 +370,7 @@ void HoverVehicleData::packData(BitStream* stream) for (S32 i = 0; i < MaxSounds; i++) { - PACKDATA_SOUNDASSET_ARRAY(HoverSounds, i); + PACKDATA_ASSET_ARRAY(HoverSounds, i); } for (S32 j = 0; j < MaxJetEmitters; j++) @@ -419,7 +419,7 @@ void HoverVehicleData::unpackData(BitStream* stream) for (S32 i = 0; i < MaxSounds; i++) { - UNPACKDATA_SOUNDASSET_ARRAY(HoverSounds, i); + UNPACKDATA_ASSET_ARRAY(HoverSounds, i); } for (S32 j = 0; j < MaxJetEmitters; j++) { diff --git a/Engine/source/T3D/vehicles/hoverVehicle.h b/Engine/source/T3D/vehicles/hoverVehicle.h index da22da280..8e7cce79b 100644 --- a/Engine/source/T3D/vehicles/hoverVehicle.h +++ b/Engine/source/T3D/vehicles/hoverVehicle.h @@ -47,7 +47,7 @@ class HoverVehicleData : public VehicleData MaxSounds }; DECLARE_SOUNDASSET_ARRAY(HoverVehicleData, HoverSounds, Sounds::MaxSounds); - DECLARE_SOUNDASSET_ARRAY_SETGET(HoverVehicleData, HoverSounds); + DECLARE_ASSET_ARRAY_SETGET(HoverVehicleData, HoverSounds); SFXProfile* getHoverSoundProfile(U32 id) { if (mHoverSoundsAsset[id] != NULL) diff --git a/Engine/source/T3D/vehicles/vehicle.cpp b/Engine/source/T3D/vehicles/vehicle.cpp index 8079fc163..2fad95b6d 100644 --- a/Engine/source/T3D/vehicles/vehicle.cpp +++ b/Engine/source/T3D/vehicles/vehicle.cpp @@ -189,7 +189,7 @@ VehicleData::VehicleData() for (S32 i = 0; i < Body::MaxSounds; i++) { - INIT_SOUNDASSET_ARRAY(VehicleBodySounds, i); + INIT_ASSET_ARRAY(VehicleBodySounds, i); } dustEmitter = NULL; @@ -214,7 +214,7 @@ VehicleData::VehicleData() hardSplashSoundVel = 3.0; for (S32 i = 0; i < Sounds::MaxSounds; i++) - INIT_SOUNDASSET_ARRAY(VehicleWaterSounds, i); + INIT_ASSET_ARRAY(VehicleWaterSounds, i); collDamageThresholdVel = 20; collDamageMultiplier = 0.05f; @@ -302,7 +302,7 @@ void VehicleData::packData(BitStream* stream) stream->write(body.friction); for (i = 0; i < Body::MaxSounds; i++) { - PACKDATA_SOUNDASSET_ARRAY(VehicleBodySounds, i); + PACKDATA_ASSET_ARRAY(VehicleBodySounds, i); } stream->write(minImpactSpeed); @@ -346,7 +346,7 @@ void VehicleData::packData(BitStream* stream) // write the water sound profiles for (i = 0; i < MaxSounds; i++) { - PACKDATA_SOUNDASSET_ARRAY(VehicleWaterSounds, i); + PACKDATA_ASSET_ARRAY(VehicleWaterSounds, i); } if (stream->writeFlag( dustEmitter )) @@ -398,7 +398,7 @@ void VehicleData::unpackData(BitStream* stream) S32 i; for (i = 0; i < Body::MaxSounds; i++) { - UNPACKDATA_SOUNDASSET_ARRAY(VehicleBodySounds, i); + UNPACKDATA_ASSET_ARRAY(VehicleBodySounds, i); } stream->read(&minImpactSpeed); @@ -442,7 +442,7 @@ void VehicleData::unpackData(BitStream* stream) // write the water sound profiles for (i = 0; i < Sounds::MaxSounds; i++) { - UNPACKDATA_SOUNDASSET_ARRAY(VehicleWaterSounds, i); + UNPACKDATA_ASSET_ARRAY(VehicleWaterSounds, i); } if( stream->readFlag() ) diff --git a/Engine/source/T3D/vehicles/vehicle.h b/Engine/source/T3D/vehicles/vehicle.h index 3e9636027..c9a50b831 100644 --- a/Engine/source/T3D/vehicles/vehicle.h +++ b/Engine/source/T3D/vehicles/vehicle.h @@ -50,7 +50,7 @@ struct VehicleData : public RigidShapeData } body; DECLARE_SOUNDASSET_ARRAY(VehicleData, VehicleBodySounds, Body::Sounds::MaxSounds) - DECLARE_SOUNDASSET_ARRAY_SETGET(VehicleData, VehicleBodySounds); + DECLARE_ASSET_ARRAY_SETGET(VehicleData, VehicleBodySounds); SFXProfile* getVehicleBodySoundProfile(U32 id) { @@ -82,7 +82,7 @@ struct VehicleData : public RigidShapeData }; DECLARE_SOUNDASSET_ARRAY(VehicleData, VehicleWaterSounds, Sounds::MaxSounds) - DECLARE_SOUNDASSET_ARRAY_SETGET(VehicleData, VehicleWaterSounds); + DECLARE_ASSET_ARRAY_SETGET(VehicleData, VehicleWaterSounds); SFXProfile* getVehicleWaterSoundProfile(U32 id) { diff --git a/Engine/source/T3D/vehicles/wheeledVehicle.cpp b/Engine/source/T3D/vehicles/wheeledVehicle.cpp index 4e9e7201e..258222847 100644 --- a/Engine/source/T3D/vehicles/wheeledVehicle.cpp +++ b/Engine/source/T3D/vehicles/wheeledVehicle.cpp @@ -75,7 +75,7 @@ ConsoleDocClass( WheeledVehicleTire, WheeledVehicleTire::WheeledVehicleTire() { - INIT_SHAPEASSET(Shape); + INIT_ASSET(Shape); staticFriction = 1; kineticFriction = 0.5f; @@ -177,7 +177,7 @@ void WheeledVehicleTire::packData(BitStream* stream) { Parent::packData(stream); - PACKDATA_SHAPEASSET(Shape); + PACKDATA_ASSET(Shape); stream->write(mass); stream->write(staticFriction); @@ -196,7 +196,7 @@ void WheeledVehicleTire::unpackData(BitStream* stream) { Parent::unpackData(stream); - UNPACKDATA_SHAPEASSET(Shape); + UNPACKDATA_ASSET(Shape); stream->read(&mass); stream->read(&staticFriction); @@ -312,7 +312,7 @@ WheeledVehicleData::WheeledVehicleData() wheelCount = 0; dMemset(&wheel, 0, sizeof(wheel)); for (S32 i = 0; i < MaxSounds; i++) - INIT_SOUNDASSET_ARRAY(WheeledVehicleSounds, i); + INIT_ASSET_ARRAY(WheeledVehicleSounds, i); } @@ -483,7 +483,7 @@ void WheeledVehicleData::packData(BitStream* stream) for (S32 i = 0; i < MaxSounds; i++) { - PACKDATA_SOUNDASSET_ARRAY(WheeledVehicleSounds, i); + PACKDATA_ASSET_ARRAY(WheeledVehicleSounds, i); } stream->write(maxWheelSpeed); @@ -502,7 +502,7 @@ void WheeledVehicleData::unpackData(BitStream* stream) for (S32 i = 0; i < MaxSounds; i++) { - UNPACKDATA_SOUNDASSET_ARRAY(WheeledVehicleSounds, i); + UNPACKDATA_ASSET_ARRAY(WheeledVehicleSounds, i); } stream->read(&maxWheelSpeed); diff --git a/Engine/source/T3D/vehicles/wheeledVehicle.h b/Engine/source/T3D/vehicles/wheeledVehicle.h index a2ab03b11..c8759e52d 100644 --- a/Engine/source/T3D/vehicles/wheeledVehicle.h +++ b/Engine/source/T3D/vehicles/wheeledVehicle.h @@ -44,7 +44,7 @@ struct WheeledVehicleTire: public SimDataBlock typedef SimDataBlock Parent; DECLARE_SHAPEASSET(WheeledVehicleTire, Shape, onShapeChanged); - DECLARE_SHAPEASSET_SETGET(WheeledVehicleTire, Shape); + DECLARE_ASSET_SETGET(WheeledVehicleTire, Shape); // Physical properties F32 mass; // Mass of the whole wheel @@ -120,7 +120,7 @@ struct WheeledVehicleData: public VehicleData }; DECLARE_SOUNDASSET_ARRAY(WheeledVehicleData, WheeledVehicleSounds, Sounds::MaxSounds); - DECLARE_SOUNDASSET_ARRAY_SETGET(WheeledVehicleData, WheeledVehicleSounds); + DECLARE_ASSET_ARRAY_SETGET(WheeledVehicleData, WheeledVehicleSounds); SFXProfile* getWheeledVehicleSound(U32 id) { diff --git a/Engine/source/afx/afxMagicMissile.cpp b/Engine/source/afx/afxMagicMissile.cpp index 93d4ef237..a67447248 100644 --- a/Engine/source/afx/afxMagicMissile.cpp +++ b/Engine/source/afx/afxMagicMissile.cpp @@ -141,7 +141,7 @@ U32 Projectile::smProjectileWarpTicks = 5; // afxMagicMissileData::afxMagicMissileData() { - INIT_SHAPEASSET(ProjectileShape); + INIT_ASSET(ProjectileShape); sound = NULL; @@ -246,7 +246,7 @@ afxMagicMissileData::afxMagicMissileData() afxMagicMissileData::afxMagicMissileData(const afxMagicMissileData& other, bool temp_clone) : GameBaseData(other, temp_clone) { - CLONE_SHAPEASSET(ProjectileShape); + CLONE_ASSET(ProjectileShape); projectileShape = other.projectileShape; // -- TSShape loads using projectileShapeName sound = other.sound; splash = other.splash; @@ -599,7 +599,7 @@ void afxMagicMissileData::packData(BitStream* stream) { Parent::packData(stream); - PACKDATA_SHAPEASSET(ProjectileShape); + PACKDATA_ASSET(ProjectileShape); /* From stock Projectile code... stream->writeFlag(faceViewer); @@ -710,7 +710,7 @@ void afxMagicMissileData::unpackData(BitStream* stream) { Parent::unpackData(stream); - UNPACKDATA_SHAPEASSET(ProjectileShape); + UNPACKDATA_ASSET(ProjectileShape); /* From stock Projectile code... faceViewer = stream->readFlag(); */ diff --git a/Engine/source/afx/afxMagicMissile.h b/Engine/source/afx/afxMagicMissile.h index 1206354fd..626dfd91d 100644 --- a/Engine/source/afx/afxMagicMissile.h +++ b/Engine/source/afx/afxMagicMissile.h @@ -72,7 +72,7 @@ public: // variables set in datablock definition: // Shape related DECLARE_SHAPEASSET(afxMagicMissileData, ProjectileShape, onShapeChanged); - DECLARE_SHAPEASSET_SETGET(afxMagicMissileData, ProjectileShape); + DECLARE_ASSET_SETGET(afxMagicMissileData, ProjectileShape); //StringTableEntry projectileShapeName; //bool hasLight; diff --git a/Engine/source/afx/ce/afxBillboard.cpp b/Engine/source/afx/ce/afxBillboard.cpp index 553c2942f..c0092c389 100644 --- a/Engine/source/afx/ce/afxBillboard.cpp +++ b/Engine/source/afx/ce/afxBillboard.cpp @@ -51,7 +51,7 @@ ConsoleDocClass( afxBillboardData, afxBillboardData::afxBillboardData() { color.set(1.0f, 1.0f, 1.0f, 1.0f); - INIT_IMAGEASSET(Texture); + INIT_ASSET(Texture); dimensions.set(1.0f, 1.0f); texCoords[0].set(0.0f, 0.0f); texCoords[1].set(0.0f, 1.0f); @@ -66,7 +66,7 @@ afxBillboardData::afxBillboardData(const afxBillboardData& other, bool temp_clon : GameBaseData(other, temp_clone) { color = other.color; - CLONE_IMAGEASSET(Texture); + CLONE_ASSET(Texture); dimensions = other.dimensions; texCoords[0] = other.texCoords[0]; texCoords[1] = other.texCoords[1]; @@ -123,7 +123,7 @@ void afxBillboardData::packData(BitStream* stream) Parent::packData(stream); stream->write(color); - PACKDATA_IMAGEASSET(Texture); + PACKDATA_ASSET(Texture); mathWrite(*stream, dimensions); mathWrite(*stream, texCoords[0]); @@ -140,7 +140,7 @@ void afxBillboardData::unpackData(BitStream* stream) Parent::unpackData(stream); stream->read(&color); - UNPACKDATA_IMAGEASSET(Texture); + UNPACKDATA_ASSET(Texture); mathRead(*stream, &dimensions); mathRead(*stream, &texCoords[0]); mathRead(*stream, &texCoords[1]); diff --git a/Engine/source/afx/ce/afxBillboard.h b/Engine/source/afx/ce/afxBillboard.h index 1183500a2..8c6532539 100644 --- a/Engine/source/afx/ce/afxBillboard.h +++ b/Engine/source/afx/ce/afxBillboard.h @@ -48,7 +48,7 @@ public: public: DECLARE_IMAGEASSET(afxBillboardData, Texture, onChangeTexture, GFXStaticTextureSRGBProfile); - DECLARE_IMAGEASSET_SETGET(afxBillboardData, Texture); + DECLARE_ASSET_SETGET(afxBillboardData, Texture); LinearColorF color; diff --git a/Engine/source/afx/ce/afxModel.cpp b/Engine/source/afx/ce/afxModel.cpp index ba452156b..7c6eb019c 100644 --- a/Engine/source/afx/ce/afxModel.cpp +++ b/Engine/source/afx/ce/afxModel.cpp @@ -54,7 +54,7 @@ ConsoleDocClass( afxModelData, afxModelData::afxModelData() { - INIT_SHAPEASSET(Shape); + INIT_ASSET(Shape); sequence = ST_NULLSTRING; seq_rate = 1.0f; seq_offset = 0.0f; @@ -84,7 +84,7 @@ afxModelData::afxModelData() afxModelData::afxModelData(const afxModelData& other, bool temp_clone) : GameBaseData(other, temp_clone) { - CLONE_SHAPEASSET(Shape); + CLONE_ASSET(Shape); sequence = other.sequence; seq_rate = other.seq_rate; seq_offset = other.seq_offset; @@ -253,7 +253,7 @@ void afxModelData::packData(BitStream* stream) { Parent::packData(stream); - PACKDATA_SHAPEASSET(Shape); + PACKDATA_ASSET(Shape); stream->writeString(sequence); stream->write(seq_rate); stream->write(seq_offset); @@ -285,7 +285,7 @@ void afxModelData::unpackData(BitStream* stream) { Parent::unpackData(stream); - UNPACKDATA_SHAPEASSET(Shape); + UNPACKDATA_ASSET(Shape); sequence = stream->readSTString(); stream->read(&seq_rate); stream->read(&seq_offset); diff --git a/Engine/source/afx/ce/afxModel.h b/Engine/source/afx/ce/afxModel.h index 0d13692ef..80c6803f7 100644 --- a/Engine/source/afx/ce/afxModel.h +++ b/Engine/source/afx/ce/afxModel.h @@ -44,7 +44,7 @@ struct afxModelData : public GameBaseData typedef GameBaseData Parent; DECLARE_SHAPEASSET(afxModelData, Shape, onShapeChanged); - DECLARE_SHAPEASSET_SETGET(afxModelData, Shape); + DECLARE_ASSET_SETGET(afxModelData, Shape); StringTableEntry sequence; diff --git a/Engine/source/afx/ce/afxZodiac.cpp b/Engine/source/afx/ce/afxZodiac.cpp index eca56af5a..dc4cb5b01 100644 --- a/Engine/source/afx/ce/afxZodiac.cpp +++ b/Engine/source/afx/ce/afxZodiac.cpp @@ -78,7 +78,7 @@ bool afxZodiacData::sPreferDestinationGradients = false; afxZodiacData::afxZodiacData() { - INIT_IMAGEASSET(Texture); + INIT_ASSET(Texture); radius_xy = 1; vert_range.set(0.0f, 0.0f); @@ -120,7 +120,7 @@ afxZodiacData::afxZodiacData() afxZodiacData::afxZodiacData(const afxZodiacData& other, bool temp_clone) : GameBaseData(other, temp_clone) { - CLONE_IMAGEASSET(Texture); + CLONE_ASSET(Texture); radius_xy = other.radius_xy; vert_range = other.vert_range; @@ -269,7 +269,7 @@ void afxZodiacData::packData(BitStream* stream) merge_zflags(); - PACKDATA_IMAGEASSET(Texture); + PACKDATA_ASSET(Texture); stream->write(radius_xy); stream->write(vert_range.x); stream->write(vert_range.y); @@ -294,7 +294,7 @@ void afxZodiacData::unpackData(BitStream* stream) { Parent::unpackData(stream); - UNPACKDATA_IMAGEASSET(Texture); + UNPACKDATA_ASSET(Texture); stream->read(&radius_xy); stream->read(&vert_range.x); stream->read(&vert_range.y); diff --git a/Engine/source/afx/ce/afxZodiac.h b/Engine/source/afx/ce/afxZodiac.h index d03fcf593..917ee5490 100644 --- a/Engine/source/afx/ce/afxZodiac.h +++ b/Engine/source/afx/ce/afxZodiac.h @@ -60,7 +60,7 @@ public: public: DECLARE_IMAGEASSET(afxZodiacData, Texture, onImageChanged, AFX_GFXZodiacTextureProfile); - DECLARE_IMAGEASSET_SETGET(afxZodiacData, Texture); + DECLARE_ASSET_SETGET(afxZodiacData, Texture); F32 radius_xy; Point2F vert_range; diff --git a/Engine/source/afx/ce/afxZodiacPlane.cpp b/Engine/source/afx/ce/afxZodiacPlane.cpp index aaea763e7..c9045bc95 100644 --- a/Engine/source/afx/ce/afxZodiacPlane.cpp +++ b/Engine/source/afx/ce/afxZodiacPlane.cpp @@ -51,7 +51,7 @@ ConsoleDocClass( afxZodiacPlaneData, afxZodiacPlaneData::afxZodiacPlaneData() { - INIT_IMAGEASSET(Texture); + INIT_ASSET(Texture); radius_xy = 1; start_ang = 0; @@ -71,7 +71,7 @@ afxZodiacPlaneData::afxZodiacPlaneData() afxZodiacPlaneData::afxZodiacPlaneData(const afxZodiacPlaneData& other, bool temp_clone) : GameBaseData(other, temp_clone) { - CLONE_IMAGEASSET(Texture); + CLONE_ASSET(Texture); radius_xy = other.radius_xy; start_ang = other.start_ang; @@ -165,7 +165,7 @@ void afxZodiacPlaneData::packData(BitStream* stream) merge_zflags(); - PACKDATA_IMAGEASSET(Texture); + PACKDATA_ASSET(Texture); stream->write(radius_xy); stream->write(start_ang); @@ -184,7 +184,7 @@ void afxZodiacPlaneData::unpackData(BitStream* stream) { Parent::unpackData(stream); - UNPACKDATA_IMAGEASSET(Texture); + UNPACKDATA_ASSET(Texture); stream->read(&radius_xy); stream->read(&start_ang); diff --git a/Engine/source/afx/ce/afxZodiacPlane.h b/Engine/source/afx/ce/afxZodiacPlane.h index e99702b4c..7b2d7aec2 100644 --- a/Engine/source/afx/ce/afxZodiacPlane.h +++ b/Engine/source/afx/ce/afxZodiacPlane.h @@ -60,7 +60,7 @@ public: public: DECLARE_IMAGEASSET(afxZodiacPlaneData, Texture, onImageChanged, AFX_GFXZodiacTextureProfile); - DECLARE_IMAGEASSET_SETGET(afxZodiacPlaneData, Texture); + DECLARE_ASSET_SETGET(afxZodiacPlaneData, Texture); F32 radius_xy; F32 start_ang; diff --git a/Engine/source/assets/assetBase.h b/Engine/source/assets/assetBase.h index 7d1918857..d4efc6a8a 100644 --- a/Engine/source/assets/assetBase.h +++ b/Engine/source/assets/assetBase.h @@ -173,6 +173,5 @@ private: #define assetText(x,suff) #x#suff #define macroText(x) #x #define assetDoc(x,suff) "@brief "#x" "#suff - #endif // _ASSET_BASE_H_ diff --git a/Engine/source/environment/VolumetricFog.cpp b/Engine/source/environment/VolumetricFog.cpp index b602d87ac..c9eaff9df 100644 --- a/Engine/source/environment/VolumetricFog.cpp +++ b/Engine/source/environment/VolumetricFog.cpp @@ -137,8 +137,8 @@ VolumetricFog::VolumetricFog() mSpeed1.set(0.5f, 0.0f); mSpeed2.set(0.1f, 0.1f); - INIT_SHAPEASSET(Shape); - INIT_IMAGEASSET(Texture); + INIT_ASSET(Shape); + INIT_ASSET(Texture); } VolumetricFog::~VolumetricFog() @@ -543,7 +543,7 @@ U32 VolumetricFog::packUpdate(NetConnection *con, U32 mask, BitStream *stream) stream->write(mFogDensity); if (stream->writeFlag(mask & FogModulationMask)) { - PACK_IMAGEASSET(con, Texture); + PACK_ASSET(con, Texture); mTexTiles = mFabs(mTexTiles); stream->write(mTexTiles); stream->write(mStrength); @@ -567,7 +567,7 @@ U32 VolumetricFog::packUpdate(NetConnection *con, U32 mask, BitStream *stream) } if (stream->writeFlag(mask & FogShapeMask)) { - PACK_SHAPEASSET(con, Shape); + PACK_ASSET(con, Shape); mathWrite(*stream, getTransform()); mathWrite(*stream, getScale()); @@ -613,7 +613,7 @@ void VolumetricFog::unpackUpdate(NetConnection *con, BitStream *stream) } if (stream->readFlag())// Fog Modulation { - UNPACK_IMAGEASSET(con, Texture); + UNPACK_ASSET(con, Texture); stream->read(&mTexTiles); mTexTiles = mFabs(mTexTiles); stream->read(&mStrength); @@ -667,7 +667,7 @@ void VolumetricFog::unpackUpdate(NetConnection *con, BitStream *stream) } if (stream->readFlag())//Fog shape { - UNPACK_SHAPEASSET(con, Shape); + UNPACK_ASSET(con, Shape); mathRead(*stream, &mat); mathRead(*stream, &scale); diff --git a/Engine/source/environment/VolumetricFog.h b/Engine/source/environment/VolumetricFog.h index 1a4abaca3..83df0c184 100644 --- a/Engine/source/environment/VolumetricFog.h +++ b/Engine/source/environment/VolumetricFog.h @@ -85,7 +85,7 @@ class VolumetricFog : public SceneObject }; DECLARE_SHAPEASSET(VolumetricFog, Shape, onShapeChanged); - DECLARE_SHAPEASSET_NET_SETGET(VolumetricFog, Shape, FogShapeMask); + DECLARE_ASSET_NET_SETGET(VolumetricFog, Shape, FogShapeMask); protected: // Rendertargets; @@ -163,7 +163,7 @@ class VolumetricFog : public SceneObject // Fog Modulation data DECLARE_IMAGEASSET(VolumetricFog, Texture, onImageChanged, GFXStaticTextureSRGBProfile); - DECLARE_IMAGEASSET_NET_SETGET(VolumetricFog, Texture, FogModulationMask); + DECLARE_ASSET_NET_SETGET(VolumetricFog, Texture, FogModulationMask); bool mIsTextured; F32 mTexTiles; @@ -257,4 +257,4 @@ class VolumetricFog : public SceneObject DECLARE_CALLBACK(void, onEnterFog, (SimObjectId obj)); DECLARE_CALLBACK(void, onLeaveFog, (SimObjectId obj)); }; -#endif \ No newline at end of file +#endif diff --git a/Engine/source/environment/basicClouds.cpp b/Engine/source/environment/basicClouds.cpp index defd8fc41..462bf573f 100644 --- a/Engine/source/environment/basicClouds.cpp +++ b/Engine/source/environment/basicClouds.cpp @@ -215,7 +215,7 @@ U32 BasicClouds::packUpdate( NetConnection *conn, U32 mask, BitStream *stream ) { stream->writeFlag( mLayerEnabled[i] ); - PACK_IMAGEASSET_ARRAY(conn, Texture, i); + PACK_ASSET_ARRAY(conn, Texture, i); stream->write( mTexScale[i] ); mathWrite( *stream, mTexDirection[i] ); @@ -236,7 +236,7 @@ void BasicClouds::unpackUpdate( NetConnection *conn, BitStream *stream ) { mLayerEnabled[i] = stream->readFlag(); - UNPACK_IMAGEASSET_ARRAY(conn, Texture, i); + UNPACK_ASSET_ARRAY(conn, Texture, i); stream->read( &mTexScale[i] ); mathRead( *stream, &mTexDirection[i] ); diff --git a/Engine/source/environment/cloudLayer.cpp b/Engine/source/environment/cloudLayer.cpp index 01e55dc6e..dce8f84a2 100644 --- a/Engine/source/environment/cloudLayer.cpp +++ b/Engine/source/environment/cloudLayer.cpp @@ -113,7 +113,7 @@ CloudLayer::CloudLayer() mHeight = 4.0f; - INIT_IMAGEASSET(Texture); + INIT_ASSET(Texture); } IMPLEMENT_CO_NETOBJECT_V1( CloudLayer ); @@ -242,7 +242,7 @@ U32 CloudLayer::packUpdate( NetConnection *conn, U32 mask, BitStream *stream ) { U32 retMask = Parent::packUpdate( conn, mask, stream ); - PACK_IMAGEASSET(conn, Texture); + PACK_ASSET(conn, Texture); for ( U32 i = 0; i < TEX_COUNT; i++ ) { @@ -264,7 +264,7 @@ void CloudLayer::unpackUpdate( NetConnection *conn, BitStream *stream ) { Parent::unpackUpdate( conn, stream ); - UNPACK_IMAGEASSET(conn, Texture); + UNPACK_ASSET(conn, Texture); if(mTextureAssetId != StringTable->EmptyString()) mTextureAsset = mTextureAssetId; diff --git a/Engine/source/environment/cloudLayer.h b/Engine/source/environment/cloudLayer.h index 82e152dfb..8f7ffc667 100644 --- a/Engine/source/environment/cloudLayer.h +++ b/Engine/source/environment/cloudLayer.h @@ -97,7 +97,7 @@ protected: static U32 smTriangleCount; DECLARE_IMAGEASSET(CloudLayer, Texture, onImageChanged, GFXStaticTextureSRGBProfile); - DECLARE_IMAGEASSET_NET_SETGET(CloudLayer, Texture, CloudLayerMask); + DECLARE_ASSET_NET_SETGET(CloudLayer, Texture, CloudLayerMask); GFXShaderRef mShader; @@ -136,4 +136,4 @@ protected: }; -#endif // _CLOUDLAYER_H_ \ No newline at end of file +#endif // _CLOUDLAYER_H_ diff --git a/Engine/source/environment/decalRoad.cpp b/Engine/source/environment/decalRoad.cpp index e1d9a27ee..bd5e1e619 100644 --- a/Engine/source/environment/decalRoad.cpp +++ b/Engine/source/environment/decalRoad.cpp @@ -287,7 +287,7 @@ DecalRoad::DecalRoad() mTypeMask |= StaticObjectType | StaticShapeObjectType; mNetFlags.set(Ghostable); - INIT_MATERIALASSET(Material); + INIT_ASSET(Material); mMaterialInst = nullptr; } @@ -491,7 +491,7 @@ U32 DecalRoad::packUpdate(NetConnection * con, U32 mask, BitStream * stream) if ( stream->writeFlag( mask & DecalRoadMask ) ) { // Write Texture Name. - PACK_MATERIALASSET(con, Material); + PACK_ASSET(con, Material); stream->write( mBreakAngle ); @@ -580,7 +580,7 @@ void DecalRoad::unpackUpdate( NetConnection *con, BitStream *stream ) // DecalRoadMask if ( stream->readFlag() ) { - UNPACK_MATERIALASSET(con, Material); + UNPACK_ASSET(con, Material); if (isProperlyAdded()) _initMaterial(); diff --git a/Engine/source/environment/decalRoad.h b/Engine/source/environment/decalRoad.h index 7934d7889..180b92d08 100644 --- a/Engine/source/environment/decalRoad.h +++ b/Engine/source/environment/decalRoad.h @@ -243,7 +243,7 @@ protected: BaseMatInstance* mMaterialInst; DECLARE_MATERIALASSET(DecalRoad, Material); - DECLARE_MATERIALASSET_NET_SETGET(DecalRoad, Material, DecalRoadMask); + DECLARE_ASSET_NET_SETGET(DecalRoad, Material, DecalRoadMask); U32 mRenderPriority; diff --git a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp index b0812f738..7d139c2ea 100644 --- a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp @@ -97,9 +97,9 @@ GuiMeshRoadEditorCtrl::GuiMeshRoadEditorCtrl() mHoverNodeColor( 255,255,255,255 ), mHasCopied( false ) { - INIT_MATERIALASSET(TopMaterial); - INIT_MATERIALASSET(BottomMaterial); - INIT_MATERIALASSET(SideMaterial); + INIT_ASSET(TopMaterial); + INIT_ASSET(BottomMaterial); + INIT_ASSET(SideMaterial); mTopMaterialAssetId = Con::getVariable("$MeshRoadEditor::defaultTopMaterialAsset"); mBottomMaterialAssetId = Con::getVariable("$MeshRoadEditor::defaultBottomMaterialAsset"); diff --git a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.h b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.h index 95cffeab0..497dd14f8 100644 --- a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.h +++ b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.h @@ -160,13 +160,13 @@ class GuiMeshRoadEditorCtrl : public EditTSCtrl public: DECLARE_MATERIALASSET(GuiMeshRoadEditorCtrl, TopMaterial); - DECLARE_MATERIALASSET_SETGET(GuiMeshRoadEditorCtrl, TopMaterial); + DECLARE_ASSET_SETGET(GuiMeshRoadEditorCtrl, TopMaterial); DECLARE_MATERIALASSET(GuiMeshRoadEditorCtrl, BottomMaterial); - DECLARE_MATERIALASSET_SETGET(GuiMeshRoadEditorCtrl, BottomMaterial); + DECLARE_ASSET_SETGET(GuiMeshRoadEditorCtrl, BottomMaterial); DECLARE_MATERIALASSET(GuiMeshRoadEditorCtrl, SideMaterial); - DECLARE_MATERIALASSET_SETGET(GuiMeshRoadEditorCtrl, SideMaterial); + DECLARE_ASSET_SETGET(GuiMeshRoadEditorCtrl, SideMaterial); }; class GuiMeshRoadEditorUndoAction : public UndoAction diff --git a/Engine/source/environment/editors/guiRoadEditorCtrl.h b/Engine/source/environment/editors/guiRoadEditorCtrl.h index 5e076aa68..9d2c5d014 100644 --- a/Engine/source/environment/editors/guiRoadEditorCtrl.h +++ b/Engine/source/environment/editors/guiRoadEditorCtrl.h @@ -104,7 +104,7 @@ class GuiRoadEditorCtrl : public EditTSCtrl public: DECLARE_MATERIALASSET(GuiRoadEditorCtrl, Material); - DECLARE_MATERIALASSET_SETGET(GuiRoadEditorCtrl, Material); + DECLARE_ASSET_SETGET(GuiRoadEditorCtrl, Material); protected: diff --git a/Engine/source/environment/meshRoad.cpp b/Engine/source/environment/meshRoad.cpp index f27d2d84a..d3f143d88 100644 --- a/Engine/source/environment/meshRoad.cpp +++ b/Engine/source/environment/meshRoad.cpp @@ -920,9 +920,9 @@ MeshRoad::MeshRoad() mTriangleCount[i] = 0; } - INIT_MATERIALASSET(TopMaterial); - INIT_MATERIALASSET(BottomMaterial); - INIT_MATERIALASSET(SideMaterial); + INIT_ASSET(TopMaterial); + INIT_ASSET(BottomMaterial); + INIT_ASSET(SideMaterial); mSideProfile.mRoad = this; } @@ -1416,9 +1416,9 @@ U32 MeshRoad::packUpdate(NetConnection * con, U32 mask, BitStream * stream) stream->writeAffineTransform( mObjToWorld ); // Write Materials - PACK_MATERIALASSET(con, TopMaterial); - PACK_MATERIALASSET(con, BottomMaterial); - PACK_MATERIALASSET(con, SideMaterial); + PACK_ASSET(con, TopMaterial); + PACK_ASSET(con, BottomMaterial); + PACK_ASSET(con, SideMaterial); stream->write( mTextureLength ); stream->write( mBreakAngle ); @@ -1515,9 +1515,9 @@ void MeshRoad::unpackUpdate(NetConnection * con, BitStream * stream) stream->readAffineTransform(&ObjectMatrix); Parent::setTransform(ObjectMatrix); - UNPACK_MATERIALASSET(con, TopMaterial); - UNPACK_MATERIALASSET(con, BottomMaterial); - UNPACK_MATERIALASSET(con, SideMaterial); + UNPACK_ASSET(con, TopMaterial); + UNPACK_ASSET(con, BottomMaterial); + UNPACK_ASSET(con, SideMaterial); if ( isProperlyAdded() ) _initMaterial(); diff --git a/Engine/source/environment/meshRoad.h b/Engine/source/environment/meshRoad.h index 718a015cd..9fe7505b9 100644 --- a/Engine/source/environment/meshRoad.h +++ b/Engine/source/environment/meshRoad.h @@ -622,13 +622,13 @@ protected: GFXPrimitiveBufferHandle mPB[SurfaceCount]; DECLARE_MATERIALASSET(MeshRoad, TopMaterial); - DECLARE_MATERIALASSET_NET_SETGET(MeshRoad, TopMaterial, MeshRoadMask); + DECLARE_ASSET_NET_SETGET(MeshRoad, TopMaterial, MeshRoadMask); DECLARE_MATERIALASSET(MeshRoad, BottomMaterial); - DECLARE_MATERIALASSET_NET_SETGET(MeshRoad, BottomMaterial, MeshRoadMask); + DECLARE_ASSET_NET_SETGET(MeshRoad, BottomMaterial, MeshRoadMask); DECLARE_MATERIALASSET(MeshRoad, SideMaterial); - DECLARE_MATERIALASSET_NET_SETGET(MeshRoad, SideMaterial, MeshRoadMask); + DECLARE_ASSET_NET_SETGET(MeshRoad, SideMaterial, MeshRoadMask); //String mMaterialName[SurfaceCount]; SimObjectPtr mMaterial[SurfaceCount]; diff --git a/Engine/source/environment/scatterSky.cpp b/Engine/source/environment/scatterSky.cpp index cd447e56c..36ab28ecf 100644 --- a/Engine/source/environment/scatterSky.cpp +++ b/Engine/source/environment/scatterSky.cpp @@ -168,7 +168,7 @@ ScatterSky::ScatterSky() mNightCubemapName = StringTable->EmptyString(); mSunSize = 1.0f; - INIT_MATERIALASSET(MoonMat); + INIT_ASSET(MoonMat); mMoonMatInst = NULL; @@ -503,7 +503,7 @@ U32 ScatterSky::packUpdate(NetConnection *con, U32 mask, BitStream *stream) stream->writeFlag( mMoonEnabled ); - PACK_MATERIALASSET(con, MoonMat); + PACK_ASSET(con, MoonMat); stream->write( mMoonScale ); stream->write( mMoonTint ); @@ -617,7 +617,7 @@ void ScatterSky::unpackUpdate(NetConnection *con, BitStream *stream) mMoonEnabled = stream->readFlag(); - UNPACK_MATERIALASSET(con, MoonMat); + UNPACK_ASSET(con, MoonMat); stream->read( &mMoonScale ); stream->read( &mMoonTint ); diff --git a/Engine/source/environment/scatterSky.h b/Engine/source/environment/scatterSky.h index 2657aa6b8..0633e9e23 100644 --- a/Engine/source/environment/scatterSky.h +++ b/Engine/source/environment/scatterSky.h @@ -212,7 +212,7 @@ protected: bool mMoonEnabled; DECLARE_MATERIALASSET(ScatterSky, MoonMat); - DECLARE_MATERIALASSET_NET_SETGET(ScatterSky, MoonMat, UpdateMask); + DECLARE_ASSET_NET_SETGET(ScatterSky, MoonMat, UpdateMask); BaseMatInstance *mMoonMatInst; F32 mMoonScale; diff --git a/Engine/source/environment/skyBox.cpp b/Engine/source/environment/skyBox.cpp index 057de94aa..468ecb8dd 100644 --- a/Engine/source/environment/skyBox.cpp +++ b/Engine/source/environment/skyBox.cpp @@ -56,7 +56,7 @@ SkyBox::SkyBox() mTypeMask |= EnvironmentObjectType | StaticObjectType; mNetFlags.set(Ghostable | ScopeAlways); - INIT_MATERIALASSET(Material); + INIT_ASSET(Material); mMatInstance = NULL; mIsVBDirty = false; @@ -139,7 +139,7 @@ U32 SkyBox::packUpdate( NetConnection *conn, U32 mask, BitStream *stream ) { U32 retMask = Parent::packUpdate( conn, mask, stream ); - PACK_MATERIALASSET(conn, Material); + PACK_ASSET(conn, Material); stream->writeFlag( mDrawBottom ); stream->write( mFogBandHeight ); @@ -152,7 +152,7 @@ void SkyBox::unpackUpdate( NetConnection *conn, BitStream *stream ) Parent::unpackUpdate( conn, stream ); StringTableEntry oldMatName = getMaterial(); - UNPACK_MATERIALASSET(conn, Material); + UNPACK_ASSET(conn, Material); if (oldMatName != getMaterial()) { _updateMaterial(); diff --git a/Engine/source/environment/skyBox.h b/Engine/source/environment/skyBox.h index 38c2b0ac7..7f2ebe494 100644 --- a/Engine/source/environment/skyBox.h +++ b/Engine/source/environment/skyBox.h @@ -102,7 +102,7 @@ protected: // Material DECLARE_MATERIALASSET(SkyBox, Material); - DECLARE_MATERIALASSET_NET_SETGET(SkyBox, Material, -1); + DECLARE_ASSET_NET_SETGET(SkyBox, Material, -1); BaseMatInstance *mMatInstance; SkyMatParams mMatParamHandle; diff --git a/Engine/source/environment/sun.cpp b/Engine/source/environment/sun.cpp index 42062a78b..47cc91070 100644 --- a/Engine/source/environment/sun.cpp +++ b/Engine/source/environment/sun.cpp @@ -90,7 +90,7 @@ Sun::Sun() mCoronaUseLightColor = true; mCoronaMatInst = NULL; - INIT_MATERIALASSET(CoronaMaterial); + INIT_ASSET(CoronaMaterial); mMatrixSet = reinterpret_cast(dMalloc_aligned(sizeof(MatrixSet), 16)); constructInPlace(mMatrixSet); @@ -240,7 +240,7 @@ U32 Sun::packUpdate(NetConnection *conn, U32 mask, BitStream *stream ) stream->writeFlag( mCoronaEnabled ); - PACK_MATERIALASSET(conn, CoronaMaterial); + PACK_ASSET(conn, CoronaMaterial); stream->write( mCoronaScale ); stream->write( mCoronaTint ); @@ -286,7 +286,7 @@ void Sun::unpackUpdate( NetConnection *conn, BitStream *stream ) mCoronaEnabled = stream->readFlag(); - UNPACK_MATERIALASSET(conn, CoronaMaterial); + UNPACK_ASSET(conn, CoronaMaterial); stream->read( &mCoronaScale ); stream->read( &mCoronaTint ); diff --git a/Engine/source/environment/sun.h b/Engine/source/environment/sun.h index 9d11c0ed1..f9d1674f8 100644 --- a/Engine/source/environment/sun.h +++ b/Engine/source/environment/sun.h @@ -79,7 +79,7 @@ protected: bool mCoronaEnabled; DECLARE_MATERIALASSET(Sun, CoronaMaterial); - DECLARE_MATERIALASSET_NET_SETGET(Sun, CoronaMaterial, UpdateMask); + DECLARE_ASSET_NET_SETGET(Sun, CoronaMaterial, UpdateMask); BaseMatInstance *mCoronaMatInst; MatrixSet *mMatrixSet; diff --git a/Engine/source/environment/waterObject.cpp b/Engine/source/environment/waterObject.cpp index dd5ea1a6f..7aba59163 100644 --- a/Engine/source/environment/waterObject.cpp +++ b/Engine/source/environment/waterObject.cpp @@ -260,9 +260,9 @@ WaterObject::WaterObject() mMatrixSet = reinterpret_cast(dMalloc_aligned(sizeof(MatrixSet), 16)); constructInPlace(mMatrixSet); - INIT_IMAGEASSET(RippleTex); - INIT_IMAGEASSET(FoamTex); - INIT_IMAGEASSET(DepthGradientTex); + INIT_ASSET(RippleTex); + INIT_ASSET(FoamTex); + INIT_ASSET(DepthGradientTex); mCubemapName = StringTable->EmptyString(); } @@ -546,9 +546,9 @@ U32 WaterObject::packUpdate( NetConnection * conn, U32 mask, BitStream *stream ) if ( stream->writeFlag( mask & TextureMask ) ) { - PACK_IMAGEASSET(conn, RippleTex); - PACK_IMAGEASSET(conn, DepthGradientTex); - PACK_IMAGEASSET(conn, FoamTex); + PACK_ASSET(conn, RippleTex); + PACK_ASSET(conn, DepthGradientTex); + PACK_ASSET(conn, FoamTex); stream->writeString( mCubemapName ); } @@ -668,9 +668,9 @@ void WaterObject::unpackUpdate( NetConnection * conn, BitStream *stream ) // TextureMask if ( stream->readFlag() ) { - UNPACK_IMAGEASSET(conn, RippleTex); - UNPACK_IMAGEASSET(conn, DepthGradientTex); - UNPACK_IMAGEASSET(conn, FoamTex); + UNPACK_ASSET(conn, RippleTex); + UNPACK_ASSET(conn, DepthGradientTex); + UNPACK_ASSET(conn, FoamTex); mCubemapName = stream->readSTString(); diff --git a/Engine/source/environment/waterObject.h b/Engine/source/environment/waterObject.h index 3c72ba21e..17d5d8428 100644 --- a/Engine/source/environment/waterObject.h +++ b/Engine/source/environment/waterObject.h @@ -273,11 +273,11 @@ protected: // Other textures DECLARE_IMAGEASSET(WaterObject, RippleTex, onRippleTexChanged, GFXStaticTextureProfile); - DECLARE_IMAGEASSET_NET_SETGET(WaterObject, RippleTex, TextureMask); + DECLARE_ASSET_NET_SETGET(WaterObject, RippleTex, TextureMask); DECLARE_IMAGEASSET(WaterObject, FoamTex, onFoamTexChanged, GFXStaticTextureSRGBProfile); - DECLARE_IMAGEASSET_NET_SETGET(WaterObject, FoamTex, TextureMask); + DECLARE_ASSET_NET_SETGET(WaterObject, FoamTex, TextureMask); DECLARE_IMAGEASSET(WaterObject, DepthGradientTex, onDepthGradientTexChanged, GFXStaticTextureSRGBProfile); - DECLARE_IMAGEASSET_NET_SETGET(WaterObject, DepthGradientTex, TextureMask); + DECLARE_ASSET_NET_SETGET(WaterObject, DepthGradientTex, TextureMask); StringTableEntry mCubemapName; diff --git a/Engine/source/forest/forestItem.cpp b/Engine/source/forest/forestItem.cpp index 11d514b34..26624abb9 100644 --- a/Engine/source/forest/forestItem.cpp +++ b/Engine/source/forest/forestItem.cpp @@ -53,7 +53,7 @@ ForestItemData::ForestItemData() mTightnessCoefficient( 0.4f ), mDampingCoefficient( 0.7f ) { - INIT_SHAPEASSET(Shape); + INIT_ASSET(Shape); } void ForestItemData::initPersistFields() @@ -164,7 +164,7 @@ void ForestItemData::packData(BitStream* stream) stream->write( localName ); - PACKDATA_SHAPEASSET(Shape); + PACKDATA_ASSET(Shape); stream->writeFlag( mCollidable ); @@ -192,7 +192,7 @@ void ForestItemData::unpackData(BitStream* stream) char readBuffer[1024]; - UNPACKDATA_SHAPEASSET(Shape); + UNPACKDATA_ASSET(Shape); mCollidable = stream->readFlag(); diff --git a/Engine/source/forest/forestItem.h b/Engine/source/forest/forestItem.h index 0c7eb0697..2ffb9f9ab 100644 --- a/Engine/source/forest/forestItem.h +++ b/Engine/source/forest/forestItem.h @@ -63,7 +63,7 @@ protected: public: DECLARE_SHAPEASSET(ForestItemData, Shape, onShapeChanged); - DECLARE_SHAPEASSET_SETGET(ForestItemData, Shape); + DECLARE_ASSET_SETGET(ForestItemData, Shape); /// This is the radius used during placement to ensure /// the element isn't crowded up against other trees. diff --git a/Engine/source/gfx/sim/cubemapData.cpp b/Engine/source/gfx/sim/cubemapData.cpp index a6833de5c..3be7cfbda 100644 --- a/Engine/source/gfx/sim/cubemapData.cpp +++ b/Engine/source/gfx/sim/cubemapData.cpp @@ -44,10 +44,10 @@ CubemapData::CubemapData() for (U32 i = 0; i < 6; i++) { - INIT_IMAGEASSET_ARRAY(CubeMapFace, i); + INIT_ASSET_ARRAY(CubeMapFace, i); } - INIT_IMAGEASSET(CubeMap); + INIT_ASSET(CubeMap); } CubemapData::~CubemapData() diff --git a/Engine/source/gfx/sim/cubemapData.h b/Engine/source/gfx/sim/cubemapData.h index 7ec2e0fb5..c33cf7021 100644 --- a/Engine/source/gfx/sim/cubemapData.h +++ b/Engine/source/gfx/sim/cubemapData.h @@ -74,7 +74,7 @@ public: protected: DECLARE_IMAGEASSET(CubemapData, CubeMap, onCubemapChanged, GFXStaticTextureSRGBProfile); - DECLARE_IMAGEASSET_SETGET(CubemapData, CubeMap); + DECLARE_ASSET_SETGET(CubemapData, CubeMap); DECLARE_IMAGEASSET_ARRAY(CubemapData, CubeMapFace, GFXStaticTextureSRGBProfile, 6); DECLARE_IMAGEASSET_ARRAY_SETGET(CubemapData, CubeMapFace); diff --git a/Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp b/Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp index 91088b2a4..23c451fab 100644 --- a/Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp @@ -129,7 +129,7 @@ GuiBitmapButtonCtrl::GuiBitmapButtonCtrl() setExtent( 140, 30 ); mMasked = false; - INIT_IMAGEASSET(Bitmap); + INIT_ASSET(Bitmap); } //----------------------------------------------------------------------------- @@ -668,4 +668,4 @@ bool GuiBitmapButtonCtrl::pointInControl(const Point2I& parentCoordPoint) return Parent::pointInControl(parentCoordPoint); } -DEF_IMAGEASSET_BINDS(GuiBitmapButtonCtrl, Bitmap); +DEF_ASSET_BINDS(GuiBitmapButtonCtrl, Bitmap); diff --git a/Engine/source/gui/buttons/guiBitmapButtonCtrl.h b/Engine/source/gui/buttons/guiBitmapButtonCtrl.h index 59e7825f1..1791c563a 100644 --- a/Engine/source/gui/buttons/guiBitmapButtonCtrl.h +++ b/Engine/source/gui/buttons/guiBitmapButtonCtrl.h @@ -119,7 +119,7 @@ class GuiBitmapButtonCtrl : public GuiButtonCtrl BitmapMode mBitmapMode; DECLARE_IMAGEASSET(GuiBitmapButtonCtrl, Bitmap, onBitmapChange, GFXDefaultGUIProfile); - DECLARE_IMAGEASSET_SETGET(GuiBitmapButtonCtrl, Bitmap); + DECLARE_ASSET_SETGET(GuiBitmapButtonCtrl, Bitmap); /// alpha masking bool mMasked; diff --git a/Engine/source/gui/buttons/guiIconButtonCtrl.cpp b/Engine/source/gui/buttons/guiIconButtonCtrl.cpp index c0fb939ff..093c79cb7 100644 --- a/Engine/source/gui/buttons/guiIconButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiIconButtonCtrl.cpp @@ -85,7 +85,7 @@ ConsoleDocClass( GuiIconButtonCtrl, GuiIconButtonCtrl::GuiIconButtonCtrl() { - INIT_IMAGEASSET(Bitmap); + INIT_ASSET(Bitmap); mTextLocation = TextLocLeft; mIconLocation = IconLocLeft; mTextMargin = 4; @@ -412,4 +412,4 @@ void GuiIconButtonCtrl::renderBitmapArray(RectI &bounds, S32 state) } } -DEF_IMAGEASSET_BINDS(GuiIconButtonCtrl, Bitmap); +DEF_ASSET_BINDS(GuiIconButtonCtrl, Bitmap); diff --git a/Engine/source/gui/buttons/guiIconButtonCtrl.h b/Engine/source/gui/buttons/guiIconButtonCtrl.h index d2cf0b9bd..8196fef49 100644 --- a/Engine/source/gui/buttons/guiIconButtonCtrl.h +++ b/Engine/source/gui/buttons/guiIconButtonCtrl.h @@ -43,7 +43,7 @@ private: protected: DECLARE_IMAGEASSET(GuiIconButtonCtrl, Bitmap, onImageChanged, GFXTexturePersistentSRGBProfile); - DECLARE_IMAGEASSET_SETGET(GuiIconButtonCtrl, Bitmap); + DECLARE_ASSET_SETGET(GuiIconButtonCtrl, Bitmap); S32 mIconLocation; S32 mTextLocation; diff --git a/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp b/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp index 3f1b26f0c..f75a93d83 100644 --- a/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiToolboxButtonCtrl.cpp @@ -43,9 +43,9 @@ ConsoleDocClass( GuiToolboxButtonCtrl, //------------------------------------- GuiToolboxButtonCtrl::GuiToolboxButtonCtrl() { - INIT_IMAGEASSET(NormalBitmap); - INIT_IMAGEASSET(LoweredBitmap); - INIT_IMAGEASSET(HoverBitmap); + INIT_ASSET(NormalBitmap); + INIT_ASSET(LoweredBitmap); + INIT_ASSET(HoverBitmap); setMinExtent(Point2I(16,16)); setExtent(48, 48); @@ -193,6 +193,6 @@ void GuiToolboxButtonCtrl::renderButton(GFXTexHandle &texture, Point2I &offset, } } -DEF_IMAGEASSET_BINDS(GuiToolboxButtonCtrl, NormalBitmap); -DEF_IMAGEASSET_BINDS(GuiToolboxButtonCtrl, LoweredBitmap); -DEF_IMAGEASSET_BINDS(GuiToolboxButtonCtrl, HoverBitmap); +DEF_ASSET_BINDS(GuiToolboxButtonCtrl, NormalBitmap); +DEF_ASSET_BINDS(GuiToolboxButtonCtrl, LoweredBitmap); +DEF_ASSET_BINDS(GuiToolboxButtonCtrl, HoverBitmap); diff --git a/Engine/source/gui/buttons/guiToolboxButtonCtrl.h b/Engine/source/gui/buttons/guiToolboxButtonCtrl.h index ec2b56711..8741cdee9 100644 --- a/Engine/source/gui/buttons/guiToolboxButtonCtrl.h +++ b/Engine/source/gui/buttons/guiToolboxButtonCtrl.h @@ -40,11 +40,11 @@ private: protected: DECLARE_IMAGEASSET(GuiToolboxButtonCtrl, NormalBitmap, onNormalImageChanged, GFXTexturePersistentSRGBProfile); - DECLARE_IMAGEASSET_SETGET(GuiToolboxButtonCtrl, NormalBitmap); + DECLARE_ASSET_SETGET(GuiToolboxButtonCtrl, NormalBitmap); DECLARE_IMAGEASSET(GuiToolboxButtonCtrl, LoweredBitmap, onLoweredImageChanged, GFXTexturePersistentSRGBProfile); - DECLARE_IMAGEASSET_SETGET(GuiToolboxButtonCtrl, LoweredBitmap); + DECLARE_ASSET_SETGET(GuiToolboxButtonCtrl, LoweredBitmap); DECLARE_IMAGEASSET(GuiToolboxButtonCtrl, HoverBitmap, onHoverImageChanged, GFXTexturePersistentSRGBProfile); - DECLARE_IMAGEASSET_SETGET(GuiToolboxButtonCtrl, HoverBitmap); + DECLARE_ASSET_SETGET(GuiToolboxButtonCtrl, HoverBitmap); void renderButton(GFXTexHandle &texture, Point2I &offset, const RectI& updateRect); void renderStateRect( GFXTexHandle &texture, const RectI& rect ); diff --git a/Engine/source/gui/controls/guiBitmapCtrl.cpp b/Engine/source/gui/controls/guiBitmapCtrl.cpp index 1b158d435..89e8ecbb3 100644 --- a/Engine/source/gui/controls/guiBitmapCtrl.cpp +++ b/Engine/source/gui/controls/guiBitmapCtrl.cpp @@ -60,7 +60,7 @@ GuiBitmapCtrl::GuiBitmapCtrl(void) mColor(ColorI::WHITE), mWrap( false ) { - INIT_IMAGEASSET(Bitmap); + INIT_ASSET(Bitmap); } bool GuiBitmapCtrl::setBitmapName( void *object, const char *index, const char *data ) diff --git a/Engine/source/gui/controls/guiBitmapCtrl.h b/Engine/source/gui/controls/guiBitmapCtrl.h index 05f4ca047..c5e2130dd 100644 --- a/Engine/source/gui/controls/guiBitmapCtrl.h +++ b/Engine/source/gui/controls/guiBitmapCtrl.h @@ -40,7 +40,7 @@ class GuiBitmapCtrl : public GuiControl /// Name of the bitmap file. If this is 'texhandle' the bitmap is not loaded /// from a file but rather set explicitly on the control. DECLARE_IMAGEASSET(GuiBitmapCtrl, Bitmap, onImageChanged, GFXDefaultGUIProfile); - DECLARE_IMAGEASSET_SETGET(GuiBitmapCtrl, Bitmap); + DECLARE_ASSET_SETGET(GuiBitmapCtrl, Bitmap); Point2I mStartPoint; ColorI mColor; diff --git a/Engine/source/gui/controls/guiMaterialCtrl.cpp b/Engine/source/gui/controls/guiMaterialCtrl.cpp index 34c0243a9..6d177767f 100644 --- a/Engine/source/gui/controls/guiMaterialCtrl.cpp +++ b/Engine/source/gui/controls/guiMaterialCtrl.cpp @@ -45,7 +45,7 @@ ConsoleDocClass( GuiMaterialCtrl, GuiMaterialCtrl::GuiMaterialCtrl() : mMaterialInst( NULL ) { - INIT_MATERIALASSET(Material); + INIT_ASSET(Material); } void GuiMaterialCtrl::initPersistFields() diff --git a/Engine/source/gui/controls/guiMaterialCtrl.h b/Engine/source/gui/controls/guiMaterialCtrl.h index bafbdf0eb..ff0b44efa 100644 --- a/Engine/source/gui/controls/guiMaterialCtrl.h +++ b/Engine/source/gui/controls/guiMaterialCtrl.h @@ -41,7 +41,7 @@ private: protected: DECLARE_MATERIALASSET(GuiMaterialCtrl, Material); - DECLARE_MATERIALASSET_SETGET(GuiMaterialCtrl, Material); + DECLARE_ASSET_SETGET(GuiMaterialCtrl, Material); BaseMatInstance *mMaterialInst; diff --git a/Engine/source/gui/controls/guiPopUpCtrl.cpp b/Engine/source/gui/controls/guiPopUpCtrl.cpp index 0cd08dfb8..47abbc17c 100644 --- a/Engine/source/gui/controls/guiPopUpCtrl.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrl.cpp @@ -278,8 +278,8 @@ GuiPopUpMenuCtrl::GuiPopUpMenuCtrl(void) mBackgroundCancel = false; // Added mReverseTextList = false; // Added - Don't reverse text list if displaying up - INIT_IMAGEASSET_ARRAY(Bitmap, 0); - INIT_IMAGEASSET_ARRAY(Bitmap, 1); + INIT_ASSET_ARRAY(Bitmap, 0); + INIT_ASSET_ARRAY(Bitmap, 1); mBitmapBounds.set(16, 16); // Added mIdMax = -1; diff --git a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp index 5cbd1e3bc..852424075 100644 --- a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp @@ -329,8 +329,8 @@ GuiPopUpMenuCtrlEx::GuiPopUpMenuCtrlEx(void) mBackgroundCancel = false; // Added mReverseTextList = false; // Added - Don't reverse text list if displaying up - INIT_IMAGEASSET_ARRAY(Bitmap, Normal); - INIT_IMAGEASSET_ARRAY(Bitmap, Depressed); + INIT_ASSET_ARRAY(Bitmap, Normal); + INIT_ASSET_ARRAY(Bitmap, Depressed); mBitmapBounds.set(16, 16); // Added mHotTrackItems = false; diff --git a/Engine/source/gui/core/guiControl.cpp b/Engine/source/gui/core/guiControl.cpp index 2011aa68b..d312c7610 100644 --- a/Engine/source/gui/core/guiControl.cpp +++ b/Engine/source/gui/core/guiControl.cpp @@ -2898,7 +2898,7 @@ static ConsoleDocFragment _sGuiControlSetExtent2( "GuiControl", // The class to place the method in; use NULL for functions. "void setExtent( Point2I p );" ); // The definition string. -DefineEngineMethod( GuiControl, setExtent, void, ( const char* extOrX, const char* y ), (""), +DefineEngineMethod( GuiControl, setExtent, void, ( const char* extOrX, const char* y ), ("", nullAsType()), "( Point2I p | int x, int y ) Set the width and height of the control.\n\n" "@hide" ) { diff --git a/Engine/source/gui/core/guiTypes.cpp b/Engine/source/gui/core/guiTypes.cpp index 59fc8b854..d4575d21a 100644 --- a/Engine/source/gui/core/guiTypes.cpp +++ b/Engine/source/gui/core/guiTypes.cpp @@ -79,7 +79,7 @@ GuiCursor::GuiCursor() mRenderOffset.set(0.0f,0.0f); mExtent.set(1,1); - INIT_IMAGEASSET(Bitmap); + INIT_ASSET(Bitmap); } GuiCursor::~GuiCursor() @@ -324,7 +324,7 @@ GuiControlProfile::GuiControlProfile(void) : mMouseOverSelected = false; // bitmap members - INIT_IMAGEASSET(Bitmap); + INIT_ASSET(Bitmap); mUseBitmapArray = false; mChildrenProfileName = NULL; diff --git a/Engine/source/gui/core/guiTypes.h b/Engine/source/gui/core/guiTypes.h index 23fa13246..c82c2fd50 100644 --- a/Engine/source/gui/core/guiTypes.h +++ b/Engine/source/gui/core/guiTypes.h @@ -345,7 +345,7 @@ private: typedef SimObject Parent; DECLARE_IMAGEASSET(GuiCursor, Bitmap, onImageChanged, GFXGuiCursorProfile); - DECLARE_IMAGEASSET_SETGET(GuiCursor, Bitmap); + DECLARE_ASSET_SETGET(GuiCursor, Bitmap); Point2I mHotSpot; Point2F mRenderOffset; @@ -555,7 +555,7 @@ public: { return mBitmap; } - DECLARE_IMAGEASSET_SETGET(GuiControlProfile, Bitmap); + DECLARE_ASSET_SETGET(GuiControlProfile, Bitmap); void onBitmapChanged() {} diff --git a/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp b/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp index 138488f05..90e940e07 100644 --- a/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp +++ b/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp @@ -87,7 +87,7 @@ DefineEngineMethod( GuiChunkedBitmapCtrl, setBitmap, void, (const char* filename GuiChunkedBitmapCtrl::GuiChunkedBitmapCtrl() { - INIT_IMAGEASSET(Bitmap); + INIT_ASSET(Bitmap); mUseVariable = false; mTile = false; diff --git a/Engine/source/gui/game/guiChunkedBitmapCtrl.h b/Engine/source/gui/game/guiChunkedBitmapCtrl.h index 037eb91f6..f5d3405b8 100644 --- a/Engine/source/gui/game/guiChunkedBitmapCtrl.h +++ b/Engine/source/gui/game/guiChunkedBitmapCtrl.h @@ -18,7 +18,7 @@ private: protected: DECLARE_IMAGEASSET(GuiChunkedBitmapCtrl, Bitmap, onImageChanged, GFXDefaultGUIProfile); - DECLARE_IMAGEASSET_SETGET(GuiChunkedBitmapCtrl, Bitmap); + DECLARE_ASSET_SETGET(GuiChunkedBitmapCtrl, Bitmap); bool mUseVariable; bool mTile; diff --git a/Engine/source/gui/game/guiProgressBitmapCtrl.cpp b/Engine/source/gui/game/guiProgressBitmapCtrl.cpp index 0d0baa483..0faf2a8e0 100644 --- a/Engine/source/gui/game/guiProgressBitmapCtrl.cpp +++ b/Engine/source/gui/game/guiProgressBitmapCtrl.cpp @@ -124,7 +124,7 @@ GuiProgressBitmapCtrl::GuiProgressBitmapCtrl() mNumberOfBitmaps(0), mDim(0) { - INIT_IMAGEASSET(Bitmap); + INIT_ASSET(Bitmap); } //----------------------------------------------------------------------------- diff --git a/Engine/source/gui/game/guiProgressBitmapCtrl.h b/Engine/source/gui/game/guiProgressBitmapCtrl.h index e391f7b72..fba8aaa3c 100644 --- a/Engine/source/gui/game/guiProgressBitmapCtrl.h +++ b/Engine/source/gui/game/guiProgressBitmapCtrl.h @@ -48,7 +48,7 @@ class GuiProgressBitmapCtrl : public GuiTextCtrl F32 mProgress; DECLARE_IMAGEASSET(GuiProgressBitmapCtrl, Bitmap, onImageChanged, GFXDefaultGUIProfile); - DECLARE_IMAGEASSET_SETGET(GuiProgressBitmapCtrl, Bitmap); + DECLARE_ASSET_SETGET(GuiProgressBitmapCtrl, Bitmap); bool mUseVariable; bool mTile; diff --git a/Engine/source/gui/worldEditor/guiMissionArea.cpp b/Engine/source/gui/worldEditor/guiMissionArea.cpp index cd9c82ac9..a17b5a4ab 100644 --- a/Engine/source/gui/worldEditor/guiMissionArea.cpp +++ b/Engine/source/gui/worldEditor/guiMissionArea.cpp @@ -59,7 +59,7 @@ ConsoleDocClass( GuiMissionAreaCtrl, GuiMissionAreaCtrl::GuiMissionAreaCtrl() { - INIT_IMAGEASSET(HandleBitmap); + INIT_ASSET(HandleBitmap); mHandleTextureSize = Point2I::Zero; mHandleTextureHalfSize = Point2F::Zero; diff --git a/Engine/source/gui/worldEditor/guiMissionArea.h b/Engine/source/gui/worldEditor/guiMissionArea.h index 885f85107..c14438ac6 100644 --- a/Engine/source/gui/worldEditor/guiMissionArea.h +++ b/Engine/source/gui/worldEditor/guiMissionArea.h @@ -64,7 +64,7 @@ protected: GFXStateBlockRef mSolidStateBlock; DECLARE_IMAGEASSET(GuiMissionAreaCtrl, HandleBitmap, onHandleBitmapChanged, GFXTexturePersistentSRGBProfile); - DECLARE_IMAGEASSET_SETGET(GuiMissionAreaCtrl, HandleBitmap); + DECLARE_ASSET_SETGET(GuiMissionAreaCtrl, HandleBitmap); Point2I mHandleTextureSize; Point2F mHandleTextureHalfSize; diff --git a/Engine/source/gui/worldEditor/worldEditor.h b/Engine/source/gui/worldEditor/worldEditor.h index dd596af74..a94fe068d 100644 --- a/Engine/source/gui/worldEditor/worldEditor.h +++ b/Engine/source/gui/worldEditor/worldEditor.h @@ -329,11 +329,11 @@ class WorldEditor : public EditTSCtrl ColorI mPopupTextColor; DECLARE_IMAGEASSET(WorldEditor, SelectHandle, onSelectHandleChanged, GFXStaticTextureSRGBProfile); - DECLARE_IMAGEASSET_SETGET(WorldEditor, SelectHandle); + DECLARE_ASSET_SETGET(WorldEditor, SelectHandle); DECLARE_IMAGEASSET(WorldEditor, DefaultHandle, onDefaultHandleChanged, GFXStaticTextureSRGBProfile); - DECLARE_IMAGEASSET_SETGET(WorldEditor, DefaultHandle); + DECLARE_ASSET_SETGET(WorldEditor, DefaultHandle); DECLARE_IMAGEASSET(WorldEditor, LockedHandle, onLockedHandleChanged, GFXStaticTextureSRGBProfile); - DECLARE_IMAGEASSET_SETGET(WorldEditor, LockedHandle); + DECLARE_ASSET_SETGET(WorldEditor, LockedHandle); ColorI mObjectTextColor; bool mObjectsUseBoxCenter; diff --git a/Engine/source/materials/materialDefinition.cpp b/Engine/source/materials/materialDefinition.cpp index 7eb49ffc0..823072c4f 100644 --- a/Engine/source/materials/materialDefinition.cpp +++ b/Engine/source/materials/materialDefinition.cpp @@ -142,18 +142,18 @@ Material::Material() mAccuCoverage[i] = 0.9f; mAccuSpecular[i] = 16.0f; - INIT_IMAGEASSET_ARRAY(DiffuseMap, i); - INIT_IMAGEASSET_ARRAY(OverlayMap, i); - INIT_IMAGEASSET_ARRAY(LightMap, i); - INIT_IMAGEASSET_ARRAY(ToneMap, i); - INIT_IMAGEASSET_ARRAY(DetailMap, i); - INIT_IMAGEASSET_ARRAY(NormalMap, i); - INIT_IMAGEASSET_ARRAY(ORMConfigMap, i); - INIT_IMAGEASSET_ARRAY(RoughMap, i); - INIT_IMAGEASSET_ARRAY(AOMap, i); - INIT_IMAGEASSET_ARRAY(MetalMap, i); - INIT_IMAGEASSET_ARRAY(GlowMap, i); - INIT_IMAGEASSET_ARRAY(DetailNormalMap, i); + INIT_ASSET_ARRAY(DiffuseMap, i); + INIT_ASSET_ARRAY(OverlayMap, i); + INIT_ASSET_ARRAY(LightMap, i); + INIT_ASSET_ARRAY(ToneMap, i); + INIT_ASSET_ARRAY(DetailMap, i); + INIT_ASSET_ARRAY(NormalMap, i); + INIT_ASSET_ARRAY(ORMConfigMap, i); + INIT_ASSET_ARRAY(RoughMap, i); + INIT_ASSET_ARRAY(AOMap, i); + INIT_ASSET_ARRAY(MetalMap, i); + INIT_ASSET_ARRAY(GlowMap, i); + INIT_ASSET_ARRAY(DetailNormalMap, i); mParallaxScale[i] = 0.0f; diff --git a/Engine/source/postFx/postEffect.cpp b/Engine/source/postFx/postEffect.cpp index a9587c4aa..2f87ffa67 100644 --- a/Engine/source/postFx/postEffect.cpp +++ b/Engine/source/postFx/postEffect.cpp @@ -508,7 +508,7 @@ PostEffect::PostEffect() for (U32 i = 0; i < NumTextures; i++) { - INIT_IMAGEASSET_ARRAY(Texture, i); + INIT_ASSET_ARRAY(Texture, i); } } diff --git a/Engine/source/terrain/terrMaterial.cpp b/Engine/source/terrain/terrMaterial.cpp index 06b3b27bd..8a7683078 100644 --- a/Engine/source/terrain/terrMaterial.cpp +++ b/Engine/source/terrain/terrMaterial.cpp @@ -73,11 +73,11 @@ TerrainMaterial::TerrainMaterial() mIsSRGB(false), mInvertRoughness(false) { - INIT_IMAGEASSET(DiffuseMap); - INIT_IMAGEASSET(NormalMap); - INIT_IMAGEASSET(DetailMap); - INIT_IMAGEASSET(ORMConfigMap); - INIT_IMAGEASSET(MacroMap); + INIT_ASSET(DiffuseMap); + INIT_ASSET(NormalMap); + INIT_ASSET(DetailMap); + INIT_ASSET(ORMConfigMap); + INIT_ASSET(MacroMap); } TerrainMaterial::~TerrainMaterial() @@ -203,8 +203,8 @@ TerrainMaterial* TerrainMaterial::findOrCreate( const char *nameOrPath ) //material.getDiffuseMap(); //returns the raw file referenced //material.getDiffuseMapAsset(); //returns the asset id //material.setDiffuseMap(%texture); //tries to set the asset and failing that attempts a flat file reference -DEF_IMAGEASSET_BINDS(TerrainMaterial, DiffuseMap); -DEF_IMAGEASSET_BINDS(TerrainMaterial, NormalMap); -DEF_IMAGEASSET_BINDS(TerrainMaterial, DetailMap); -DEF_IMAGEASSET_BINDS(TerrainMaterial, ORMConfigMap); -DEF_IMAGEASSET_BINDS(TerrainMaterial, MacroMap); +DEF_ASSET_BINDS(TerrainMaterial, DiffuseMap); +DEF_ASSET_BINDS(TerrainMaterial, NormalMap); +DEF_ASSET_BINDS(TerrainMaterial, DetailMap); +DEF_ASSET_BINDS(TerrainMaterial, ORMConfigMap); +DEF_ASSET_BINDS(TerrainMaterial, MacroMap); diff --git a/Engine/source/terrain/terrMaterial.h b/Engine/source/terrain/terrMaterial.h index daf111321..4e129ef73 100644 --- a/Engine/source/terrain/terrMaterial.h +++ b/Engine/source/terrain/terrMaterial.h @@ -43,7 +43,7 @@ protected: //AssetPtr mDiffuseAsset; DECLARE_IMAGEASSET(TerrainMaterial, DiffuseMap, onDiffuseMapChanged, GFXStaticTextureSRGBProfile); - DECLARE_IMAGEASSET_SETGET(TerrainMaterial, DiffuseMap); + DECLARE_ASSET_SETGET(TerrainMaterial, DiffuseMap); /// The size of the diffuse base map in meters /// used to generate its texture coordinates. @@ -51,11 +51,11 @@ protected: /// DECLARE_IMAGEASSET(TerrainMaterial, NormalMap, onNormalMapChanged, GFXNormalMapProfile); - DECLARE_IMAGEASSET_SETGET(TerrainMaterial, NormalMap); + DECLARE_ASSET_SETGET(TerrainMaterial, NormalMap); /// DECLARE_IMAGEASSET(TerrainMaterial, DetailMap, onDetailMapChanged, GFXStaticTextureProfile); - DECLARE_IMAGEASSET_SETGET(TerrainMaterial, DetailMap); + DECLARE_ASSET_SETGET(TerrainMaterial, DetailMap); /// The size of the detail map in meters used /// to generate the texture coordinates for the @@ -70,7 +70,7 @@ protected: /// DECLARE_IMAGEASSET(TerrainMaterial, ORMConfigMap, onORMConfigMapChanged, GFXStaticTextureProfile); - DECLARE_IMAGEASSET_SETGET(TerrainMaterial, ORMConfigMap); + DECLARE_ASSET_SETGET(TerrainMaterial, ORMConfigMap); bool mIsSRGB; bool mInvertRoughness; @@ -82,7 +82,7 @@ protected: bool mSideProjection; DECLARE_IMAGEASSET(TerrainMaterial, MacroMap, onMacroMapChanged, GFXStaticTextureProfile); - DECLARE_IMAGEASSET_SETGET(TerrainMaterial, MacroMap); + DECLARE_ASSET_SETGET(TerrainMaterial, MacroMap); F32 mMacroSize; F32 mMacroStrength; F32 mMacroDistance; From ab1b14587e322230da9261e3a00890be858198a5 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 3 Oct 2021 15:19:04 -0500 Subject: [PATCH 145/399] generic asset loader macros. currently unused --- Engine/source/T3D/assets/assetMacroHelpers.h | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Engine/source/T3D/assets/assetMacroHelpers.h b/Engine/source/T3D/assets/assetMacroHelpers.h index 42f51e8e8..ef37cd7d5 100644 --- a/Engine/source/T3D/assets/assetMacroHelpers.h +++ b/Engine/source/T3D/assets/assetMacroHelpers.h @@ -34,6 +34,18 @@ m##name##Asset = NULL;\ m##name = NULL; +//load asset into memory by looking up the ID, spew a warning if anything goes wrong +#define LOAD_ASSET(name, assetClass)\ +if (m##name##AssetId != StringTable->EmptyString())\ +{\ + S32 assetState = assetClass::getAssetById(m##name##AssetId, &m##name##Asset);\ + if (assetState == assetClass::Ok )\ + {\ + m##name##Name = StringTable->EmptyString();\ + }\ + else Con::warnf("Warning: %s::LOAD_ASSET(%s)-%s", mClassName, m##name##AssetId, assetClass::getAssetErrstrn(assetState).c_str());\ +} + // copy constructor #define CLONE_ASSET(name) \ m##name##Name = other.m##name##Name;\ @@ -134,6 +146,18 @@ DefineEngineMethod(className, set##name, bool, (const char* assetName), , assetT m##name[index] = NULL;\ } +//load asset into memory by looking up the ID, spew a warning if anything goes wrong +#define LOAD_ASSET_ARRAY(name, index, assetClass)\ +if (m##name##AssetId[index] != StringTable->EmptyString())\ +{\ + S32 assetState = assetClass::getAssetById(m##name##AssetId[index], &m##name##Asset[index]);\ + if (assetState == assetClass::Ok )\ + {\ + m##name##Name[index] = StringTable->EmptyString();\ + }\ + else Con::warnf("Warning: %s::LOAD_ASSET(%s[%d])-%s", mClassName, m##name##AssetId[index],index, assetClass::getAssetErrstrn(assetState).c_str());\ +} + // copy constructor #define CLONE_ASSET_ARRAY(name, index) \ {\ From 42d137f4a9513c395f281d849dbbf887ec9443b5 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 3 Oct 2021 15:20:08 -0500 Subject: [PATCH 146/399] DECLARE_ASSET_ARRAY_SETGET is incompatible with INITPERSISTFIELD_SOUNDASSET_ENUMED --- Engine/source/T3D/vehicles/hoverVehicle.h | 1 - Engine/source/T3D/vehicles/vehicle.h | 2 -- Engine/source/T3D/vehicles/wheeledVehicle.h | 1 - 3 files changed, 4 deletions(-) diff --git a/Engine/source/T3D/vehicles/hoverVehicle.h b/Engine/source/T3D/vehicles/hoverVehicle.h index 8e7cce79b..8f666a76a 100644 --- a/Engine/source/T3D/vehicles/hoverVehicle.h +++ b/Engine/source/T3D/vehicles/hoverVehicle.h @@ -47,7 +47,6 @@ class HoverVehicleData : public VehicleData MaxSounds }; DECLARE_SOUNDASSET_ARRAY(HoverVehicleData, HoverSounds, Sounds::MaxSounds); - DECLARE_ASSET_ARRAY_SETGET(HoverVehicleData, HoverSounds); SFXProfile* getHoverSoundProfile(U32 id) { if (mHoverSoundsAsset[id] != NULL) diff --git a/Engine/source/T3D/vehicles/vehicle.h b/Engine/source/T3D/vehicles/vehicle.h index c9a50b831..2e6440662 100644 --- a/Engine/source/T3D/vehicles/vehicle.h +++ b/Engine/source/T3D/vehicles/vehicle.h @@ -50,7 +50,6 @@ struct VehicleData : public RigidShapeData } body; DECLARE_SOUNDASSET_ARRAY(VehicleData, VehicleBodySounds, Body::Sounds::MaxSounds) - DECLARE_ASSET_ARRAY_SETGET(VehicleData, VehicleBodySounds); SFXProfile* getVehicleBodySoundProfile(U32 id) { @@ -82,7 +81,6 @@ struct VehicleData : public RigidShapeData }; DECLARE_SOUNDASSET_ARRAY(VehicleData, VehicleWaterSounds, Sounds::MaxSounds) - DECLARE_ASSET_ARRAY_SETGET(VehicleData, VehicleWaterSounds); SFXProfile* getVehicleWaterSoundProfile(U32 id) { diff --git a/Engine/source/T3D/vehicles/wheeledVehicle.h b/Engine/source/T3D/vehicles/wheeledVehicle.h index c8759e52d..56f5997a9 100644 --- a/Engine/source/T3D/vehicles/wheeledVehicle.h +++ b/Engine/source/T3D/vehicles/wheeledVehicle.h @@ -120,7 +120,6 @@ struct WheeledVehicleData: public VehicleData }; DECLARE_SOUNDASSET_ARRAY(WheeledVehicleData, WheeledVehicleSounds, Sounds::MaxSounds); - DECLARE_ASSET_ARRAY_SETGET(WheeledVehicleData, WheeledVehicleSounds); SFXProfile* getWheeledVehicleSound(U32 id) { From 67c889279dbbd27671ef45c4df3ca1dbd97091c4 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 3 Oct 2021 17:42:32 -0500 Subject: [PATCH 147/399] fix groundplane material reference in examplelevel --- .../BaseGame/game/data/ExampleModule/levels/ExampleLevel.mis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Templates/BaseGame/game/data/ExampleModule/levels/ExampleLevel.mis b/Templates/BaseGame/game/data/ExampleModule/levels/ExampleLevel.mis index ba5384a96..e2b9ce7d1 100644 --- a/Templates/BaseGame/game/data/ExampleModule/levels/ExampleLevel.mis +++ b/Templates/BaseGame/game/data/ExampleModule/levels/ExampleLevel.mis @@ -36,7 +36,7 @@ new Scene(EditorTemplateLevel) { squareSize = "128"; scaleU = "25"; scaleV = "25"; - MaterialFile = "FloorGray"; + MaterialAsset = "Prototyping:FloorGray"; canSave = "1"; canSaveDynamicFields = "1"; Enabled = "1"; From a1117b1c41ad728311c82aa558598971dedf8788 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 3 Oct 2021 21:51:40 -0500 Subject: [PATCH 148/399] add getInWorldNormal method glsl side --- .../shaderGen/GLSL/shaderFeatureGLSL.cpp | 35 +++++++++++++------ .../source/shaderGen/GLSL/shaderFeatureGLSL.h | 1 + 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp index e9604eb77..73bb56fd1 100644 --- a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp +++ b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp @@ -765,6 +765,21 @@ Var* ShaderFeatureGLSL::getWsView( Var *wsPosition, MultiLine *meta ) return wsView; } +Var* ShaderFeatureGLSL::getInWorldNormal(Vector& componentList) +{ + Var* wsNormal = (Var*)LangElement::find("wsNormal"); + if (!wsNormal) + { + ShaderConnector* connectComp = dynamic_cast(componentList[C_CONNECTOR]); + wsNormal = connectComp->getElement(RT_TEXCOORD); + wsNormal->setName("wsNormal"); + wsNormal->setStructName("IN"); + wsNormal->setType("float3"); + } + + return wsNormal; +} + Var* ShaderFeatureGLSL::addOutDetailTexCoord( Vector &componentList, MultiLine *meta, bool useTexAnim, @@ -851,21 +866,23 @@ Var* ShaderFeatureGLSL::getSurface(Vector& componentList, Mult meta->addStatement(new GenOp(" @ = vec4(0.0,1.0,@,@);\r\n", colorDecl, roughness, metalness)); //reconstruct ormConfig, no ao darkening } - Var* wsNormal = (Var*)LangElement::find("wsNormal"); Var* normal = (Var*)LangElement::find("normal"); if (!normal) { normal = new Var("normal", "vec3"); meta->addStatement(new GenOp(" @;\r\n\n", new DecOp(normal))); + + Var* wsNormal = (Var*)LangElement::find("wsNormal"); if (!fd.features[MFT_NormalMap]) { - Var* worldToTangent = getInWorldToTangent(componentList); - meta->addStatement(new GenOp(" @ = normalize(tMul(@,vec3(0,0,1.0f)));\r\n\n", normal, worldToTangent)); + if (!wsNormal) + wsNormal = getInWorldNormal(componentList); + meta->addStatement(new GenOp(" @ = normalize( @ );\r\n\n", normal, wsNormal)); } else { - meta->addStatement(new GenOp(" @ = normalize( half3( @ ) );\r\n", normal, wsNormal)); - } + meta->addStatement(new GenOp(" @ = normalize( @ );\r\n", normal, wsNormal)); + } } Var* wsEyePos = (Var*)LangElement::find("eyePosWorld"); @@ -2142,14 +2159,10 @@ void RTLightingFeatGLSL::processPix( Vector &componentList, // Now the wsPosition and wsView. Var *wsPosition = getInWsPosition( componentList ); + Var* worldToTangent = getInWorldToTangent(componentList); + Var* wsNormal = getInWorldNormal(componentList); Var *wsView = getWsView( wsPosition, meta ); - // Create temporaries to hold results of lighting. - Var *rtShading = new Var( "rtShading", "vec4" ); - Var *specular = new Var( "specular", "vec4" ); - meta->addStatement( new GenOp( " @; @;\r\n", - new DecOp( rtShading ), new DecOp( specular ) ) ); - // Look for a light mask generated from a previous // feature (this is done for BL terrain lightmaps). LangElement *lightMask = LangElement::find( "lightMask" ); diff --git a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.h b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.h index 24a2a8115..d4dbb1886 100644 --- a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.h +++ b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.h @@ -137,6 +137,7 @@ public: MultiLine *meta ); Var* getSurface(Vector& componentList, MultiLine* meta, const MaterialFeatureData& fd); + Var* getInWorldNormal(Vector& componentList); // ShaderFeature Var* getVertTexCoord( const String &name ); From 661a192e878a951ac10d0d2f715e352fd5e57ba4 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 3 Oct 2021 21:53:16 -0500 Subject: [PATCH 149/399] orderfix for RTLightingFeatHLSL vert vs pixel shader. the order needs to match, same as network comunicating --- Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp index dfdb5439c..ecd4619d0 100644 --- a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp +++ b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp @@ -879,12 +879,10 @@ Var* ShaderFeatureHLSL::getSurface(Vector& componentList, Mult meta->addStatement(new GenOp(" @;\r\n\n", new DecOp(normal))); Var* wsNormal = (Var*)LangElement::find("wsNormal"); - if (!fd.features[MFT_NormalMap]) { if (!wsNormal) wsNormal = getInWorldNormal(componentList); - meta->addStatement(new GenOp(" @ = normalize( @ );\r\n\n", normal, wsNormal)); } else @@ -2227,10 +2225,9 @@ void RTLightingFeatHLSL::processPix( Vector &componentList, MultiLine *meta = new MultiLine; // Now the wsPosition and wsView. - Var* worldToTangent = getInWorldToTangent(componentList); - Var* wsNormal = getInWorldNormal(componentList); Var *wsPosition = getInWsPosition( componentList ); - + Var* worldToTangent = getInWorldToTangent(componentList); + Var* wsNormal = getInWorldNormal(componentList); Var *wsView = getWsView( wsPosition, meta ); // Look for a light mask generated from a previous From 79ad78361d75e8f233a7504b949836d803ffc4fd Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 4 Oct 2021 18:24:33 -0500 Subject: [PATCH 150/399] item->importStatus cleanup for asset importer --- Engine/source/T3D/assets/assetImporter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/T3D/assets/assetImporter.cpp b/Engine/source/T3D/assets/assetImporter.cpp index 5df1ca8ab..254df381d 100644 --- a/Engine/source/T3D/assets/assetImporter.cpp +++ b/Engine/source/T3D/assets/assetImporter.cpp @@ -1409,7 +1409,7 @@ void AssetImporter::processImportAssets(AssetImportObject* assetItem) Con::executef(this, processCommand.c_str(), item); } - item->importStatus == AssetImportObject::Processed; + item->importStatus = AssetImportObject::Processed; //try recusing on the children(if any) processImportAssets(item); @@ -2018,7 +2018,7 @@ void AssetImporter::validateAsset(AssetImportObject* assetItem) AssetQuery aQuery; U32 numAssetsFound = AssetDatabase.findAllAssets(&aQuery); - bool hasCollision = false; + hasCollision = false; for (U32 i = 0; i < numAssetsFound; i++) { StringTableEntry assetId = aQuery.mAssetList[i]; From 1b6b803a20d7f58f639ff2c09e7f8bf0e7b78742 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Mon, 4 Oct 2021 20:04:21 -0400 Subject: [PATCH 151/399] * BugFix: Clear a lot of warnings and correct a few actual programming errors along the way. --- Engine/lib/collada/include/dae.h | 2 +- .../lib/collada/include/dae/daeErrorHandler.h | 2 +- .../include/dae/daeStandardURIResolver.h | 2 +- .../lib/collada/src/dae/daeErrorHandler.cpp | 2 +- Engine/source/T3D/assets/MaterialAsset.cpp | 15 ++++--- Engine/source/T3D/assets/assetImporter.cpp | 2 +- Engine/source/T3D/assets/assetImporter.h | 9 ----- Engine/source/T3D/convexShape.cpp | 4 +- Engine/source/T3D/fx/particleEmitter.cpp | 12 +++++- Engine/source/T3D/fx/precipitation.cpp | 2 +- Engine/source/T3D/gameBase/gameConnection.cpp | 2 +- Engine/source/T3D/shapeBase.h | 2 +- Engine/source/afx/util/afxAnimCurve.h | 2 +- Engine/source/afx/util/afxCurveEval.h | 1 + Engine/source/afx/xm/afxXM_WaveBase.h | 3 +- Engine/source/collision/optimizedPolyList.h | 2 +- Engine/source/collision/polytope.h | 2 +- Engine/source/console/CMDscan.cpp | 40 +++++++++---------- Engine/source/console/arrayObject.cpp | 4 +- Engine/source/console/simObject.cpp | 4 +- Engine/source/core/stringBuffer.cpp | 2 +- Engine/source/core/strings/unicode.cpp | 4 +- Engine/source/core/util/hashFunction.h | 4 +- Engine/source/environment/decalRoad.cpp | 2 +- .../editors/guiMeshRoadEditorCtrl.cpp | 2 +- .../editors/guiRiverEditorCtrl.cpp | 2 +- .../environment/editors/guiRoadEditorCtrl.cpp | 2 +- Engine/source/environment/meshRoad.cpp | 4 +- Engine/source/environment/river.cpp | 2 +- Engine/source/gfx/bitmap/gBitmap.cpp | 4 +- .../source/gfx/bitmap/loaders/bitmapPng.cpp | 2 +- Engine/source/gfx/gl/gfxGLCubemap.cpp | 2 +- Engine/source/gfx/gl/gfxGLStateBlock.cpp | 4 +- Engine/source/gfx/gl/gfxGLTextureArray.cpp | 2 +- Engine/source/gfx/gl/gfxGLTextureArray.h | 2 +- Engine/source/gfx/gl/gfxGLTextureObject.cpp | 2 +- Engine/source/gfx/sim/cubemapData.cpp | 2 +- .../source/gfx/video/videoEncoderTheora.cpp | 2 +- Engine/source/gui/core/guiCanvas.cpp | 2 +- Engine/source/gui/editor/guiInspector.cpp | 4 +- .../source/gui/editor/guiShapeEdPreview.cpp | 6 +-- .../worldEditor/guiConvexShapeEditorCtrl.h | 2 +- .../source/gui/worldEditor/guiMissionArea.h | 2 +- .../source/gui/worldEditor/terrainActions.cpp | 2 +- .../advanced/advancedLightBinManager.h | 2 +- .../source/lighting/basic/blTerrainSystem.cpp | 4 +- .../source/materials/materialDefinition.cpp | 2 +- Engine/source/math/mRandom.h | 2 +- Engine/source/navigation/guiNavEditorCtrl.h | 2 +- Engine/source/persistence/taml/taml.cpp | 2 +- Engine/source/platform/platformNet.cpp | 2 +- Engine/source/platformSDL/sdlInput.cpp | 2 +- .../source/platformX86UNIX/x86UNIXFileio.cpp | 16 ++++---- .../renderInstance/renderImposterMgr.cpp | 2 +- .../renderInstance/renderPassStateToken.cpp | 2 +- .../scene/mixin/scenePolyhedralObject.impl.h | 6 +-- Engine/source/sim/actionMap.cpp | 2 +- Engine/source/sim/actionMap.h | 2 +- Engine/source/sim/netObject.cpp | 4 +- Engine/source/ts/tsShape.cpp | 6 +-- Engine/source/ts/tsShapeConstruct.cpp | 2 +- 61 files changed, 120 insertions(+), 118 deletions(-) diff --git a/Engine/lib/collada/include/dae.h b/Engine/lib/collada/include/dae.h index d6f217ed8..d5d16f125 100644 --- a/Engine/lib/collada/include/dae.h +++ b/Engine/lib/collada/include/dae.h @@ -195,7 +195,7 @@ private: daeRawRefCache rawRefCache; daeSidRefCache sidRefCache; - std::auto_ptr localCharEncoding; + std::unique_ptr localCharEncoding; static charEncoding globalCharEncoding; }; diff --git a/Engine/lib/collada/include/dae/daeErrorHandler.h b/Engine/lib/collada/include/dae/daeErrorHandler.h index 6d6499486..edc20ee31 100644 --- a/Engine/lib/collada/include/dae/daeErrorHandler.h +++ b/Engine/lib/collada/include/dae/daeErrorHandler.h @@ -60,7 +60,7 @@ public: private: static daeErrorHandler *_instance; - static std::auto_ptr _defaultInstance; + static std::unique_ptr _defaultInstance; }; #endif diff --git a/Engine/lib/collada/include/dae/daeStandardURIResolver.h b/Engine/lib/collada/include/dae/daeStandardURIResolver.h index 0c92bcc6e..6d9bcf15d 100644 --- a/Engine/lib/collada/include/dae/daeStandardURIResolver.h +++ b/Engine/lib/collada/include/dae/daeStandardURIResolver.h @@ -12,7 +12,7 @@ */ #ifndef __DAE_STANDARD_URI_RESOLVER__ -#define __DAE_STANDARD_URI_RESOVLER__ +#define __DAE_STANDARD_URI_RESOLVER__ #include #include "dae/daeURI.h" diff --git a/Engine/lib/collada/src/dae/daeErrorHandler.cpp b/Engine/lib/collada/src/dae/daeErrorHandler.cpp index 843bbbae3..2e7edcf9c 100644 --- a/Engine/lib/collada/src/dae/daeErrorHandler.cpp +++ b/Engine/lib/collada/src/dae/daeErrorHandler.cpp @@ -15,7 +15,7 @@ #include daeErrorHandler *daeErrorHandler::_instance = NULL; -std::auto_ptr daeErrorHandler::_defaultInstance(new stdErrPlugin); +std::unique_ptr daeErrorHandler::_defaultInstance(new stdErrPlugin); daeErrorHandler::daeErrorHandler() { } diff --git a/Engine/source/T3D/assets/MaterialAsset.cpp b/Engine/source/T3D/assets/MaterialAsset.cpp index 8fd2b6ecf..57008b025 100644 --- a/Engine/source/T3D/assets/MaterialAsset.cpp +++ b/Engine/source/T3D/assets/MaterialAsset.cpp @@ -19,7 +19,6 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. //----------------------------------------------------------------------------- -#pragma once #ifndef MATERIALASSET_H #include "MaterialAsset.h" @@ -171,10 +170,16 @@ void MaterialAsset::initializeAsset() if (Torque::FS::IsScriptFile(mScriptPath)) { if (!Sim::findObject(mMatDefinitionName)) - if (Con::executeFile(mScriptPath, false, false)) - mLoadedState = ScriptLoaded; - else - mLoadedState = Failed; + { + if (Con::executeFile(mScriptPath, false, false)) + { + mLoadedState = ScriptLoaded; + } + else + { + mLoadedState = Failed; + } + } } loadMaterial(); diff --git a/Engine/source/T3D/assets/assetImporter.cpp b/Engine/source/T3D/assets/assetImporter.cpp index 5df1ca8ab..c9ed8a211 100644 --- a/Engine/source/T3D/assets/assetImporter.cpp +++ b/Engine/source/T3D/assets/assetImporter.cpp @@ -1409,7 +1409,7 @@ void AssetImporter::processImportAssets(AssetImportObject* assetItem) Con::executef(this, processCommand.c_str(), item); } - item->importStatus == AssetImportObject::Processed; + item->importStatus = AssetImportObject::Processed; //try recusing on the children(if any) processImportAssets(item); diff --git a/Engine/source/T3D/assets/assetImporter.h b/Engine/source/T3D/assets/assetImporter.h index 0c176840a..b03c89c40 100644 --- a/Engine/source/T3D/assets/assetImporter.h +++ b/Engine/source/T3D/assets/assetImporter.h @@ -931,15 +931,6 @@ public: return imagePath; } - static inline const char* makeFullPath(const String& path) - { - char qualifiedFilePath[2048]; - - Platform::makeFullPathName(path.c_str(), qualifiedFilePath, sizeof(qualifiedFilePath)); - - return qualifiedFilePath; - } - // void setTargetModuleId(const String& moduleId) { targetModuleId = moduleId; } const String& getTargetModuleId() { return targetModuleId; } diff --git a/Engine/source/T3D/convexShape.cpp b/Engine/source/T3D/convexShape.cpp index 99f3f418a..e0184f2f4 100644 --- a/Engine/source/T3D/convexShape.cpp +++ b/Engine/source/T3D/convexShape.cpp @@ -318,10 +318,10 @@ void ConvexShape::initPersistFields() addGroup( "Internal" ); - addProtectedField( "surface", TypeRealString, NULL, &protectedSetSurface, &defaultProtectedGetFn, + addProtectedField( "surface", TypeRealString, 0, &protectedSetSurface, &defaultProtectedGetFn, "Do not modify, for internal use.", AbstractClassRep::FIELD_HideInInspectors ); - addProtectedField( "surfaceTexture", TypeRealString, NULL, &protectedSetSurfaceTexture, &defaultProtectedGetFn, + addProtectedField( "surfaceTexture", TypeRealString, 0, &protectedSetSurfaceTexture, &defaultProtectedGetFn, "Do not modify, for internal use.", AbstractClassRep::FIELD_HideInInspectors ); endGroup( "Internal" ); diff --git a/Engine/source/T3D/fx/particleEmitter.cpp b/Engine/source/T3D/fx/particleEmitter.cpp index 45acd1ecb..c60dc6d49 100644 --- a/Engine/source/T3D/fx/particleEmitter.cpp +++ b/Engine/source/T3D/fx/particleEmitter.cpp @@ -1914,7 +1914,11 @@ void ParticleEmitter::copyToVB( const Point3F &camPos, const LinearColorF &ambie { SortParticle* partPtr = orderedVector.address(); for (U32 i = 0; i < n_parts - 1; i++, partPtr++, buffPtr -= 4) - setupRibbon(partPtr->p, partPtr++->p, partPtr--->p, camPos, ambientColor, buffPtr); + { + SortParticle* part = partPtr; + partPtr++; + setupRibbon(part->p, partPtr->p, partPtr->p, camPos, ambientColor, buffPtr); + } } // do unsorted-oriented particles else @@ -1933,7 +1937,11 @@ void ParticleEmitter::copyToVB( const Point3F &camPos, const LinearColorF &ambie { SortParticle* partPtr = orderedVector.address(); for (U32 i = 0; i < n_parts - 1; i++, partPtr++, buffPtr += 4) - setupRibbon(partPtr->p, partPtr++->p, partPtr--->p, camPos, ambientColor, buffPtr); + { + SortParticle* part = partPtr; + partPtr++; + setupRibbon(part->p, partPtr->p, partPtr->p, camPos, ambientColor, buffPtr); + } } // do unsorted-oriented particles else diff --git a/Engine/source/T3D/fx/precipitation.cpp b/Engine/source/T3D/fx/precipitation.cpp index 4356cd45f..5740edae6 100644 --- a/Engine/source/T3D/fx/precipitation.cpp +++ b/Engine/source/T3D/fx/precipitation.cpp @@ -996,7 +996,7 @@ void Precipitation::initRenderObjects() // entire or a partially filled vb. mRainIB.set(GFX, mMaxVBDrops * 6, 0, GFXBufferTypeStatic); U16 *idxBuff; - mRainIB.lock(&idxBuff, NULL, NULL, NULL); + mRainIB.lock(&idxBuff, NULL, 0, 0); for( U32 i=0; i < mMaxVBDrops; i++ ) { // diff --git a/Engine/source/T3D/gameBase/gameConnection.cpp b/Engine/source/T3D/gameBase/gameConnection.cpp index 09cfa13cf..f759a03da 100644 --- a/Engine/source/T3D/gameBase/gameConnection.cpp +++ b/Engine/source/T3D/gameBase/gameConnection.cpp @@ -807,7 +807,7 @@ bool GameConnection::isValidControlCameraFov(F32 fov) return cObj->isValidCameraFov(fov); } - return NULL; + return false; } bool GameConnection::setControlCameraFov(F32 fov) diff --git a/Engine/source/T3D/shapeBase.h b/Engine/source/T3D/shapeBase.h index 4d3286b5c..2deb7996c 100644 --- a/Engine/source/T3D/shapeBase.h +++ b/Engine/source/T3D/shapeBase.h @@ -116,7 +116,7 @@ class ShapeBaseConvex : public Convex Box3F box; public: - ShapeBaseConvex() :pShapeBase(NULL), transform(NULL), hullId(NULL), nodeTransform(0) { mType = ShapeBaseConvexType; } + ShapeBaseConvex() :pShapeBase(NULL), transform(NULL), hullId(0), nodeTransform(0) { mType = ShapeBaseConvexType; } ShapeBaseConvex(const ShapeBaseConvex& cv) { mObject = cv.mObject; pShapeBase = cv.pShapeBase; diff --git a/Engine/source/afx/util/afxAnimCurve.h b/Engine/source/afx/util/afxAnimCurve.h index 158203b44..6ed7dbfd0 100644 --- a/Engine/source/afx/util/afxAnimCurve.h +++ b/Engine/source/afx/util/afxAnimCurve.h @@ -56,7 +56,7 @@ class afxAnimCurve public: afxAnimCurve(); - ~afxAnimCurve(); + virtual ~afxAnimCurve(); void addKey( Point2F &v ); void addKey( F32 time, F32 value ); diff --git a/Engine/source/afx/util/afxCurveEval.h b/Engine/source/afx/util/afxCurveEval.h index 0a8765c19..d5c6853b9 100644 --- a/Engine/source/afx/util/afxCurveEval.h +++ b/Engine/source/afx/util/afxCurveEval.h @@ -32,6 +32,7 @@ class afxCurveEval { public: + virtual ~afxCurveEval() { } virtual Point2F evaluateCurve(Point2F& v0, Point2F& v1, F32 t)=0; virtual Point2F evaluateCurve(Point2F& v0, Point2F& v1, Point2F& t0, Point2F& t1, F32 t)=0; virtual Point2F evaluateCurveTangent(Point2F& v0, Point2F& v1, F32 t)=0; diff --git a/Engine/source/afx/xm/afxXM_WaveBase.h b/Engine/source/afx/xm/afxXM_WaveBase.h index f7dd26f31..e231ef2b8 100644 --- a/Engine/source/afx/xm/afxXM_WaveBase.h +++ b/Engine/source/afx/xm/afxXM_WaveBase.h @@ -81,6 +81,7 @@ public: class afxXM_WaveInterp { public: + virtual ~afxXM_WaveInterp() { } virtual void interpolate(F32 t, afxXM_Params& params)=0; virtual void pulse()=0; @@ -250,7 +251,7 @@ protected: public: /*C*/ afxXM_WaveBase(afxXM_WaveBaseData*, afxEffectWrapper*, afxXM_WaveInterp*); - /*D*/ ~afxXM_WaveBase(); + /*D*/ virtual ~afxXM_WaveBase(); virtual void updateParams(F32 dt, F32 elapsed, afxXM_Params& params); }; diff --git a/Engine/source/collision/optimizedPolyList.h b/Engine/source/collision/optimizedPolyList.h index b66cc76c0..b42469fe1 100644 --- a/Engine/source/collision/optimizedPolyList.h +++ b/Engine/source/collision/optimizedPolyList.h @@ -87,7 +87,7 @@ class OptimizedPolyList : public AbstractPolyList Poly() : plane( -1 ), - material( NULL ), + material( 0 ), vertexStart(0), vertexCount( 0 ), surfaceKey(0), diff --git a/Engine/source/collision/polytope.h b/Engine/source/collision/polytope.h index 347a85c70..34483c976 100644 --- a/Engine/source/collision/polytope.h +++ b/Engine/source/collision/polytope.h @@ -76,7 +76,7 @@ public: Collision() { object = NULL; - material = NULL; + material = 0; distance = 0.0; } }; diff --git a/Engine/source/console/CMDscan.cpp b/Engine/source/console/CMDscan.cpp index 43a864570..787b4e845 100644 --- a/Engine/source/console/CMDscan.cpp +++ b/Engine/source/console/CMDscan.cpp @@ -774,9 +774,9 @@ YY_MALLOC_DECL YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; #line 105 "CMDscan.l" @@ -823,7 +823,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; @@ -1430,9 +1430,9 @@ case YY_STATE_EOF(INITIAL): static int yy_get_next_buffer() { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; + char *dest = yy_current_buffer->yy_ch_buf; + char *source = yytext_ptr; + int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) @@ -1560,14 +1560,14 @@ static int yy_get_next_buffer() static yy_state_type yy_get_previous_state() { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = yy_start; for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; @@ -1599,10 +1599,10 @@ static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; + int yy_is_jam; + char *yy_cp = yy_c_buf_p; - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; @@ -1623,14 +1623,14 @@ yy_state_type yy_current_state; #ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) +static void yyunput( int c, char *yy_bp ) #else static void yyunput( c, yy_bp ) int c; -register char *yy_bp; +char *yy_bp; #endif { - register char *yy_cp = yy_c_buf_p; + char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; @@ -1638,10 +1638,10 @@ register char *yy_bp; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ + int number_to_move = yy_n_chars + 2; + char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; - register char *source = + char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) @@ -2095,7 +2095,7 @@ yyconst char *s2; int n; #endif { - register int i; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } diff --git a/Engine/source/console/arrayObject.cpp b/Engine/source/console/arrayObject.cpp index 68b34059e..4c18ac306 100644 --- a/Engine/source/console/arrayObject.cpp +++ b/Engine/source/console/arrayObject.cpp @@ -125,7 +125,7 @@ S32 QSORT_CALLBACK ArrayObject::_valueFunctionCompare( const void* a, const void ArrayObject::ArrayObject() : mCaseSensitive( false ), - mCurrentIndex( NULL ) + mCurrentIndex( 0 ) { } @@ -137,7 +137,7 @@ void ArrayObject::initPersistFields() "Makes the keys and values case-sensitive.\n" "By default, comparison of key and value strings will be case-insensitive." ); - addProtectedField( "key", TypeCaseString, NULL, &_addKeyFromField, &emptyStringProtectedGetFn, + addProtectedField( "key", TypeCaseString, 0, &_addKeyFromField, &emptyStringProtectedGetFn, "Helper field which allows you to add new key['keyname'] = value pairs." ); Parent::initPersistFields(); diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index 6b54bdd1d..3d485354c 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -179,10 +179,10 @@ void SimObject::initPersistFields() addGroup( "Editing" ); - addProtectedField( "hidden", TypeBool, NULL, + addProtectedField( "hidden", TypeBool, 0, &_setHidden, &_getHidden, "Whether the object is visible." ); - addProtectedField( "locked", TypeBool, NULL, + addProtectedField( "locked", TypeBool, 0, &_setLocked, &_getLocked, "Whether the object can be edited." ); diff --git a/Engine/source/core/stringBuffer.cpp b/Engine/source/core/stringBuffer.cpp index 2bc3fb069..66983fcf2 100644 --- a/Engine/source/core/stringBuffer.cpp +++ b/Engine/source/core/stringBuffer.cpp @@ -371,7 +371,7 @@ void StringBuffer::getCopy(UTF16 *buff, const U32 buffSize) const AssertFatal(mBuffer.last() == 0, "StringBuffer::get UTF8 - not a null terminated string!"); dMemcpy(buff, mBuffer.address(), sizeof(UTF16) * getMin(buffSize, (U32)mBuffer.size())); // ensure null termination. - buff[buffSize-1] = NULL; + buff[buffSize-1] = 0; } UTF8* StringBuffer::createCopy8() const diff --git a/Engine/source/core/strings/unicode.cpp b/Engine/source/core/strings/unicode.cpp index fd2341b7b..ad43ad3e1 100644 --- a/Engine/source/core/strings/unicode.cpp +++ b/Engine/source/core/strings/unicode.cpp @@ -236,8 +236,8 @@ U32 convertUTF16toUTF8DoubleNULL( const UTF16 *unistring, UTF8 *outbuffer, U32 } nCodeunits = getMin(nCodeunits,len - 1); - outbuffer[nCodeunits] = NULL; - outbuffer[nCodeunits+1] = NULL; + outbuffer[nCodeunits] = '\0'; + outbuffer[nCodeunits+1] = '\0'; PROFILE_END(); return nCodeunits; diff --git a/Engine/source/core/util/hashFunction.h b/Engine/source/core/util/hashFunction.h index d2e1d5b4a..02ecd019b 100644 --- a/Engine/source/core/util/hashFunction.h +++ b/Engine/source/core/util/hashFunction.h @@ -30,9 +30,9 @@ namespace Torque { -extern U32 hash(register const U8 *k, register U32 length, register U32 initval); +extern U32 hash(const U8 *k, U32 length, U32 initval); -extern U64 hash64(register const U8 *k, register U32 length, register U64 initval); +extern U64 hash64(const U8 *k, U32 length, U64 initval); } diff --git a/Engine/source/environment/decalRoad.cpp b/Engine/source/environment/decalRoad.cpp index e1d9a27ee..33d137a83 100644 --- a/Engine/source/environment/decalRoad.cpp +++ b/Engine/source/environment/decalRoad.cpp @@ -320,7 +320,7 @@ void DecalRoad::initPersistFields() addGroup( "Internal" ); - addProtectedField( "node", TypeString, NULL, &addNodeFromField, &emptyStringProtectedGetFn, + addProtectedField( "node", TypeString, 0, &addNodeFromField, &emptyStringProtectedGetFn, "Do not modify, for internal use." ); endGroup( "Internal" ); diff --git a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp index b0812f738..6433332d7 100644 --- a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp @@ -1757,7 +1757,7 @@ DefineEngineMethod( GuiMeshRoadEditorCtrl, getSelectedRoad, S32, (), , "" ) { MeshRoad *road = object->getSelectedRoad(); if ( !road ) - return NULL; + return 0; return road->getId(); } diff --git a/Engine/source/environment/editors/guiRiverEditorCtrl.cpp b/Engine/source/environment/editors/guiRiverEditorCtrl.cpp index e650fdf59..983c8a01e 100644 --- a/Engine/source/environment/editors/guiRiverEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiRiverEditorCtrl.cpp @@ -1472,7 +1472,7 @@ DefineEngineMethod( GuiRiverEditorCtrl, getSelectedRiver, S32, (), , "" ) { River *river = object->getSelectedRiver(); if ( !river ) - return NULL; + return 0; return river->getId(); } diff --git a/Engine/source/environment/editors/guiRoadEditorCtrl.cpp b/Engine/source/environment/editors/guiRoadEditorCtrl.cpp index 3f111a80e..67b6ef883 100644 --- a/Engine/source/environment/editors/guiRoadEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiRoadEditorCtrl.cpp @@ -1097,7 +1097,7 @@ DefineEngineMethod( GuiRoadEditorCtrl, getSelectedRoad, S32, (), , "" ) if ( road ) return road->getId(); - return NULL; + return 0; } DefineEngineMethod( GuiRoadEditorCtrl, getSelectedNode, S32, (), , "" ) diff --git a/Engine/source/environment/meshRoad.cpp b/Engine/source/environment/meshRoad.cpp index f27d2d84a..01f8017de 100644 --- a/Engine/source/environment/meshRoad.cpp +++ b/Engine/source/environment/meshRoad.cpp @@ -954,10 +954,10 @@ void MeshRoad::initPersistFields() addGroup( "Internal" ); - addProtectedField( "Node", TypeString, NULL, &addNodeFromField, &emptyStringProtectedGetFn, + addProtectedField( "Node", TypeString, 0, &addNodeFromField, &emptyStringProtectedGetFn, "Do not modify, for internal use." ); - addProtectedField( "ProfileNode", TypeString, NULL, &addProfileNodeFromField, &emptyStringProtectedGetFn, + addProtectedField( "ProfileNode", TypeString, 0, &addProfileNodeFromField, &emptyStringProtectedGetFn, "Do not modify, for internal use." ); endGroup( "Internal" ); diff --git a/Engine/source/environment/river.cpp b/Engine/source/environment/river.cpp index 9bb1d7aac..0213f9d1d 100644 --- a/Engine/source/environment/river.cpp +++ b/Engine/source/environment/river.cpp @@ -647,7 +647,7 @@ void River::initPersistFields() addGroup( "Internal" ); - addProtectedField( "Node", TypeString, NULL, &addNodeFromField, &emptyStringProtectedGetFn, "For internal use, do not modify." ); + addProtectedField( "Node", TypeString, 0, &addNodeFromField, &emptyStringProtectedGetFn, "For internal use, do not modify." ); endGroup( "Internal" ); diff --git a/Engine/source/gfx/bitmap/gBitmap.cpp b/Engine/source/gfx/bitmap/gBitmap.cpp index 9560586dd..b7045d129 100644 --- a/Engine/source/gfx/bitmap/gBitmap.cpp +++ b/Engine/source/gfx/bitmap/gBitmap.cpp @@ -1199,7 +1199,7 @@ bool GBitmap::readBitmap( const String &bmType, Stream &ioStream ) if ( regInfo == NULL ) { Con::errorf( "[GBitmap::readBitmap] unable to find registration for extension [%s]", bmType.c_str() ); - return NULL; + return false; } return regInfo->readFunc( ioStream, this ); @@ -1212,7 +1212,7 @@ bool GBitmap::writeBitmap( const String &bmType, Stream &ioStream, U32 compress if ( regInfo == NULL ) { Con::errorf( "[GBitmap::writeBitmap] unable to find registration for extension [%s]", bmType.c_str() ); - return NULL; + return false; } return regInfo->writeFunc( this, ioStream, (compressionLevel == U32_MAX) ? regInfo->defaultCompression : compressionLevel ); diff --git a/Engine/source/gfx/bitmap/loaders/bitmapPng.cpp b/Engine/source/gfx/bitmap/loaders/bitmapPng.cpp index 65586caa8..9eb1d7b2c 100644 --- a/Engine/source/gfx/bitmap/loaders/bitmapPng.cpp +++ b/Engine/source/gfx/bitmap/loaders/bitmapPng.cpp @@ -143,7 +143,7 @@ static bool sReadPNG(Stream &stream, GBitmap *bitmap) stream.read(cs_headerBytesChecked, header); bool isPng = png_check_sig(header, cs_headerBytesChecked) != 0; - if (isPng == false) + if (!isPng) { AssertWarn(false, "GBitmap::readPNG: stream doesn't contain a PNG"); return false; diff --git a/Engine/source/gfx/gl/gfxGLCubemap.cpp b/Engine/source/gfx/gl/gfxGLCubemap.cpp index 99f3f02a8..db23a0fc2 100644 --- a/Engine/source/gfx/gl/gfxGLCubemap.cpp +++ b/Engine/source/gfx/gl/gfxGLCubemap.cpp @@ -308,7 +308,7 @@ U8* GFXGLCubemap::getTextureData(U32 face, U32 mip) GFXGLCubemapArray::GFXGLCubemapArray() { - mCubemap = NULL; + mCubemap = 0; } GFXGLCubemapArray::~GFXGLCubemapArray() diff --git a/Engine/source/gfx/gl/gfxGLStateBlock.cpp b/Engine/source/gfx/gl/gfxGLStateBlock.cpp index 5be2e43d5..12eab71b0 100644 --- a/Engine/source/gfx/gl/gfxGLStateBlock.cpp +++ b/Engine/source/gfx/gl/gfxGLStateBlock.cpp @@ -101,8 +101,8 @@ void GFXGLStateBlock::activate(const GFXGLStateBlock* oldState) // the state value even if that value is identical to the current value. #define STATE_CHANGE(state) (!oldState || oldState->mDesc.state != mDesc.state) -#define TOGGLE_STATE(state, enum) if(mDesc.state) glEnable(enum); else glDisable(enum) -#define CHECK_TOGGLE_STATE(state, enum) if(!oldState || oldState->mDesc.state != mDesc.state) if(mDesc.state) glEnable(enum); else glDisable(enum) +#define TOGGLE_STATE(state, enum) if(mDesc.state) { glEnable(enum); } else { glDisable(enum); } +#define CHECK_TOGGLE_STATE(state, enum) if(!oldState || oldState->mDesc.state != mDesc.state) { if(mDesc.state) { glEnable(enum); } else { glDisable(enum); }} // Blending CHECK_TOGGLE_STATE(blendEnable, GL_BLEND); diff --git a/Engine/source/gfx/gl/gfxGLTextureArray.cpp b/Engine/source/gfx/gl/gfxGLTextureArray.cpp index f2b403bb0..e0137a448 100644 --- a/Engine/source/gfx/gl/gfxGLTextureArray.cpp +++ b/Engine/source/gfx/gl/gfxGLTextureArray.cpp @@ -6,7 +6,7 @@ GFXGLTextureArray::GFXGLTextureArray() { - mTextureArray = NULL; + mTextureArray = 0; } void GFXGLTextureArray::init() diff --git a/Engine/source/gfx/gl/gfxGLTextureArray.h b/Engine/source/gfx/gl/gfxGLTextureArray.h index 65e1d9729..7073b1653 100644 --- a/Engine/source/gfx/gl/gfxGLTextureArray.h +++ b/Engine/source/gfx/gl/gfxGLTextureArray.h @@ -13,7 +13,7 @@ public: ~GFXGLTextureArray() { Release(); }; - void init(); + void init() override; void setToTexUnit(U32 tuNum) override; diff --git a/Engine/source/gfx/gl/gfxGLTextureObject.cpp b/Engine/source/gfx/gl/gfxGLTextureObject.cpp index 9eabc8114..1d5c043e4 100644 --- a/Engine/source/gfx/gl/gfxGLTextureObject.cpp +++ b/Engine/source/gfx/gl/gfxGLTextureObject.cpp @@ -46,7 +46,7 @@ GFXGLTextureObject::GFXGLTextureObject(GFXDevice * aDevice, GFXTextureProfile *p { #if TORQUE_DEBUG - mFrameAllocatorMarkGuard == FrameAllocator::getWaterMark(); + mFrameAllocatorMarkGuard = FrameAllocator::getWaterMark(); #endif dMemset(&mLockedRect, 0, sizeof(mLockedRect)); diff --git a/Engine/source/gfx/sim/cubemapData.cpp b/Engine/source/gfx/sim/cubemapData.cpp index a6833de5c..bf9390dfe 100644 --- a/Engine/source/gfx/sim/cubemapData.cpp +++ b/Engine/source/gfx/sim/cubemapData.cpp @@ -135,7 +135,7 @@ void CubemapData::createMap() if( initSuccess ) { mCubemap = GFX->createCubemap(); - if (mCubeMapFace == NULL || mCubeMapFace->isNull()) + if (!mCubeMapFace || mCubeMapFace->isNull()) return; mCubemap->initStatic(mCubeMapFace); } diff --git a/Engine/source/gfx/video/videoEncoderTheora.cpp b/Engine/source/gfx/video/videoEncoderTheora.cpp index d64f76487..ef88787f8 100644 --- a/Engine/source/gfx/video/videoEncoderTheora.cpp +++ b/Engine/source/gfx/video/videoEncoderTheora.cpp @@ -226,7 +226,7 @@ public: return setStatus(false); } - ogg_stream_init(&to, Platform::getRandom() * S32_MAX); + ogg_stream_init(&to, Platform::getRandom() * double(S32_MAX)); ogg_packet op; diff --git a/Engine/source/gui/core/guiCanvas.cpp b/Engine/source/gui/core/guiCanvas.cpp index 96022edaa..0b894f7c3 100644 --- a/Engine/source/gui/core/guiCanvas.cpp +++ b/Engine/source/gui/core/guiCanvas.cpp @@ -2438,7 +2438,7 @@ DefineEngineMethod( GuiCanvas, getMouseControl, S32, (),, if (control) return control->getId(); - return NULL; + return 0; } DefineEngineFunction(excludeOtherInstance, bool, (const char* appIdentifer),, diff --git a/Engine/source/gui/editor/guiInspector.cpp b/Engine/source/gui/editor/guiInspector.cpp index 48c4dcc94..47d1e3c85 100644 --- a/Engine/source/gui/editor/guiInspector.cpp +++ b/Engine/source/gui/editor/guiInspector.cpp @@ -908,12 +908,12 @@ DefineEngineMethod( GuiInspector, findByObject, S32, (SimObject* obj), , "@return id of an awake inspector that is inspecting the passed object if one exists, else NULL or 0.") { if ( !obj) - return NULL; + return 0; SimObject *inspector = GuiInspector::findByObject(obj); if ( !inspector ) - return NULL; + return 0; return inspector->getId(); } diff --git a/Engine/source/gui/editor/guiShapeEdPreview.cpp b/Engine/source/gui/editor/guiShapeEdPreview.cpp index 5ea20ec13..eba775edb 100644 --- a/Engine/source/gui/editor/guiShapeEdPreview.cpp +++ b/Engine/source/gui/editor/guiShapeEdPreview.cpp @@ -160,11 +160,11 @@ void GuiShapeEdPreview::initPersistFields() addGroup( "Animation" ); addField( "activeThread", TypeS32, Offset( mActiveThread, GuiShapeEdPreview ), "Index of the active thread, or -1 if none" ); - addProtectedField( "threadPos", TypeF32, NULL, &setFieldThreadPos, &getFieldThreadPos, + addProtectedField( "threadPos", TypeF32, 0, &setFieldThreadPos, &getFieldThreadPos, "Current position of the active thread (0-1)" ); - addProtectedField( "threadDirection", TypeS32, NULL, &setFieldThreadDir, &getFieldThreadDir, + addProtectedField( "threadDirection", TypeS32, 0, &setFieldThreadDir, &getFieldThreadDir, "Playback direction of the active thread" ); - addProtectedField( "threadPingPong", TypeBool, NULL, &setFieldThreadPingPong, &getFieldThreadPingPong, + addProtectedField( "threadPingPong", TypeBool, 0, &setFieldThreadPingPong, &getFieldThreadPingPong, "'PingPong' mode of the active thread" ); endGroup( "Animation" ); diff --git a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.h b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.h index 6ede0cf61..1600a4e50 100644 --- a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.h +++ b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.h @@ -248,7 +248,7 @@ class GuiConvexEditorUndoAction : public UndoAction friend class GuiConvexEditorCtrl; public: - GuiConvexEditorUndoAction( const UTF8* actionName ) : UndoAction( actionName ), mEditor(NULL), mObjId(NULL) + GuiConvexEditorUndoAction( const UTF8* actionName ) : UndoAction( actionName ), mEditor(NULL), mObjId(0) { } diff --git a/Engine/source/gui/worldEditor/guiMissionArea.h b/Engine/source/gui/worldEditor/guiMissionArea.h index 885f85107..9c3dec0a5 100644 --- a/Engine/source/gui/worldEditor/guiMissionArea.h +++ b/Engine/source/gui/worldEditor/guiMissionArea.h @@ -145,7 +145,7 @@ class GuiMissionAreaUndoAction : public UndoAction { public: - GuiMissionAreaUndoAction( const UTF8* actionName ) : UndoAction( actionName ), mMissionAreaEditor(NULL), mObjId(NULL) + GuiMissionAreaUndoAction( const UTF8* actionName ) : UndoAction( actionName ), mMissionAreaEditor(NULL), mObjId(0) { } diff --git a/Engine/source/gui/worldEditor/terrainActions.cpp b/Engine/source/gui/worldEditor/terrainActions.cpp index 3fc07205d..a6fbb5c21 100644 --- a/Engine/source/gui/worldEditor/terrainActions.cpp +++ b/Engine/source/gui/worldEditor/terrainActions.cpp @@ -773,7 +773,7 @@ ConsoleDocClass( TerrainSmoothAction, ); TerrainSmoothAction::TerrainSmoothAction() - : UndoAction("Terrain Smoothing"), mFactor(1.0), mSteps(1), mTerrainId(NULL) + : UndoAction("Terrain Smoothing"), mFactor(1.0), mSteps(1), mTerrainId(0) { } diff --git a/Engine/source/lighting/advanced/advancedLightBinManager.h b/Engine/source/lighting/advanced/advancedLightBinManager.h index 4f97e4239..4d04f3cfc 100644 --- a/Engine/source/lighting/advanced/advancedLightBinManager.h +++ b/Engine/source/lighting/advanced/advancedLightBinManager.h @@ -70,7 +70,7 @@ protected: GFXStateBlockRef mLitState[NUM_LIT_STATES][2]; public: - LightMatInstance(Material &mat) : Parent(mat), mLightMapParamsSC(NULL), mInternalPass(false), mSpecialLight(NULL) {} + LightMatInstance(Material &mat) : Parent(mat), mLightMapParamsSC(NULL), mInternalPass(false), mSpecialLight(false) {} virtual bool init( const FeatureSet &features, const GFXVertexFormat *vertexFormat ); virtual bool setupPass( SceneRenderState *state, const SceneData &sgData ); diff --git a/Engine/source/lighting/basic/blTerrainSystem.cpp b/Engine/source/lighting/basic/blTerrainSystem.cpp index d6fb3f9d5..1cf077575 100644 --- a/Engine/source/lighting/basic/blTerrainSystem.cpp +++ b/Engine/source/lighting/basic/blTerrainSystem.cpp @@ -682,9 +682,9 @@ bool blTerrainSystem::createPersistChunkFromProxy(SceneLighting::ObjectProxy* ob { *ret = new blTerrainChunk(); return true; - } else { - return NULL; } + + return false; } // Given a ray, this will return the color from the lightmap of this object, return true if handled diff --git a/Engine/source/materials/materialDefinition.cpp b/Engine/source/materials/materialDefinition.cpp index 7eb49ffc0..3c3cb5898 100644 --- a/Engine/source/materials/materialDefinition.cpp +++ b/Engine/source/materials/materialDefinition.cpp @@ -218,7 +218,7 @@ Material::Material() mPlanarReflection = false; mCubemapData = NULL; - mDynamicCubemap = NULL; + mDynamicCubemap = false; mLastUpdateTime = 0; diff --git a/Engine/source/math/mRandom.h b/Engine/source/math/mRandom.h index c69c06477..dbd4a2328 100644 --- a/Engine/source/math/mRandom.h +++ b/Engine/source/math/mRandom.h @@ -54,7 +54,7 @@ public: inline F32 MRandomGenerator::randF() { // default: multiply by 1/(2^31) - return F32(randI()) * (1.0f / S32_MAX); + return F32(randI()) * (1.0f / F64(S32_MAX)); } inline S32 MRandomGenerator::randI(S32 i, S32 n) diff --git a/Engine/source/navigation/guiNavEditorCtrl.h b/Engine/source/navigation/guiNavEditorCtrl.h index 4a6780b33..2d4c96bce 100644 --- a/Engine/source/navigation/guiNavEditorCtrl.h +++ b/Engine/source/navigation/guiNavEditorCtrl.h @@ -168,7 +168,7 @@ protected: class GuiNavEditorUndoAction : public UndoAction { public: - GuiNavEditorUndoAction(const UTF8* actionName) : UndoAction(actionName), mNavEditor(NULL), mObjId(NULL) + GuiNavEditorUndoAction(const UTF8* actionName) : UndoAction(actionName), mNavEditor(NULL), mObjId(0) { } diff --git a/Engine/source/persistence/taml/taml.cpp b/Engine/source/persistence/taml/taml.cpp index 837843c72..0454e102a 100644 --- a/Engine/source/persistence/taml/taml.cpp +++ b/Engine/source/persistence/taml/taml.cpp @@ -335,7 +335,7 @@ ImplementEnumType(_TamlFormatMode, // Write. //return writer.write( stream, pRootNode ); - return NULL; + return false; } /// Invalid. diff --git a/Engine/source/platform/platformNet.cpp b/Engine/source/platform/platformNet.cpp index 1e5cb0a5a..db7c26604 100644 --- a/Engine/source/platform/platformNet.cpp +++ b/Engine/source/platform/platformNet.cpp @@ -241,7 +241,7 @@ namespace PlatformNetState struct addrinfo* pickAddressByProtocol(struct addrinfo* addr, int protocol) { - for (addr; addr != NULL; addr = addr->ai_next) + for (; addr != NULL; addr = addr->ai_next) { if (addr->ai_family == protocol) return addr; diff --git a/Engine/source/platformSDL/sdlInput.cpp b/Engine/source/platformSDL/sdlInput.cpp index a60a0e7b5..67d86b277 100644 --- a/Engine/source/platformSDL/sdlInput.cpp +++ b/Engine/source/platformSDL/sdlInput.cpp @@ -102,7 +102,7 @@ U16 Input::getKeyCode( U16 asciiCode ) char c[2]; c[0]= asciiCode; - c[1] = NULL; + c[1] = 0; return KeyMapSDL::getTorqueScanCodeFromSDL( SDL_GetScancodeFromKey( SDL_GetKeyFromName(c) ) ); } diff --git a/Engine/source/platformX86UNIX/x86UNIXFileio.cpp b/Engine/source/platformX86UNIX/x86UNIXFileio.cpp index 77419a96a..eee06a84e 100644 --- a/Engine/source/platformX86UNIX/x86UNIXFileio.cpp +++ b/Engine/source/platformX86UNIX/x86UNIXFileio.cpp @@ -594,20 +594,20 @@ bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite) return currentStatus; U32 finalPos = 0; - switch (absolutePos) + + if (absolutePos) { - case true: // absolute position AssertFatal(0 <= position, "File::setPosition: negative absolute position"); // position beyond EOS is OK finalPos = lseek(*((int *)handle), position, SEEK_SET); - break; - case false: // relative position + } + else + { AssertFatal((getPosition() >= (U32)abs(position) && 0 > position) || 0 <= position, "File::setPosition: negative relative position"); // position beyond EOS is OK finalPos = lseek(*((int *)handle), position, SEEK_CUR); - break; } if (0xffffffff == finalPos) @@ -1110,7 +1110,7 @@ bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite) if (dip == NULL) return false; - while (d = readdir(dip)) + while ((d = readdir(dip))) { bool isDir = false; if (d->d_type == DT_UNKNOWN) @@ -1229,14 +1229,14 @@ bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite) // Iterate through and grab valid directories ////////////////////////////////////////////////////////////////////////// - while (d = readdir(dip)) + while ((d = readdir(dip))) { bool isDir; isDir = false; if (d->d_type == DT_UNKNOWN) { char child [1024]; - if ((Path[dStrlen(Path) - 1] == '/')) + if (Path[dStrlen(Path) - 1] == '/') dSprintf(child, 1024, "%s%s", Path, d->d_name); else dSprintf(child, 1024, "%s/%s", Path, d->d_name); diff --git a/Engine/source/renderInstance/renderImposterMgr.cpp b/Engine/source/renderInstance/renderImposterMgr.cpp index d93c6c620..e0b8b3156 100644 --- a/Engine/source/renderInstance/renderImposterMgr.cpp +++ b/Engine/source/renderInstance/renderImposterMgr.cpp @@ -152,7 +152,7 @@ void RenderImposterMgr::_innerRender( const SceneRenderState *state, RenderDefer // Setup a static index buffer for rendering. mIB.set( GFX, smImposterBatchSize * 6, 0, GFXBufferTypeStatic ); U16 *idxBuff; - mIB.lock(&idxBuff, NULL, NULL, NULL); + mIB.lock(&idxBuff, NULL, 0, 0); for ( U32 i=0; i < smImposterBatchSize; i++ ) { // diff --git a/Engine/source/renderInstance/renderPassStateToken.cpp b/Engine/source/renderInstance/renderPassStateToken.cpp index 560fb40f3..c00b05cdf 100644 --- a/Engine/source/renderInstance/renderPassStateToken.cpp +++ b/Engine/source/renderInstance/renderPassStateToken.cpp @@ -86,7 +86,7 @@ static const char *_get_enable(void* obj, const char* data) void RenderPassStateToken::initPersistFields() { - addProtectedField("enabled", TypeBool, NULL, &_set_enable, &_get_enable, "Enables or disables this token."); + addProtectedField("enabled", TypeBool, 0, &_set_enable, &_get_enable, "Enables or disables this token."); Parent::initPersistFields(); } diff --git a/Engine/source/scene/mixin/scenePolyhedralObject.impl.h b/Engine/source/scene/mixin/scenePolyhedralObject.impl.h index 4ce8998f0..32ec98e71 100644 --- a/Engine/source/scene/mixin/scenePolyhedralObject.impl.h +++ b/Engine/source/scene/mixin/scenePolyhedralObject.impl.h @@ -44,15 +44,15 @@ void ScenePolyhedralObject< Base, P >::initPersistFields() { Parent::addGroup( "Internal" ); - Parent::addProtectedField( "plane", TypeRealString, NULL, + Parent::addProtectedField( "plane", TypeRealString, 0, &_setPlane, &defaultProtectedGetFn, "For internal use only.", AbstractClassRep::FIELD_HideInInspectors ); - Parent::addProtectedField( "point", TypeRealString, NULL, + Parent::addProtectedField( "point", TypeRealString, 0, &_setPoint, &defaultProtectedGetFn, "For internal use only.", AbstractClassRep::FIELD_HideInInspectors ); - Parent::addProtectedField( "edge", TypeRealString, NULL, + Parent::addProtectedField( "edge", TypeRealString, 0, &_setEdge, &defaultProtectedGetFn, "For internal use only.", AbstractClassRep::FIELD_HideInInspectors ); diff --git a/Engine/source/sim/actionMap.cpp b/Engine/source/sim/actionMap.cpp index 40a41aa06..117278aff 100644 --- a/Engine/source/sim/actionMap.cpp +++ b/Engine/source/sim/actionMap.cpp @@ -1962,7 +1962,7 @@ void ContextAction::processTick() if (mActive) { F32 currTime = Sim::getCurrentTime(); - static const char *argv[2]; + static const char *argv[3]; //see if this key even is still active if (!mBreakEvent) diff --git a/Engine/source/sim/actionMap.h b/Engine/source/sim/actionMap.h index 26caffe7b..840dd70f9 100644 --- a/Engine/source/sim/actionMap.h +++ b/Engine/source/sim/actionMap.h @@ -92,7 +92,7 @@ class ActionMap : public SimObject U32 deviceInst; Vector nodeMap; - DeviceMap():deviceType(NULL), deviceInst(NULL){ + DeviceMap():deviceType(0), deviceInst(0){ VECTOR_SET_ASSOCIATION(nodeMap); } ~DeviceMap(); diff --git a/Engine/source/sim/netObject.cpp b/Engine/source/sim/netObject.cpp index 25c5e3657..0a33379ec 100644 --- a/Engine/source/sim/netObject.cpp +++ b/Engine/source/sim/netObject.cpp @@ -407,7 +407,7 @@ DefineEngineMethod( NetObject, getClientObject, S32, (),, if ( obj ) return obj->getId(); - return NULL; + return 0; } //ConsoleMethod( NetObject, getClientObject, S32, 2, 2, "Short-Circuit-Netorking: this is only valid for a local-client / singleplayer situation." ) @@ -439,7 +439,7 @@ DefineEngineMethod( NetObject, getServerObject, S32, (),, if ( obj ) return obj->getId(); - return NULL; + return 0; } //ConsoleMethod( NetObject, getServerObject, S32, 2, 2, "Short-Circuit-Netorking: this is only valid for a local-client / singleplayer situation." ) diff --git a/Engine/source/ts/tsShape.cpp b/Engine/source/ts/tsShape.cpp index b3026a98a..36825014b 100644 --- a/Engine/source/ts/tsShape.cpp +++ b/Engine/source/ts/tsShape.cpp @@ -74,7 +74,7 @@ TSShape::TSShape() mRadius = 0; mFlags = 0; tubeRadius = 0; - data = NULL; + data = 0; materialList = NULL; mReadVersion = -1; // -1 means constructed from scratch (e.g., in exporter or no read yet) mSequencesConstructed = false; @@ -225,11 +225,7 @@ const String& TSShape::getTargetName( S32 mapToNameIndex ) const S32 TSShape::getTargetCount() const { - if(!this) - return -1; - return materialList->getMaterialNameList().size(); - } S32 TSShape::findNode(S32 nameIndex) const diff --git a/Engine/source/ts/tsShapeConstruct.cpp b/Engine/source/ts/tsShapeConstruct.cpp index 08dbc21c2..6f53670b8 100644 --- a/Engine/source/ts/tsShapeConstruct.cpp +++ b/Engine/source/ts/tsShapeConstruct.cpp @@ -357,7 +357,7 @@ void TSShapeConstructor::initPersistFields() endGroup("Collada"); addGroup("Sequences"); - addProtectedField("sequence", TypeStringFilename, NULL, &addSequenceFromField, &emptyStringProtectedGetFn, + addProtectedField("sequence", TypeStringFilename, 0, &addSequenceFromField, &emptyStringProtectedGetFn, "Legacy method of adding sequences to a DTS or DAE shape after loading.\n\n" "@tsexample\n" "singleton TSShapeConstructor(MyShapeDae)\n" From eb8434c5a447b30886d94d54c04e7e3dd4edfeab Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Tue, 5 Oct 2021 00:23:26 -0500 Subject: [PATCH 152/399] don't try and sort ribbon particles --- Engine/source/T3D/fx/particleEmitter.cpp | 37 +++--------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/Engine/source/T3D/fx/particleEmitter.cpp b/Engine/source/T3D/fx/particleEmitter.cpp index c60dc6d49..79d2e6f1d 100644 --- a/Engine/source/T3D/fx/particleEmitter.cpp +++ b/Engine/source/T3D/fx/particleEmitter.cpp @@ -1908,50 +1908,21 @@ void ParticleEmitter::copyToVB( const Point3F &camPos, const LinearColorF &ambie if (mDataBlock->reverseOrder) { - buffPtr += 4 * (n_parts - 1); - // do sorted-oriented particles - if (mDataBlock->sortParticles) - { - SortParticle* partPtr = orderedVector.address(); - for (U32 i = 0; i < n_parts - 1; i++, partPtr++, buffPtr -= 4) - { - SortParticle* part = partPtr; - partPtr++; - setupRibbon(part->p, partPtr->p, partPtr->p, camPos, ambientColor, buffPtr); - } - } - // do unsorted-oriented particles - else - { Particle* oldPtr = NULL; - for (Particle* partPtr = part_list_head.next; partPtr != NULL; partPtr = partPtr->next, buffPtr -= 4) { + for (Particle* partPtr = part_list_head.next; partPtr != NULL; partPtr = partPtr->next, buffPtr -= 4) + { setupRibbon(partPtr, partPtr->next, oldPtr, camPos, ambientColor, buffPtr); oldPtr = partPtr; } - } } else { - // do sorted-oriented particles - if (mDataBlock->sortParticles) - { - SortParticle* partPtr = orderedVector.address(); - for (U32 i = 0; i < n_parts - 1; i++, partPtr++, buffPtr += 4) - { - SortParticle* part = partPtr; - partPtr++; - setupRibbon(part->p, partPtr->p, partPtr->p, camPos, ambientColor, buffPtr); - } - } - // do unsorted-oriented particles - else - { Particle* oldPtr = NULL; - for (Particle* partPtr = part_list_head.next; partPtr != NULL; partPtr = partPtr->next, buffPtr += 4) { + for (Particle* partPtr = part_list_head.next; partPtr != NULL; partPtr = partPtr->next, buffPtr += 4) + { setupRibbon(partPtr, partPtr->next, oldPtr, camPos, ambientColor, buffPtr); oldPtr = partPtr; } - } } PROFILE_END(); } From 42e90ad3fb7cbb5b5fa9c78baa8875e4ea2e8d46 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Tue, 5 Oct 2021 14:46:37 -0500 Subject: [PATCH 153/399] RTLightingFeat work. 1) we do *not* in fact want to early out in the presence of MFT_ImposterVert. it mangles the position-send. 2) dx sucessfuly handles the if ( !fd.features[MFT_NormalMap] ) case, so use the same for gl --- Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp | 6 ++---- Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp | 3 --- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp index 73bb56fd1..6df9a01bf 100644 --- a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp +++ b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp @@ -2070,7 +2070,6 @@ RTLightingFeatGLSL::RTLightingFeatGLSL() void RTLightingFeatGLSL::processVert( Vector &componentList, const MaterialFeatureData &fd ) { - if (fd.features[MFT_ImposterVert]) return; MultiLine *meta = new MultiLine; ShaderConnector *connectComp = dynamic_cast( componentList[C_CONNECTOR] ); @@ -2124,8 +2123,7 @@ void RTLightingFeatGLSL::processVert( Vector &componentList, // If there isn't a normal map then we need to pass // the world space normal to the pixel shader ourselves. - //Temporarily disabled while we figure out how to better handle normals without a normal map - /*if ( !fd.features[MFT_NormalMap] ) + if ( !fd.features[MFT_NormalMap] ) { Var *outNormal = connectComp->getElement( RT_TEXCOORD ); outNormal->setName( "wsNormal" ); @@ -2137,7 +2135,7 @@ void RTLightingFeatGLSL::processVert( Vector &componentList, // Transform the normal to world space. meta->addStatement( new GenOp( " @ = tMul( @, vec4( normalize( @ ), 0.0 ) ).xyz;\r\n", outNormal, objTrans, inNormal ) ); - }*/ + } } diff --git a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp index ecd4619d0..eae07aa95 100644 --- a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp +++ b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp @@ -2136,8 +2136,6 @@ RTLightingFeatHLSL::RTLightingFeatHLSL() void RTLightingFeatHLSL::processVert( Vector &componentList, const MaterialFeatureData &fd ) { - if (fd.features[MFT_ImposterVert]) return; - MultiLine *meta = new MultiLine; ShaderConnector *connectComp = dynamic_cast( componentList[C_CONNECTOR] ); @@ -2192,7 +2190,6 @@ void RTLightingFeatHLSL::processVert( Vector &componentList, // If there isn't a normal map then we need to pass // the world space normal to the pixel shader ourselves. - //Temporarily disabled while we figure out how to better handle normals without a normal map if ( !fd.features[MFT_NormalMap] ) { Var *outNormal = connectComp->getElement( RT_TEXCOORD ); From 070a3a30b60bea1c7d14a5bd1a5e5f5aa00bcaf3 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Wed, 6 Oct 2021 00:35:38 -0400 Subject: [PATCH 154/399] * [Linux] BugFix: Free the mouse cursor when triggering SIGTRAP on Linux to ensure that the cursor is available for debugging. --- .../source/platformX86UNIX/x86UNIXProcessControl.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Engine/source/platformX86UNIX/x86UNIXProcessControl.cpp b/Engine/source/platformX86UNIX/x86UNIXProcessControl.cpp index 09c59af4d..db7d0bdb7 100644 --- a/Engine/source/platformX86UNIX/x86UNIXProcessControl.cpp +++ b/Engine/source/platformX86UNIX/x86UNIXProcessControl.cpp @@ -24,6 +24,8 @@ #include "platformX86UNIX/x86UNIXState.h" #include "platformX86UNIX/x86UNIXStdConsole.h" #include "platform/platformInput.h" +#include "windowManager/platformWindow.h" +#include "windowManager/platformWindowMgr.h" #include "console/console.h" #include @@ -165,6 +167,15 @@ void Platform::debugBreak() Con::errorf(ConsoleLogEntry::General, "Platform::debugBreak: triggering SIGSEGV for core dump"); //kill(getpid(), SIGSEGV); + + // On Linux, the mouse cursor will remain trapped when the SIGTRAP below triggers so we ensure the mouse + // locked state is disabled prior to dropping to debug + PlatformWindow* firstWindow = WindowManager->getFirstWindow(); + if (firstWindow) + { + firstWindow->setMouseLocked(false); + } + kill(getpid(), SIGTRAP); } From 24bf807713a3a361406ae3365a5483b8e0be68cd Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Wed, 6 Oct 2021 21:53:26 -0400 Subject: [PATCH 155/399] various shadergen fixes. --- .../shaderGen/GLSL/shaderFeatureGLSL.cpp | 1 + .../shaderGen/HLSL/shaderFeatureHLSL.cpp | 8 ++++ .../source/terrain/glsl/terrFeatureGLSL.cpp | 41 +++++++++++-------- 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp index 6df9a01bf..b41dfc234 100644 --- a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp +++ b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp @@ -1982,6 +1982,7 @@ void ReflectCubeFeatGLSL::processPix( Vector &componentList, Var *envColor = new Var("envColor", "vec3"); meta->addStatement(new GenOp(" @ = @.rgb - (@.rgb * @);\r\n", new DecOp(dColor), targ, targ, metalness)); meta->addStatement(new GenOp(" @ = @.rgb*(@).rgb;\r\n", new DecOp(envColor), targ, texCube)); + meta->addStatement(new GenOp(" @.rgb = @+@;\r\n", targ, dColor, envColor)); } else if (lerpVal) meta->addStatement(new GenOp(" @ *= vec4(@.rgb*@.a, @.a);\r\n", targ, texCube, lerpVal, targ)); diff --git a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp index eae07aa95..0b5f79e4d 100644 --- a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp +++ b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp @@ -892,6 +892,14 @@ Var* ShaderFeatureHLSL::getSurface(Vector& componentList, Mult } Var* wsEyePos = (Var*)LangElement::find("eyePosWorld"); + + if (!wsEyePos) + { + wsEyePos = new Var("eyePosWorld", "float3"); + wsEyePos->uniform = true; + wsEyePos->constSortPos = cspPass; + } + Var* wsPosition = getInWsPosition(componentList); Var* wsView = getWsView(wsPosition, meta); diff --git a/Engine/source/terrain/glsl/terrFeatureGLSL.cpp b/Engine/source/terrain/glsl/terrFeatureGLSL.cpp index d30e639ec..3b66006ce 100644 --- a/Engine/source/terrain/glsl/terrFeatureGLSL.cpp +++ b/Engine/source/terrain/glsl/terrFeatureGLSL.cpp @@ -281,6 +281,8 @@ void TerrainBaseMapFeatGLSL::processVert( Vector &componentLis Var *squareSize = _getUniformVar( "squareSize", "float", cspPass ); meta->addStatement( new GenOp( " @ = normalize( vec3( @, 0, @ ) );\r\n", new DecOp( inTanget ), squareSize, inTangentZ ) ); + + getOutViewToTangent(componentList, meta, fd); } void TerrainBaseMapFeatGLSL::processPix( Vector &componentList, @@ -331,6 +333,8 @@ void TerrainBaseMapFeatGLSL::processPix( Vector &componentLis meta->addStatement(new GenOp(" @ = float4(0.0, 1.0, 1.0, 0.0);\r\n", ormConfig)); output = meta; + + Var* viewToTangent = getInViewToTangent(componentList); } ShaderFeature::Resources TerrainBaseMapFeatGLSL::getResources( const MaterialFeatureData &fd ) @@ -781,6 +785,22 @@ void TerrainMacroMapFeatGLSL::processPix( Vector &componentL meta->addStatement( new GenOp( " @ = calcBlend( @.x, @.xy, @, @ );\r\n", new DecOp( detailBlend ), detailInfo, inTex, layerSize, layerSample ) ); + // Check to see if we have a gbuffer normal. + Var* gbNormal = (Var*)LangElement::find("gbNormal"); + + // If we have a gbuffer normal and we don't have a + // normal map feature then we need to lerp in a + // default normal else the normals below this layer + // will show thru. + if (gbNormal && + !fd.features.hasFeature(MFT_TerrainNormalMap, detailIndex)) + { + Var* viewToTangent = getInViewToTangent(componentList); + + meta->addStatement(new GenOp(" @ = lerp( @, @[2], min( @, @.w ) );\r\n", + gbNormal, gbNormal, viewToTangent, detailBlend, inDet)); + } + Var *detailColor = (Var*)LangElement::find( "macroColor" ); if ( !detailColor ) { @@ -1224,21 +1244,7 @@ void TerrainORMMapFeatGLSL::processPix(Vector &componentList, ShaderFeature::Resources TerrainORMMapFeatGLSL::getResources(const MaterialFeatureData &fd) { Resources res; - - S32 featureIndex = 0, firstOrmMapIndex = 0; - for (int idx = 0; idx < fd.features.getCount(); ++idx) { - const FeatureType& type = fd.features.getAt(idx, &featureIndex); - if (type == MFT_TerrainORMMap) { - firstOrmMapIndex = getMin(firstOrmMapIndex, featureIndex); - } - } - - // We only need to process normals during the deferred. - if (getProcessIndex() == firstOrmMapIndex) - { - res.numTexReg = 1; - res.numTex = 1; - } + res.numTex = 1; return res; } @@ -1283,7 +1289,10 @@ void TerrainBlankInfoMapFeatGLSL::processPix(Vector &component String matinfoName(String::ToString("matinfoCol%d", compositeIndex)); - meta->addStatement(new GenOp(" @.gba += vec3(@, @, 0.0);\r\n", ormConfig, detailBlend, detailBlend)); + if (!fd.features.hasFeature(MFT_TerrainHeightBlend)) + { + meta->addStatement(new GenOp(" @.gba += vec3(@, @, 0.0);\r\n", ormConfig, detailBlend, detailBlend)); + } output = meta; } From 5d26dba7da4967f7a0845a9b2f61e3cb5c55f81c Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Thu, 7 Oct 2021 00:27:39 -0400 Subject: [PATCH 156/399] * BugFix: Clear some MSVC compiler warnings. --- Engine/source/T3D/convexShape.cpp | 17 -------- Engine/source/T3D/lighting/IBLUtilities.cpp | 2 - Engine/source/T3D/shapeImage.cpp | 1 - Engine/source/console/SimXMLDocument.cpp | 1 - Engine/source/console/astNodes.cpp | 6 +-- Engine/source/console/compiledEval.cpp | 5 +-- Engine/source/environment/cloudLayer.cpp | 1 - Engine/source/environment/meshRoad.cpp | 1 - Engine/source/forest/forestItem.cpp | 2 - Engine/source/gfx/D3D11/gfxD3D11Cubemap.cpp | 3 -- .../gui/controls/guiGameListMenuCtrl.cpp | 9 ----- Engine/source/gui/controls/guiPopUpCtrl.cpp | 1 - Engine/source/gui/controls/guiPopUpCtrlEx.cpp | 1 - .../gui/utility/guiRenderTargetVizCtrl.cpp | 2 - .../advanced/advancedLightBinManager.cpp | 2 - .../materials/processedShaderMaterial.cpp | 7 ---- Engine/source/persistence/taml/taml.cpp | 2 +- .../source/platform/async/asyncPacketStream.h | 2 +- Engine/source/platform/platformNet.cpp | 40 +++---------------- .../renderInstance/renderTranslucentMgr.cpp | 1 - Engine/source/terrain/terrCellMaterial.cpp | 2 - Engine/source/terrain/terrData.cpp | 3 -- Engine/source/ts/tsCollision.cpp | 24 +++++------ 23 files changed, 24 insertions(+), 111 deletions(-) diff --git a/Engine/source/T3D/convexShape.cpp b/Engine/source/T3D/convexShape.cpp index e0184f2f4..729548ce7 100644 --- a/Engine/source/T3D/convexShape.cpp +++ b/Engine/source/T3D/convexShape.cpp @@ -222,7 +222,6 @@ bool ConvexShape::protectedSetSurface( void *object, const char *index, const ch */ String t = data; - S32 len = t.length(); dSscanf( data, "%g %g %g %g %g %g %g %i %g %g %g %g %f", &quat.x, &quat.y, &quat.z, &quat.w, &pos.x, &pos.y, &pos.z, &matID, &offset.x, &offset.y, &scale.x, &scale.y, &rot); @@ -961,17 +960,6 @@ bool ConvexShape::castRay( const Point3F &start, const Point3F &end, RayInfo *in VectorF rayDir( end - start ); rayDir.normalizeSafe(); - if ( false ) - { - PlaneF plane( Point3F(0,0,0), Point3F(0,0,1) ); - Point3F sp( 0,0,-1 ); - Point3F ep( 0,0,1 ); - - F32 t = plane.intersect( sp, ep ); - Point3F hitPnt; - hitPnt.interpolate( sp, ep, t ); - } - for ( S32 i = 0; i < planeCount; i++ ) { // Don't hit the back-side of planes. @@ -1376,8 +1364,6 @@ void ConvexShape::_updateGeometry( bool updateCollision ) { U32 count = faceList[i].triangles.size(); - S32 matID = mSurfaceUVs[i].matID; - mSurfaceBuffers[mSurfaceUVs[i].matID].mPrimCount += count; mSurfaceBuffers[mSurfaceUVs[i].matID].mVertCount += count * 3; } @@ -1429,9 +1415,6 @@ void ConvexShape::_updateGeometry( bool updateCollision ) { if (mSurfaceBuffers[i].mVertCount > 0) { - U32 primCount = mSurfaceBuffers[i].mPrimCount; - U32 vertCount = mSurfaceBuffers[i].mVertCount; - mSurfaceBuffers[i].mVertexBuffer.set(GFX, mSurfaceBuffers[i].mVertCount, GFXBufferTypeStatic); VertexType *pVert = mSurfaceBuffers[i].mVertexBuffer.lock(); diff --git a/Engine/source/T3D/lighting/IBLUtilities.cpp b/Engine/source/T3D/lighting/IBLUtilities.cpp index f3b7c477c..5cdf27acb 100644 --- a/Engine/source/T3D/lighting/IBLUtilities.cpp +++ b/Engine/source/T3D/lighting/IBLUtilities.cpp @@ -46,7 +46,6 @@ namespace IBLUtilities } GFXShaderConstBufferRef irrConsts = irrShader->allocConstBuffer(); - GFXShaderConstHandle* irrEnvMapSC = irrShader->getShaderConstHandle("$environmentMap"); GFXShaderConstHandle* irrFaceSC = irrShader->getShaderConstHandle("$face"); GFXStateBlockDesc desc; @@ -132,7 +131,6 @@ namespace IBLUtilities } GFXShaderConstBufferRef prefilterConsts = prefilterShader->allocConstBuffer(); - GFXShaderConstHandle* prefilterEnvMapSC = prefilterShader->getShaderConstHandle("$environmentMap"); GFXShaderConstHandle* prefilterFaceSC = prefilterShader->getShaderConstHandle("$face"); GFXShaderConstHandle* prefilterRoughnessSC = prefilterShader->getShaderConstHandle("$roughness"); GFXShaderConstHandle* prefilterMipSizeSC = prefilterShader->getShaderConstHandle("$mipSize"); diff --git a/Engine/source/T3D/shapeImage.cpp b/Engine/source/T3D/shapeImage.cpp index 7bd42bea5..b8ea08a75 100644 --- a/Engine/source/T3D/shapeImage.cpp +++ b/Engine/source/T3D/shapeImage.cpp @@ -407,7 +407,6 @@ bool ShapeBaseImageData::preload(bool server, String &errorStr) { if (!Parent::preload(server, errorStr)) return false; - bool shapeError = false; // Resolve objects transmitted from server if (!server) { diff --git a/Engine/source/console/SimXMLDocument.cpp b/Engine/source/console/SimXMLDocument.cpp index 9f0bd4ff4..6e0de4c19 100644 --- a/Engine/source/console/SimXMLDocument.cpp +++ b/Engine/source/console/SimXMLDocument.cpp @@ -827,7 +827,6 @@ void SimXMLDocument::setObjectAttributes(const char* objectID) char textbuf[1024]; tinyxml2::XMLElement* field = m_qDocument->NewElement("Field"); - tinyxml2::XMLElement* group = m_qDocument->NewElement("FieldGroup"); pElement->SetAttribute( "Name", pObject->getName() ); diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index aaca1ea06..c34c4b38d 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -74,7 +74,7 @@ void StmtNode::addBreakLine(CodeStream& code) //------------------------------------------------------------ -StmtNode::StmtNode() +StmtNode::StmtNode() : dbgLineNumber(0) { next = NULL; dbgFileName = CodeBlock::smCurrentParser->getCurrentFile(); @@ -84,12 +84,12 @@ void StmtNode::setPackage(StringTableEntry) { } -void StmtNode::append(StmtNode* next) +void StmtNode::append(StmtNode* appended) { StmtNode* walk = this; while (walk->next) walk = walk->next; - walk->next = next; + walk->next = appended; } diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 360c13c90..e9862c7ee 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -717,7 +717,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa TelDebugger->pushStackFrame(); StringTableEntry var, objParent; - U32 failJump; + U32 failJump = 0; StringTableEntry fnName; StringTableEntry fnNamespace, fnPackage; @@ -776,7 +776,6 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa fnNamespace = CodeToSTE(code, ip + 2); fnPackage = CodeToSTE(code, ip + 4); bool hasBody = (code[ip + 6] & 0x01) != 0; - U32 lineNumber = code[ip + 6] >> 1; Namespace::unlinkPackages(); if (fnNamespace == NULL && fnPackage == NULL) @@ -1819,8 +1818,6 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa // it handles this method. It is set to an enum from the table // above indicating whether it handles it on a component it owns // or just on the object. - S32 routingId = 0; - fnName = CodeToSTE(code, ip); fnNamespace = CodeToSTE(code, ip + 2); U32 callType = code[ip + 4]; diff --git a/Engine/source/environment/cloudLayer.cpp b/Engine/source/environment/cloudLayer.cpp index 01e55dc6e..29d2ab502 100644 --- a/Engine/source/environment/cloudLayer.cpp +++ b/Engine/source/environment/cloudLayer.cpp @@ -278,7 +278,6 @@ void CloudLayer::unpackUpdate( NetConnection *conn, BitStream *stream ) stream->read( &mBaseColor ); - F32 oldCoverage = mCoverage; stream->read( &mCoverage ); stream->read( &mExposure ); diff --git a/Engine/source/environment/meshRoad.cpp b/Engine/source/environment/meshRoad.cpp index 01f8017de..84cbb2d0f 100644 --- a/Engine/source/environment/meshRoad.cpp +++ b/Engine/source/environment/meshRoad.cpp @@ -2896,7 +2896,6 @@ void MeshRoad::_generateVerts() // Make Primitive Buffers U32 p00, p01, p11, p10; - U32 pb00, pb01, pb11, pb10; U32 offset = 0; U16 *pIdx = NULL; U32 curIdx = 0; diff --git a/Engine/source/forest/forestItem.cpp b/Engine/source/forest/forestItem.cpp index 11d514b34..36ac0dfe3 100644 --- a/Engine/source/forest/forestItem.cpp +++ b/Engine/source/forest/forestItem.cpp @@ -190,8 +190,6 @@ void ForestItemData::unpackData(BitStream* stream) stream->read( &localName ); setInternalName( localName ); - char readBuffer[1024]; - UNPACKDATA_SHAPEASSET(Shape); mCollidable = stream->readFlag(); diff --git a/Engine/source/gfx/D3D11/gfxD3D11Cubemap.cpp b/Engine/source/gfx/D3D11/gfxD3D11Cubemap.cpp index 562ab7b63..ed10be7bd 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11Cubemap.cpp +++ b/Engine/source/gfx/D3D11/gfxD3D11Cubemap.cpp @@ -528,9 +528,6 @@ void GFXD3D11CubemapArray::init(const U32 cubemapCount, const U32 cubemapFaceSiz void GFXD3D11CubemapArray::updateTexture(const GFXCubemapHandle &cubemap, const U32 slot) { - U32 cubeMapSz = cubemap->getSize(); - U32 cubeMapSize = cubemap->getMipMapLevels(); - AssertFatal(slot <= mNumCubemaps, "GFXD3D11CubemapArray::updateTexture - trying to update a cubemap texture that is out of bounds!"); AssertFatal(mFormat == cubemap->getFormat(), "GFXD3D11CubemapArray::updateTexture - Destination format doesn't match"); AssertFatal(mSize == cubemap->getSize(), "GFXD3D11CubemapArray::updateTexture - Destination size doesn't match"); diff --git a/Engine/source/gui/controls/guiGameListMenuCtrl.cpp b/Engine/source/gui/controls/guiGameListMenuCtrl.cpp index 72b3d02f2..33efb32d8 100644 --- a/Engine/source/gui/controls/guiGameListMenuCtrl.cpp +++ b/Engine/source/gui/controls/guiGameListMenuCtrl.cpp @@ -275,8 +275,6 @@ void GuiGameListMenuCtrl::onRenderSliderOption(Row* row, Point2I currentOffset) Point2I arrowOffset; S32 columnSplit = profile->mColumnSplit * xScale; - S32 iconIndex; - bool isRowSelected = (getSelected() != NO_ROW) && (row == mRows[getSelected()]); bool isRowHighlighted = (getHighlighted() != NO_ROW) ? ((row == mRows[getHighlighted()]) && (row->mEnabled)) : false; /*if (profileHasArrows) @@ -384,8 +382,6 @@ void GuiGameListMenuCtrl::onRenderKeybindOption(Row* row, Point2I currentOffset) S32 rowHeight = profile->getRowHeight(); - S32 optionWidth = xScale - columnSplit; - GFXDrawUtil* drawer = GFX->getDrawUtil(); //drawer->drawBitmap(row->mBitmap, ) @@ -1048,7 +1044,6 @@ RectI GuiGameListMenuCtrl::getRowBounds(S32 rowIndex) { GuiGameListMenuProfile* profile = (GuiGameListMenuProfile*)mProfile; - F32 xScale = (float)getWidth() / profile->getRowWidth(); S32 rowHeight = profile->getRowHeight(); Point2I currentOffset = Point2I::Zero; @@ -1375,9 +1370,6 @@ void GuiGameListMenuCtrl::clickKeybind(Row* row, S32 xPos) S32 rowHeight = profile->getRowHeight(); - S32 optionWidth = xScale - columnSplit; - - GFXDrawUtil* drawer = GFX->getDrawUtil(); //drawer->drawBitmap(row->mBitmap, ) Point2I button; @@ -1388,7 +1380,6 @@ void GuiGameListMenuCtrl::clickKeybind(Row* row, S32 xPos) buttonSize.x = rowHeight / 2; buttonSize.y = rowHeight / 2; - GFXTextureObject* texture = row->mBitmapTex; RectI rect(button, buttonSize); if (rect.pointInRect(Point2I(xPos, rowHeight / 2))) diff --git a/Engine/source/gui/controls/guiPopUpCtrl.cpp b/Engine/source/gui/controls/guiPopUpCtrl.cpp index 0cd08dfb8..d66f50e92 100644 --- a/Engine/source/gui/controls/guiPopUpCtrl.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrl.cpp @@ -311,7 +311,6 @@ void GuiPopUpMenuCtrl::initPersistFields(void) bool GuiPopUpMenuCtrl::_setBitmaps(void* obj, const char* index, const char* data) { - bool ret = false; GuiPopUpMenuCtrl* object = static_cast(obj); object->setBitmap(data); diff --git a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp index 5cbd1e3bc..b66e0d209 100644 --- a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp @@ -365,7 +365,6 @@ void GuiPopUpMenuCtrlEx::initPersistFields(void) bool GuiPopUpMenuCtrlEx::_setBitmaps(void* obj, const char* index, const char* data) { - bool ret = false; GuiPopUpMenuCtrlEx* object = static_cast(obj); object->setBitmap(data); diff --git a/Engine/source/gui/utility/guiRenderTargetVizCtrl.cpp b/Engine/source/gui/utility/guiRenderTargetVizCtrl.cpp index 91544f5e0..6c1366afb 100644 --- a/Engine/source/gui/utility/guiRenderTargetVizCtrl.cpp +++ b/Engine/source/gui/utility/guiRenderTargetVizCtrl.cpp @@ -102,8 +102,6 @@ void GuiRenderTargetVizCtrl::onRender(Point2I offset, camObject = dynamic_cast(camObject->getClientObject()); - bool servObj = camObject->isServerObject(); - if (camObject) { GFXTexHandle targ = camObject->getCameraRenderTarget(); diff --git a/Engine/source/lighting/advanced/advancedLightBinManager.cpp b/Engine/source/lighting/advanced/advancedLightBinManager.cpp index 322560799..fd8cd6dc4 100644 --- a/Engine/source/lighting/advanced/advancedLightBinManager.cpp +++ b/Engine/source/lighting/advanced/advancedLightBinManager.cpp @@ -323,8 +323,6 @@ void AdvancedLightBinManager::_scoreLights(const MatrixF& cameraTrans) { if (dist > smLightFadeStart) { - F32 brightness = light.lightInfo->getBrightness(); - float fadeOutAmt = (dist - smLightFadeStart) / (smLightFadeEnd - smLightFadeStart); fadeOutAmt = 1 - fadeOutAmt; diff --git a/Engine/source/materials/processedShaderMaterial.cpp b/Engine/source/materials/processedShaderMaterial.cpp index fc453958f..b6d7be05c 100644 --- a/Engine/source/materials/processedShaderMaterial.cpp +++ b/Engine/source/materials/processedShaderMaterial.cpp @@ -1290,16 +1290,9 @@ void ProcessedShaderMaterial::setCustomShaderData(VectormCustomHandles.size(); ++h) - { - StringTableEntry handleName = shaderData[i].getHandleName(); - bool tmp = true; - } //roll through and try setting our data! for (U32 h = 0; h < handles->mCustomHandles.size(); ++h) { - StringTableEntry handleName = shaderData[i].getHandleName(); - StringTableEntry rpdHandleName = handles->mCustomHandles[h].handleName; if (handles->mCustomHandles[h].handleName == shaderData[i].getHandleName()) { if (handles->mCustomHandles[h].handle->isValid()) diff --git a/Engine/source/persistence/taml/taml.cpp b/Engine/source/persistence/taml/taml.cpp index 0454e102a..b05b0d8bc 100644 --- a/Engine/source/persistence/taml/taml.cpp +++ b/Engine/source/persistence/taml/taml.cpp @@ -640,7 +640,7 @@ ImplementEnumType(_TamlFormatMode, // Iterate fields. U8 arrayDepth = 0; - TamlCustomNode* currentArrayNode; + TamlCustomNode* currentArrayNode = NULL; for (U32 index = 0; index < fieldCount; ++index) { // Fetch field. diff --git a/Engine/source/platform/async/asyncPacketStream.h b/Engine/source/platform/async/asyncPacketStream.h index 44b4b661f..00f798946 100644 --- a/Engine/source/platform/async/asyncPacketStream.h +++ b/Engine/source/platform/async/asyncPacketStream.h @@ -282,7 +282,7 @@ void AsyncPacketBufferedInputStream< Stream, Packet >::_requestNext() if( resettable ) { IPositionable< U32 >* positionable = dynamic_cast< IPositionable< U32 >* >( &Deref( stream ) ); - U32 pos; + U32 pos = 0; if(positionable) pos = positionable->getPosition(); diff --git a/Engine/source/platform/platformNet.cpp b/Engine/source/platform/platformNet.cpp index db7c26604..a97a094c0 100644 --- a/Engine/source/platform/platformNet.cpp +++ b/Engine/source/platform/platformNet.cpp @@ -95,36 +95,6 @@ typedef int SOCKET; #endif -#if defined(TORQUE_USE_WINSOCK) -static const char* strerror_wsa( S32 code ) -{ - switch( code ) - { -#define E( name ) case name: return #name; - E( WSANOTINITIALISED ); - E( WSAENETDOWN ); - E( WSAEADDRINUSE ); - E( WSAEINPROGRESS ); - E( WSAEALREADY ); - E( WSAEADDRNOTAVAIL ); - E( WSAEAFNOSUPPORT ); - E( WSAEFAULT ); - E( WSAEINVAL ); - E( WSAEISCONN ); - E( WSAENETUNREACH ); - E( WSAEHOSTUNREACH ); - E( WSAENOBUFS ); - E( WSAENOTSOCK ); - E( WSAETIMEDOUT ); - E( WSAEWOULDBLOCK ); - E( WSAEACCES ); -#undef E - default: - return "Unknown"; - } -} -#endif - #include "core/util/tVector.h" #include "platform/platformNetAsync.h" #include "console/console.h" @@ -1243,7 +1213,8 @@ void Net::process() } break; case PolledSocket::NameLookupRequired: - U32 newState; + { + U32 newState = Net::NoError; // is the lookup complete? if (!gNetAsync.checkLookup( @@ -1262,7 +1233,7 @@ void Net::process() { // try to connect out_h_addr.port = currentSock->remotePort; - const sockaddr *ai_addr = NULL; + const sockaddr* ai_addr = NULL; int ai_addrlen = 0; sockaddr_in socketAddress; sockaddr_in6 socketAddress6; @@ -1304,7 +1275,7 @@ void Net::process() else { Con::errorf("Error connecting to %s: Invalid Protocol", - currentSock->remoteAddr); + currentSock->remoteAddr); newState = Net::ConnectFailed; removeSock = true; removeSockHandle = currentSock->handleFd; @@ -1319,7 +1290,7 @@ void Net::process() if (err != Net::WouldBlock) { Con::errorf("Error connecting to %s: %u", - currentSock->remoteAddr, err); + currentSock->remoteAddr, err); newState = Net::ConnectFailed; removeSock = true; removeSockHandle = currentSock->handleFd; @@ -1340,6 +1311,7 @@ void Net::process() smConnectionNotify->trigger(currentSock->handleFd, newState); break; + } case PolledSocket::Listening: NetAddress incomingAddy; diff --git a/Engine/source/renderInstance/renderTranslucentMgr.cpp b/Engine/source/renderInstance/renderTranslucentMgr.cpp index 725cd3e7e..8c4b0cc8c 100644 --- a/Engine/source/renderInstance/renderTranslucentMgr.cpp +++ b/Engine/source/renderInstance/renderTranslucentMgr.cpp @@ -144,7 +144,6 @@ void RenderTranslucentMgr::render( SceneRenderState *state ) GFXTextureObject *lastLM = NULL; GFXCubemap *lastCubemap = NULL; GFXTextureObject *lastReflectTex = NULL; - GFXTextureObject *lastMiscTex = NULL; GFXTextureObject *lastAccuTex = NULL; // Find the particle render manager (if we don't have it) diff --git a/Engine/source/terrain/terrCellMaterial.cpp b/Engine/source/terrain/terrCellMaterial.cpp index ff34a65ac..5f6eefd08 100644 --- a/Engine/source/terrain/terrCellMaterial.cpp +++ b/Engine/source/terrain/terrCellMaterial.cpp @@ -615,8 +615,6 @@ bool TerrainCellMaterial::_initShader(bool deferredMat, mOrmTexArrayConst = mShader->getShaderConstHandle("$ormMapSampler"); if (mOrmTexArrayConst->isValid()) { - GFXTextureProfile* profile = &GFXStaticTextureProfile; - const S32 sampler = mOrmTexArrayConst->getSamplerRegister(); desc.samplers[sampler] = GFXSamplerStateDesc::getWrapLinear(); diff --git a/Engine/source/terrain/terrData.cpp b/Engine/source/terrain/terrData.cpp index be43d6638..0f07abd9b 100644 --- a/Engine/source/terrain/terrData.cpp +++ b/Engine/source/terrain/terrData.cpp @@ -992,8 +992,6 @@ void TerrainBlock::addMaterial( const String &name, U32 insertAt ) mFile->mMaterials.push_back( mat ); mFile->_initMaterialInstMapping(); - bool isSrv = isServerObject(); - //now we update our asset if (mTerrainAsset) { @@ -1418,7 +1416,6 @@ void TerrainBlock::unpackUpdate(NetConnection* con, BitStream *stream) char buffer[256]; stream->readString(buffer); - bool validAsset = setTerrainAsset(StringTable->insert(buffer)); } if (baseTexSizeChanged && isProperlyAdded()) _updateBaseTexture(NONE); diff --git a/Engine/source/ts/tsCollision.cpp b/Engine/source/ts/tsCollision.cpp index 53fcb60d6..22381436b 100644 --- a/Engine/source/ts/tsCollision.cpp +++ b/Engine/source/ts/tsCollision.cpp @@ -1044,9 +1044,9 @@ PhysicsCollision* TSShape::_buildColShapes( bool useVisibleMesh, const Point3F & // We need the default mesh transform. MatrixF localXfm; getNodeWorldTransform( object.nodeIndex, &localXfm ); - Point3F t = localXfm.getPosition(); - t.convolve(scale); - localXfm.setPosition(t); + Point3F nodeWorldPosition = localXfm.getPosition(); + nodeWorldPosition.convolve(scale); + localXfm.setPosition(nodeWorldPosition); // We have some sort of collision shape... so allocate it. if ( !colShape ) @@ -1061,9 +1061,9 @@ PhysicsCollision* TSShape::_buildColShapes( bool useVisibleMesh, const Point3F & // Add the offset to the center of the bounds // into the local space transform. MatrixF centerXfm( true ); - Point3F t = mesh->getBounds().getCenter(); - t.convolve(scale); - centerXfm.setPosition(t); + Point3F meshBoundsCenter = mesh->getBounds().getCenter(); + meshBoundsCenter.convolve(scale); + centerXfm.setPosition(meshBoundsCenter); localXfm.mul( centerXfm ); colShape->addBox( halfWidth, localXfm ); @@ -1077,9 +1077,9 @@ PhysicsCollision* TSShape::_buildColShapes( bool useVisibleMesh, const Point3F & // Add the offset to the center of the bounds // into the local space transform. MatrixF primXfm( true ); - Point3F t = mesh->getBounds().getCenter(); - t.convolve(scale); - primXfm.setPosition(t); + Point3F meshBoundsCenter = mesh->getBounds().getCenter(); + meshBoundsCenter.convolve(scale); + primXfm.setPosition(meshBoundsCenter); localXfm.mul( primXfm ); colShape->addSphere( radius, localXfm ); @@ -1092,9 +1092,9 @@ PhysicsCollision* TSShape::_buildColShapes( bool useVisibleMesh, const Point3F & // We need to center the capsule and align it to the Y axis. MatrixF primXfm( true ); - Point3F t = mesh->getBounds().getCenter(); - t.convolve(scale); - primXfm.setPosition(t); + Point3F meshBoundsCenter = mesh->getBounds().getCenter(); + meshBoundsCenter.convolve(scale); + primXfm.setPosition(meshBoundsCenter); // Use the longest axis as the capsule height. F32 height = -radius * 2.0f; From 22d6b4a1f139c73edde7d466e0d810a2ecc465da Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Thu, 7 Oct 2021 00:32:42 -0400 Subject: [PATCH 157/399] * BugFix: Correct an accidentally removed line from clearing compiler warnings. --- Engine/source/terrain/terrData.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Engine/source/terrain/terrData.cpp b/Engine/source/terrain/terrData.cpp index 0f07abd9b..532e0cc19 100644 --- a/Engine/source/terrain/terrData.cpp +++ b/Engine/source/terrain/terrData.cpp @@ -1416,6 +1416,7 @@ void TerrainBlock::unpackUpdate(NetConnection* con, BitStream *stream) char buffer[256]; stream->readString(buffer); + setTerrainAsset(StringTable->insert(buffer)); } if (baseTexSizeChanged && isProperlyAdded()) _updateBaseTexture(NONE); From 74cc60508b5e957f72fda20e3aac5b6d1f1c1332 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Thu, 7 Oct 2021 01:10:00 -0400 Subject: [PATCH 158/399] * BugFix: More cleanup of MSVC compiler warnings. --- Engine/source/T3D/assets/GUIAsset.cpp | 2 -- Engine/source/T3D/assets/ImageAsset.cpp | 17 ----------------- Engine/source/T3D/assets/ScriptAsset.cpp | 10 ---------- Engine/source/T3D/assets/ShapeAsset.cpp | 2 -- Engine/source/T3D/assets/TerrainAsset.cpp | 2 -- Engine/source/T3D/assets/assetImporter.cpp | 9 +-------- Engine/source/windowManager/sdl/sdlWindow.cpp | 2 +- 7 files changed, 2 insertions(+), 42 deletions(-) diff --git a/Engine/source/T3D/assets/GUIAsset.cpp b/Engine/source/T3D/assets/GUIAsset.cpp index f9a2b500c..cacc3f9be 100644 --- a/Engine/source/T3D/assets/GUIAsset.cpp +++ b/Engine/source/T3D/assets/GUIAsset.cpp @@ -65,8 +65,6 @@ ConsoleSetType(TypeGUIAssetPtr) if (argc == 1) { // Yes, so fetch field value. - const char* pFieldValue = argv[0]; - *((const char**)dptr) = StringTable->insert(argv[0]); return; diff --git a/Engine/source/T3D/assets/ImageAsset.cpp b/Engine/source/T3D/assets/ImageAsset.cpp index 4376614ed..fea2bca3e 100644 --- a/Engine/source/T3D/assets/ImageAsset.cpp +++ b/Engine/source/T3D/assets/ImageAsset.cpp @@ -275,21 +275,6 @@ void ImageAsset::loadImage() mLoadedState = Ok; mIsValidImage = true; return; - - //GFXTexHandle texture = getTexture(&GFXStaticTextureSRGBProfile); - - //mTexture.set(mImagePath, &GFXStaticTextureSRGBProfile, avar("%s() - mImage (line %d)", __FUNCTION__, __LINE__)); - - /*if (texture.isValid()) - { - mIsValidImage = true; - - //mBitmap = texture.getBitmap(); - - return; - }*/ - - mChangeSignal.trigger(); } mLoadedState = BadFileReference; @@ -497,8 +482,6 @@ GuiControl* GuiInspectorTypeImageAssetPtr::constructEditControl() mInspector->getInspectObject()->getIdString(), mCaption); mBrowseButton->setField("Command", szBuffer); - const char* id = mInspector->getInspectObject()->getIdString(); - setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString()); // Create "Open in ShapeEditor" button diff --git a/Engine/source/T3D/assets/ScriptAsset.cpp b/Engine/source/T3D/assets/ScriptAsset.cpp index dad8ab1c6..ee1b696d0 100644 --- a/Engine/source/T3D/assets/ScriptAsset.cpp +++ b/Engine/source/T3D/assets/ScriptAsset.cpp @@ -191,16 +191,6 @@ bool ScriptAsset::execScript() return true; return false; - - if (Torque::FS::IsScriptFile(mScriptPath)) - { - return Con::executeFile(mScriptPath, false, false); - } - else - { - Con::errorf("ScriptAsset:execScript() - Script asset must have a valid file to exec"); - return false; - } } DefineEngineMethod(ScriptAsset, execScript, bool, (), , diff --git a/Engine/source/T3D/assets/ShapeAsset.cpp b/Engine/source/T3D/assets/ShapeAsset.cpp index bde3b4af5..7a8628238 100644 --- a/Engine/source/T3D/assets/ShapeAsset.cpp +++ b/Engine/source/T3D/assets/ShapeAsset.cpp @@ -603,8 +603,6 @@ GuiControl* GuiInspectorTypeShapeAssetPtr::constructEditControl() mInspector->getInspectObject()->getIdString(), mCaption); mBrowseButton->setField("Command", szBuffer); - const char* id = mInspector->getInspectObject()->getIdString(); - setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString()); // Create "Open in ShapeEditor" button diff --git a/Engine/source/T3D/assets/TerrainAsset.cpp b/Engine/source/T3D/assets/TerrainAsset.cpp index da0372097..70ce8786b 100644 --- a/Engine/source/T3D/assets/TerrainAsset.cpp +++ b/Engine/source/T3D/assets/TerrainAsset.cpp @@ -468,8 +468,6 @@ GuiControl* GuiInspectorTypeTerrainAssetPtr::constructEditControl() mInspector->getInspectObject()->getIdString(), mCaption); mBrowseButton->setField("Command", szBuffer); - const char* id = mInspector->getInspectObject()->getIdString(); - setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString()); // Create "Open in ShapeEditor" button diff --git a/Engine/source/T3D/assets/assetImporter.cpp b/Engine/source/T3D/assets/assetImporter.cpp index c9ed8a211..e9afcc479 100644 --- a/Engine/source/T3D/assets/assetImporter.cpp +++ b/Engine/source/T3D/assets/assetImporter.cpp @@ -1821,10 +1821,8 @@ void AssetImporter::processShapeAsset(AssetImportObject* assetItem) } S32 meshCount = dAtoi(assetItem->shapeInfo->getDataField(StringTable->insert("_meshCount"), nullptr)); - S32 shapeItem = assetItem->shapeInfo->findItemByName("Meshes"); S32 animCount = dAtoi(assetItem->shapeInfo->getDataField(StringTable->insert("_animCount"), nullptr)); - S32 animItem = assetItem->shapeInfo->findItemByName("Animations"); S32 materialCount = dAtoi(assetItem->shapeInfo->getDataField(StringTable->insert("_materialCount"), nullptr)); S32 matItem = assetItem->shapeInfo->findItemByName("Materials"); @@ -2005,9 +2003,7 @@ void AssetImporter::validateAsset(AssetImportObject* assetItem) if (assetItem->importStatus == AssetImportObject::Skipped || assetItem->importStatus == AssetImportObject::NotProcessed) return; - bool hasCollision = checkAssetForCollision(assetItem); - - if (hasCollision) + if (checkAssetForCollision(assetItem)) { importIssues = true; return; @@ -2018,7 +2014,6 @@ void AssetImporter::validateAsset(AssetImportObject* assetItem) AssetQuery aQuery; U32 numAssetsFound = AssetDatabase.findAllAssets(&aQuery); - bool hasCollision = false; for (U32 i = 0; i < numAssetsFound; i++) { StringTableEntry assetId = aQuery.mAssetList[i]; @@ -2032,7 +2027,6 @@ void AssetImporter::validateAsset(AssetImportObject* assetItem) if (assetName == StringTable->insert(assetItem->assetName.c_str())) { - hasCollision = true; assetItem->status = "Error"; assetItem->statusType = "DuplicateAsset"; assetItem->statusInfo = "Duplicate asset names found within the target module!\nAsset \"" + assetItem->assetName + "\" of type \"" + assetItem->assetType + "\" has a matching name.\nPlease rename it and try again!"; @@ -2241,7 +2235,6 @@ void AssetImporter::resetImportConfig() activeImportConfig->registerObject(); } - bool foundConfig = false; Settings* editorSettings; //See if we can get our editor settings if (Sim::findObject("EditorSettings", editorSettings)) diff --git a/Engine/source/windowManager/sdl/sdlWindow.cpp b/Engine/source/windowManager/sdl/sdlWindow.cpp index 2c725a2d1..6b420d080 100644 --- a/Engine/source/windowManager/sdl/sdlWindow.cpp +++ b/Engine/source/windowManager/sdl/sdlWindow.cpp @@ -550,7 +550,7 @@ void PlatformWindowSDL::_triggerTextNotify(const SDL_Event& evt) } else // get a wchar string { - const U32 len = strlen(evt.text.text); + const dsize_t len = strlen(evt.text.text); U16 wchar[16] = {}; dMemcpy(wchar, evt.text.text, sizeof(char)*len); From 15b946fb35c86f6e4207cf55e71e55075444153e Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Thu, 7 Oct 2021 09:59:03 -0400 Subject: [PATCH 159/399] * Adjustment: Utilize native compiler intrinsics for endian swapping when available. --- Engine/source/core/util/endian.h | 13 ++++++++++++- Engine/source/platform/types.gcc.h | 7 +++++-- Engine/source/platform/types.visualc.h | 7 +++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Engine/source/core/util/endian.h b/Engine/source/core/util/endian.h index 566f8be54..eaff3c03c 100644 --- a/Engine/source/core/util/endian.h +++ b/Engine/source/core/util/endian.h @@ -48,8 +48,12 @@ Convert the byte ordering on the U16 to and from big/little endian format. inline U16 endianSwap(const U16 in_swap) { +#ifdef TORQUE_U16_ENDIANSWAP_BUILTIN + return TORQUE_U16_ENDIANSWAP_BUILTIN(in_swap); +#else return U16(((in_swap >> 8) & 0x00ff) | ((in_swap << 8) & 0xff00)); +#endif } inline S16 endianSwap(const S16 in_swap) @@ -64,10 +68,14 @@ Convert the byte ordering on the U32 to and from big/little endian format. */ inline U32 endianSwap(const U32 in_swap) { +#ifdef TORQUE_U32_ENDIANSWAP_BUILTIN + return TORQUE_U32_ENDIANSWAP_BUILTIN(in_swap); +#else return U32(((in_swap >> 24) & 0x000000ff) | ((in_swap >> 8) & 0x0000ff00) | ((in_swap << 8) & 0x00ff0000) | ((in_swap << 24) & 0xff000000)); +#endif } inline S32 endianSwap(const S32 in_swap) @@ -77,12 +85,16 @@ inline S32 endianSwap(const S32 in_swap) inline U64 endianSwap(const U64 in_swap) { +#ifdef TORQUE_U64_ENDIANSWAP_BUILTIN + return TORQUE_U64_ENDIANSWAP_BUILTIN(in_swap); +#else U32 *inp = (U32 *) &in_swap; U64 ret; U32 *outp = (U32 *) &ret; outp[0] = endianSwap(inp[1]); outp[1] = endianSwap(inp[0]); return ret; +#endif } inline S64 endianSwap(const S64 in_swap) @@ -138,4 +150,3 @@ TORQUE_DECLARE_TEMPLATIZED_ENDIAN_CONV(F32) TORQUE_DECLARE_TEMPLATIZED_ENDIAN_CONV(F64) #endif - diff --git a/Engine/source/platform/types.gcc.h b/Engine/source/platform/types.gcc.h index 8255a251d..f6f4cf6df 100644 --- a/Engine/source/platform/types.gcc.h +++ b/Engine/source/platform/types.gcc.h @@ -107,7 +107,7 @@ typedef unsigned long U64; // This could be reconfigured for static builds, though minimal impact //# define TORQUE_SUPPORTS_NASM # endif -#else +#else # error "GCC: Unsupported Operating System" #endif @@ -169,5 +169,8 @@ typedef unsigned long U64; #endif #endif -#endif // INCLUDED_TYPES_GCC_H +#define TORQUE_U16_ENDIANSWAP_BUILTIN __builtin_bswap16 +#define TORQUE_U32_ENDIANSWAP_BUILTIN __builtin_bswap32 +#define TORQUE_U64_ENDIANSWAP_BUILTIN __builtin_bswap64 +#endif // INCLUDED_TYPES_GCC_H diff --git a/Engine/source/platform/types.visualc.h b/Engine/source/platform/types.visualc.h index 4ccc6ce42..1b62da721 100644 --- a/Engine/source/platform/types.visualc.h +++ b/Engine/source/platform/types.visualc.h @@ -69,7 +69,7 @@ typedef unsigned _int64 U64; # define TORQUE_OS_WIN # define TORQUE_OS_WIN64 # include "platform/types.win.h" -#else +#else # error "VC: Unsupported Operating System" #endif @@ -115,5 +115,8 @@ typedef unsigned _int64 U64; #define TORQUE_UNLIKELY #endif -#endif // INCLUDED_TYPES_VISUALC_H +#define TORQUE_U16_ENDIANSWAP_BUILTIN _byteswap_ushort +#define TORQUE_U32_ENDIANSWAP_BUILTIN _byteswap_ulong +#define TORQUE_U64_ENDIANSWAP_BUILTIN _byteswap_uint64 +#endif // INCLUDED_TYPES_VISUALC_H From 2d55fcf1bcf3744244a624b65d95b6b2bead3cb1 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Thu, 7 Oct 2021 13:16:55 -0400 Subject: [PATCH 160/399] * BugFix: Invert the corrections made in ImageAsset and ScriptAsset to be correct. --- Engine/source/T3D/assets/ImageAsset.cpp | 5 +++-- Engine/source/T3D/assets/ScriptAsset.cpp | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Engine/source/T3D/assets/ImageAsset.cpp b/Engine/source/T3D/assets/ImageAsset.cpp index fea2bca3e..eb5f5036d 100644 --- a/Engine/source/T3D/assets/ImageAsset.cpp +++ b/Engine/source/T3D/assets/ImageAsset.cpp @@ -147,7 +147,7 @@ void ImageAsset::consoleInit() Con::addVariable("$Core::NoImageAssetFallback", TypeString, &smNoImageAssetFallback, "The assetId of the texture to display when the requested image asset is missing.\n" "@ingroup GFX\n"); - + smNoImageAssetFallback = StringTable->insert(Con::getVariable("$Core::NoImageAssetFallback")); } @@ -274,6 +274,7 @@ void ImageAsset::loadImage() mLoadedState = Ok; mIsValidImage = true; + mChangeSignal.trigger(); return; } mLoadedState = BadFileReference; @@ -552,7 +553,7 @@ bool GuiInspectorTypeImageAssetPtr::renderTooltip(const Point2I& hoverPos, const if (texture.isNull()) return false; - // Render image at a reasonable screen size while + // Render image at a reasonable screen size while // keeping its aspect ratio... Point2I screensize = getRoot()->getWindowSize(); Point2I offset = hoverPos; diff --git a/Engine/source/T3D/assets/ScriptAsset.cpp b/Engine/source/T3D/assets/ScriptAsset.cpp index ee1b696d0..199c6402c 100644 --- a/Engine/source/T3D/assets/ScriptAsset.cpp +++ b/Engine/source/T3D/assets/ScriptAsset.cpp @@ -190,6 +190,11 @@ bool ScriptAsset::execScript() if (handle) return true; + if (Torque::FS::IsScriptFile(mScriptPath)) + { + return Con::executeFile(mScriptPath, false, false); + } + Con::errorf("ScriptAsset:execScript() - Script asset must have a valid file to exec"); return false; } From cf9d15a9d48bed4c3174dfaa7156778448d4ea8b Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Fri, 8 Oct 2021 17:23:16 -0400 Subject: [PATCH 161/399] * BugFix: Correct a Windows compilation error in the endian swap code due to a missing include. --- Engine/source/platform/types.visualc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Engine/source/platform/types.visualc.h b/Engine/source/platform/types.visualc.h index 1b62da721..2be0e51b3 100644 --- a/Engine/source/platform/types.visualc.h +++ b/Engine/source/platform/types.visualc.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_TYPES_VISUALC_H #define INCLUDED_TYPES_VISUALC_H +#include // For more information on VisualC++ predefined macros // http://support.microsoft.com/default.aspx?scid=kb;EN-US;q65472 From 23e5e891ed0f4a57ae11e3c4e1ba90953ee4228c Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Fri, 8 Oct 2021 23:45:20 -0500 Subject: [PATCH 162/399] simplify callOnModules --- .../game/core/utility/scripts/module.tscript | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/Templates/BaseGame/game/core/utility/scripts/module.tscript b/Templates/BaseGame/game/core/utility/scripts/module.tscript index a895f99bf..1f6a755d1 100644 --- a/Templates/BaseGame/game/core/utility/scripts/module.tscript +++ b/Templates/BaseGame/game/core/utility/scripts/module.tscript @@ -4,8 +4,7 @@ if (!isObject(ExecFilesList)) new ArrayObject(ExecFilesList); function callOnModules(%functionName, %moduleGroup, %var0, %var1, %var2, %var3, %var4, %var5, %var6) -{ - %maxvars = 7; // match this to i/o signature +{ //clear per module group file execution chain ExecFilesList.empty(); //Get our modules so we can exec any specific client-side loading/handling @@ -19,22 +18,9 @@ function callOnModules(%functionName, %moduleGroup, %var0, %var1, %var2, %var3, if(%module.group !$= %moduleGroup) continue; } - + // match this to i/o signature if(isObject(%module.scopeSet) && %module.scopeSet.isMethod(%functionName)) - { - %stryng = %module.scopeSet @ "." @ %functionName @ "("; - for (%a=0;%a<%maxvars;%a++) - { - if (%var[%a] !$= "") - { - %stryng = %stryng @ %var[%a]; - if (%a<%maxvars-1 && %var[%a+1] !$= "") - %stryng = %stryng @ ","; - } - } - %stryng = %stryng @ ");"; - eval(%stryng); - } + %module.scopeSet.call(%functionName, %var0, %var1, %var2, %var3, %var4, %var5, %var6); } %execFilecount = ExecFilesList.count(); From 506621352ceebea54eb3c706bfba252027ebd87a Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 9 Oct 2021 00:07:01 -0500 Subject: [PATCH 163/399] Tweaks the MaterialAsset loading logic to continue to see if the matDefinition already points to an existing object(to avoid needlessly re-executing files over and over), but also validate other cases, and ensures that if we DO have an existing definition, we still process and load it in the asset itself properly. --- Engine/source/T3D/assets/MaterialAsset.cpp | 19 +++++++++++++++++-- Engine/source/T3D/assets/MaterialAsset.h | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Engine/source/T3D/assets/MaterialAsset.cpp b/Engine/source/T3D/assets/MaterialAsset.cpp index 57008b025..50e75ffa3 100644 --- a/Engine/source/T3D/assets/MaterialAsset.cpp +++ b/Engine/source/T3D/assets/MaterialAsset.cpp @@ -167,6 +167,12 @@ void MaterialAsset::initializeAsset() mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath; + if (mMatDefinitionName == StringTable->EmptyString()) + { + mLoadedState = Failed; + return; + } + if (Torque::FS::IsScriptFile(mScriptPath)) { if (!Sim::findObject(mMatDefinitionName)) @@ -180,6 +186,10 @@ void MaterialAsset::initializeAsset() mLoadedState = Failed; } } + else + { + mLoadedState = DefinitionAlreadyExists; + } } loadMaterial(); @@ -189,6 +199,12 @@ void MaterialAsset::onAssetRefresh() { mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath; + if (mMatDefinitionName == StringTable->EmptyString()) + { + mLoadedState = Failed; + return; + } + if (Torque::FS::IsScriptFile(mScriptPath)) { //Since we're refreshing, we can assume that the file we're executing WILL have an existing definition. @@ -204,7 +220,6 @@ void MaterialAsset::onAssetRefresh() //And now that we've executed, switch back to the prior behavior Con::setVariable("$Con::redefineBehavior", redefineBehaviorPrev.c_str()); - } loadMaterial(); @@ -232,7 +247,7 @@ void MaterialAsset::loadMaterial() if (mMaterialDefinition) SAFE_DELETE(mMaterialDefinition); - if (mLoadedState == ScriptLoaded && mMatDefinitionName != StringTable->EmptyString()) + if ((mLoadedState == ScriptLoaded || mLoadedState == DefinitionAlreadyExists) && mMatDefinitionName != StringTable->EmptyString()) { Material* matDef; if (!Sim::findObject(mMatDefinitionName, matDef)) diff --git a/Engine/source/T3D/assets/MaterialAsset.h b/Engine/source/T3D/assets/MaterialAsset.h index 07ec0227a..75b1f6b96 100644 --- a/Engine/source/T3D/assets/MaterialAsset.h +++ b/Engine/source/T3D/assets/MaterialAsset.h @@ -73,6 +73,7 @@ public: enum MaterialAssetErrCode { ScriptLoaded = AssetErrCode::Extended, + DefinitionAlreadyExists, Extended }; From 112dafd8a82bb4485a0dd0a6668e30da9676467f Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sat, 9 Oct 2021 11:31:26 -0500 Subject: [PATCH 164/399] remove basiconly from decals and decal roads. seems we fixed the bit that was causing that to not render --- .../game/core/rendering/scripts/renderManager.tscript | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Templates/BaseGame/game/core/rendering/scripts/renderManager.tscript b/Templates/BaseGame/game/core/rendering/scripts/renderManager.tscript index 1eefa6cf5..8c024c222 100644 --- a/Templates/BaseGame/game/core/rendering/scripts/renderManager.tscript +++ b/Templates/BaseGame/game/core/rendering/scripts/renderManager.tscript @@ -59,8 +59,8 @@ function initRenderManager() DiffuseRenderPassManager.addManager( new RenderObjectMgr(ObjectBin) { bintype = "Object"; renderOrder = 0.6; processAddOrder = 0.6; } ); DiffuseRenderPassManager.addManager( new RenderObjectMgr(ShadowBin) { bintype = "Shadow"; renderOrder = 0.7; processAddOrder = 0.7; } ); - DiffuseRenderPassManager.addManager( new RenderMeshMgr(DecalRoadBin) { bintype = "DecalRoad"; renderOrder = 0.8; processAddOrder = 0.8; basicOnly = true;} ); - DiffuseRenderPassManager.addManager( new RenderMeshMgr(DecalBin) { bintype = "Decal"; renderOrder = 0.81; processAddOrder = 0.81; basicOnly = true;} ); + DiffuseRenderPassManager.addManager( new RenderMeshMgr(DecalRoadBin) { bintype = "DecalRoad"; renderOrder = 0.8; processAddOrder = 0.8; } ); + DiffuseRenderPassManager.addManager( new RenderMeshMgr(DecalBin) { bintype = "Decal"; renderOrder = 0.81; processAddOrder = 0.81;} ); DiffuseRenderPassManager.addManager( new RenderOcclusionMgr(OccluderBin){ bintype = "Occluder"; renderOrder = 0.9; processAddOrder = 0.9; } ); // Render the sky last From 0429b5afa56b8d1bf76d86ed4a41eb566f6d97c2 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 9 Oct 2021 18:47:12 -0400 Subject: [PATCH 165/399] Added more tests for torquescript --- Engine/source/console/test/ScriptTest.cpp | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index 05775694f..05f0582ff 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -889,6 +889,40 @@ TEST(Script, InnerObjectTests) ASSERT_EQ(nestedFuncCall.getInt(), 123); } +TEST(Script, MiscTesting) +{ + ConsoleValue test1 = RunScript(R"( + function testNotPassedInParameters(%a, %b, %c, %d) + { + if (%d $= "") + return true; + return false; + } + + return testNotPassedInParameters(1, 2); // skip passing in %c and %d + )"); + + ASSERT_EQ(test1.getBool(), true); + + ConsoleValue test2 = RunScript(R"( + function SimObject::concatNameTest(%this) + { + return true; + } + + new SimObject(WeirdTestObject1); + + function testObjectNameConcatination(%i) + { + return (WeirdTestObject @ %i).concatNameTest(); + } + + return testObjectNameConcatination(1); + )"); + + ASSERT_EQ(test2.getBool(), true); +} + TEST(Script, MiscRegressions) { ConsoleValue regression1 = RunScript(R"( From f7cf1c020c771b191415f26aff6dec1d7d75345d Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sat, 9 Oct 2021 18:20:57 -0500 Subject: [PATCH 166/399] inject getworldtotangent and getworldnormal to ensure var order --- Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp index b41dfc234..bb09113a4 100644 --- a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp +++ b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp @@ -2974,6 +2974,8 @@ void ReflectionProbeFeatGLSL::processPix(Vector& componentList // Now the wsPosition and wsView. Var *wsPosition = getInWsPosition(componentList); + Var *worldToTangent = getInWorldToTangent(componentList); + Var *wsNormal = getInWorldNormal(componentList); Var *wsView = getWsView(wsPosition, meta); //Reflection Probe WIP From d53dcb03c2715d11aaab0fdb73d6bebb7e95f650 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Sat, 9 Oct 2021 22:13:06 -0400 Subject: [PATCH 167/399] * [AssetBrowser] BugFix: Correct an error where on Linux the select asset path function would not list any directories. --- .../game/tools/assetBrowser/scripts/directoryHandling.tscript | 4 ++-- .../game/tools/assetBrowser/scripts/selectPath.tscript | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.tscript index 3eb822f21..4f13dfb8b 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.tscript @@ -216,7 +216,7 @@ function directoryHandler::getFolderTreeItemFromAddress(%this, %address) //break down the address %folderCount = getTokenCount(%address, "/"); - if(startsWith(%address, "Data/") || startsWith(%address, "Tools/") || startsWith(%address, "Core/")) + if(startsWith(%address, "data/") || startsWith(%address, "tools/") || startsWith(%address, "core/")) { %curItem = %this.treeCtrl.findChildItemByName(1, "Modules"); } @@ -242,7 +242,7 @@ function directoryHandler::expandTreeToAddress(%this, %address) %rootId = AssetBrowser-->filterTree.findItemByName("Content"); %this.treeCtrl.expandItem(%rootId); - if(startsWith(%address, "Data/") || startsWith(%address, "Tools/") || startsWith(%address, "Core/")) + if(startsWith(%address, "data/") || startsWith(%address, "tools/") || startsWith(%address, "core/")) { %curItem = %this.treeCtrl.findChildItemByName(1, "Modules"); } diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/selectPath.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/selectPath.tscript index 691a546e0..7db32c752 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/selectPath.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/selectPath.tscript @@ -22,7 +22,7 @@ function SelectAssetPath::showDialog(%this, %startingPath, %callback, %promptTex %this.callback = %callback; %dataItem = SelectAssetPath-->folderTree.insertItem(0, "Data"); - %this.dirHandler.loadFolders("Data", %dataItem); + %this.dirHandler.loadFolders("data", %dataItem); %this.dirHandler.expandTreeToAddress(%startingPath); %id = %this.dirHandler.getFolderTreeItemFromAddress(%startingPath); @@ -60,4 +60,4 @@ function SelectAssetPath::newFolder(%this) { AssetBrowser_newFolderNameTxt.text = "NewFolder"; Canvas.pushDialog(AssetBrowser_newFolder); -} \ No newline at end of file +} From 77ea34d2b2ebb46c9c2eed55099e4d3bbc2b2cac Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Sun, 10 Oct 2021 04:19:27 -0400 Subject: [PATCH 168/399] * Adjustment: Minor tweaks to allow case insensitivity on Unix systems. --- Engine/source/platformPOSIX/posixVolume.cpp | 83 ++++++++++++++++++++- 1 file changed, 80 insertions(+), 3 deletions(-) diff --git a/Engine/source/platformPOSIX/posixVolume.cpp b/Engine/source/platformPOSIX/posixVolume.cpp index 271df1e18..656a69335 100644 --- a/Engine/source/platformPOSIX/posixVolume.cpp +++ b/Engine/source/platformPOSIX/posixVolume.cpp @@ -149,18 +149,95 @@ PosixFileSystem::~PosixFileSystem() { } +static void MungeCase(char* pathName, S32 pathNameSize) +{ + const int MaxPath = PATH_MAX; + + char tempBuf[MaxPath]; + dStrncpy(tempBuf, pathName, pathNameSize); + + AssertFatal(pathName[0] == '/', "PATH must be absolute"); + + struct stat filestat; + const int MaxPathEl = 200; + char *currChar = pathName; + char testPath[MaxPath]; + char pathEl[MaxPathEl]; + bool done = false; + + dStrncpy(tempBuf, "/", MaxPath); + currChar++; + + while (!done) + { + char* termChar = dStrchr(currChar, '/'); + if (termChar == NULL) + termChar = dStrchr(currChar, '\0'); + AssertFatal(termChar, "Can't find / or NULL terminator"); + + S32 pathElLen = (termChar - currChar); + dStrncpy(pathEl, currChar, pathElLen); + pathEl[pathElLen] = '\0'; + dStrncpy(testPath, tempBuf, MaxPath); + dStrcat(testPath, pathEl, MaxPath); + if (stat(testPath, &filestat) != -1) + { + dStrncpy(tempBuf, testPath, MaxPath); + } + else + { + DIR *dir = opendir(tempBuf); + struct dirent* ent; + bool foundMatch = false; + while (dir != NULL && (ent = readdir(dir)) != NULL) + { + if (dStricmp(pathEl, ent->d_name) == 0) + { + foundMatch = true; + dStrcat(tempBuf, ent->d_name, MaxPath); + break; + } + } + + if (!foundMatch) + dStrncpy(tempBuf, testPath, MaxPath); + if (dir) + closedir(dir); + } + if (*termChar == '/') + { + dStrcat(tempBuf, "/", MaxPath); + termChar++; + currChar = termChar; + } + else + done = true; + } + + dStrncpy(pathName, tempBuf, pathNameSize); +} + +// static void MungeCase(char* pathName, S32 pathNameSize) FileNodeRef PosixFileSystem::resolve(const Path& path) { String file = buildFileName(_volume,path); struct stat info; - if (stat(file.c_str(),&info) == 0) + + UTF8 testPath[1024]; + dMemcpy(testPath, file.c_str(), file.length()); + testPath[file.length()] = 0x00; + MungeCase(testPath, file.length()); + + String realFile(testPath); + + if (stat(realFile.c_str(),&info) == 0) { // Construct the appropriate object if (S_ISREG(info.st_mode)) - return new PosixFile(path,file); + return new PosixFile(path,realFile); if (S_ISDIR(info.st_mode)) - return new PosixDirectory(path,file); + return new PosixDirectory(path,realFile); } return 0; From a458c97217ae115361c980ca76ee4b85a4c28f90 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sun, 10 Oct 2021 20:08:03 -0400 Subject: [PATCH 169/399] Implement more extensions to get graphics card memory for OpenGL on windows and Linux. (cherry picked from commit da942cdb79a87b76e629b36415c83067e3620a70) --- Engine/source/gfx/gl/gfxGLDevice.cpp | 36 ++++++++++++++++++++++++++-- Engine/source/gfx/gl/tGL/tGL.cpp | 18 +++++++++++--- 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/Engine/source/gfx/gl/gfxGLDevice.cpp b/Engine/source/gfx/gl/gfxGLDevice.cpp index 1c82b4e74..40884bb05 100644 --- a/Engine/source/gfx/gl/gfxGLDevice.cpp +++ b/Engine/source/gfx/gl/gfxGLDevice.cpp @@ -51,6 +51,10 @@ #include "shaderGen/shaderGen.h" #include "gfxGLUtils.h" +#if defined(TORQUE_OS_WIN) +#include "gfx/gl/tGL/tWGL.h" +#endif + GFXAdapter::CreateDeviceInstanceDelegate GFXGLDevice::mCreateDeviceInstance(GFXGLDevice::createInstance); GFXDevice *GFXGLDevice::createInstance( U32 adapterIndex ) @@ -1073,8 +1077,36 @@ U32 GFXGLDevice::getTotalVideoMemory_GL_EXT() return mem / 1024; } - // TODO OPENGL, add supprt for INTEL cards. - + +#if defined(TORQUE_OS_WIN) + else if( (gglHasWExtension(AMD_gpu_association)) ) + { + // Just assume 1 AMD gpu. Who uses crossfire anyways now? And, crossfire doesn't double + // vram anyways, so does it really matter? + UINT id; + if (wglGetGPUIDsAMD(1, &id) != 0) + { + S32 memorySize; + if (wglGetGPUInfoAMD(id, WGL_GPU_RAM_AMD, GL_INT, 1, &memorySize) != -1) + { + // memory size is returned in MB + return memorySize; + } + } + } +#endif + +#if defined(TORQUE_OS_LINUX) + else if ( (gglHasXExtension(MESA_query_renderer)) ) + { + // memory size is in mb + S32 memorySize; + glXQueryCurrentRendererIntegerMESA(GLX_RENDERER_VIDEO_MEMORY_MESA, &memorySize); + return memorySize; + } +#endif + + // No other way, sad. Probably windows Intel. return 0; } diff --git a/Engine/source/gfx/gl/tGL/tGL.cpp b/Engine/source/gfx/gl/tGL/tGL.cpp index b13fec60a..93e1e5a51 100644 --- a/Engine/source/gfx/gl/tGL/tGL.cpp +++ b/Engine/source/gfx/gl/tGL/tGL.cpp @@ -25,8 +25,10 @@ #include "core/strings/stringFunctions.h" #include "console/console.h" -#ifdef TORQUE_OS_WIN - #include "tWGL.h" +#if defined(TORQUE_OS_WIN) +#include "tWGL.h" +#elif defined(TORQUE_OS_LINUX) +#include "tXGL.h" #endif namespace GL @@ -41,7 +43,17 @@ namespace GL void gglPerformExtensionBinds(void *context) { - +#if defined(TORQUE_OS_WIN) + if (!gladLoadWGL((HDC)context)) + { + AssertFatal(false, "Unable to load WGL in GLAD. Make sure your OpenGL drivers are up to date!"); + } +#elif defined(TORQUE_OS_LINUX) + if (!gladLoadGLX()) + { + AssertFatal(false, "Unable to load GLX in GLAD. Make sure your OpenGL drivers are up to date!"); + } +#endif } } From 1385b29f03b7f643e11e5417c1eb9f860c0a0cfe Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Sun, 10 Oct 2021 20:53:55 -0400 Subject: [PATCH 170/399] * Adjustment: Initial testing with extensions to load GPU VRAM. --- Engine/lib/glad/include/KHR/khrplatform.h | 2 +- Engine/lib/glad/include/glad/glad_glx.h | 20 ++++++++++++++++-- Engine/lib/glad/src/glx/glad_glx.c | 25 +++++++++++++++-------- Engine/source/gfx/gl/gfxGLDevice.cpp | 6 ++++-- Engine/source/gfx/gl/tGL/tGL.cpp | 3 ++- 5 files changed, 42 insertions(+), 14 deletions(-) diff --git a/Engine/lib/glad/include/KHR/khrplatform.h b/Engine/lib/glad/include/KHR/khrplatform.h index 5b55ea2b9..dd22d9270 100644 --- a/Engine/lib/glad/include/KHR/khrplatform.h +++ b/Engine/lib/glad/include/KHR/khrplatform.h @@ -119,7 +119,7 @@ * This follows the return type of the function and precedes the function * name in the function prototype. */ -#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(KHRONOS_STATIC) +#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) /* Win32 but not WinCE */ # define KHRONOS_APIENTRY __stdcall #else diff --git a/Engine/lib/glad/include/glad/glad_glx.h b/Engine/lib/glad/include/glad/glad_glx.h index 46abf2c5b..696366e44 100644 --- a/Engine/lib/glad/include/glad/glad_glx.h +++ b/Engine/lib/glad/include/glad/glad_glx.h @@ -1,6 +1,6 @@ /* - GLX loader generated by glad 0.1.33 on Sun Aug 18 11:26:39 2019. + GLX loader generated by glad 0.1.34 on Mon Oct 11 00:48:11 2021. Language/Generator: C/C++ Specification: glx @@ -27,6 +27,7 @@ GLX_EXT_create_context_es_profile, GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB, + GLX_EXT_get_drawable_type, GLX_EXT_import_context, GLX_EXT_libglvnd, GLX_EXT_no_config_context, @@ -48,6 +49,7 @@ GLX_NV_copy_image, GLX_NV_delay_before_swap, GLX_NV_float_buffer, + GLX_NV_multigpu_context, GLX_NV_multisample_coverage, GLX_NV_present_video, GLX_NV_robustness_video_memory_purge, @@ -79,7 +81,7 @@ Reproducible: False Commandline: - --api="glx=1.4" --generator="c" --spec="glx" --extensions="GLX_3DFX_multisample,GLX_AMD_gpu_association,GLX_ARB_context_flush_control,GLX_ARB_create_context,GLX_ARB_create_context_no_error,GLX_ARB_create_context_profile,GLX_ARB_create_context_robustness,GLX_ARB_fbconfig_float,GLX_ARB_framebuffer_sRGB,GLX_ARB_get_proc_address,GLX_ARB_multisample,GLX_ARB_robustness_application_isolation,GLX_ARB_robustness_share_group_isolation,GLX_ARB_vertex_buffer_object,GLX_EXT_buffer_age,GLX_EXT_context_priority,GLX_EXT_create_context_es2_profile,GLX_EXT_create_context_es_profile,GLX_EXT_fbconfig_packed_float,GLX_EXT_framebuffer_sRGB,GLX_EXT_import_context,GLX_EXT_libglvnd,GLX_EXT_no_config_context,GLX_EXT_stereo_tree,GLX_EXT_swap_control,GLX_EXT_swap_control_tear,GLX_EXT_texture_from_pixmap,GLX_EXT_visual_info,GLX_EXT_visual_rating,GLX_INTEL_swap_event,GLX_MESA_agp_offset,GLX_MESA_copy_sub_buffer,GLX_MESA_pixmap_colormap,GLX_MESA_query_renderer,GLX_MESA_release_buffers,GLX_MESA_set_3dfx_mode,GLX_MESA_swap_control,GLX_NV_copy_buffer,GLX_NV_copy_image,GLX_NV_delay_before_swap,GLX_NV_float_buffer,GLX_NV_multisample_coverage,GLX_NV_present_video,GLX_NV_robustness_video_memory_purge,GLX_NV_swap_group,GLX_NV_video_capture,GLX_NV_video_out,GLX_OML_swap_method,GLX_OML_sync_control,GLX_SGIS_blended_overlay,GLX_SGIS_multisample,GLX_SGIS_shared_multisample,GLX_SGIX_dmbuffer,GLX_SGIX_fbconfig,GLX_SGIX_hyperpipe,GLX_SGIX_pbuffer,GLX_SGIX_swap_barrier,GLX_SGIX_swap_group,GLX_SGIX_video_resize,GLX_SGIX_video_source,GLX_SGIX_visual_select_group,GLX_SGI_cushion,GLX_SGI_make_current_read,GLX_SGI_swap_control,GLX_SGI_video_sync,GLX_SUN_get_transparent_index" + --api="glx=1.4" --generator="c" --spec="glx" --extensions="GLX_3DFX_multisample,GLX_AMD_gpu_association,GLX_ARB_context_flush_control,GLX_ARB_create_context,GLX_ARB_create_context_no_error,GLX_ARB_create_context_profile,GLX_ARB_create_context_robustness,GLX_ARB_fbconfig_float,GLX_ARB_framebuffer_sRGB,GLX_ARB_get_proc_address,GLX_ARB_multisample,GLX_ARB_robustness_application_isolation,GLX_ARB_robustness_share_group_isolation,GLX_ARB_vertex_buffer_object,GLX_EXT_buffer_age,GLX_EXT_context_priority,GLX_EXT_create_context_es2_profile,GLX_EXT_create_context_es_profile,GLX_EXT_fbconfig_packed_float,GLX_EXT_framebuffer_sRGB,GLX_EXT_get_drawable_type,GLX_EXT_import_context,GLX_EXT_libglvnd,GLX_EXT_no_config_context,GLX_EXT_stereo_tree,GLX_EXT_swap_control,GLX_EXT_swap_control_tear,GLX_EXT_texture_from_pixmap,GLX_EXT_visual_info,GLX_EXT_visual_rating,GLX_INTEL_swap_event,GLX_MESA_agp_offset,GLX_MESA_copy_sub_buffer,GLX_MESA_pixmap_colormap,GLX_MESA_query_renderer,GLX_MESA_release_buffers,GLX_MESA_set_3dfx_mode,GLX_MESA_swap_control,GLX_NV_copy_buffer,GLX_NV_copy_image,GLX_NV_delay_before_swap,GLX_NV_float_buffer,GLX_NV_multigpu_context,GLX_NV_multisample_coverage,GLX_NV_present_video,GLX_NV_robustness_video_memory_purge,GLX_NV_swap_group,GLX_NV_video_capture,GLX_NV_video_out,GLX_OML_swap_method,GLX_OML_sync_control,GLX_SGIS_blended_overlay,GLX_SGIS_multisample,GLX_SGIS_shared_multisample,GLX_SGIX_dmbuffer,GLX_SGIX_fbconfig,GLX_SGIX_hyperpipe,GLX_SGIX_pbuffer,GLX_SGIX_swap_barrier,GLX_SGIX_swap_group,GLX_SGIX_video_resize,GLX_SGIX_video_source,GLX_SGIX_visual_select_group,GLX_SGI_cushion,GLX_SGI_make_current_read,GLX_SGI_swap_control,GLX_SGI_video_sync,GLX_SUN_get_transparent_index" Online: Too many extensions */ @@ -139,6 +141,7 @@ typedef void* (* GLADloadproc)(const char *name); #endif GLAPI int gladLoadGLX(Display *dpy, int screen); +GLAPI void gladUnloadGLX(void); GLAPI int gladLoadGLXLoader(GLADloadproc, Display *dpy, int screen); @@ -616,6 +619,11 @@ GLAPI PFNGLXGETPROCADDRESSPROC glad_glXGetProcAddress; #define GLX_3DFX_WINDOW_MODE_MESA 0x1 #define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 #define GLX_FLOAT_COMPONENTS_NV 0x20B0 +#define GLX_CONTEXT_MULTIGPU_ATTRIB_NV 0x20AA +#define GLX_CONTEXT_MULTIGPU_ATTRIB_SINGLE_NV 0x20AB +#define GLX_CONTEXT_MULTIGPU_ATTRIB_AFR_NV 0x20AC +#define GLX_CONTEXT_MULTIGPU_ATTRIB_MULTICAST_NV 0x20AD +#define GLX_CONTEXT_MULTIGPU_ATTRIB_MULTI_DISPLAY_MULTICAST_NV 0x20AE #define GLX_COVERAGE_SAMPLES_NV 100001 #define GLX_COLOR_SAMPLES_NV 0x20B3 #define GLX_NUM_VIDEO_SLOTS_NV 0x20F0 @@ -804,6 +812,10 @@ GLAPI int GLAD_GLX_EXT_fbconfig_packed_float; #define GLX_EXT_framebuffer_sRGB 1 GLAPI int GLAD_GLX_EXT_framebuffer_sRGB; #endif +#ifndef GLX_EXT_get_drawable_type +#define GLX_EXT_get_drawable_type 1 +GLAPI int GLAD_GLX_EXT_get_drawable_type; +#endif #ifndef GLX_EXT_import_context #define GLX_EXT_import_context 1 GLAPI int GLAD_GLX_EXT_import_context; @@ -957,6 +969,10 @@ GLAPI PFNGLXDELAYBEFORESWAPNVPROC glad_glXDelayBeforeSwapNV; #define GLX_NV_float_buffer 1 GLAPI int GLAD_GLX_NV_float_buffer; #endif +#ifndef GLX_NV_multigpu_context +#define GLX_NV_multigpu_context 1 +GLAPI int GLAD_GLX_NV_multigpu_context; +#endif #ifndef GLX_NV_multisample_coverage #define GLX_NV_multisample_coverage 1 GLAPI int GLAD_GLX_NV_multisample_coverage; diff --git a/Engine/lib/glad/src/glx/glad_glx.c b/Engine/lib/glad/src/glx/glad_glx.c index 0adb32bd6..69eeb3dd8 100644 --- a/Engine/lib/glad/src/glx/glad_glx.c +++ b/Engine/lib/glad/src/glx/glad_glx.c @@ -1,6 +1,6 @@ /* - GLX loader generated by glad 0.1.33 on Sun Aug 18 11:26:39 2019. + GLX loader generated by glad 0.1.34 on Mon Oct 11 00:48:11 2021. Language/Generator: C/C++ Specification: glx @@ -27,6 +27,7 @@ GLX_EXT_create_context_es_profile, GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB, + GLX_EXT_get_drawable_type, GLX_EXT_import_context, GLX_EXT_libglvnd, GLX_EXT_no_config_context, @@ -48,6 +49,7 @@ GLX_NV_copy_image, GLX_NV_delay_before_swap, GLX_NV_float_buffer, + GLX_NV_multigpu_context, GLX_NV_multisample_coverage, GLX_NV_present_video, GLX_NV_robustness_video_memory_purge, @@ -79,7 +81,7 @@ Reproducible: False Commandline: - --api="glx=1.4" --generator="c" --spec="glx" --extensions="GLX_3DFX_multisample,GLX_AMD_gpu_association,GLX_ARB_context_flush_control,GLX_ARB_create_context,GLX_ARB_create_context_no_error,GLX_ARB_create_context_profile,GLX_ARB_create_context_robustness,GLX_ARB_fbconfig_float,GLX_ARB_framebuffer_sRGB,GLX_ARB_get_proc_address,GLX_ARB_multisample,GLX_ARB_robustness_application_isolation,GLX_ARB_robustness_share_group_isolation,GLX_ARB_vertex_buffer_object,GLX_EXT_buffer_age,GLX_EXT_context_priority,GLX_EXT_create_context_es2_profile,GLX_EXT_create_context_es_profile,GLX_EXT_fbconfig_packed_float,GLX_EXT_framebuffer_sRGB,GLX_EXT_import_context,GLX_EXT_libglvnd,GLX_EXT_no_config_context,GLX_EXT_stereo_tree,GLX_EXT_swap_control,GLX_EXT_swap_control_tear,GLX_EXT_texture_from_pixmap,GLX_EXT_visual_info,GLX_EXT_visual_rating,GLX_INTEL_swap_event,GLX_MESA_agp_offset,GLX_MESA_copy_sub_buffer,GLX_MESA_pixmap_colormap,GLX_MESA_query_renderer,GLX_MESA_release_buffers,GLX_MESA_set_3dfx_mode,GLX_MESA_swap_control,GLX_NV_copy_buffer,GLX_NV_copy_image,GLX_NV_delay_before_swap,GLX_NV_float_buffer,GLX_NV_multisample_coverage,GLX_NV_present_video,GLX_NV_robustness_video_memory_purge,GLX_NV_swap_group,GLX_NV_video_capture,GLX_NV_video_out,GLX_OML_swap_method,GLX_OML_sync_control,GLX_SGIS_blended_overlay,GLX_SGIS_multisample,GLX_SGIS_shared_multisample,GLX_SGIX_dmbuffer,GLX_SGIX_fbconfig,GLX_SGIX_hyperpipe,GLX_SGIX_pbuffer,GLX_SGIX_swap_barrier,GLX_SGIX_swap_group,GLX_SGIX_video_resize,GLX_SGIX_video_source,GLX_SGIX_visual_select_group,GLX_SGI_cushion,GLX_SGI_make_current_read,GLX_SGI_swap_control,GLX_SGI_video_sync,GLX_SUN_get_transparent_index" + --api="glx=1.4" --generator="c" --spec="glx" --extensions="GLX_3DFX_multisample,GLX_AMD_gpu_association,GLX_ARB_context_flush_control,GLX_ARB_create_context,GLX_ARB_create_context_no_error,GLX_ARB_create_context_profile,GLX_ARB_create_context_robustness,GLX_ARB_fbconfig_float,GLX_ARB_framebuffer_sRGB,GLX_ARB_get_proc_address,GLX_ARB_multisample,GLX_ARB_robustness_application_isolation,GLX_ARB_robustness_share_group_isolation,GLX_ARB_vertex_buffer_object,GLX_EXT_buffer_age,GLX_EXT_context_priority,GLX_EXT_create_context_es2_profile,GLX_EXT_create_context_es_profile,GLX_EXT_fbconfig_packed_float,GLX_EXT_framebuffer_sRGB,GLX_EXT_get_drawable_type,GLX_EXT_import_context,GLX_EXT_libglvnd,GLX_EXT_no_config_context,GLX_EXT_stereo_tree,GLX_EXT_swap_control,GLX_EXT_swap_control_tear,GLX_EXT_texture_from_pixmap,GLX_EXT_visual_info,GLX_EXT_visual_rating,GLX_INTEL_swap_event,GLX_MESA_agp_offset,GLX_MESA_copy_sub_buffer,GLX_MESA_pixmap_colormap,GLX_MESA_query_renderer,GLX_MESA_release_buffers,GLX_MESA_set_3dfx_mode,GLX_MESA_swap_control,GLX_NV_copy_buffer,GLX_NV_copy_image,GLX_NV_delay_before_swap,GLX_NV_float_buffer,GLX_NV_multigpu_context,GLX_NV_multisample_coverage,GLX_NV_present_video,GLX_NV_robustness_video_memory_purge,GLX_NV_swap_group,GLX_NV_video_capture,GLX_NV_video_out,GLX_OML_swap_method,GLX_OML_sync_control,GLX_SGIS_blended_overlay,GLX_SGIS_multisample,GLX_SGIS_shared_multisample,GLX_SGIX_dmbuffer,GLX_SGIX_fbconfig,GLX_SGIX_hyperpipe,GLX_SGIX_pbuffer,GLX_SGIX_swap_barrier,GLX_SGIX_swap_group,GLX_SGIX_video_resize,GLX_SGIX_video_source,GLX_SGIX_visual_select_group,GLX_SGI_cushion,GLX_SGI_make_current_read,GLX_SGI_swap_control,GLX_SGI_video_sync,GLX_SUN_get_transparent_index" Online: Too many extensions */ @@ -119,7 +121,7 @@ static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr; #endif static -int open_gl(void) { +int open_glx(void) { #ifndef IS_UWP libGL = LoadLibraryW(L"opengl32.dll"); if(libGL != NULL) { @@ -134,7 +136,7 @@ int open_gl(void) { } static -void close_gl(void) { +void close_glx(void) { if(libGL != NULL) { FreeLibrary((HMODULE) libGL); libGL = NULL; @@ -150,7 +152,7 @@ static PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr; #endif static -int open_gl(void) { +int open_glx(void) { #ifdef __APPLE__ static const char *NAMES[] = { "../Frameworks/OpenGL.framework/OpenGL", @@ -181,7 +183,7 @@ int open_gl(void) { } static -void close_gl(void) { +void close_glx(void) { if(libGL != NULL) { dlclose(libGL); libGL = NULL; @@ -213,14 +215,17 @@ void* get_proc(const char *namez) { int gladLoadGLX(Display *dpy, int screen) { int status = 0; - if(open_gl()) { + if(open_glx()) { status = gladLoadGLXLoader((GLADloadproc)get_proc, dpy, screen); - close_gl(); } return status; } +void gladUnloadGLX(void) { + close_glx(); +} + static Display *GLADGLXDisplay = 0; static int GLADGLXscreen = 0; @@ -326,6 +331,7 @@ int GLAD_GLX_EXT_create_context_es2_profile = 0; int GLAD_GLX_EXT_create_context_es_profile = 0; int GLAD_GLX_EXT_fbconfig_packed_float = 0; int GLAD_GLX_EXT_framebuffer_sRGB = 0; +int GLAD_GLX_EXT_get_drawable_type = 0; int GLAD_GLX_EXT_import_context = 0; int GLAD_GLX_EXT_libglvnd = 0; int GLAD_GLX_EXT_no_config_context = 0; @@ -347,6 +353,7 @@ int GLAD_GLX_NV_copy_buffer = 0; int GLAD_GLX_NV_copy_image = 0; int GLAD_GLX_NV_delay_before_swap = 0; int GLAD_GLX_NV_float_buffer = 0; +int GLAD_GLX_NV_multigpu_context = 0; int GLAD_GLX_NV_multisample_coverage = 0; int GLAD_GLX_NV_present_video = 0; int GLAD_GLX_NV_robustness_video_memory_purge = 0; @@ -752,6 +759,7 @@ static int find_extensionsGLX(void) { GLAD_GLX_EXT_create_context_es_profile = has_ext("GLX_EXT_create_context_es_profile"); GLAD_GLX_EXT_fbconfig_packed_float = has_ext("GLX_EXT_fbconfig_packed_float"); GLAD_GLX_EXT_framebuffer_sRGB = has_ext("GLX_EXT_framebuffer_sRGB"); + GLAD_GLX_EXT_get_drawable_type = has_ext("GLX_EXT_get_drawable_type"); GLAD_GLX_EXT_import_context = has_ext("GLX_EXT_import_context"); GLAD_GLX_EXT_libglvnd = has_ext("GLX_EXT_libglvnd"); GLAD_GLX_EXT_no_config_context = has_ext("GLX_EXT_no_config_context"); @@ -773,6 +781,7 @@ static int find_extensionsGLX(void) { GLAD_GLX_NV_copy_image = has_ext("GLX_NV_copy_image"); GLAD_GLX_NV_delay_before_swap = has_ext("GLX_NV_delay_before_swap"); GLAD_GLX_NV_float_buffer = has_ext("GLX_NV_float_buffer"); + GLAD_GLX_NV_multigpu_context = has_ext("GLX_NV_multigpu_context"); GLAD_GLX_NV_multisample_coverage = has_ext("GLX_NV_multisample_coverage"); GLAD_GLX_NV_present_video = has_ext("GLX_NV_present_video"); GLAD_GLX_NV_robustness_video_memory_purge = has_ext("GLX_NV_robustness_video_memory_purge"); diff --git a/Engine/source/gfx/gl/gfxGLDevice.cpp b/Engine/source/gfx/gl/gfxGLDevice.cpp index 40884bb05..1cba42143 100644 --- a/Engine/source/gfx/gl/gfxGLDevice.cpp +++ b/Engine/source/gfx/gl/gfxGLDevice.cpp @@ -53,6 +53,8 @@ #if defined(TORQUE_OS_WIN) #include "gfx/gl/tGL/tWGL.h" +#elif defined(TORQUE_OS_LINUX) +#include "gfx/gl/tGL/tXGL.h" #endif GFXAdapter::CreateDeviceInstanceDelegate GFXGLDevice::mCreateDeviceInstance(GFXGLDevice::createInstance); @@ -1097,10 +1099,10 @@ U32 GFXGLDevice::getTotalVideoMemory_GL_EXT() #endif #if defined(TORQUE_OS_LINUX) - else if ( (gglHasXExtension(MESA_query_renderer)) ) + else if ( (gglHasXExtension(NULL, NULL, MESA_query_renderer)) ) { // memory size is in mb - S32 memorySize; + U32 memorySize; glXQueryCurrentRendererIntegerMESA(GLX_RENDERER_VIDEO_MEMORY_MESA, &memorySize); return memorySize; } diff --git a/Engine/source/gfx/gl/tGL/tGL.cpp b/Engine/source/gfx/gl/tGL/tGL.cpp index 93e1e5a51..5d9b4718a 100644 --- a/Engine/source/gfx/gl/tGL/tGL.cpp +++ b/Engine/source/gfx/gl/tGL/tGL.cpp @@ -49,7 +49,8 @@ namespace GL AssertFatal(false, "Unable to load WGL in GLAD. Make sure your OpenGL drivers are up to date!"); } #elif defined(TORQUE_OS_LINUX) - if (!gladLoadGLX()) + + if (!gladLoadGLX(NULL, 0)) { AssertFatal(false, "Unable to load GLX in GLAD. Make sure your OpenGL drivers are up to date!"); } From 497a94f884badc354dc34e8c616c5ff380eadb72 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Mon, 11 Oct 2021 10:24:24 -0400 Subject: [PATCH 171/399] * Adjustment: Cleanups to the case insensitivity code for POSIX systems and add case insensitivty to directory dumping code. --- Engine/source/platformPOSIX/posixVolume.cpp | 93 +++---------------- .../source/platformX86UNIX/x86UNIXFileio.cpp | 20 +++- Tools/CMake/torque3d.cmake | 3 + Tools/CMake/torqueConfig.h.in | 3 + 4 files changed, 37 insertions(+), 82 deletions(-) diff --git a/Engine/source/platformPOSIX/posixVolume.cpp b/Engine/source/platformPOSIX/posixVolume.cpp index 656a69335..411559ffa 100644 --- a/Engine/source/platformPOSIX/posixVolume.cpp +++ b/Engine/source/platformPOSIX/posixVolume.cpp @@ -42,7 +42,7 @@ //#define DEBUG_SPEW - +extern void ResolvePathCaseInsensitive(char* pathName, S32 pathNameSize); namespace Torque { @@ -149,95 +149,32 @@ PosixFileSystem::~PosixFileSystem() { } -static void MungeCase(char* pathName, S32 pathNameSize) -{ - const int MaxPath = PATH_MAX; - - char tempBuf[MaxPath]; - dStrncpy(tempBuf, pathName, pathNameSize); - - AssertFatal(pathName[0] == '/', "PATH must be absolute"); - - struct stat filestat; - const int MaxPathEl = 200; - char *currChar = pathName; - char testPath[MaxPath]; - char pathEl[MaxPathEl]; - bool done = false; - - dStrncpy(tempBuf, "/", MaxPath); - currChar++; - - while (!done) - { - char* termChar = dStrchr(currChar, '/'); - if (termChar == NULL) - termChar = dStrchr(currChar, '\0'); - AssertFatal(termChar, "Can't find / or NULL terminator"); - - S32 pathElLen = (termChar - currChar); - dStrncpy(pathEl, currChar, pathElLen); - pathEl[pathElLen] = '\0'; - dStrncpy(testPath, tempBuf, MaxPath); - dStrcat(testPath, pathEl, MaxPath); - if (stat(testPath, &filestat) != -1) - { - dStrncpy(tempBuf, testPath, MaxPath); - } - else - { - DIR *dir = opendir(tempBuf); - struct dirent* ent; - bool foundMatch = false; - while (dir != NULL && (ent = readdir(dir)) != NULL) - { - if (dStricmp(pathEl, ent->d_name) == 0) - { - foundMatch = true; - dStrcat(tempBuf, ent->d_name, MaxPath); - break; - } - } - - if (!foundMatch) - dStrncpy(tempBuf, testPath, MaxPath); - if (dir) - closedir(dir); - } - if (*termChar == '/') - { - dStrcat(tempBuf, "/", MaxPath); - termChar++; - currChar = termChar; - } - else - done = true; - } - - dStrncpy(pathName, tempBuf, pathNameSize); -} - -// static void MungeCase(char* pathName, S32 pathNameSize) FileNodeRef PosixFileSystem::resolve(const Path& path) { String file = buildFileName(_volume,path); struct stat info; - UTF8 testPath[1024]; - dMemcpy(testPath, file.c_str(), file.length()); - testPath[file.length()] = 0x00; - MungeCase(testPath, file.length()); +#ifdef TORQUE_POSIX_PATH_CASE_INSENSITIVE + // Resolve the case sensitive filepath + String::SizeType fileLength = file.length(); + UTF8 caseSensitivePath[fileLength + 1]; + dMemcpy(caseSensitivePath, file.c_str(), fileLength); + caseSensitivePath[fileLength] = 0x00; + ResolvePathCaseInsensitive(caseSensitivePath, fileLength); - String realFile(testPath); + String caseSensitiveFile(caseSensitivePath); +#else + String caseSensitiveFile = file; +#endif - if (stat(realFile.c_str(),&info) == 0) + if (stat(caseSensitiveFile.c_str(),&info) == 0) { // Construct the appropriate object if (S_ISREG(info.st_mode)) - return new PosixFile(path,realFile); + return new PosixFile(path,caseSensitiveFile); if (S_ISDIR(info.st_mode)) - return new PosixDirectory(path,realFile); + return new PosixDirectory(path,caseSensitiveFile); } return 0; diff --git a/Engine/source/platformX86UNIX/x86UNIXFileio.cpp b/Engine/source/platformX86UNIX/x86UNIXFileio.cpp index eee06a84e..26a43ee7e 100644 --- a/Engine/source/platformX86UNIX/x86UNIXFileio.cpp +++ b/Engine/source/platformX86UNIX/x86UNIXFileio.cpp @@ -33,7 +33,7 @@ directory. Files are never created or modified in the game directory. For case-sensitivity, the MungePath code will test whether a given path - specified by the engine exists. If not, it will use the MungeCase function + specified by the engine exists. If not, it will use the ResolvePathCaseInsensitive function which will try to determine if an actual filesystem path matches the specified path case insensitive. If one is found, the actual path transparently (we hope) replaces the one requested by the engine. @@ -183,7 +183,7 @@ bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite) // munge the case of the specified pathName. This means try to find the actual // filename in with case-insensitive matching on the specified pathName, and // store the actual found name. - static void MungeCase(char* pathName, S32 pathNameSize) + void ResolvePathCaseInsensitive(char* pathName, S32 pathNameSize) { char tempBuf[MaxPath]; dStrncpy(tempBuf, pathName, pathNameSize); @@ -296,7 +296,7 @@ bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite) return; // otherwise munge the case of the path - MungeCase(dest, destSize); + ResolvePathCaseInsensitive(dest, destSize); } //----------------------------------------------------------------------------- @@ -1284,7 +1284,19 @@ bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite) bool Platform::dumpDirectories(const char *path, Vector &directoryVector, S32 depth, bool noBasePath) { - bool retVal = recurseDumpDirectories(path, "", directoryVector, -1, depth, noBasePath); +#ifdef TORQUE_POSIX_PATH_CASE_INSENSITIVE + dsize_t pathLength = dStrlen(path); + char caseSensitivePath[pathLength + 1]; + + // Load path into temporary buffer + dMemcpy(caseSensitivePath, path, pathLength); + caseSensitivePath[pathLength] = 0x00; + ResolvePathCaseInsensitive(caseSensitivePath, pathLength); +#else + const char* caseSensitivePath = path; +#endif + + bool retVal = recurseDumpDirectories(caseSensitivePath, "", directoryVector, -1, depth, noBasePath); clearExcludedDirectories(); return retVal; } diff --git a/Tools/CMake/torque3d.cmake b/Tools/CMake/torque3d.cmake index 987a094b8..460d32e51 100644 --- a/Tools/CMake/torque3d.cmake +++ b/Tools/CMake/torque3d.cmake @@ -163,6 +163,9 @@ endif() option(TORQUE_MULTITHREAD "Multi Threading" ON) mark_as_advanced(TORQUE_MULTITHREAD) +option(TORQUE_POSIX_PATH_CASE_INSENSITIVE ON) +mark_as_advanced(TORQUE_POSIX_PATH_CASE_INSENSITIVE) + option(TORQUE_DISABLE_MEMORY_MANAGER "Disable memory manager" ON) mark_as_advanced(TORQUE_DISABLE_MEMORY_MANAGER) diff --git a/Tools/CMake/torqueConfig.h.in b/Tools/CMake/torqueConfig.h.in index 13ce58b6c..6465012c4 100644 --- a/Tools/CMake/torqueConfig.h.in +++ b/Tools/CMake/torqueConfig.h.in @@ -44,6 +44,9 @@ /// Define me if you want to enable Arcane FX support. #cmakedefine TORQUE_AFX_ENABLED +/// Define me if you want path case insensitivity support on POSIX systems. Does nothing on Windows. +#cmakedefine TORQUE_POSIX_PATH_CASE_INSENSITIVE + /// Define me if you want to enable multithreading support. #cmakedefine TORQUE_MULTITHREAD From 444c9dcf41fc3c9fcd358abb29da776ca659dd01 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Mon, 11 Oct 2021 10:45:02 -0400 Subject: [PATCH 172/399] * BugFix: Correct non-constant array allocations in the POSIX case insensitivity code. --- Engine/source/platformPOSIX/posixVolume.cpp | 14 +++++++++----- Engine/source/platformX86UNIX/x86UNIXFileio.cpp | 6 +++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Engine/source/platformPOSIX/posixVolume.cpp b/Engine/source/platformPOSIX/posixVolume.cpp index 411559ffa..b8b070217 100644 --- a/Engine/source/platformPOSIX/posixVolume.cpp +++ b/Engine/source/platformPOSIX/posixVolume.cpp @@ -157,7 +157,7 @@ FileNodeRef PosixFileSystem::resolve(const Path& path) #ifdef TORQUE_POSIX_PATH_CASE_INSENSITIVE // Resolve the case sensitive filepath String::SizeType fileLength = file.length(); - UTF8 caseSensitivePath[fileLength + 1]; + UTF8* caseSensitivePath = new UTF8[fileLength + 1]; dMemcpy(caseSensitivePath, file.c_str(), fileLength); caseSensitivePath[fileLength] = 0x00; ResolvePathCaseInsensitive(caseSensitivePath, fileLength); @@ -167,17 +167,21 @@ FileNodeRef PosixFileSystem::resolve(const Path& path) String caseSensitiveFile = file; #endif + FileNodeRef result = 0; if (stat(caseSensitiveFile.c_str(),&info) == 0) { // Construct the appropriate object if (S_ISREG(info.st_mode)) - return new PosixFile(path,caseSensitiveFile); + result = new PosixFile(path,caseSensitiveFile); if (S_ISDIR(info.st_mode)) - return new PosixDirectory(path,caseSensitiveFile); + result = new PosixDirectory(path,caseSensitiveFile); } - - return 0; + +#ifdef TORQUE_POSIX_PATH_CASE_INSENSITIVE + delete[] caseSensitivePath; +#endif + return result; } FileNodeRef PosixFileSystem::create(const Path& path, FileNode::Mode mode) diff --git a/Engine/source/platformX86UNIX/x86UNIXFileio.cpp b/Engine/source/platformX86UNIX/x86UNIXFileio.cpp index 26a43ee7e..9669638ae 100644 --- a/Engine/source/platformX86UNIX/x86UNIXFileio.cpp +++ b/Engine/source/platformX86UNIX/x86UNIXFileio.cpp @@ -1286,7 +1286,7 @@ bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite) { #ifdef TORQUE_POSIX_PATH_CASE_INSENSITIVE dsize_t pathLength = dStrlen(path); - char caseSensitivePath[pathLength + 1]; + char* caseSensitivePath = new char[pathLength + 1]; // Load path into temporary buffer dMemcpy(caseSensitivePath, path, pathLength); @@ -1298,6 +1298,10 @@ bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite) bool retVal = recurseDumpDirectories(caseSensitivePath, "", directoryVector, -1, depth, noBasePath); clearExcludedDirectories(); + +#ifdef TORQUE_POSIX_PATH_CASE_INSENSITIVE + delete[] caseSensitivePath; +#endif return retVal; } From e468c2bf73c7d9e1aef3ec252141fdd68ff0c77a Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 Oct 2021 14:38:14 -0500 Subject: [PATCH 173/399] add a bit of further clarity to soundasset code injectors --- Engine/source/T3D/assets/SoundAsset.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index 77c1e7180..eebcf6590 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -432,7 +432,7 @@ if (m##name##AssetId[index] != StringTable->EmptyString())\ {\ m##name##Name[index] = StringTable->EmptyString();\ }\ - else Con::warnf("Warning: %s::LOAD_IMAGEASSET(%s)-%s", mClassName, m##name##AssetId[index], ImageAsset::getAssetErrstrn(assetState).c_str());\ + else Con::warnf("Warning: %s::LOAD_SOUNDASSET_ARRAY(%s[%i])-%s", mClassName, m##name##AssetId[index], index, ImageAsset::getAssetErrstrn(assetState).c_str());\ } #define assetEnumNameConcat(x,suff)(new std::string( x + std::string(#suff)))->c_str() @@ -440,11 +440,12 @@ if (m##name##AssetId[index] != StringTable->EmptyString())\ #define INITPERSISTFIELD_SOUNDASSET_ENUMED(name, enumType, maxValue, consoleClass, docs) \ for (U32 i = 0; i < maxValue; i++)\ {\ - const char* enumString = castConsoleTypeToString(static_cast(i));\ + const enumType itter = static_cast(i);\ + const char* enumString = castConsoleTypeToString(static_cast(itter));\ if (enumString && enumString[0])\ {\ - addField(assetEnumNameConcat(enumString, File), TypeSoundFilename, Offset(m##name##Name[i], consoleClass), assetText(name, docs), AbstractClassRep::FIELD_HideInInspectors); \ - addField(assetEnumNameConcat(enumString, Asset), TypeSoundAssetId, Offset(m##name##AssetId[i], consoleClass), assetText(name, asset reference.));\ + addField(assetEnumNameConcat(enumString, File), TypeSoundFilename, Offset(m##name##Name[itter], consoleClass), assetText(name, docs), AbstractClassRep::FIELD_HideInInspectors); \ + addField(assetEnumNameConcat(enumString, Asset), TypeSoundAssetId, Offset(m##name##AssetId[itter], consoleClass), assetText(name, asset reference.));\ }\ } #pragma endregion From d9eea8e5be4f250abe2a6eb08b1a6cfa58753c76 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 Oct 2021 16:25:37 -0500 Subject: [PATCH 174/399] make gcc happy --- Engine/source/T3D/assets/SoundAsset.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/T3D/assets/SoundAsset.h b/Engine/source/T3D/assets/SoundAsset.h index eebcf6590..d320986b9 100644 --- a/Engine/source/T3D/assets/SoundAsset.h +++ b/Engine/source/T3D/assets/SoundAsset.h @@ -444,8 +444,8 @@ if (m##name##AssetId[index] != StringTable->EmptyString())\ const char* enumString = castConsoleTypeToString(static_cast(itter));\ if (enumString && enumString[0])\ {\ - addField(assetEnumNameConcat(enumString, File), TypeSoundFilename, Offset(m##name##Name[itter], consoleClass), assetText(name, docs), AbstractClassRep::FIELD_HideInInspectors); \ - addField(assetEnumNameConcat(enumString, Asset), TypeSoundAssetId, Offset(m##name##AssetId[itter], consoleClass), assetText(name, asset reference.));\ + addField(assetEnumNameConcat(enumString, File), TypeSoundFilename, Offset(m##name##Name[0], consoleClass) + sizeof(m##name##Name[0])*i, assetText(name, docs), AbstractClassRep::FIELD_HideInInspectors); \ + addField(assetEnumNameConcat(enumString, Asset), TypeSoundAssetId, Offset(m##name##AssetId[0], consoleClass) + sizeof(m##name##AssetId[0])*i, assetText(name, asset reference.));\ }\ } #pragma endregion From 8d0128698a9476f1fd8f79587bf42b63aa00d052 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Mon, 11 Oct 2021 19:02:58 -0400 Subject: [PATCH 175/399] * [ZIPVolume] BugFix: Add the capability of resolving ZIP prefix paths with case insensitivity and a CMake option to control this behavior. --- Engine/source/core/util/zip/zipVolume.cpp | 9 ++++++++- Tools/CMake/torque3d.cmake | 3 +++ Tools/CMake/torqueConfig.h.in | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Engine/source/core/util/zip/zipVolume.cpp b/Engine/source/core/util/zip/zipVolume.cpp index 5dcb8dee8..a3a0ac7c9 100644 --- a/Engine/source/core/util/zip/zipVolume.cpp +++ b/Engine/source/core/util/zip/zipVolume.cpp @@ -407,8 +407,15 @@ FileNodeRef ZipFileSystem::resolve(const Path& path) if(mZipNameIsDir) { // Remove the fake root from the name so things can be found +#ifdef TORQUE_ZIP_PATH_CASE_INSENSITIVE + String lowerFakeRoot = String::ToLower(mFakeRoot); + String lowerName = String::ToLower(name); + if(lowerName.find(lowerFakeRoot) == 0) + name = name.substr(mFakeRoot.length()); +#else if(name.find(mFakeRoot) == 0) - name = name.substr(mFakeRoot.length()); + name = name.substr(mFakeRoot.length()); +#endif #ifdef TORQUE_DISABLE_FIND_ROOT_WITHIN_ZIP else diff --git a/Tools/CMake/torque3d.cmake b/Tools/CMake/torque3d.cmake index 460d32e51..cd09fabd6 100644 --- a/Tools/CMake/torque3d.cmake +++ b/Tools/CMake/torque3d.cmake @@ -166,6 +166,9 @@ mark_as_advanced(TORQUE_MULTITHREAD) option(TORQUE_POSIX_PATH_CASE_INSENSITIVE ON) mark_as_advanced(TORQUE_POSIX_PATH_CASE_INSENSITIVE) +option(TORQUE_ZIP_PATH_CASE_INSENSITIVE ON) +mark_as_advanced(TORQUE_ZIP_PATH_CASE_INSENSITIVE) + option(TORQUE_DISABLE_MEMORY_MANAGER "Disable memory manager" ON) mark_as_advanced(TORQUE_DISABLE_MEMORY_MANAGER) diff --git a/Tools/CMake/torqueConfig.h.in b/Tools/CMake/torqueConfig.h.in index 6465012c4..9e045b1d5 100644 --- a/Tools/CMake/torqueConfig.h.in +++ b/Tools/CMake/torqueConfig.h.in @@ -47,6 +47,9 @@ /// Define me if you want path case insensitivity support on POSIX systems. Does nothing on Windows. #cmakedefine TORQUE_POSIX_PATH_CASE_INSENSITIVE +/// Define me if you want path case insensitivity support in ZIP files. +#cmakedefine TORQUE_ZIP_PATH_CASE_INSENSITIVE + /// Define me if you want to enable multithreading support. #cmakedefine TORQUE_MULTITHREAD From c376bc3f9cf12b00aaf7aeb437e426b30ef00e6d Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Mon, 11 Oct 2021 19:31:37 -0400 Subject: [PATCH 176/399] * [ZIP] BugFix: Correct another codepath that may fail due to case sensitive string searches. --- Engine/source/core/util/zip/zipVolume.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Engine/source/core/util/zip/zipVolume.cpp b/Engine/source/core/util/zip/zipVolume.cpp index a3a0ac7c9..d56c9471e 100644 --- a/Engine/source/core/util/zip/zipVolume.cpp +++ b/Engine/source/core/util/zip/zipVolume.cpp @@ -487,8 +487,15 @@ FileNodeRef ZipFileSystem::resolveLoose(const Path& path) if(mZipNameIsDir) { // Remove the fake root from the name so things can be found +#ifdef TORQUE_ZIP_PATH_CASE_INSENSITIVE + String lowerFakeRoot = String::ToLower(mFakeRoot); + String lowerName = String::ToLower(name); + if(lowerName.find(lowerFakeRoot) == 0) + name = name.substr(mFakeRoot.length()); +#else if(name.find(mFakeRoot) == 0) - name = name.substr(mFakeRoot.length()); + name = name.substr(mFakeRoot.length()); +#endif #ifdef TORQUE_DISABLE_FIND_ROOT_WITHIN_ZIP else From 8b29dae3b9c08c08033af23322cb0f8bfee29b53 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Mon, 11 Oct 2021 20:12:32 -0400 Subject: [PATCH 177/399] * [AssetBrowser] BugFix: Correct the inability to spawn assorted objects. --- .../BaseGame/game/tools/assetBrowser/scripts/creator.tscript | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript index 48366f453..8971087c5 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript @@ -174,7 +174,7 @@ function AssetBrowser::addCreatorClass(%this, %class, %name, %buildfunc) %method = "build" @ %class; if( !ObjectBuilderGui.isMethod( %method ) ) - %cmd = "return new " @ %class @ "();"; + %cmd = "new " @ %class @ "();"; else %cmd = "ObjectBuilderGui." @ %method @ "();"; @@ -187,4 +187,4 @@ function AssetBrowser::addCreatorClass(%this, %class, %name, %buildfunc) %args.val[2] = %buildfunc; %this.creatorClassArray.push_back( %group, %args ); -} \ No newline at end of file +} From bce14ab63fd1a187ec9c9f02b8c6f407c749a5bc Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 Oct 2021 20:02:49 -0500 Subject: [PATCH 178/399] fix opengl cubemap display --- Engine/source/gfx/gl/gfxGLDevice.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Engine/source/gfx/gl/gfxGLDevice.cpp b/Engine/source/gfx/gl/gfxGLDevice.cpp index 1c82b4e74..38f94ae0f 100644 --- a/Engine/source/gfx/gl/gfxGLDevice.cpp +++ b/Engine/source/gfx/gl/gfxGLDevice.cpp @@ -187,6 +187,9 @@ void GFXGLDevice::initGLState() //enable sRGB glEnable(GL_FRAMEBUFFER_SRGB); + + //enable seamless cubemapping + glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS); } void GFXGLDevice::vsyncCallback() From 66cfd34b7127d37a21665bba41ba5ecabfc9cc12 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Tue, 12 Oct 2021 13:09:12 -0400 Subject: [PATCH 179/399] * [CMake] BugFix: Correctly set the description and default values of TORQUE_POSIX_PATH_CASE_INSENSITIVE and TORQUE_ZIP_PATH_CASE_INSENSITIVE. --- Tools/CMake/torque3d.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/CMake/torque3d.cmake b/Tools/CMake/torque3d.cmake index cd09fabd6..97b57260e 100644 --- a/Tools/CMake/torque3d.cmake +++ b/Tools/CMake/torque3d.cmake @@ -163,10 +163,10 @@ endif() option(TORQUE_MULTITHREAD "Multi Threading" ON) mark_as_advanced(TORQUE_MULTITHREAD) -option(TORQUE_POSIX_PATH_CASE_INSENSITIVE ON) +option(TORQUE_POSIX_PATH_CASE_INSENSITIVE "POSIX Pathing Case Insensitivity" ON) mark_as_advanced(TORQUE_POSIX_PATH_CASE_INSENSITIVE) -option(TORQUE_ZIP_PATH_CASE_INSENSITIVE ON) +option(TORQUE_ZIP_PATH_CASE_INSENSITIVE "ZIP Pathing Case Insensitivity" ON) mark_as_advanced(TORQUE_ZIP_PATH_CASE_INSENSITIVE) option(TORQUE_DISABLE_MEMORY_MANAGER "Disable memory manager" ON) From ca5e706ab4602b7de09c60a37ceb778810f67624 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Tue, 12 Oct 2021 13:19:28 -0400 Subject: [PATCH 180/399] * [CMake] BugFix: Clear several CMake warnings. --- Tools/CMake/basics.cmake | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Tools/CMake/basics.cmake b/Tools/CMake/basics.cmake index 952826d97..5a9fc0a42 100644 --- a/Tools/CMake/basics.cmake +++ b/Tools/CMake/basics.cmake @@ -364,10 +364,10 @@ macro(finishExecutable) endmacro() macro(setupVersionNumbers) - set(TORQUE_APP_VERSION_MAJOR 1 CACHE INTEGER "") - set(TORQUE_APP_VERSION_MINOR 0 CACHE INTEGER "") - set(TORQUE_APP_VERSION_PATCH 0 CACHE INTEGER "") - set(TORQUE_APP_VERSION_TWEAK 0 CACHE INTEGER "") + set(TORQUE_APP_VERSION_MAJOR 1 CACHE STRING "") + set(TORQUE_APP_VERSION_MINOR 0 CACHE STRING "") + set(TORQUE_APP_VERSION_PATCH 0 CACHE STRING "") + set(TORQUE_APP_VERSION_TWEAK 0 CACHE STRING "") mark_as_advanced(TORQUE_APP_VERSION_TWEAK) MATH(EXPR TORQUE_APP_VERSION "${TORQUE_APP_VERSION_MAJOR} * 1000 + ${TORQUE_APP_VERSION_MINOR} * 100 + ${TORQUE_APP_VERSION_PATCH} * 10 + ${TORQUE_APP_VERSION_TWEAK}") set(TORQUE_APP_VERSION_STRING "${TORQUE_APP_VERSION_MAJOR}.${TORQUE_APP_VERSION_MINOR}.${TORQUE_APP_VERSION_PATCH}.${TORQUE_APP_VERSION_TWEAK}") @@ -400,17 +400,17 @@ set(TORQUE_STATIC ON) #option(TORQUE_STATIC "enables or disable static" OFF) if(WIN32) - set(TORQUE_CXX_FLAGS_EXECUTABLES "/wd4018 /wd4100 /wd4121 /wd4127 /wd4130 /wd4244 /wd4245 /wd4389 /wd4511 /wd4512 /wd4800 /wd4995 " CACHE TYPE STRING) + set(TORQUE_CXX_FLAGS_EXECUTABLES "/wd4018 /wd4100 /wd4121 /wd4127 /wd4130 /wd4244 /wd4245 /wd4389 /wd4511 /wd4512 /wd4800 /wd4995 " CACHE STRING) mark_as_advanced(TORQUE_CXX_FLAGS_EXECUTABLES) - set(TORQUE_CXX_FLAGS_LIBS "/W0" CACHE TYPE STRING) + set(TORQUE_CXX_FLAGS_LIBS "/W0" CACHE STRING) mark_as_advanced(TORQUE_CXX_FLAGS_LIBS) set(TORQUE_CXX_FLAGS_COMMON_DEFAULT "-DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS /MP /O2 /Ob2 /Oi /Ot /Oy /GT /Zi /W4 /nologo /GF /EHsc /GS- /Gy- /Qpar- /fp:precise /fp:except- /GR /Zc:wchar_t-" ) if( TORQUE_CPU_X32 ) set(TORQUE_CXX_FLAGS_COMMON_DEFAULT "${TORQUE_CXX_FLAGS_COMMON_DEFAULT} /arch:SSE2") endif() - set(TORQUE_CXX_FLAGS_COMMON ${TORQUE_CXX_FLAGS_COMMON_DEFAULT} CACHE TYPE STRING) + set(TORQUE_CXX_FLAGS_COMMON ${TORQUE_CXX_FLAGS_COMMON_DEFAULT} CACHE STRING) mark_as_advanced(TORQUE_CXX_FLAGS_COMMON) @@ -436,11 +436,11 @@ if(WIN32) endif() else() # TODO: improve default settings on other platforms - set(TORQUE_CXX_FLAGS_EXECUTABLES "" CACHE TYPE STRING) + set(TORQUE_CXX_FLAGS_EXECUTABLES "" CACHE STRING "") mark_as_advanced(TORQUE_CXX_FLAGS_EXECUTABLES) - set(TORQUE_CXX_FLAGS_LIBS "" CACHE TYPE STRING) + set(TORQUE_CXX_FLAGS_LIBS "" CACHE STRING "") mark_as_advanced(TORQUE_CXX_FLAGS_LIBS) - set(TORQUE_CXX_FLAGS_COMMON "" CACHE TYPE STRING) + set(TORQUE_CXX_FLAGS_COMMON "" CACHE STRING "") mark_as_advanced(TORQUE_CXX_FLAGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORQUE_CXX_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}") From 46b2cc9b53fdd95bc30522b8a56f0b5ebabc2900 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Tue, 12 Oct 2021 14:17:47 -0400 Subject: [PATCH 181/399] * [CMake] Adjustment: Set minimum version to 3.10.2. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb48b5e97..c1b20657a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.12) +cmake_minimum_required (VERSION 3.10.2) set(TORQUE_APP_NAME "" CACHE STRING "the app name") From 7a78ec46c8e88dd8653ad6db3999be1e59ddd59c Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Tue, 12 Oct 2021 17:20:23 -0400 Subject: [PATCH 182/399] * [lpng] BugFix: Correct some compiler warnings associated with lpng and SSE optimizations. This also enables SSE when available for lpng. --- Tools/CMake/libraries/lpng.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tools/CMake/libraries/lpng.cmake b/Tools/CMake/libraries/lpng.cmake index 93a32a406..833577e82 100644 --- a/Tools/CMake/libraries/lpng.cmake +++ b/Tools/CMake/libraries/lpng.cmake @@ -29,6 +29,11 @@ project(lpng) set(PNG_ARM_NEON off CACHE STRING "") add_definitions(-DPNG_ARM_NEON_OPT=0) +# Enables SSE for libpng - also takes care of compiler warnings. +# If we don't want SSE, we should set it to off/0. +set(PNG_INTEL_SSE on CACHE STRING "") +add_definitions(-DPNG_INTEL_SSE_OPT=1) + addInclude(${libDir}/zlib) finishLibrary("${libDir}/${PROJECT_NAME}") From c965429cf660123556067fafc5ed19064747f042 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Tue, 12 Oct 2021 17:38:27 -0400 Subject: [PATCH 183/399] * [lpng] BugFix: Corrections to allow the SSE intrinsics to build properly. --- .../lib/lpng/intel/filter_sse2_intrinsics.c | 406 ++++++++++++++++++ Engine/lib/lpng/intel/intel_init.c | 53 +++ Tools/CMake/basics.cmake | 1 + Tools/CMake/libraries/lpng.cmake | 10 +- 4 files changed, 468 insertions(+), 2 deletions(-) create mode 100644 Engine/lib/lpng/intel/filter_sse2_intrinsics.c create mode 100644 Engine/lib/lpng/intel/intel_init.c diff --git a/Engine/lib/lpng/intel/filter_sse2_intrinsics.c b/Engine/lib/lpng/intel/filter_sse2_intrinsics.c new file mode 100644 index 000000000..5e8553fbb --- /dev/null +++ b/Engine/lib/lpng/intel/filter_sse2_intrinsics.c @@ -0,0 +1,406 @@ + +/* filter_sse2_intrinsics.c - SSE2 optimized filter functions + * + * Copyright (c) 2016-2017 Glenn Randers-Pehrson + * Written by Mike Klein and Matt Sarett + * Derived from arm/filter_neon_intrinsics.c + * + * Last changed in libpng 1.6.31 [July 27, 2017] + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +#include "../pngpriv.h" + +#ifdef PNG_READ_SUPPORTED + +#if PNG_INTEL_SSE_IMPLEMENTATION > 0 + +#include + +/* Functions in this file look at most 3 pixels (a,b,c) to predict the 4th (d). + * They're positioned like this: + * prev: c b + * row: a d + * The Sub filter predicts d=a, Avg d=(a+b)/2, and Paeth predicts d to be + * whichever of a, b, or c is closest to p=a+b-c. + */ + +static __m128i load4(const void* p) { + return _mm_cvtsi32_si128(*(const int*)p); +} + +static void store4(void* p, __m128i v) { + *(int*)p = _mm_cvtsi128_si32(v); +} + +static __m128i load3(const void* p) { + /* We'll load 2 bytes, then 1 byte, + * then mask them together, and finally load into SSE. + */ + const png_uint_16* p01 = (png_const_uint_16p)p; + const png_byte* p2 = (const png_byte*)(p01+1); + + png_uint_32 v012 = (png_uint_32)(*p01) + | (png_uint_32)(*p2) << 16; + return load4(&v012); +} + +static void store3(void* p, __m128i v) { + /* We'll pull from SSE as a 32-bit int, then write + * its bottom two bytes, then its third byte. + */ + png_uint_32 v012; + png_uint_16* p01; + png_byte* p2; + + store4(&v012, v); + + p01 = (png_uint_16p)p; + p2 = (png_byte*)(p01+1); + *p01 = (png_uint_16)v012; + *p2 = (png_byte)(v012 >> 16); +} + +void png_read_filter_row_sub3_sse2(png_row_infop row_info, png_bytep row, + png_const_bytep prev) +{ + /* The Sub filter predicts each pixel as the previous pixel, a. + * There is no pixel to the left of the first pixel. It's encoded directly. + * That works with our main loop if we just say that left pixel was zero. + */ + png_size_t rb; + + __m128i a, d = _mm_setzero_si128(); + + png_debug(1, "in png_read_filter_row_sub3_sse2"); + + rb = row_info->rowbytes; + while (rb >= 4) { + a = d; d = load4(row); + d = _mm_add_epi8(d, a); + store3(row, d); + + row += 3; + rb -= 3; + } + if (rb > 0) { + a = d; d = load3(row); + d = _mm_add_epi8(d, a); + store3(row, d); + + row += 3; + rb -= 3; + } + PNG_UNUSED(prev) +} + +void png_read_filter_row_sub4_sse2(png_row_infop row_info, png_bytep row, + png_const_bytep prev) +{ + /* The Sub filter predicts each pixel as the previous pixel, a. + * There is no pixel to the left of the first pixel. It's encoded directly. + * That works with our main loop if we just say that left pixel was zero. + */ + png_size_t rb; + + __m128i a, d = _mm_setzero_si128(); + + png_debug(1, "in png_read_filter_row_sub4_sse2"); + + rb = row_info->rowbytes+4; + while (rb > 4) { + a = d; d = load4(row); + d = _mm_add_epi8(d, a); + store4(row, d); + + row += 4; + rb -= 4; + } + PNG_UNUSED(prev) +} + +void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row, + png_const_bytep prev) +{ + /* The Avg filter predicts each pixel as the (truncated) average of a and b. + * There's no pixel to the left of the first pixel. Luckily, it's + * predicted to be half of the pixel above it. So again, this works + * perfectly with our loop if we make sure a starts at zero. + */ + + png_size_t rb; + + const __m128i zero = _mm_setzero_si128(); + + __m128i b; + __m128i a, d = zero; + + png_debug(1, "in png_read_filter_row_avg3_sse2"); + rb = row_info->rowbytes; + while (rb >= 4) { + __m128i avg; + b = load4(prev); + a = d; d = load4(row ); + + /* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */ + avg = _mm_avg_epu8(a,b); + /* ...but we can fix it up by subtracting off 1 if it rounded up. */ + avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b), + _mm_set1_epi8(1))); + d = _mm_add_epi8(d, avg); + store3(row, d); + + prev += 3; + row += 3; + rb -= 3; + } + if (rb > 0) { + __m128i avg; + b = load3(prev); + a = d; d = load3(row ); + + /* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */ + avg = _mm_avg_epu8(a,b); + /* ...but we can fix it up by subtracting off 1 if it rounded up. */ + avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b), + _mm_set1_epi8(1))); + + d = _mm_add_epi8(d, avg); + store3(row, d); + + prev += 3; + row += 3; + rb -= 3; + } +} + +void png_read_filter_row_avg4_sse2(png_row_infop row_info, png_bytep row, + png_const_bytep prev) +{ + /* The Avg filter predicts each pixel as the (truncated) average of a and b. + * There's no pixel to the left of the first pixel. Luckily, it's + * predicted to be half of the pixel above it. So again, this works + * perfectly with our loop if we make sure a starts at zero. + */ + png_size_t rb; + const __m128i zero = _mm_setzero_si128(); + __m128i b; + __m128i a, d = zero; + + png_debug(1, "in png_read_filter_row_avg4_sse2"); + + rb = row_info->rowbytes+4; + while (rb > 4) { + __m128i avg; + b = load4(prev); + a = d; d = load4(row ); + + /* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */ + avg = _mm_avg_epu8(a,b); + /* ...but we can fix it up by subtracting off 1 if it rounded up. */ + avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b), + _mm_set1_epi8(1))); + + d = _mm_add_epi8(d, avg); + store4(row, d); + + prev += 4; + row += 4; + rb -= 4; + } +} + +/* Returns |x| for 16-bit lanes. */ +static __m128i abs_i16(__m128i x) { +#if PNG_INTEL_SSE_IMPLEMENTATION >= 2 + return _mm_abs_epi16(x); +#else + /* Read this all as, return x<0 ? -x : x. + * To negate two's complement, you flip all the bits then add 1. + */ + __m128i is_negative = _mm_cmplt_epi16(x, _mm_setzero_si128()); + + /* Flip negative lanes. */ + x = _mm_xor_si128(x, is_negative); + + /* +1 to negative lanes, else +0. */ + x = _mm_sub_epi16(x, is_negative); + return x; +#endif +} + +/* Bytewise c ? t : e. */ +static __m128i if_then_else(__m128i c, __m128i t, __m128i e) { +#if PNG_INTEL_SSE_IMPLEMENTATION >= 3 + return _mm_blendv_epi8(e,t,c); +#else + return _mm_or_si128(_mm_and_si128(c, t), _mm_andnot_si128(c, e)); +#endif +} + +void png_read_filter_row_paeth3_sse2(png_row_infop row_info, png_bytep row, + png_const_bytep prev) +{ + /* Paeth tries to predict pixel d using the pixel to the left of it, a, + * and two pixels from the previous row, b and c: + * prev: c b + * row: a d + * The Paeth function predicts d to be whichever of a, b, or c is nearest to + * p=a+b-c. + * + * The first pixel has no left context, and so uses an Up filter, p = b. + * This works naturally with our main loop's p = a+b-c if we force a and c + * to zero. + * Here we zero b and d, which become c and a respectively at the start of + * the loop. + */ + png_size_t rb; + const __m128i zero = _mm_setzero_si128(); + __m128i c, b = zero, + a, d = zero; + + png_debug(1, "in png_read_filter_row_paeth3_sse2"); + + rb = row_info->rowbytes; + while (rb >= 4) { + /* It's easiest to do this math (particularly, deal with pc) with 16-bit + * intermediates. + */ + __m128i pa,pb,pc,smallest,nearest; + c = b; b = _mm_unpacklo_epi8(load4(prev), zero); + a = d; d = _mm_unpacklo_epi8(load4(row ), zero); + + /* (p-a) == (a+b-c - a) == (b-c) */ + + pa = _mm_sub_epi16(b,c); + + /* (p-b) == (a+b-c - b) == (a-c) */ + pb = _mm_sub_epi16(a,c); + + /* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */ + pc = _mm_add_epi16(pa,pb); + + pa = abs_i16(pa); /* |p-a| */ + pb = abs_i16(pb); /* |p-b| */ + pc = abs_i16(pc); /* |p-c| */ + + smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb)); + + /* Paeth breaks ties favoring a over b over c. */ + nearest = if_then_else(_mm_cmpeq_epi16(smallest, pa), a, + if_then_else(_mm_cmpeq_epi16(smallest, pb), b, + c)); + + /* Note `_epi8`: we need addition to wrap modulo 255. */ + d = _mm_add_epi8(d, nearest); + store3(row, _mm_packus_epi16(d,d)); + + prev += 3; + row += 3; + rb -= 3; + } + if (rb > 0) { + /* It's easiest to do this math (particularly, deal with pc) with 16-bit + * intermediates. + */ + __m128i pa,pb,pc,smallest,nearest; + c = b; b = _mm_unpacklo_epi8(load3(prev), zero); + a = d; d = _mm_unpacklo_epi8(load3(row ), zero); + + /* (p-a) == (a+b-c - a) == (b-c) */ + pa = _mm_sub_epi16(b,c); + + /* (p-b) == (a+b-c - b) == (a-c) */ + pb = _mm_sub_epi16(a,c); + + /* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */ + pc = _mm_add_epi16(pa,pb); + + pa = abs_i16(pa); /* |p-a| */ + pb = abs_i16(pb); /* |p-b| */ + pc = abs_i16(pc); /* |p-c| */ + + smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb)); + + /* Paeth breaks ties favoring a over b over c. */ + nearest = if_then_else(_mm_cmpeq_epi16(smallest, pa), a, + if_then_else(_mm_cmpeq_epi16(smallest, pb), b, + c)); + + /* Note `_epi8`: we need addition to wrap modulo 255. */ + d = _mm_add_epi8(d, nearest); + store3(row, _mm_packus_epi16(d,d)); + + prev += 3; + row += 3; + rb -= 3; + } +} + +void png_read_filter_row_paeth4_sse2(png_row_infop row_info, png_bytep row, + png_const_bytep prev) +{ + /* Paeth tries to predict pixel d using the pixel to the left of it, a, + * and two pixels from the previous row, b and c: + * prev: c b + * row: a d + * The Paeth function predicts d to be whichever of a, b, or c is nearest to + * p=a+b-c. + * + * The first pixel has no left context, and so uses an Up filter, p = b. + * This works naturally with our main loop's p = a+b-c if we force a and c + * to zero. + * Here we zero b and d, which become c and a respectively at the start of + * the loop. + */ + png_size_t rb; + const __m128i zero = _mm_setzero_si128(); + __m128i pa,pb,pc,smallest,nearest; + __m128i c, b = zero, + a, d = zero; + + png_debug(1, "in png_read_filter_row_paeth4_sse2"); + + rb = row_info->rowbytes+4; + while (rb > 4) { + /* It's easiest to do this math (particularly, deal with pc) with 16-bit + * intermediates. + */ + c = b; b = _mm_unpacklo_epi8(load4(prev), zero); + a = d; d = _mm_unpacklo_epi8(load4(row ), zero); + + /* (p-a) == (a+b-c - a) == (b-c) */ + pa = _mm_sub_epi16(b,c); + + /* (p-b) == (a+b-c - b) == (a-c) */ + pb = _mm_sub_epi16(a,c); + + /* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */ + pc = _mm_add_epi16(pa,pb); + + pa = abs_i16(pa); /* |p-a| */ + pb = abs_i16(pb); /* |p-b| */ + pc = abs_i16(pc); /* |p-c| */ + + smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb)); + + /* Paeth breaks ties favoring a over b over c. */ + nearest = if_then_else(_mm_cmpeq_epi16(smallest, pa), a, + if_then_else(_mm_cmpeq_epi16(smallest, pb), b, + c)); + + /* Note `_epi8`: we need addition to wrap modulo 255. */ + d = _mm_add_epi8(d, nearest); + store4(row, _mm_packus_epi16(d,d)); + + prev += 4; + row += 4; + rb -= 4; + } +} + +#endif /* PNG_INTEL_SSE_IMPLEMENTATION > 0 */ +#endif /* READ */ diff --git a/Engine/lib/lpng/intel/intel_init.c b/Engine/lib/lpng/intel/intel_init.c new file mode 100644 index 000000000..8f08baf8c --- /dev/null +++ b/Engine/lib/lpng/intel/intel_init.c @@ -0,0 +1,53 @@ + +/* intel_init.c - SSE2 optimized filter functions + * + * Copyright (c) 2016-2017 Glenn Randers-Pehrson + * Written by Mike Klein and Matt Sarett, Google, Inc. + * Derived from arm/arm_init.c + * + * Last changed in libpng 1.6.29 [March 16, 2017] + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +#include "../pngpriv.h" + +#ifdef PNG_READ_SUPPORTED +#if PNG_INTEL_SSE_IMPLEMENTATION > 0 + +void +png_init_filter_functions_sse2(png_structp pp, unsigned int bpp) +{ + /* The techniques used to implement each of these filters in SSE operate on + * one pixel at a time. + * So they generally speed up 3bpp images about 3x, 4bpp images about 4x. + * They can scale up to 6 and 8 bpp images and down to 2 bpp images, + * but they'd not likely have any benefit for 1bpp images. + * Most of these can be implemented using only MMX and 64-bit registers, + * but they end up a bit slower than using the equally-ubiquitous SSE2. + */ + png_debug(1, "in png_init_filter_functions_sse2"); + if (bpp == 3) + { + pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_sse2; + pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_sse2; + pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = + png_read_filter_row_paeth3_sse2; + } + else if (bpp == 4) + { + pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_sse2; + pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_sse2; + pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = + png_read_filter_row_paeth4_sse2; + } + + /* No need optimize PNG_FILTER_VALUE_UP. The compiler should + * autovectorize. + */ +} + +#endif /* PNG_INTEL_SSE_IMPLEMENTATION > 0 */ +#endif /* PNG_READ_SUPPORTED */ diff --git a/Tools/CMake/basics.cmake b/Tools/CMake/basics.cmake index 5a9fc0a42..c46386db2 100644 --- a/Tools/CMake/basics.cmake +++ b/Tools/CMake/basics.cmake @@ -300,6 +300,7 @@ macro(finishLibrary) # more paths? if(${ARGC} GREATER 0) foreach(dir ${ARGV0}) + MESSAGE(STATUS "TEST: ${dir}") addPath("${dir}") endforeach() endif() diff --git a/Tools/CMake/libraries/lpng.cmake b/Tools/CMake/libraries/lpng.cmake index 833577e82..0d4307239 100644 --- a/Tools/CMake/libraries/lpng.cmake +++ b/Tools/CMake/libraries/lpng.cmake @@ -31,8 +31,14 @@ add_definitions(-DPNG_ARM_NEON_OPT=0) # Enables SSE for libpng - also takes care of compiler warnings. # If we don't want SSE, we should set it to off/0. -set(PNG_INTEL_SSE on CACHE STRING "") -add_definitions(-DPNG_INTEL_SSE_OPT=1) +if ( TORQUE_CPU_X32 OR TORQUE_CPU_X64 ) + set(PNG_INTEL_SSE on CACHE STRING "") + add_definitions(-DPNG_INTEL_SSE_OPT=1) + addPath("${libDir}/lpng/intel") +else() + set(PNG_INTEL_SSE off CACHE STRING "") + add_definitions(-DPNG_INTEL_SSE_OPT=0) +endif() addInclude(${libDir}/zlib) From c0ff69a2e6fbcf382ba6f5da791238f8d6af5734 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Tue, 12 Oct 2021 18:44:32 -0400 Subject: [PATCH 184/399] * [CMake] BugFix: Remove a forgotten debug message. --- Tools/CMake/basics.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/Tools/CMake/basics.cmake b/Tools/CMake/basics.cmake index c46386db2..5a9fc0a42 100644 --- a/Tools/CMake/basics.cmake +++ b/Tools/CMake/basics.cmake @@ -300,7 +300,6 @@ macro(finishLibrary) # more paths? if(${ARGC} GREATER 0) foreach(dir ${ARGV0}) - MESSAGE(STATUS "TEST: ${dir}") addPath("${dir}") endforeach() endif() From 2f3215c4fb76e9547ba9b06ad3283feb2ba8b524 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Tue, 12 Oct 2021 22:04:36 -0400 Subject: [PATCH 185/399] * [lpng] Adjustment: Update libpng to version 1.6.37. --- Engine/lib/lpng/ANNOUNCE | 58 +- Engine/lib/lpng/AUTHORS | 45 + Engine/lib/lpng/CHANGES | 104 +- Engine/lib/lpng/CMakeLists.txt | 320 +- Engine/lib/lpng/INSTALL | 2 +- Engine/lib/lpng/LICENSE | 177 +- Engine/lib/lpng/Makefile.am | 393 + Engine/lib/lpng/Makefile.in | 2428 +++ Engine/lib/lpng/README | 111 +- Engine/lib/lpng/TODO | 49 +- Engine/lib/lpng/TRADEMARK | 8 + Engine/lib/lpng/aclocal.m4 | 1196 ++ Engine/lib/lpng/arm/arm_init.c | 136 + Engine/lib/lpng/arm/filter_neon.S | 253 + Engine/lib/lpng/arm/filter_neon_intrinsics.c | 402 + Engine/lib/lpng/arm/palette_neon_intrinsics.c | 149 + Engine/lib/lpng/autogen.sh | 225 + Engine/lib/lpng/compile | 348 + Engine/lib/lpng/config.guess | 1476 ++ Engine/lib/lpng/config.h.in | 126 + Engine/lib/lpng/config.sub | 1801 ++ Engine/lib/lpng/configure | 16116 ++++++++++++++++ Engine/lib/lpng/configure.ac | 532 + Engine/lib/lpng/contrib/README.txt | 5 + Engine/lib/lpng/contrib/arm-neon/README | 83 + .../lib/lpng/contrib/arm-neon/android-ndk.c | 39 + Engine/lib/lpng/contrib/arm-neon/linux-auxv.c | 120 + Engine/lib/lpng/contrib/arm-neon/linux.c | 161 + Engine/lib/lpng/contrib/conftest/README | 49 + Engine/lib/lpng/contrib/conftest/pngcp.dfa | 57 + Engine/lib/lpng/contrib/conftest/read.dfa | 58 + Engine/lib/lpng/contrib/conftest/s_read.dfa | 35 + Engine/lib/lpng/contrib/conftest/s_write.dfa | 33 + Engine/lib/lpng/contrib/conftest/simple.dfa | 36 + Engine/lib/lpng/contrib/conftest/write.dfa | 45 + Engine/lib/lpng/contrib/examples/README.txt | 24 + Engine/lib/lpng/contrib/examples/iccfrompng.c | 185 + Engine/lib/lpng/contrib/examples/pngpixel.c | 371 + Engine/lib/lpng/contrib/examples/pngtopng.c | 98 + Engine/lib/lpng/contrib/examples/simpleover.c | 648 + Engine/lib/lpng/contrib/gregbook/COPYING | 340 + Engine/lib/lpng/contrib/gregbook/LICENSE | 50 + .../lpng/contrib/gregbook/Makefile.mingw32 | 131 + Engine/lib/lpng/contrib/gregbook/Makefile.sgi | 105 + Engine/lib/lpng/contrib/gregbook/Makefile.unx | 134 + Engine/lib/lpng/contrib/gregbook/Makefile.w32 | 114 + Engine/lib/lpng/contrib/gregbook/README | 186 + Engine/lib/lpng/contrib/gregbook/makevms.com | 132 + Engine/lib/lpng/contrib/gregbook/readpng.c | 323 + Engine/lib/lpng/contrib/gregbook/readpng.h | 88 + Engine/lib/lpng/contrib/gregbook/readpng2.c | 521 + Engine/lib/lpng/contrib/gregbook/readpng2.h | 116 + Engine/lib/lpng/contrib/gregbook/readppm.c | 188 + Engine/lib/lpng/contrib/gregbook/rpng-win.c | 735 + Engine/lib/lpng/contrib/gregbook/rpng-x.c | 911 + Engine/lib/lpng/contrib/gregbook/rpng2-win.c | 1261 ++ Engine/lib/lpng/contrib/gregbook/rpng2-x.c | 2143 ++ Engine/lib/lpng/contrib/gregbook/toucan.png | Bin 0 -> 12901 bytes Engine/lib/lpng/contrib/gregbook/wpng.c | 865 + Engine/lib/lpng/contrib/gregbook/writepng.c | 401 + Engine/lib/lpng/contrib/gregbook/writepng.h | 133 + Engine/lib/lpng/contrib/libtests/fakepng.c | 65 + Engine/lib/lpng/contrib/libtests/gentests.sh | 102 + Engine/lib/lpng/contrib/libtests/makepng.c | 1941 ++ Engine/lib/lpng/contrib/libtests/pngimage.c | 1712 ++ .../lpng/contrib/libtests/pngstest-errors.h | 165 + Engine/lib/lpng/contrib/libtests/pngstest.c | 3828 ++++ Engine/lib/lpng/contrib/libtests/pngunknown.c | 1294 ++ Engine/lib/lpng/contrib/libtests/pngvalid.c | 12230 ++++++++++++ Engine/lib/lpng/contrib/libtests/readpng.c | 115 + Engine/lib/lpng/contrib/libtests/tarith.c | 999 + Engine/lib/lpng/contrib/libtests/timepng.c | 608 + Engine/lib/lpng/contrib/mips-msa/README | 83 + Engine/lib/lpng/contrib/mips-msa/linux.c | 64 + Engine/lib/lpng/contrib/oss-fuzz/Dockerfile | 25 + Engine/lib/lpng/contrib/oss-fuzz/README.txt | 37 + Engine/lib/lpng/contrib/oss-fuzz/build.sh | 51 + .../contrib/oss-fuzz/libpng_read_fuzzer.cc | 190 + .../oss-fuzz/libpng_read_fuzzer.options | 2 + Engine/lib/lpng/contrib/oss-fuzz/png.dict | 39 + Engine/lib/lpng/contrib/pngminim/README | 5 + .../lib/lpng/contrib/pngminim/decoder/README | 10 + .../lpng/contrib/pngminim/decoder/makefile | 151 + .../lpng/contrib/pngminim/decoder/pngusr.dfa | 40 + .../lpng/contrib/pngminim/decoder/pngusr.h | 23 + .../lib/lpng/contrib/pngminim/encoder/README | 10 + .../lpng/contrib/pngminim/encoder/makefile | 150 + .../lpng/contrib/pngminim/encoder/pngusr.dfa | 39 + .../lpng/contrib/pngminim/encoder/pngusr.h | 23 + .../lib/lpng/contrib/pngminim/preader/README | 15 + .../lpng/contrib/pngminim/preader/makefile | 166 + .../lpng/contrib/pngminim/preader/pngusr.dfa | 40 + .../lpng/contrib/pngminim/preader/pngusr.h | 23 + Engine/lib/lpng/contrib/pngminus/CHANGES.txt | 13 + .../lib/lpng/contrib/pngminus/CMakeLists.txt | 24 + Engine/lib/lpng/contrib/pngminus/LICENSE.txt | 22 + Engine/lib/lpng/contrib/pngminus/Makefile | 62 + Engine/lib/lpng/contrib/pngminus/README.txt | 120 + Engine/lib/lpng/contrib/pngminus/makevms.com | 92 + Engine/lib/lpng/contrib/pngminus/png2pnm.bat | 41 + Engine/lib/lpng/contrib/pngminus/png2pnm.c | 427 + Engine/lib/lpng/contrib/pngminus/png2pnm.sh | 42 + Engine/lib/lpng/contrib/pngminus/pngminus.bat | 4 + Engine/lib/lpng/contrib/pngminus/pngminus.sh | 5 + Engine/lib/lpng/contrib/pngminus/pnm2png.bat | 41 + Engine/lib/lpng/contrib/pngminus/pnm2png.c | 620 + Engine/lib/lpng/contrib/pngminus/pnm2png.sh | 42 + Engine/lib/lpng/contrib/pngsuite/README | 107 + .../pngsuite/bad_interlace_conversions.txt | 9 + Engine/lib/lpng/contrib/pngsuite/basn0g01.png | Bin 0 -> 164 bytes Engine/lib/lpng/contrib/pngsuite/basn0g02.png | Bin 0 -> 104 bytes Engine/lib/lpng/contrib/pngsuite/basn0g04.png | Bin 0 -> 145 bytes Engine/lib/lpng/contrib/pngsuite/basn0g08.png | Bin 0 -> 138 bytes Engine/lib/lpng/contrib/pngsuite/basn0g16.png | Bin 0 -> 167 bytes Engine/lib/lpng/contrib/pngsuite/basn2c08.png | Bin 0 -> 145 bytes Engine/lib/lpng/contrib/pngsuite/basn2c16.png | Bin 0 -> 302 bytes Engine/lib/lpng/contrib/pngsuite/basn3p01.png | Bin 0 -> 112 bytes Engine/lib/lpng/contrib/pngsuite/basn3p02.png | Bin 0 -> 146 bytes Engine/lib/lpng/contrib/pngsuite/basn3p04.png | Bin 0 -> 216 bytes Engine/lib/lpng/contrib/pngsuite/basn3p08.png | Bin 0 -> 1286 bytes Engine/lib/lpng/contrib/pngsuite/basn4a08.png | Bin 0 -> 126 bytes Engine/lib/lpng/contrib/pngsuite/basn4a16.png | Bin 0 -> 2206 bytes Engine/lib/lpng/contrib/pngsuite/basn6a08.png | Bin 0 -> 184 bytes Engine/lib/lpng/contrib/pngsuite/basn6a16.png | Bin 0 -> 3435 bytes .../lib/lpng/contrib/pngsuite/ftbbn0g01.png | Bin 0 -> 176 bytes .../lib/lpng/contrib/pngsuite/ftbbn0g02.png | Bin 0 -> 197 bytes .../lib/lpng/contrib/pngsuite/ftbbn0g04.png | Bin 0 -> 429 bytes .../lib/lpng/contrib/pngsuite/ftbbn2c16.png | Bin 0 -> 2041 bytes .../lib/lpng/contrib/pngsuite/ftbbn3p08.png | Bin 0 -> 1499 bytes .../lib/lpng/contrib/pngsuite/ftbgn2c16.png | Bin 0 -> 2041 bytes .../lib/lpng/contrib/pngsuite/ftbgn3p08.png | Bin 0 -> 1499 bytes .../lib/lpng/contrib/pngsuite/ftbrn2c08.png | Bin 0 -> 1633 bytes .../lib/lpng/contrib/pngsuite/ftbwn0g16.png | Bin 0 -> 1313 bytes .../lib/lpng/contrib/pngsuite/ftbwn3p08.png | Bin 0 -> 1496 bytes .../lib/lpng/contrib/pngsuite/ftbyn3p08.png | Bin 0 -> 1499 bytes .../lib/lpng/contrib/pngsuite/ftp0n0g08.png | Bin 0 -> 719 bytes .../lib/lpng/contrib/pngsuite/ftp0n2c08.png | Bin 0 -> 1594 bytes .../lib/lpng/contrib/pngsuite/ftp0n3p08.png | Bin 0 -> 1476 bytes .../lib/lpng/contrib/pngsuite/ftp1n3p08.png | Bin 0 -> 1483 bytes .../lib/lpng/contrib/pngsuite/ibasn0g08.png | Bin 0 -> 237 bytes .../lib/lpng/contrib/pngsuite/ibasn0g16.png | Bin 0 -> 274 bytes .../lib/lpng/contrib/pngsuite/ibasn2c08.png | Bin 0 -> 299 bytes .../lib/lpng/contrib/pngsuite/ibasn2c16.png | Bin 0 -> 558 bytes .../lib/lpng/contrib/pngsuite/ibasn3p08.png | Bin 0 -> 1492 bytes .../lib/lpng/contrib/pngsuite/ibasn4a08.png | Bin 0 -> 198 bytes .../lib/lpng/contrib/pngsuite/ibasn4a16.png | Bin 0 -> 2839 bytes .../lib/lpng/contrib/pngsuite/ibasn6a08.png | Bin 0 -> 339 bytes .../lib/lpng/contrib/pngsuite/ibasn6a16.png | Bin 0 -> 4164 bytes .../lib/lpng/contrib/pngsuite/iftbbn2c16.png | Bin 0 -> 2624 bytes .../lib/lpng/contrib/pngsuite/iftbbn3p08.png | Bin 0 -> 1507 bytes .../lib/lpng/contrib/pngsuite/iftbgn2c16.png | Bin 0 -> 2624 bytes .../lib/lpng/contrib/pngsuite/iftbgn3p08.png | Bin 0 -> 1507 bytes .../lib/lpng/contrib/pngsuite/iftbrn2c08.png | Bin 0 -> 1624 bytes .../lib/lpng/contrib/pngsuite/iftbwn0g16.png | Bin 0 -> 1448 bytes .../lib/lpng/contrib/pngsuite/iftbwn3p08.png | Bin 0 -> 1507 bytes .../lib/lpng/contrib/pngsuite/iftbyn3p08.png | Bin 0 -> 1507 bytes .../lib/lpng/contrib/pngsuite/iftp0n0g08.png | Bin 0 -> 847 bytes .../lib/lpng/contrib/pngsuite/iftp0n2c08.png | Bin 0 -> 2020 bytes .../lib/lpng/contrib/pngsuite/iftp0n3p08.png | Bin 0 -> 1495 bytes .../lib/lpng/contrib/pngsuite/iftp1n3p08.png | Bin 0 -> 1507 bytes .../lpng/contrib/pngsuite/interlaced/README | 2 + .../contrib/pngsuite/interlaced/ibasn0g01.png | Bin 0 -> 201 bytes .../contrib/pngsuite/interlaced/ibasn0g02.png | Bin 0 -> 138 bytes .../contrib/pngsuite/interlaced/ibasn0g04.png | Bin 0 -> 231 bytes .../contrib/pngsuite/interlaced/ibasn3p01.png | Bin 0 -> 116 bytes .../contrib/pngsuite/interlaced/ibasn3p02.png | Bin 0 -> 163 bytes .../contrib/pngsuite/interlaced/ibasn3p04.png | Bin 0 -> 288 bytes .../pngsuite/interlaced/iftbbn0g01.png | Bin 0 -> 214 bytes .../pngsuite/interlaced/iftbbn0g02.png | Bin 0 -> 211 bytes .../pngsuite/interlaced/iftbbn0g04.png | Bin 0 -> 489 bytes Engine/lib/lpng/contrib/powerpc-vsx/README | 81 + Engine/lib/lpng/contrib/powerpc-vsx/linux.c | 57 + .../lib/lpng/contrib/powerpc-vsx/linux_aux.c | 34 + .../contrib/testpngs/crashers/bad_iCCP.png | Bin 0 -> 321 bytes .../contrib/testpngs/crashers/badadler.png | Bin 0 -> 67 bytes .../lpng/contrib/testpngs/crashers/badcrc.png | Bin 0 -> 67 bytes .../crashers/empty_ancillary_chunks.png | Bin 0 -> 730 bytes .../contrib/testpngs/crashers/huge_IDAT.png | Bin 0 -> 79 bytes .../testpngs/crashers/huge_bKGD_chunk.png | Bin 0 -> 57 bytes .../testpngs/crashers/huge_cHRM_chunk.png | Bin 0 -> 57 bytes .../testpngs/crashers/huge_eXIf_chunk.png | Bin 0 -> 57 bytes .../testpngs/crashers/huge_gAMA_chunk.png | Bin 0 -> 57 bytes .../testpngs/crashers/huge_hIST_chunk.png | Bin 0 -> 57 bytes .../testpngs/crashers/huge_iCCP_chunk.png | Bin 0 -> 57 bytes .../testpngs/crashers/huge_iTXt_chunk.png | Bin 0 -> 57 bytes .../crashers/huge_juNK_unsafe_to_copy.png | Bin 0 -> 57 bytes .../crashers/huge_juNk_safe_to_copy.png | Bin 0 -> 57 bytes .../testpngs/crashers/huge_pCAL_chunk.png | Bin 0 -> 57 bytes .../testpngs/crashers/huge_pHYs_chunk.png | Bin 0 -> 57 bytes .../testpngs/crashers/huge_sCAL_chunk.png | Bin 0 -> 57 bytes .../testpngs/crashers/huge_sPLT_chunk.png | Bin 0 -> 57 bytes .../testpngs/crashers/huge_sRGB_chunk.png | Bin 0 -> 57 bytes .../testpngs/crashers/huge_sTER_chunk.png | Bin 0 -> 57 bytes .../testpngs/crashers/huge_tEXt_chunk.png | Bin 0 -> 57 bytes .../testpngs/crashers/huge_tIME_chunk.png | Bin 0 -> 57 bytes .../testpngs/crashers/huge_zTXt_chunk.png | Bin 0 -> 57 bytes .../lpng/contrib/testpngs/gray-1-1.8-tRNS.png | Bin 0 -> 325 bytes .../lib/lpng/contrib/testpngs/gray-1-1.8.png | Bin 0 -> 311 bytes .../contrib/testpngs/gray-1-linear-tRNS.png | Bin 0 -> 325 bytes .../lpng/contrib/testpngs/gray-1-linear.png | Bin 0 -> 311 bytes .../contrib/testpngs/gray-1-sRGB-tRNS.png | Bin 0 -> 278 bytes .../lib/lpng/contrib/testpngs/gray-1-sRGB.png | Bin 0 -> 264 bytes .../lib/lpng/contrib/testpngs/gray-1-tRNS.png | Bin 0 -> 265 bytes Engine/lib/lpng/contrib/testpngs/gray-1.png | Bin 0 -> 251 bytes .../contrib/testpngs/gray-16-1.8-tRNS.png | Bin 0 -> 744 bytes .../lib/lpng/contrib/testpngs/gray-16-1.8.png | Bin 0 -> 744 bytes .../contrib/testpngs/gray-16-linear-tRNS.png | Bin 0 -> 744 bytes .../lpng/contrib/testpngs/gray-16-linear.png | Bin 0 -> 744 bytes .../contrib/testpngs/gray-16-sRGB-tRNS.png | Bin 0 -> 697 bytes .../lpng/contrib/testpngs/gray-16-sRGB.png | Bin 0 -> 697 bytes .../lpng/contrib/testpngs/gray-16-tRNS.png | Bin 0 -> 684 bytes Engine/lib/lpng/contrib/testpngs/gray-16.png | Bin 0 -> 684 bytes .../lpng/contrib/testpngs/gray-2-1.8-tRNS.png | Bin 0 -> 325 bytes .../lib/lpng/contrib/testpngs/gray-2-1.8.png | Bin 0 -> 311 bytes .../contrib/testpngs/gray-2-linear-tRNS.png | Bin 0 -> 325 bytes .../lpng/contrib/testpngs/gray-2-linear.png | Bin 0 -> 311 bytes .../contrib/testpngs/gray-2-sRGB-tRNS.png | Bin 0 -> 278 bytes .../lib/lpng/contrib/testpngs/gray-2-sRGB.png | Bin 0 -> 264 bytes .../lib/lpng/contrib/testpngs/gray-2-tRNS.png | Bin 0 -> 265 bytes Engine/lib/lpng/contrib/testpngs/gray-2.png | Bin 0 -> 251 bytes .../lpng/contrib/testpngs/gray-4-1.8-tRNS.png | Bin 0 -> 327 bytes .../lib/lpng/contrib/testpngs/gray-4-1.8.png | Bin 0 -> 313 bytes .../contrib/testpngs/gray-4-linear-tRNS.png | Bin 0 -> 327 bytes .../lpng/contrib/testpngs/gray-4-linear.png | Bin 0 -> 313 bytes .../contrib/testpngs/gray-4-sRGB-tRNS.png | Bin 0 -> 280 bytes .../lib/lpng/contrib/testpngs/gray-4-sRGB.png | Bin 0 -> 266 bytes .../lib/lpng/contrib/testpngs/gray-4-tRNS.png | Bin 0 -> 267 bytes Engine/lib/lpng/contrib/testpngs/gray-4.png | Bin 0 -> 253 bytes .../lpng/contrib/testpngs/gray-8-1.8-tRNS.png | Bin 0 -> 327 bytes .../lib/lpng/contrib/testpngs/gray-8-1.8.png | Bin 0 -> 313 bytes .../contrib/testpngs/gray-8-linear-tRNS.png | Bin 0 -> 327 bytes .../lpng/contrib/testpngs/gray-8-linear.png | Bin 0 -> 313 bytes .../contrib/testpngs/gray-8-sRGB-tRNS.png | Bin 0 -> 280 bytes .../lib/lpng/contrib/testpngs/gray-8-sRGB.png | Bin 0 -> 266 bytes .../lib/lpng/contrib/testpngs/gray-8-tRNS.png | Bin 0 -> 267 bytes Engine/lib/lpng/contrib/testpngs/gray-8.png | Bin 0 -> 253 bytes .../contrib/testpngs/gray-alpha-16-1.8.png | Bin 0 -> 919 bytes .../contrib/testpngs/gray-alpha-16-linear.png | Bin 0 -> 919 bytes .../contrib/testpngs/gray-alpha-16-sRGB.png | Bin 0 -> 872 bytes .../lpng/contrib/testpngs/gray-alpha-16.png | Bin 0 -> 859 bytes .../contrib/testpngs/gray-alpha-8-1.8.png | Bin 0 -> 744 bytes .../contrib/testpngs/gray-alpha-8-linear.png | Bin 0 -> 744 bytes .../contrib/testpngs/gray-alpha-8-sRGB.png | Bin 0 -> 697 bytes .../lpng/contrib/testpngs/gray-alpha-8.png | Bin 0 -> 684 bytes Engine/lib/lpng/contrib/testpngs/makepngs.sh | 94 + .../contrib/testpngs/palette-1-1.8-tRNS.png | Bin 0 -> 342 bytes .../lpng/contrib/testpngs/palette-1-1.8.png | Bin 0 -> 329 bytes .../testpngs/palette-1-linear-tRNS.png | Bin 0 -> 342 bytes .../contrib/testpngs/palette-1-linear.png | Bin 0 -> 329 bytes .../contrib/testpngs/palette-1-sRGB-tRNS.png | Bin 0 -> 295 bytes .../lpng/contrib/testpngs/palette-1-sRGB.png | Bin 0 -> 282 bytes .../lpng/contrib/testpngs/palette-1-tRNS.png | Bin 0 -> 282 bytes .../lib/lpng/contrib/testpngs/palette-1.png | Bin 0 -> 269 bytes .../contrib/testpngs/palette-2-1.8-tRNS.png | Bin 0 -> 350 bytes .../lpng/contrib/testpngs/palette-2-1.8.png | Bin 0 -> 335 bytes .../testpngs/palette-2-linear-tRNS.png | Bin 0 -> 350 bytes .../contrib/testpngs/palette-2-linear.png | Bin 0 -> 335 bytes .../contrib/testpngs/palette-2-sRGB-tRNS.png | Bin 0 -> 303 bytes .../lpng/contrib/testpngs/palette-2-sRGB.png | Bin 0 -> 288 bytes .../lpng/contrib/testpngs/palette-2-tRNS.png | Bin 0 -> 290 bytes .../lib/lpng/contrib/testpngs/palette-2.png | Bin 0 -> 275 bytes .../contrib/testpngs/palette-4-1.8-tRNS.png | Bin 0 -> 400 bytes .../lpng/contrib/testpngs/palette-4-1.8.png | Bin 0 -> 373 bytes .../testpngs/palette-4-linear-tRNS.png | Bin 0 -> 400 bytes .../contrib/testpngs/palette-4-linear.png | Bin 0 -> 373 bytes .../contrib/testpngs/palette-4-sRGB-tRNS.png | Bin 0 -> 353 bytes .../lpng/contrib/testpngs/palette-4-sRGB.png | Bin 0 -> 326 bytes .../lpng/contrib/testpngs/palette-4-tRNS.png | Bin 0 -> 340 bytes .../lib/lpng/contrib/testpngs/palette-4.png | Bin 0 -> 313 bytes .../contrib/testpngs/palette-8-1.8-tRNS.png | Bin 0 -> 1360 bytes .../lpng/contrib/testpngs/palette-8-1.8.png | Bin 0 -> 1093 bytes .../testpngs/palette-8-linear-tRNS.png | Bin 0 -> 1360 bytes .../contrib/testpngs/palette-8-linear.png | Bin 0 -> 1093 bytes .../contrib/testpngs/palette-8-sRGB-tRNS.png | Bin 0 -> 1313 bytes .../lpng/contrib/testpngs/palette-8-sRGB.png | Bin 0 -> 1046 bytes .../lpng/contrib/testpngs/palette-8-tRNS.png | Bin 0 -> 1300 bytes .../lib/lpng/contrib/testpngs/palette-8.png | Bin 0 -> 1033 bytes .../lpng/contrib/testpngs/rgb-16-1.8-tRNS.png | Bin 0 -> 1211 bytes .../lib/lpng/contrib/testpngs/rgb-16-1.8.png | Bin 0 -> 1211 bytes .../contrib/testpngs/rgb-16-linear-tRNS.png | Bin 0 -> 1211 bytes .../lpng/contrib/testpngs/rgb-16-linear.png | Bin 0 -> 1211 bytes .../contrib/testpngs/rgb-16-sRGB-tRNS.png | Bin 0 -> 1164 bytes .../lib/lpng/contrib/testpngs/rgb-16-sRGB.png | Bin 0 -> 1164 bytes .../lib/lpng/contrib/testpngs/rgb-16-tRNS.png | Bin 0 -> 1151 bytes Engine/lib/lpng/contrib/testpngs/rgb-16.png | Bin 0 -> 1151 bytes .../lpng/contrib/testpngs/rgb-8-1.8-tRNS.png | Bin 0 -> 837 bytes .../lib/lpng/contrib/testpngs/rgb-8-1.8.png | Bin 0 -> 819 bytes .../contrib/testpngs/rgb-8-linear-tRNS.png | Bin 0 -> 837 bytes .../lpng/contrib/testpngs/rgb-8-linear.png | Bin 0 -> 819 bytes .../lpng/contrib/testpngs/rgb-8-sRGB-tRNS.png | Bin 0 -> 790 bytes .../lib/lpng/contrib/testpngs/rgb-8-sRGB.png | Bin 0 -> 772 bytes .../lib/lpng/contrib/testpngs/rgb-8-tRNS.png | Bin 0 -> 777 bytes Engine/lib/lpng/contrib/testpngs/rgb-8.png | Bin 0 -> 759 bytes .../contrib/testpngs/rgb-alpha-16-1.8.png | Bin 0 -> 1437 bytes .../contrib/testpngs/rgb-alpha-16-linear.png | Bin 0 -> 1437 bytes .../contrib/testpngs/rgb-alpha-16-sRGB.png | Bin 0 -> 1390 bytes .../lpng/contrib/testpngs/rgb-alpha-16.png | Bin 0 -> 1377 bytes .../lpng/contrib/testpngs/rgb-alpha-8-1.8.png | Bin 0 -> 919 bytes .../contrib/testpngs/rgb-alpha-8-linear.png | Bin 0 -> 919 bytes .../contrib/testpngs/rgb-alpha-8-sRGB.png | Bin 0 -> 872 bytes .../lib/lpng/contrib/testpngs/rgb-alpha-8.png | Bin 0 -> 859 bytes Engine/lib/lpng/contrib/tools/README.txt | 27 + Engine/lib/lpng/contrib/tools/checksum-icc.c | 102 + Engine/lib/lpng/contrib/tools/chkfmt | 144 + Engine/lib/lpng/contrib/tools/cvtcolor.c | 188 + Engine/lib/lpng/contrib/tools/genpng.c | 881 + Engine/lib/lpng/contrib/tools/intgamma.sh | 110 + Engine/lib/lpng/contrib/tools/makesRGB.c | 430 + Engine/lib/lpng/contrib/tools/png-fix-itxt.c | 164 + Engine/lib/lpng/contrib/tools/pngcp.c | 2453 +++ Engine/lib/lpng/contrib/tools/pngfix.c | 4049 ++++ Engine/lib/lpng/contrib/tools/reindent | 25 + Engine/lib/lpng/contrib/tools/sRGB.h | 48 + Engine/lib/lpng/contrib/visupng/PngFile.c | 454 + Engine/lib/lpng/contrib/visupng/PngFile.h | 30 + Engine/lib/lpng/contrib/visupng/README.txt | 61 + Engine/lib/lpng/contrib/visupng/VisualPng.c | 978 + Engine/lib/lpng/contrib/visupng/VisualPng.dsp | 147 + Engine/lib/lpng/contrib/visupng/VisualPng.dsw | 29 + Engine/lib/lpng/contrib/visupng/VisualPng.ico | Bin 0 -> 766 bytes Engine/lib/lpng/contrib/visupng/VisualPng.png | Bin 0 -> 208 bytes Engine/lib/lpng/contrib/visupng/VisualPng.rc | 152 + Engine/lib/lpng/contrib/visupng/cexcept.h | 248 + Engine/lib/lpng/contrib/visupng/resource.h | 23 + Engine/lib/lpng/depcomp | 791 + Engine/lib/lpng/example.c | 436 +- Engine/lib/lpng/install-sh | 518 + .../lib/lpng/intel/filter_sse2_intrinsics.c | 49 +- Engine/lib/lpng/intel/intel_init.c | 3 +- Engine/lib/lpng/libpng-manual.txt | 157 +- Engine/lib/lpng/libpng.3 | 383 +- Engine/lib/lpng/libpngpf.3 | 22 +- Engine/lib/lpng/ltmain.sh | 11147 +++++++++++ Engine/lib/lpng/mips/filter_msa_intrinsics.c | 808 + Engine/lib/lpng/mips/mips_init.c | 130 + Engine/lib/lpng/missing | 215 + Engine/lib/lpng/png.5 | 66 +- Engine/lib/lpng/png.c | 83 +- Engine/lib/lpng/png.h | 359 +- Engine/lib/lpng/pngconf.h | 45 +- Engine/lib/lpng/pngdebug.h | 6 +- Engine/lib/lpng/pngerror.c | 12 +- Engine/lib/lpng/pngget.c | 21 +- Engine/lib/lpng/pnginfo.h | 18 +- Engine/lib/lpng/pngmem.c | 6 +- Engine/lib/lpng/pngpread.c | 52 +- Engine/lib/lpng/pngpriv.h | 80 +- Engine/lib/lpng/pngread.c | 48 +- Engine/lib/lpng/pngrio.c | 16 +- Engine/lib/lpng/pngrtran.c | 1958 +- Engine/lib/lpng/pngrutil.c | 108 +- Engine/lib/lpng/pngset.c | 28 +- Engine/lib/lpng/pngstruct.h | 32 +- Engine/lib/lpng/pngtest.c | 48 +- Engine/lib/lpng/pngtrans.c | 28 +- Engine/lib/lpng/pngusr.dfa | 14 + Engine/lib/lpng/pngwio.c | 14 +- Engine/lib/lpng/pngwrite.c | 41 +- Engine/lib/lpng/pngwtran.c | 19 +- Engine/lib/lpng/pngwutil.c | 197 +- .../lib/lpng/powerpc/filter_vsx_intrinsics.c | 768 + Engine/lib/lpng/powerpc/powerpc_init.c | 126 + Engine/lib/lpng/projects/owatcom/libpng.tgt | 383 + Engine/lib/lpng/projects/owatcom/libpng.wpj | 112 + .../lib/lpng/projects/owatcom/pngconfig.mak | 160 + Engine/lib/lpng/projects/owatcom/pngstest.tgt | 219 + Engine/lib/lpng/projects/owatcom/pngtest.tgt | 179 + Engine/lib/lpng/projects/owatcom/pngvalid.tgt | 210 + .../lib/lpng/projects/visualc71/PRJ0041.mak | 21 + Engine/lib/lpng/projects/visualc71/README.txt | 58 + .../lpng/projects/visualc71/README_zlib.txt | 44 + Engine/lib/lpng/projects/vstudio/README.txt | 87 + Engine/lib/lpng/projects/vstudio/zlib.props | 57 + Engine/lib/lpng/scripts/README.txt | 79 + Engine/lib/lpng/scripts/SCOPTIONS.ppc | 7 + Engine/lib/lpng/scripts/checksym.awk | 173 + Engine/lib/lpng/scripts/descrip.mms | 52 + Engine/lib/lpng/scripts/dfn.awk | 203 + Engine/lib/lpng/scripts/genchk.cmake.in | 37 + Engine/lib/lpng/scripts/genout.cmake.in | 93 + Engine/lib/lpng/scripts/gensrc.cmake.in | 138 + Engine/lib/lpng/scripts/intprefix.c | 22 + Engine/lib/lpng/scripts/libpng-config-body.in | 96 + Engine/lib/lpng/scripts/libpng-config-head.in | 24 + Engine/lib/lpng/scripts/libpng.pc.in | 10 + Engine/lib/lpng/scripts/libtool.m4 | 8369 ++++++++ Engine/lib/lpng/scripts/ltoptions.m4 | 437 + Engine/lib/lpng/scripts/ltsugar.m4 | 124 + Engine/lib/lpng/scripts/ltversion.m4 | 23 + Engine/lib/lpng/scripts/lt~obsolete.m4 | 99 + Engine/lib/lpng/scripts/macro.lst | 3 + Engine/lib/lpng/scripts/makefile.32sunu | 244 + Engine/lib/lpng/scripts/makefile.64sunu | 244 + Engine/lib/lpng/scripts/makefile.acorn | 57 + Engine/lib/lpng/scripts/makefile.aix | 116 + Engine/lib/lpng/scripts/makefile.amiga | 58 + Engine/lib/lpng/scripts/makefile.atari | 71 + Engine/lib/lpng/scripts/makefile.bc32 | 158 + Engine/lib/lpng/scripts/makefile.beos | 222 + Engine/lib/lpng/scripts/makefile.cegcc | 116 + Engine/lib/lpng/scripts/makefile.clang | 87 + Engine/lib/lpng/scripts/makefile.clang-asan | 87 + Engine/lib/lpng/scripts/makefile.darwin | 225 + Engine/lib/lpng/scripts/makefile.dec | 210 + Engine/lib/lpng/scripts/makefile.dj2 | 72 + Engine/lib/lpng/scripts/makefile.freebsd | 69 + Engine/lib/lpng/scripts/makefile.gcc | 87 + Engine/lib/lpng/scripts/makefile.gcc-asan | 87 + Engine/lib/lpng/scripts/makefile.hp64 | 231 + Engine/lib/lpng/scripts/makefile.hpgcc | 234 + Engine/lib/lpng/scripts/makefile.hpux | 229 + Engine/lib/lpng/scripts/makefile.ibmc | 90 + Engine/lib/lpng/scripts/makefile.intel | 115 + Engine/lib/lpng/scripts/makefile.linux | 246 + Engine/lib/lpng/scripts/makefile.linux-opt | 265 + Engine/lib/lpng/scripts/makefile.mips | 103 + Engine/lib/lpng/scripts/makefile.msys | 202 + Engine/lib/lpng/scripts/makefile.netbsd | 55 + Engine/lib/lpng/scripts/makefile.openbsd | 86 + Engine/lib/lpng/scripts/makefile.sco | 226 + Engine/lib/lpng/scripts/makefile.sggcc | 236 + Engine/lib/lpng/scripts/makefile.sgi | 237 + Engine/lib/lpng/scripts/makefile.so9 | 247 + Engine/lib/lpng/scripts/makefile.solaris | 243 + Engine/lib/lpng/scripts/makefile.std | 134 + Engine/lib/lpng/scripts/makefile.sunos | 115 + Engine/lib/lpng/scripts/makefile.vcwin32 | 113 + Engine/lib/lpng/scripts/makevms.com | 142 + Engine/lib/lpng/scripts/options.awk | 898 + Engine/lib/lpng/scripts/pnglibconf.dfa | 920 + Engine/lib/lpng/scripts/pnglibconf.h.prebuilt | 219 + Engine/lib/lpng/scripts/pnglibconf.mak | 55 + Engine/lib/lpng/scripts/pngwin.rc | 112 + Engine/lib/lpng/scripts/prefix.c | 24 + Engine/lib/lpng/scripts/smakefile.ppc | 34 + Engine/lib/lpng/scripts/sym.c | 15 + Engine/lib/lpng/scripts/symbols.c | 58 + Engine/lib/lpng/scripts/symbols.def | 255 + Engine/lib/lpng/scripts/test.cmake.in | 31 + Engine/lib/lpng/scripts/vers.c | 19 + Engine/lib/lpng/test-driver | 148 + Engine/lib/lpng/tests/pngimage-full | 2 + Engine/lib/lpng/tests/pngimage-quick | 2 + Engine/lib/lpng/tests/pngstest | 54 + Engine/lib/lpng/tests/pngstest-1.8 | 2 + Engine/lib/lpng/tests/pngstest-1.8-alpha | 2 + Engine/lib/lpng/tests/pngstest-linear | 2 + Engine/lib/lpng/tests/pngstest-linear-alpha | 2 + Engine/lib/lpng/tests/pngstest-none | 2 + Engine/lib/lpng/tests/pngstest-none-alpha | 2 + Engine/lib/lpng/tests/pngstest-sRGB | 2 + Engine/lib/lpng/tests/pngstest-sRGB-alpha | 2 + Engine/lib/lpng/tests/pngtest | 2 + Engine/lib/lpng/tests/pngtest-badpngs | 13 + Engine/lib/lpng/tests/pngunknown-IDAT | 2 + Engine/lib/lpng/tests/pngunknown-discard | 2 + Engine/lib/lpng/tests/pngunknown-if-safe | 2 + Engine/lib/lpng/tests/pngunknown-sAPI | 2 + Engine/lib/lpng/tests/pngunknown-sTER | 2 + Engine/lib/lpng/tests/pngunknown-save | 2 + Engine/lib/lpng/tests/pngunknown-vpAg | 2 + Engine/lib/lpng/tests/pngvalid-gamma-16-to-8 | 2 + .../lib/lpng/tests/pngvalid-gamma-alpha-mode | 2 + .../lib/lpng/tests/pngvalid-gamma-background | 2 + .../tests/pngvalid-gamma-expand16-alpha-mode | 2 + .../tests/pngvalid-gamma-expand16-background | 2 + .../tests/pngvalid-gamma-expand16-transform | 2 + Engine/lib/lpng/tests/pngvalid-gamma-sbit | 2 + .../lib/lpng/tests/pngvalid-gamma-threshold | 2 + .../lib/lpng/tests/pngvalid-gamma-transform | 2 + .../pngvalid-progressive-interlace-standard | 2 + .../lib/lpng/tests/pngvalid-progressive-size | 2 + .../lpng/tests/pngvalid-progressive-standard | 2 + Engine/lib/lpng/tests/pngvalid-standard | 2 + Engine/lib/lpng/tests/pngvalid-transform | 2 + 475 files changed, 110673 insertions(+), 2682 deletions(-) create mode 100644 Engine/lib/lpng/AUTHORS create mode 100644 Engine/lib/lpng/Makefile.am create mode 100644 Engine/lib/lpng/Makefile.in create mode 100644 Engine/lib/lpng/TRADEMARK create mode 100644 Engine/lib/lpng/aclocal.m4 create mode 100644 Engine/lib/lpng/arm/arm_init.c create mode 100644 Engine/lib/lpng/arm/filter_neon.S create mode 100644 Engine/lib/lpng/arm/filter_neon_intrinsics.c create mode 100644 Engine/lib/lpng/arm/palette_neon_intrinsics.c create mode 100755 Engine/lib/lpng/autogen.sh create mode 100755 Engine/lib/lpng/compile create mode 100755 Engine/lib/lpng/config.guess create mode 100644 Engine/lib/lpng/config.h.in create mode 100755 Engine/lib/lpng/config.sub mode change 100644 => 100755 Engine/lib/lpng/configure create mode 100644 Engine/lib/lpng/configure.ac create mode 100644 Engine/lib/lpng/contrib/README.txt create mode 100644 Engine/lib/lpng/contrib/arm-neon/README create mode 100644 Engine/lib/lpng/contrib/arm-neon/android-ndk.c create mode 100644 Engine/lib/lpng/contrib/arm-neon/linux-auxv.c create mode 100644 Engine/lib/lpng/contrib/arm-neon/linux.c create mode 100644 Engine/lib/lpng/contrib/conftest/README create mode 100644 Engine/lib/lpng/contrib/conftest/pngcp.dfa create mode 100644 Engine/lib/lpng/contrib/conftest/read.dfa create mode 100644 Engine/lib/lpng/contrib/conftest/s_read.dfa create mode 100644 Engine/lib/lpng/contrib/conftest/s_write.dfa create mode 100644 Engine/lib/lpng/contrib/conftest/simple.dfa create mode 100644 Engine/lib/lpng/contrib/conftest/write.dfa create mode 100644 Engine/lib/lpng/contrib/examples/README.txt create mode 100644 Engine/lib/lpng/contrib/examples/iccfrompng.c create mode 100644 Engine/lib/lpng/contrib/examples/pngpixel.c create mode 100644 Engine/lib/lpng/contrib/examples/pngtopng.c create mode 100644 Engine/lib/lpng/contrib/examples/simpleover.c create mode 100644 Engine/lib/lpng/contrib/gregbook/COPYING create mode 100644 Engine/lib/lpng/contrib/gregbook/LICENSE create mode 100644 Engine/lib/lpng/contrib/gregbook/Makefile.mingw32 create mode 100644 Engine/lib/lpng/contrib/gregbook/Makefile.sgi create mode 100644 Engine/lib/lpng/contrib/gregbook/Makefile.unx create mode 100644 Engine/lib/lpng/contrib/gregbook/Makefile.w32 create mode 100644 Engine/lib/lpng/contrib/gregbook/README create mode 100644 Engine/lib/lpng/contrib/gregbook/makevms.com create mode 100644 Engine/lib/lpng/contrib/gregbook/readpng.c create mode 100644 Engine/lib/lpng/contrib/gregbook/readpng.h create mode 100644 Engine/lib/lpng/contrib/gregbook/readpng2.c create mode 100644 Engine/lib/lpng/contrib/gregbook/readpng2.h create mode 100644 Engine/lib/lpng/contrib/gregbook/readppm.c create mode 100644 Engine/lib/lpng/contrib/gregbook/rpng-win.c create mode 100644 Engine/lib/lpng/contrib/gregbook/rpng-x.c create mode 100644 Engine/lib/lpng/contrib/gregbook/rpng2-win.c create mode 100644 Engine/lib/lpng/contrib/gregbook/rpng2-x.c create mode 100644 Engine/lib/lpng/contrib/gregbook/toucan.png create mode 100644 Engine/lib/lpng/contrib/gregbook/wpng.c create mode 100644 Engine/lib/lpng/contrib/gregbook/writepng.c create mode 100644 Engine/lib/lpng/contrib/gregbook/writepng.h create mode 100644 Engine/lib/lpng/contrib/libtests/fakepng.c create mode 100755 Engine/lib/lpng/contrib/libtests/gentests.sh create mode 100644 Engine/lib/lpng/contrib/libtests/makepng.c create mode 100644 Engine/lib/lpng/contrib/libtests/pngimage.c create mode 100644 Engine/lib/lpng/contrib/libtests/pngstest-errors.h create mode 100644 Engine/lib/lpng/contrib/libtests/pngstest.c create mode 100644 Engine/lib/lpng/contrib/libtests/pngunknown.c create mode 100644 Engine/lib/lpng/contrib/libtests/pngvalid.c create mode 100644 Engine/lib/lpng/contrib/libtests/readpng.c create mode 100644 Engine/lib/lpng/contrib/libtests/tarith.c create mode 100644 Engine/lib/lpng/contrib/libtests/timepng.c create mode 100644 Engine/lib/lpng/contrib/mips-msa/README create mode 100644 Engine/lib/lpng/contrib/mips-msa/linux.c create mode 100644 Engine/lib/lpng/contrib/oss-fuzz/Dockerfile create mode 100644 Engine/lib/lpng/contrib/oss-fuzz/README.txt create mode 100755 Engine/lib/lpng/contrib/oss-fuzz/build.sh create mode 100644 Engine/lib/lpng/contrib/oss-fuzz/libpng_read_fuzzer.cc create mode 100644 Engine/lib/lpng/contrib/oss-fuzz/libpng_read_fuzzer.options create mode 100644 Engine/lib/lpng/contrib/oss-fuzz/png.dict create mode 100644 Engine/lib/lpng/contrib/pngminim/README create mode 100644 Engine/lib/lpng/contrib/pngminim/decoder/README create mode 100644 Engine/lib/lpng/contrib/pngminim/decoder/makefile create mode 100644 Engine/lib/lpng/contrib/pngminim/decoder/pngusr.dfa create mode 100644 Engine/lib/lpng/contrib/pngminim/decoder/pngusr.h create mode 100644 Engine/lib/lpng/contrib/pngminim/encoder/README create mode 100644 Engine/lib/lpng/contrib/pngminim/encoder/makefile create mode 100644 Engine/lib/lpng/contrib/pngminim/encoder/pngusr.dfa create mode 100644 Engine/lib/lpng/contrib/pngminim/encoder/pngusr.h create mode 100644 Engine/lib/lpng/contrib/pngminim/preader/README create mode 100644 Engine/lib/lpng/contrib/pngminim/preader/makefile create mode 100644 Engine/lib/lpng/contrib/pngminim/preader/pngusr.dfa create mode 100644 Engine/lib/lpng/contrib/pngminim/preader/pngusr.h create mode 100644 Engine/lib/lpng/contrib/pngminus/CHANGES.txt create mode 100644 Engine/lib/lpng/contrib/pngminus/CMakeLists.txt create mode 100644 Engine/lib/lpng/contrib/pngminus/LICENSE.txt create mode 100644 Engine/lib/lpng/contrib/pngminus/Makefile create mode 100644 Engine/lib/lpng/contrib/pngminus/README.txt create mode 100644 Engine/lib/lpng/contrib/pngminus/makevms.com create mode 100755 Engine/lib/lpng/contrib/pngminus/png2pnm.bat create mode 100644 Engine/lib/lpng/contrib/pngminus/png2pnm.c create mode 100755 Engine/lib/lpng/contrib/pngminus/png2pnm.sh create mode 100755 Engine/lib/lpng/contrib/pngminus/pngminus.bat create mode 100755 Engine/lib/lpng/contrib/pngminus/pngminus.sh create mode 100755 Engine/lib/lpng/contrib/pngminus/pnm2png.bat create mode 100644 Engine/lib/lpng/contrib/pngminus/pnm2png.c create mode 100755 Engine/lib/lpng/contrib/pngminus/pnm2png.sh create mode 100644 Engine/lib/lpng/contrib/pngsuite/README create mode 100644 Engine/lib/lpng/contrib/pngsuite/bad_interlace_conversions.txt create mode 100644 Engine/lib/lpng/contrib/pngsuite/basn0g01.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/basn0g02.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/basn0g04.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/basn0g08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/basn0g16.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/basn2c08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/basn2c16.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/basn3p01.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/basn3p02.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/basn3p04.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/basn3p08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/basn4a08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/basn4a16.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/basn6a08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/basn6a16.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ftbbn0g01.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ftbbn0g02.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ftbbn0g04.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ftbbn2c16.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ftbbn3p08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ftbgn2c16.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ftbgn3p08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ftbrn2c08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ftbwn0g16.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ftbwn3p08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ftbyn3p08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ftp0n0g08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ftp0n2c08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ftp0n3p08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ftp1n3p08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ibasn0g08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ibasn0g16.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ibasn2c08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ibasn2c16.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ibasn3p08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ibasn4a08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ibasn4a16.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ibasn6a08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/ibasn6a16.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/iftbbn2c16.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/iftbbn3p08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/iftbgn2c16.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/iftbgn3p08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/iftbrn2c08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/iftbwn0g16.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/iftbwn3p08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/iftbyn3p08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/iftp0n0g08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/iftp0n2c08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/iftp0n3p08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/iftp1n3p08.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/interlaced/README create mode 100644 Engine/lib/lpng/contrib/pngsuite/interlaced/ibasn0g01.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/interlaced/ibasn0g02.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/interlaced/ibasn0g04.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/interlaced/ibasn3p01.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/interlaced/ibasn3p02.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/interlaced/ibasn3p04.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/interlaced/iftbbn0g01.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/interlaced/iftbbn0g02.png create mode 100644 Engine/lib/lpng/contrib/pngsuite/interlaced/iftbbn0g04.png create mode 100644 Engine/lib/lpng/contrib/powerpc-vsx/README create mode 100644 Engine/lib/lpng/contrib/powerpc-vsx/linux.c create mode 100644 Engine/lib/lpng/contrib/powerpc-vsx/linux_aux.c create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/bad_iCCP.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/badadler.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/badcrc.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/empty_ancillary_chunks.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_IDAT.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_bKGD_chunk.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_cHRM_chunk.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_eXIf_chunk.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_gAMA_chunk.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_hIST_chunk.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_iCCP_chunk.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_iTXt_chunk.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_juNK_unsafe_to_copy.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_juNk_safe_to_copy.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_pCAL_chunk.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_pHYs_chunk.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_sCAL_chunk.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_sPLT_chunk.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_sRGB_chunk.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_sTER_chunk.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_tEXt_chunk.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_tIME_chunk.png create mode 100644 Engine/lib/lpng/contrib/testpngs/crashers/huge_zTXt_chunk.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-1-1.8-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-1-1.8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-1-linear-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-1-linear.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-1-sRGB-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-1-sRGB.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-1-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-1.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-16-1.8-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-16-1.8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-16-linear-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-16-linear.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-16-sRGB-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-16-sRGB.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-16-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-16.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-2-1.8-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-2-1.8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-2-linear-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-2-linear.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-2-sRGB-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-2-sRGB.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-2-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-2.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-4-1.8-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-4-1.8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-4-linear-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-4-linear.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-4-sRGB-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-4-sRGB.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-4-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-4.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-8-1.8-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-8-1.8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-8-linear-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-8-linear.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-8-sRGB-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-8-sRGB.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-8-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-alpha-16-1.8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-alpha-16-linear.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-alpha-16-sRGB.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-alpha-16.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-alpha-8-1.8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-alpha-8-linear.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-alpha-8-sRGB.png create mode 100644 Engine/lib/lpng/contrib/testpngs/gray-alpha-8.png create mode 100755 Engine/lib/lpng/contrib/testpngs/makepngs.sh create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-1-1.8-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-1-1.8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-1-linear-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-1-linear.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-1-sRGB-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-1-sRGB.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-1-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-1.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-2-1.8-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-2-1.8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-2-linear-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-2-linear.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-2-sRGB-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-2-sRGB.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-2-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-2.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-4-1.8-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-4-1.8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-4-linear-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-4-linear.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-4-sRGB-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-4-sRGB.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-4-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-4.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-8-1.8-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-8-1.8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-8-linear-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-8-linear.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-8-sRGB-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-8-sRGB.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-8-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/palette-8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-16-1.8-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-16-1.8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-16-linear-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-16-linear.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-16-sRGB-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-16-sRGB.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-16-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-16.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-8-1.8-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-8-1.8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-8-linear-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-8-linear.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-8-sRGB-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-8-sRGB.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-8-tRNS.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-alpha-16-1.8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-alpha-16-linear.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-alpha-16-sRGB.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-alpha-16.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-alpha-8-1.8.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-alpha-8-linear.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-alpha-8-sRGB.png create mode 100644 Engine/lib/lpng/contrib/testpngs/rgb-alpha-8.png create mode 100644 Engine/lib/lpng/contrib/tools/README.txt create mode 100644 Engine/lib/lpng/contrib/tools/checksum-icc.c create mode 100755 Engine/lib/lpng/contrib/tools/chkfmt create mode 100644 Engine/lib/lpng/contrib/tools/cvtcolor.c create mode 100644 Engine/lib/lpng/contrib/tools/genpng.c create mode 100755 Engine/lib/lpng/contrib/tools/intgamma.sh create mode 100644 Engine/lib/lpng/contrib/tools/makesRGB.c create mode 100644 Engine/lib/lpng/contrib/tools/png-fix-itxt.c create mode 100644 Engine/lib/lpng/contrib/tools/pngcp.c create mode 100644 Engine/lib/lpng/contrib/tools/pngfix.c create mode 100755 Engine/lib/lpng/contrib/tools/reindent create mode 100644 Engine/lib/lpng/contrib/tools/sRGB.h create mode 100644 Engine/lib/lpng/contrib/visupng/PngFile.c create mode 100644 Engine/lib/lpng/contrib/visupng/PngFile.h create mode 100644 Engine/lib/lpng/contrib/visupng/README.txt create mode 100644 Engine/lib/lpng/contrib/visupng/VisualPng.c create mode 100644 Engine/lib/lpng/contrib/visupng/VisualPng.dsp create mode 100644 Engine/lib/lpng/contrib/visupng/VisualPng.dsw create mode 100644 Engine/lib/lpng/contrib/visupng/VisualPng.ico create mode 100644 Engine/lib/lpng/contrib/visupng/VisualPng.png create mode 100644 Engine/lib/lpng/contrib/visupng/VisualPng.rc create mode 100644 Engine/lib/lpng/contrib/visupng/cexcept.h create mode 100644 Engine/lib/lpng/contrib/visupng/resource.h create mode 100755 Engine/lib/lpng/depcomp create mode 100755 Engine/lib/lpng/install-sh create mode 100755 Engine/lib/lpng/ltmain.sh create mode 100644 Engine/lib/lpng/mips/filter_msa_intrinsics.c create mode 100644 Engine/lib/lpng/mips/mips_init.c create mode 100755 Engine/lib/lpng/missing create mode 100644 Engine/lib/lpng/pngusr.dfa create mode 100644 Engine/lib/lpng/powerpc/filter_vsx_intrinsics.c create mode 100644 Engine/lib/lpng/powerpc/powerpc_init.c create mode 100644 Engine/lib/lpng/projects/owatcom/libpng.tgt create mode 100644 Engine/lib/lpng/projects/owatcom/libpng.wpj create mode 100644 Engine/lib/lpng/projects/owatcom/pngconfig.mak create mode 100644 Engine/lib/lpng/projects/owatcom/pngstest.tgt create mode 100644 Engine/lib/lpng/projects/owatcom/pngtest.tgt create mode 100644 Engine/lib/lpng/projects/owatcom/pngvalid.tgt create mode 100644 Engine/lib/lpng/projects/visualc71/PRJ0041.mak create mode 100644 Engine/lib/lpng/projects/visualc71/README.txt create mode 100644 Engine/lib/lpng/projects/visualc71/README_zlib.txt create mode 100644 Engine/lib/lpng/projects/vstudio/README.txt create mode 100644 Engine/lib/lpng/projects/vstudio/zlib.props create mode 100644 Engine/lib/lpng/scripts/README.txt create mode 100644 Engine/lib/lpng/scripts/SCOPTIONS.ppc create mode 100755 Engine/lib/lpng/scripts/checksym.awk create mode 100644 Engine/lib/lpng/scripts/descrip.mms create mode 100755 Engine/lib/lpng/scripts/dfn.awk create mode 100644 Engine/lib/lpng/scripts/genchk.cmake.in create mode 100644 Engine/lib/lpng/scripts/genout.cmake.in create mode 100644 Engine/lib/lpng/scripts/gensrc.cmake.in create mode 100644 Engine/lib/lpng/scripts/intprefix.c create mode 100644 Engine/lib/lpng/scripts/libpng-config-body.in create mode 100644 Engine/lib/lpng/scripts/libpng-config-head.in create mode 100644 Engine/lib/lpng/scripts/libpng.pc.in create mode 100644 Engine/lib/lpng/scripts/libtool.m4 create mode 100644 Engine/lib/lpng/scripts/ltoptions.m4 create mode 100644 Engine/lib/lpng/scripts/ltsugar.m4 create mode 100644 Engine/lib/lpng/scripts/ltversion.m4 create mode 100644 Engine/lib/lpng/scripts/lt~obsolete.m4 create mode 100644 Engine/lib/lpng/scripts/macro.lst create mode 100644 Engine/lib/lpng/scripts/makefile.32sunu create mode 100644 Engine/lib/lpng/scripts/makefile.64sunu create mode 100644 Engine/lib/lpng/scripts/makefile.acorn create mode 100644 Engine/lib/lpng/scripts/makefile.aix create mode 100644 Engine/lib/lpng/scripts/makefile.amiga create mode 100644 Engine/lib/lpng/scripts/makefile.atari create mode 100644 Engine/lib/lpng/scripts/makefile.bc32 create mode 100644 Engine/lib/lpng/scripts/makefile.beos create mode 100644 Engine/lib/lpng/scripts/makefile.cegcc create mode 100644 Engine/lib/lpng/scripts/makefile.clang create mode 100644 Engine/lib/lpng/scripts/makefile.clang-asan create mode 100644 Engine/lib/lpng/scripts/makefile.darwin create mode 100644 Engine/lib/lpng/scripts/makefile.dec create mode 100644 Engine/lib/lpng/scripts/makefile.dj2 create mode 100644 Engine/lib/lpng/scripts/makefile.freebsd create mode 100644 Engine/lib/lpng/scripts/makefile.gcc create mode 100644 Engine/lib/lpng/scripts/makefile.gcc-asan create mode 100644 Engine/lib/lpng/scripts/makefile.hp64 create mode 100644 Engine/lib/lpng/scripts/makefile.hpgcc create mode 100644 Engine/lib/lpng/scripts/makefile.hpux create mode 100644 Engine/lib/lpng/scripts/makefile.ibmc create mode 100644 Engine/lib/lpng/scripts/makefile.intel create mode 100644 Engine/lib/lpng/scripts/makefile.linux create mode 100644 Engine/lib/lpng/scripts/makefile.linux-opt create mode 100644 Engine/lib/lpng/scripts/makefile.mips create mode 100644 Engine/lib/lpng/scripts/makefile.msys create mode 100644 Engine/lib/lpng/scripts/makefile.netbsd create mode 100644 Engine/lib/lpng/scripts/makefile.openbsd create mode 100644 Engine/lib/lpng/scripts/makefile.sco create mode 100644 Engine/lib/lpng/scripts/makefile.sggcc create mode 100644 Engine/lib/lpng/scripts/makefile.sgi create mode 100644 Engine/lib/lpng/scripts/makefile.so9 create mode 100644 Engine/lib/lpng/scripts/makefile.solaris create mode 100644 Engine/lib/lpng/scripts/makefile.std create mode 100644 Engine/lib/lpng/scripts/makefile.sunos create mode 100644 Engine/lib/lpng/scripts/makefile.vcwin32 create mode 100644 Engine/lib/lpng/scripts/makevms.com create mode 100755 Engine/lib/lpng/scripts/options.awk create mode 100644 Engine/lib/lpng/scripts/pnglibconf.dfa create mode 100644 Engine/lib/lpng/scripts/pnglibconf.h.prebuilt create mode 100755 Engine/lib/lpng/scripts/pnglibconf.mak create mode 100644 Engine/lib/lpng/scripts/pngwin.rc create mode 100644 Engine/lib/lpng/scripts/prefix.c create mode 100644 Engine/lib/lpng/scripts/smakefile.ppc create mode 100644 Engine/lib/lpng/scripts/sym.c create mode 100644 Engine/lib/lpng/scripts/symbols.c create mode 100644 Engine/lib/lpng/scripts/symbols.def create mode 100644 Engine/lib/lpng/scripts/test.cmake.in create mode 100644 Engine/lib/lpng/scripts/vers.c create mode 100755 Engine/lib/lpng/test-driver create mode 100755 Engine/lib/lpng/tests/pngimage-full create mode 100755 Engine/lib/lpng/tests/pngimage-quick create mode 100755 Engine/lib/lpng/tests/pngstest create mode 100755 Engine/lib/lpng/tests/pngstest-1.8 create mode 100755 Engine/lib/lpng/tests/pngstest-1.8-alpha create mode 100755 Engine/lib/lpng/tests/pngstest-linear create mode 100755 Engine/lib/lpng/tests/pngstest-linear-alpha create mode 100755 Engine/lib/lpng/tests/pngstest-none create mode 100755 Engine/lib/lpng/tests/pngstest-none-alpha create mode 100755 Engine/lib/lpng/tests/pngstest-sRGB create mode 100755 Engine/lib/lpng/tests/pngstest-sRGB-alpha create mode 100755 Engine/lib/lpng/tests/pngtest create mode 100755 Engine/lib/lpng/tests/pngtest-badpngs create mode 100755 Engine/lib/lpng/tests/pngunknown-IDAT create mode 100755 Engine/lib/lpng/tests/pngunknown-discard create mode 100755 Engine/lib/lpng/tests/pngunknown-if-safe create mode 100755 Engine/lib/lpng/tests/pngunknown-sAPI create mode 100755 Engine/lib/lpng/tests/pngunknown-sTER create mode 100755 Engine/lib/lpng/tests/pngunknown-save create mode 100755 Engine/lib/lpng/tests/pngunknown-vpAg create mode 100755 Engine/lib/lpng/tests/pngvalid-gamma-16-to-8 create mode 100755 Engine/lib/lpng/tests/pngvalid-gamma-alpha-mode create mode 100755 Engine/lib/lpng/tests/pngvalid-gamma-background create mode 100755 Engine/lib/lpng/tests/pngvalid-gamma-expand16-alpha-mode create mode 100755 Engine/lib/lpng/tests/pngvalid-gamma-expand16-background create mode 100755 Engine/lib/lpng/tests/pngvalid-gamma-expand16-transform create mode 100755 Engine/lib/lpng/tests/pngvalid-gamma-sbit create mode 100755 Engine/lib/lpng/tests/pngvalid-gamma-threshold create mode 100755 Engine/lib/lpng/tests/pngvalid-gamma-transform create mode 100755 Engine/lib/lpng/tests/pngvalid-progressive-interlace-standard create mode 100755 Engine/lib/lpng/tests/pngvalid-progressive-size create mode 100755 Engine/lib/lpng/tests/pngvalid-progressive-standard create mode 100755 Engine/lib/lpng/tests/pngvalid-standard create mode 100755 Engine/lib/lpng/tests/pngvalid-transform diff --git a/Engine/lib/lpng/ANNOUNCE b/Engine/lib/lpng/ANNOUNCE index 0f66c0d1d..ecf9c7043 100644 --- a/Engine/lib/lpng/ANNOUNCE +++ b/Engine/lib/lpng/ANNOUNCE @@ -1,35 +1,47 @@ -Libpng 1.6.34 - September 29, 2017 +libpng 1.6.37 - April 14, 2019 +============================== -This is a public release of libpng, intended for use in production codes. +This is a public release of libpng, intended for use in production code. -Files available for download: -Source files with LF line endings (for Unix/Linux) and with a -"configure" script +Files available for download +---------------------------- - libpng-1.6.34.tar.xz (LZMA-compressed, recommended) - libpng-1.6.34.tar.gz +Source files with LF line endings (for Unix/Linux): -Source files with CRLF line endings (for Windows), without the -"configure" script + * libpng-1.6.37.tar.xz (LZMA-compressed, recommended) + * libpng-1.6.37.tar.gz - lpng1634.7z (LZMA-compressed, recommended) - lpng1634.zip +Source files with CRLF line endings (for Windows): + + * lp1637.7z (LZMA-compressed, recommended) + * lp1637.zip Other information: - libpng-1.6.34-README.txt - libpng-1.6.34-LICENSE.txt - libpng-1.6.34-*.asc (armored detached GPG signatures) + * README.md + * LICENSE.md + * AUTHORS.md + * TRADEMARK.md -Changes since the last public release (1.6.33): - Removed contrib/pngsuite/i*.png; some of these were incorrect and caused - test failures. -Send comments/corrections/commendations to png-mng-implement at lists.sf.net -(subscription required; visit +Changes since the previous public release (version 1.6.36) +---------------------------------------------------------- + + * Fixed a use-after-free vulnerability (CVE-2019-7317) in png_image_free. + * Fixed a memory leak in the ARM NEON implementation of png_do_expand_palette. + * Fixed a memory leak in pngtest.c. + * Fixed two vulnerabilities (CVE-2018-14048, CVE-2018-14550) in + contrib/pngminus; refactor. + * Changed the license of contrib/pngminus to MIT; refresh makefile and docs. + (Contributed by Willem van Schaik) + * Fixed a typo in the libpng license v2. + (Contributed by Miguel Ojeda) + * Added makefiles for AddressSanitizer-enabled builds. + * Cleaned up various makefiles. + + +Send comments/corrections/commendations to png-mng-implement at lists.sf.net. +Subscription is required; visit https://lists.sourceforge.net/lists/listinfo/png-mng-implement -to subscribe) -or to glennrp at users.sourceforge.net - -Glenn R-P +to subscribe. diff --git a/Engine/lib/lpng/AUTHORS b/Engine/lib/lpng/AUTHORS new file mode 100644 index 000000000..79a3d1036 --- /dev/null +++ b/Engine/lib/lpng/AUTHORS @@ -0,0 +1,45 @@ +PNG REFERENCE LIBRARY AUTHORS +============================= + +This is the list of PNG Reference Library ("libpng") Contributing +Authors, for copyright and licensing purposes. + + * Andreas Dilger + * Cosmin Truta + * Dave Martindale + * Eric S. Raymond + * Gilles Vollant + * Glenn Randers-Pehrson + * Greg Roelofs + * Guy Eric Schalnat + * James Yu + * John Bowler + * Kevin Bracey + * Magnus Holmgren + * Mandar Sahastrabuddhe + * Mans Rullgard + * Matt Sarett + * Mike Klein + * Paul Schmidt + * Sam Bushell + * Samuel Williams + * Simon-Pierre Cadieux + * Tim Wegner + * Tom Lane + * Tom Tanner + * Vadim Barkov + * Willem van Schaik + * Zhijie Liang + * Arm Holdings + - Richard Townsend + * Google Inc. + - Matt Sarett + - Mike Klein + +The build projects, the build scripts, the test scripts, and other +files in the "projects", "scripts" and "tests" directories, have other +copyright owners, but are released under the libpng license. + +Some files in the "contrib" directory, and some tools-generated files +that are distributed with libpng, have other copyright owners, and are +released under other open source licenses. diff --git a/Engine/lib/lpng/CHANGES b/Engine/lib/lpng/CHANGES index 4b8211891..f0b0a9342 100644 --- a/Engine/lib/lpng/CHANGES +++ b/Engine/lib/lpng/CHANGES @@ -1,4 +1,3 @@ -#if 0 CHANGES - changes for libpng version 0.1 [March 29, 1995] @@ -1454,7 +1453,7 @@ Version 1.2.6beta4 [July 28, 2004] sequential read support. Added some "#if PNG_WRITE_SUPPORTED" blocks. Added #ifdef to remove some redundancy in png_malloc_default(). - Use png_malloc instead of png_zalloc to allocate the pallete. + Use png_malloc instead of png_zalloc to allocate the palette. Version 1.0.16rc1 and 1.2.6rc1 [August 4, 2004] Fixed buffer overflow vulnerability (CVE-2004-0597) in png_handle_tRNS(). @@ -3259,7 +3258,7 @@ Version 1.5.2beta01 [February 13, 2011] Revised PNG_EXPORTA macro to not use an empty parameter, to accommodate the old VisualC++ preprocessor. Turned on interlace handling in png_read_png(). - Fixed gcc pendantic warnings. + Fixed gcc pedantic warnings. Handle longjmp in Cygwin. Fixed png_get_current_row_number() in the interlaced case. Cleaned up ALPHA flags and transformations. @@ -3359,7 +3358,7 @@ Version 1.5.3beta05 [May 6, 2011] Pass "" instead of '\0' to png_default_error() in png_err(). This mistake was introduced in libpng-1.2.20beta01. This fixes CVE-2011-2691. Added PNG_WRITE_OPTIMIZE_CMF_SUPPORTED macro to make the zlib "CMF" byte - optimization configureable. + optimization configurable. IDAT compression failed if preceded by a compressed text chunk (bug introduced in libpng-1.5.3beta01-02). This was because the attempt to reset the zlib stream in png_write_IDAT happened after the first IDAT @@ -3643,7 +3642,7 @@ Version 1.5.6beta05 [October 12, 2011] Fixed bug in png_write_chunk_header() debug print, introduced in 1.5.6beta01. Version 1.5.6beta06 [October 17, 2011] - Removed two redundant tests for unitialized row. + Removed two redundant tests for uninitialized row. Fixed a relatively harmless memory overwrite in compressed text writing with a 1 byte zlib buffer. Add ability to call png_read_update_info multiple times to pngvalid.c. @@ -3689,7 +3688,7 @@ Version 1.5.7beta01 [November 4, 2011] crash. The pngmem.c implementation of png_malloc() included a cast to png_size_t which would fail on large allocations on 16-bit systems. Fix for the preprocessor of the Intel C compiler. The preprocessor - splits adjacent @ signs with a space; this changes the concatentation + splits adjacent @ signs with a space; this changes the concatenation token from @-@-@ to PNG_JOIN; that should work with all compiler preprocessors. Paeth filter speed improvements from work by Siarhei Siamashka. This @@ -3735,7 +3734,7 @@ Version 1.5.7beta03 [November 17, 2011] gray (on palette) itself. Fixes for C++ compilation using g++ When libpng source is compiled using g++. The compiler imposes C++ rules on the C source; thus it - is desireable to make the source work with either C or C++ rules + is desirable to make the source work with either C or C++ rules without throwing away useful error information. This change adds png_voidcast to allow C semantic (void*) cases or the corresponding C++ static_cast operation, as appropriate. @@ -4061,7 +4060,7 @@ Version 1.6.0beta17 [March 10, 2012] possible to call png_inflate() incrementally. A warning is no longer issued if the language tag or translated keyword in the iTXt chunk has zero length. - If benign errors are disabled use maximum window on ancilliary inflate. + If benign errors are disabled use maximum window on ancillary inflate. This works round a bug introduced in 1.5.4 where compressed ancillary chunks could end up with a too-small windowBits value in the deflate header. @@ -4176,7 +4175,7 @@ Version 1.6.0beta27 [August 11, 2012] declared even though the functions are never actually defined. This change provides a dummy definition so that the declarations work, yet any implementation will fail to compile because of an incomplete type. - Re-eliminated the use of strcpy() in pngtest.c. An unncessary use of + Re-eliminated the use of strcpy() in pngtest.c. An unnecessary use of strcpy() was accidentally re-introduced in libpng16; this change replaces it with strncpy(). Eliminated use of png_sizeof(); use sizeof() instead. @@ -4309,7 +4308,7 @@ Version 1.6.0beta31 [November 1, 2012] resulting in VS2010 having to update the files. Removed non-working ICC profile support code that was mostly added to libpng-1.6.0beta29 and beta30. There was too much code for too little - gain; implementing full ICC color correction may be desireable but is left + gain; implementing full ICC color correction may be desirable but is left up to applications. Version 1.6.0beta32 [November 25, 2012] @@ -4592,7 +4591,7 @@ Version 1.6.3beta07 [June 8, 2013] the optimizations ('check' vs 'api') are exposed in the public header files except that the new setting PNG_ARM_NEON_OPT documents how libpng makes the decision about whether or not to use the optimizations. - Protect symbol prefixing against CC/CPPFLAGS/CFLAGS useage. + Protect symbol prefixing against CC/CPPFLAGS/CFLAGS usage. Previous iOS/Xcode fixes for the ARM NEON optimizations moved the test on __ARM_NEON__ from configure time to compile time. This breaks symbol prefixing because the definition of the special png_init_filter_functions @@ -5635,7 +5634,7 @@ Version 1.6.24beta02 [June 23, 2016] to All and adds a list of the warnings that need to be turned off. This is semi-documentary; the intent is to tell libpng users which warnings have been examined and judged non-fixable at present. The warning about - structure padding is fixable, but it would be a signficant change (moving + structure padding is fixable, but it would be a significant change (moving structure members around). Version 1.6.24beta03 [July 4, 2016] @@ -5781,7 +5780,7 @@ Version 1.6.28rc01 [January 3, 2017] Added option to Cmake build allowing a custom location of zlib to be specified in a scenario where libpng is being built as a subproject alongside zlib by another project (Sam Serrels). - Changed png_ptr->options from a png_byte to png_uint_32, to accomodate + Changed png_ptr->options from a png_byte to png_uint_32, to accommodate up to 16 options. Version 1.6.28rc02 [January 4, 2017] @@ -5932,7 +5931,7 @@ Version 1.6.32beta04 [August 2, 2017] Update libpng.3 and libpng-manual.txt about eXIf functions. Version 1.6.32beta05 [August 2, 2017] - Restored png_get_eXIf() and png_set_eXIf() to maintain API compatability. + Restored png_get_eXIf() and png_set_eXIf() to maintain API compatibility. Version 1.6.32beta06 [August 2, 2017] Removed png_get_eXIf_1() and png_set_eXIf_1(). @@ -6038,14 +6037,73 @@ Version 1.6.33 [September 28, 2017] Add end_info structure and png_read_end() to the libpng fuzzer. Version 1.6.34 [September 29, 2017] - Removed contrib/pngsuite/i*.png; some of these were incorrect and caused - test failures. + Removed contrib/pngsuite/i*.png; some of them caused test failures. -Send comments/corrections/commendations to png-mng-implement at lists.sf.net -(subscription required; visit +Version 1.6.35beta01 [March 6, 2018] + Restored 21 of the contrib/pngsuite/i*.png, which do not cause test + failures. Placed the remainder in contrib/pngsuite/interlaced/i*.png. + Added calls to png_set_*() transforms commonly used by browsers to + the fuzzer. + Removed some unnecessary brackets in pngrtran.c + Fixed miscellaneous typos (Patch by github user "luzpaz"). + Change "ASM C" to "C ASM" in CMakeLists.txt + Fixed incorrect handling of bKGD chunk in sub-8-bit files (Cosmin) + Added hardware optimization directories to zip and 7z distributions. + Fixed incorrect bitmask for options. + Fixed many spelling typos. + +Version 1.6.35beta02 [March 28, 2018] + Make png_get_iCCP consistent with man page (allow compression-type argument + to be NULL, bug report by Lenard Szolnoki). + +Version 1.6.35 [July 15, 2018] + Replaced the remaining uses of png_size_t with size_t (Cosmin) + Fixed the calculation of row_factor in png_check_chunk_length + (reported by Thuan Pham in SourceForge issue #278) + Added missing parentheses to a macro definition + (suggested by "irwir" in GitHub issue #216) + +Version 1.6.36 [December 1, 2018] + Optimized png_do_expand_palette for ARM processors. + Improved performance by around 10-22% on a recent ARM Chromebook. + (Contributed by Richard Townsend, ARM Holdings) + Fixed manipulation of machine-specific optimization options. + (Contributed by Vicki Pfau) + Used memcpy instead of manual pointer arithmetic on Intel SSE2. + (Contributed by Samuel Williams) + Fixed build errors with MSVC on ARM64. + (Contributed by Zhijie Liang) + Fixed detection of libm in CMakeLists. + (Contributed by Cameron Cawley) + Fixed incorrect creation of pkg-config file in CMakeLists. + (Contributed by Kyle Bentley) + Fixed the CMake build on Windows MSYS by avoiding symlinks. + Fixed a build warning on OpenBSD. + (Contributed by Theo Buehler) + Fixed various typos in comments. + (Contributed by "luz.paz") + Raised the minimum required CMake version from 3.0.2 to 3.1. + Removed yet more of the vestigial support for pre-ANSI C compilers. + Removed ancient makefiles for ancient systems that have been broken + across all previous libpng-1.6.x versions. + Removed the Y2K compliance statement and the export control + information. + Applied various code style and documentation fixes. + +Version 1.6.37 [April 14, 2019] + Fixed a use-after-free vulnerability (CVE-2019-7317) in png_image_free. + Fixed a memory leak in the ARM NEON implementation of png_do_expand_palette. + Fixed a memory leak in pngtest.c. + Fixed two vulnerabilities (CVE-2018-14048, CVE-2018-14550) in + contrib/pngminus; refactor. + Changed the license of contrib/pngminus to MIT; refresh makefile and docs. + (Contributed by Willem van Schaik) + Fixed a typo in the libpng license v2. + (Contributed by Miguel Ojeda) + Added makefiles for AddressSanitizer-enabled builds. + Cleaned up various makefiles. + +Send comments/corrections/commendations to png-mng-implement at lists.sf.net. +Subscription is required; visit https://lists.sourceforge.net/lists/listinfo/png-mng-implement -to subscribe) -or to glennrp at users.sourceforge.net - -Glenn R-P -#endif +to subscribe. diff --git a/Engine/lib/lpng/CMakeLists.txt b/Engine/lib/lpng/CMakeLists.txt index 48c6fa287..6451fcf1b 100644 --- a/Engine/lib/lpng/CMakeLists.txt +++ b/Engine/lib/lpng/CMakeLists.txt @@ -1,42 +1,32 @@ # CMakeLists.txt -# Copyright (C) 2007,2009-2017 Glenn Randers-Pehrson +# Copyright (C) 2018 Cosmin Truta +# Copyright (C) 2007,2009-2018 Glenn Randers-Pehrson # Written by Christian Ehrlicher, 2007 # Revised by Roger Lowman, 2009-2010 -# Revised by Clifford Yapp, 2011-2012 +# Revised by Clifford Yapp, 2011-2012,2017 # Revised by Roger Leigh, 2016 # Revised by Andreas Franek, 2016 +# Revised by Sam Serrels, 2017 +# Revised by Vadim Barkov, 2017 +# Revised by Vicky Pfau, 2018 +# Revised by Cameron Cawley, 2018 +# Revised by Cosmin Truta, 2018 +# Revised by Kyle Bentley, 2018 # This code is released under the libpng license. # For conditions of distribution and use, see the disclaimer # and license in png.h -cmake_minimum_required(VERSION 3.0.2) -cmake_policy(VERSION 3.0.2) +cmake_minimum_required(VERSION 3.1) +cmake_policy(VERSION 3.1) -# Set MacOSX @rpath usage globally. -if (POLICY CMP0020) - cmake_policy(SET CMP0020 NEW) -endif(POLICY CMP0020) -if (POLICY CMP0042) - cmake_policy(SET CMP0042 NEW) -endif(POLICY CMP0042) -# Use new variable expansion policy. -if (POLICY CMP0053) - cmake_policy(SET CMP0053 NEW) -endif(POLICY CMP0053) -if (POLICY CMP0054) - cmake_policy(SET CMP0054 NEW) -endif(POLICY CMP0054) - -set(CMAKE_CONFIGURATION_TYPES "Release;Debug;MinSizeRel;RelWithDebInfo") - -project(libpng ASM C) +project(libpng C ASM) enable_testing() set(PNGLIB_MAJOR 1) set(PNGLIB_MINOR 6) -set(PNGLIB_RELEASE 34) +set(PNGLIB_RELEASE 37) set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR}) set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) @@ -44,25 +34,19 @@ include(GNUInstallDirs) # needed packages -#Allow users to specify location of Zlib, -# Useful if zlib is being built alongside this as a sub-project +# Allow users to specify location of Zlib. +# Useful if zlib is being built alongside this as a sub-project. option(PNG_BUILD_ZLIB "Custom zlib Location, else find_package is used" OFF) -IF(NOT PNG_BUILD_ZLIB) +if(NOT PNG_BUILD_ZLIB) find_package(ZLIB REQUIRED) include_directories(${ZLIB_INCLUDE_DIR}) -ENDIF(NOT PNG_BUILD_ZLIB) +endif() -if(NOT WIN32) - find_library(M_LIBRARY - NAMES m - PATHS /usr/lib /usr/local/lib - ) - if(NOT M_LIBRARY) - message(STATUS "math lib 'libm' not found; floating point support disabled") - endif() +if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU) + find_library(M_LIBRARY m) else() - # not needed on windows + # libm is not needed and/or not available set(M_LIBRARY "") endif() @@ -73,16 +57,14 @@ option(PNG_TESTS "Build libpng tests" ON) # Many more configuration options could be added here option(PNG_FRAMEWORK "Build OS X framework" OFF) -option(PNG_DEBUG "Build with debug output" OFF) -option(PNGARG "Disable ANSI-C prototypes" OFF) - -option(PNG_HARDWARE_OPTIMIZATIONS "Enable Hardware Optimizations" ON) - +option(PNG_DEBUG "Build with debug output" OFF) +option(PNG_HARDWARE_OPTIMIZATIONS "Enable hardware optimizations" ON) set(PNG_PREFIX "" CACHE STRING "Prefix to add to the API function names") set(DFA_XTRA "" CACHE FILEPATH "File containing extra configuration settings") if(PNG_HARDWARE_OPTIMIZATIONS) + # set definitions and sources for arm if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64") @@ -96,12 +78,13 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR list(FIND PNG_ARM_NEON_POSSIBLE_VALUES ${PNG_ARM_NEON} index) if(index EQUAL -1) message(FATAL_ERROR - " PNG_ARM_NEON must be one of [${PNG_ARM_NEON_POSSIBLE_VALUES}]") - elseif(NOT ${PNG_ARM_NEON} STREQUAL "no") + "PNG_ARM_NEON must be one of [${PNG_ARM_NEON_POSSIBLE_VALUES}]") + elseif(NOT ${PNG_ARM_NEON} STREQUAL "off") set(libpng_arm_sources arm/arm_init.c arm/filter_neon.S - arm/filter_neon_intrinsics.c) + arm/filter_neon_intrinsics.c + arm/palette_neon_intrinsics.c) if(${PNG_ARM_NEON} STREQUAL "on") add_definitions(-DPNG_ARM_NEON_OPT=2) @@ -115,7 +98,7 @@ endif() # set definitions and sources for powerpc if(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc*" OR - CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64*" ) + CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64*") set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off) set(PNG_POWERPC_VSX "on" CACHE STRING "Enable POWERPC VSX optimizations: off: disable the optimizations.") @@ -124,8 +107,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc*" OR list(FIND PNG_POWERPC_VSX_POSSIBLE_VALUES ${PNG_POWERPC_VSX} index) if(index EQUAL -1) message(FATAL_ERROR - " PNG_POWERPC_VSX must be one of [${PNG_POWERPC_VSX_POSSIBLE_VALUES}]") - elseif(NOT ${PNG_POWERPC_VSX} STREQUAL "no") + "PNG_POWERPC_VSX must be one of [${PNG_POWERPC_VSX_POSSIBLE_VALUES}]") + elseif(NOT ${PNG_POWERPC_VSX} STREQUAL "off") set(libpng_powerpc_sources powerpc/powerpc_init.c powerpc/filter_vsx_intrinsics.c) @@ -139,7 +122,7 @@ endif() # set definitions and sources for intel if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?86" OR - CMAKE_SYSTEM_PROCESSOR MATCHES "^x86_64*" ) + CMAKE_SYSTEM_PROCESSOR MATCHES "^x86_64*") set(PNG_INTEL_SSE_POSSIBLE_VALUES on off) set(PNG_INTEL_SSE "on" CACHE STRING "Enable INTEL_SSE optimizations: off: disable the optimizations") @@ -148,8 +131,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?86" OR list(FIND PNG_INTEL_SSE_POSSIBLE_VALUES ${PNG_INTEL_SSE} index) if(index EQUAL -1) message(FATAL_ERROR - " PNG_INTEL_SSE must be one of [${PNG_INTEL_SSE_POSSIBLE_VALUES}]") - elseif(NOT ${PNG_INTEL_SSE} STREQUAL "no") + "PNG_INTEL_SSE must be one of [${PNG_INTEL_SSE_POSSIBLE_VALUES}]") + elseif(NOT ${PNG_INTEL_SSE} STREQUAL "off") set(libpng_intel_sources intel/intel_init.c intel/filter_sse2_intrinsics.c) @@ -163,7 +146,7 @@ endif() # set definitions and sources for MIPS if(CMAKE_SYSTEM_PROCESSOR MATCHES "mipsel*" OR - CMAKE_SYSTEM_PROCESSOR MATCHES "mips64el*" ) + CMAKE_SYSTEM_PROCESSOR MATCHES "mips64el*") set(PNG_MIPS_MSA_POSSIBLE_VALUES on off) set(PNG_MIPS_MSA "on" CACHE STRING "Enable MIPS_MSA optimizations: off: disable the optimizations") @@ -172,8 +155,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "mipsel*" OR list(FIND PNG_MIPS_MSA_POSSIBLE_VALUES ${PNG_MIPS_MSA} index) if(index EQUAL -1) message(FATAL_ERROR - " PNG_MIPS_MSA must be one of [${PNG_MIPS_MSA_POSSIBLE_VALUES}]") - elseif(NOT ${PNG_MIPS_MSA} STREQUAL "no") + "PNG_MIPS_MSA must be one of [${PNG_MIPS_MSA_POSSIBLE_VALUES}]") + elseif(NOT ${PNG_MIPS_MSA} STREQUAL "off") set(libpng_mips_sources mips/mips_init.c mips/filter_msa_intrinsics.c) @@ -184,6 +167,33 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "mipsel*" OR add_definitions(-DPNG_MIPS_MSA_OPT=0) endif() endif() + +else(PNG_HARDWARE_OPTIMIZATIONS) + +# set definitions and sources for arm +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR + CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64") + add_definitions(-DPNG_ARM_NEON_OPT=0) +endif() + +# set definitions and sources for powerpc +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc*" OR + CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64*") + add_definitions(-DPNG_POWERPC_VSX_OPT=0) +endif() + +# set definitions and sources for intel +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?86" OR + CMAKE_SYSTEM_PROCESSOR MATCHES "^x86_64*") + add_definitions(-DPNG_INTEL_SSE_OPT=0) +endif() + +# set definitions and sources for MIPS +if(CMAKE_SYSTEM_PROCESSOR MATCHES "mipsel*" OR + CMAKE_SYSTEM_PROCESSOR MATCHES "mips64el*") + add_definitions(-DPNG_MIPS_MSA_OPT=0) +endif() + endif(PNG_HARDWARE_OPTIMIZATIONS) # SET LIBNAME @@ -241,17 +251,17 @@ function(symbol_prefix) foreach(line ${OUT}) string(REGEX MATCH "^PREFIX=" found_match "${line}") if(found_match) - STRING(REGEX REPLACE "^PREFIX=(.*\)" "\\1" prefix "${line}") + string(REGEX REPLACE "^PREFIX=(.*\)" "\\1" prefix "${line}") string(REGEX MATCH "__USER_LABEL_PREFIX__" found_match "${prefix}") if(found_match) - STRING(REGEX REPLACE "(.*)__USER_LABEL_PREFIX__(.*)" "\\1\\2" prefix "${prefix}") + string(REGEX REPLACE "(.*)__USER_LABEL_PREFIX__(.*)" "\\1\\2" prefix "${prefix}") endif() set(SYMBOL_PREFIX "${prefix}") endif() endforeach() - message(STATUS "Symbol prefix: ${SYMBOL_PREFIX}") - set(SYMBOL_PREFIX "${SYMBOL_PREFIX}" PARENT_SCOPE) + message(STATUS "Symbol prefix: ${SYMBOL_PREFIX}") + set(SYMBOL_PREFIX "${SYMBOL_PREFIX}" PARENT_SCOPE) endfunction() if(UNIX) @@ -276,11 +286,11 @@ else() set(oneValueArgs INPUT OUTPUT) set(multiValueArgs DEPENDS) cmake_parse_arguments(_GC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - if (NOT _GC_INPUT) - message(FATAL_ERROR "Invalid arguments. generate_out requires input.") + if(NOT _GC_INPUT) + message(FATAL_ERROR "generate_chk: Missing INPUT argument") endif() - if (NOT _GC_OUTPUT) - message(FATAL_ERROR "Invalid arguments. generate_out requires output.") + if(NOT _GC_OUTPUT) + message(FATAL_ERROR "generate_chk: Missing OUTPUT argument") endif() add_custom_command(OUTPUT "${_GC_OUTPUT}" @@ -299,11 +309,11 @@ else() set(oneValueArgs INPUT OUTPUT) set(multiValueArgs DEPENDS) cmake_parse_arguments(_GO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - if (NOT _GO_INPUT) - message(FATAL_ERROR "Invalid arguments. generate_out requires input.") + if(NOT _GO_INPUT) + message(FATAL_ERROR "generate_out: Missing INPUT argument") endif() - if (NOT _GO_OUTPUT) - message(FATAL_ERROR "Invalid arguments. generate_out requires output.") + if(NOT _GO_OUTPUT) + message(FATAL_ERROR "generate_out: Missing OUTPUT argument") endif() add_custom_command(OUTPUT "${_GO_OUTPUT}" @@ -322,8 +332,8 @@ else() set(oneValueArgs OUTPUT) set(multiValueArgs DEPENDS) cmake_parse_arguments(_GSO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - if (NOT _GSO_OUTPUT) - message(FATAL_ERROR "Invalid arguments. generate_source requires output.") + if(NOT _GSO_OUTPUT) + message(FATAL_ERROR "generate_source: Missing OUTPUT argument") endif() add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_GSO_OUTPUT}" @@ -424,7 +434,7 @@ else() WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") # A single target handles generation of all generated files. If - # they are dependend upon separately by multiple targets, this + # they are depended upon separately by multiple targets, this # confuses parallel make (it would require a separate top-level # target for each file to track the dependencies properly). add_custom_target(genfiles DEPENDS @@ -505,7 +515,7 @@ set(png_fix_itxt_sources if(MSVC) add_definitions(-D_CRT_SECURE_NO_DEPRECATE) -endif(MSVC) +endif() if(PNG_DEBUG) add_definitions(-DPNG_DEBUG) @@ -585,7 +595,7 @@ if(NOT PNG_LIB_TARGETS) message(SEND_ERROR "No library variant selected to build. " "Please enable at least one of the following options: " - " PNG_STATIC, PNG_SHARED, PNG_FRAMEWORK") + "PNG_STATIC, PNG_SHARED, PNG_FRAMEWORK") endif() if(PNG_SHARED AND WIN32) @@ -598,11 +608,11 @@ function(png_add_test) set(multiValueArgs OPTIONS FILES) cmake_parse_arguments(_PAT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - if (NOT _PAT_NAME) - message(FATAL_ERROR "Invalid arguments. png_add_test requires name.") + if(NOT _PAT_NAME) + message(FATAL_ERROR "png_add_test: Missing NAME argument") endif() - if (NOT _PAT_COMMAND) - message(FATAL_ERROR "Invalid arguments. png_add_test requires command.") + if(NOT _PAT_COMMAND) + message(FATAL_ERROR "png_add_test: Missing COMMAND argument") endif() set(TEST_OPTIONS "${_PAT_OPTIONS}") @@ -610,19 +620,11 @@ function(png_add_test) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/test.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/tests/${_PAT_NAME}.cmake" @ONLY) - if(CMAKE_MAJOR_VERSION GREATER 2) # have generator expressions - add_test(NAME "${_PAT_NAME}" - COMMAND "${CMAKE_COMMAND}" - "-DLIBPNG=$" - "-DTEST_COMMAND=$" - -P "${CMAKE_CURRENT_BINARY_DIR}/tests/${_PAT_NAME}.cmake") - else() # old 2.x add_test; limited and won't work well on Windows - # Note LIBPNG is a dummy value as there are no generator expressions - add_test("${_PAT_NAME}" "${CMAKE_COMMAND}" - "-DLIBPNG=${CMAKE_CURRENT_BINARY_DIR}/libpng.so" - "-DTEST_COMMAND=./${_PAT_COMMAND}" - -P "${CMAKE_CURRENT_BINARY_DIR}/tests/${_PAT_NAME}.cmake") - endif() + add_test(NAME "${_PAT_NAME}" + COMMAND "${CMAKE_COMMAND}" + "-DLIBPNG=$" + "-DTEST_COMMAND=$" + -P "${CMAKE_CURRENT_BINARY_DIR}/tests/${_PAT_NAME}.cmake") endfunction() if(PNG_TESTS AND PNG_SHARED) @@ -687,11 +689,11 @@ if(PNG_TESTS AND PNG_SHARED) set(TEST_PNG_VALID TRUE) if(TEST_PNG_ALPHA) - if (NOT "${alpha_type}" STREQUAL "alpha") + if(NOT "${alpha_type}" STREQUAL "alpha") set(TEST_PNG_VALID FALSE) endif() else() - if ("${alpha_type}" STREQUAL "alpha") + if("${alpha_type}" STREQUAL "alpha") set(TEST_PNG_VALID FALSE) endif() endif() @@ -760,51 +762,44 @@ endif() # copies if different. include(CMakeParseArguments) -function(CREATE_SYMLINK DEST_FILE) +function(create_symlink DEST_FILE) cmake_parse_arguments(S "" "FILE;TARGET" "" ${ARGN}) if(NOT S_TARGET AND NOT S_FILE) - message(FATAL_ERROR "Specify either a TARGET or a FILE for CREATE_SYMLINK to link to.") - endif(NOT S_TARGET AND NOT S_FILE) + message(FATAL_ERROR "create_symlink: Missing TARGET or FILE argument") + endif() if(S_TARGET AND S_FILE) - message(FATAL_ERROR "CREATE_SYMLINK called with both source file ${S_FILE} and build target ${S_TARGET} arguments - can only handle 1 type per call.") - endif(S_TARGET AND S_FILE) + message(FATAL_ERROR "create_symlink: Both source file ${S_FILE} and build target ${S_TARGET} arguments are present; can only have one.") + endif() if(S_FILE) # If we don't need to symlink something that's coming from a build target, # we can go ahead and symlink/copy at configure time. - - if(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS) + if(CMAKE_HOST_WIN32 AND NOT CYGWIN) execute_process( - COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${S_FILE} ${DEST_FILE} - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" - ) - else(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS) + COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${S_FILE} ${DEST_FILE} + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + else() execute_process( - COMMAND ${CMAKE_COMMAND} -E create_symlink ${S_FILE} ${DEST_FILE} - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" - ) - endif(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS) - endif(S_FILE) + COMMAND ${CMAKE_COMMAND} -E create_symlink ${S_FILE} ${DEST_FILE} + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + endif() + endif() if(S_TARGET) # We need to use generator expressions, which can be a bit tricky, so for # simplicity make the symlink a POST_BUILD step and use the TARGET # signature of add_custom_command. - - if(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS) + if(CMAKE_HOST_WIN32 AND NOT CYGWIN) add_custom_command(TARGET ${S_TARGET} POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E copy_if_different $ $/${DEST_FILE} - ) - else(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS) + COMMAND "${CMAKE_COMMAND}" -E copy_if_different $ $/${DEST_FILE}) + else() add_custom_command(TARGET ${S_TARGET} POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E create_symlink $ $/${DEST_FILE} - ) - endif(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS) - - endif(S_TARGET) + COMMAND "${CMAKE_COMMAND}" -E create_symlink $ $/${DEST_FILE}) + endif() + endif() endfunction() @@ -816,103 +811,95 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/genout.cmake.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/gensrc.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/scripts/gensrc.cmake @ONLY) - # libpng is a library so default to 'lib' if(NOT DEFINED CMAKE_INSTALL_LIBDIR) set(CMAKE_INSTALL_LIBDIR lib) -endif(NOT DEFINED CMAKE_INSTALL_LIBDIR) +endif() # CREATE PKGCONFIG FILES -# we use the same files like ./configure, so we have to set its vars +# We use the same files like ./configure, so we have to set its vars. # Only do this on Windows for Cygwin - the files don't make much sense outside -# a UNIX look alike +# of a UNIX look-alike. if(NOT WIN32 OR CYGWIN OR MINGW) set(prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix ${CMAKE_INSTALL_PREFIX}) - set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) - set(includedir ${CMAKE_INSTALL_PREFIX}/include) + set(libdir ${CMAKE_INSTALL_FULL_LIBDIR}) + set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}) set(LIBS "-lz -lm") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY) - CREATE_SYMLINK(libpng.pc FILE ${PNGLIB_NAME}.pc) + create_symlink(libpng.pc FILE ${PNGLIB_NAME}.pc) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY) - CREATE_SYMLINK(libpng-config FILE ${PNGLIB_NAME}-config) -endif(NOT WIN32 OR CYGWIN OR MINGW) + create_symlink(libpng-config FILE ${PNGLIB_NAME}-config) +endif() # SET UP LINKS if(PNG_SHARED) set_target_properties(png PROPERTIES -# VERSION 16.${PNGLIB_RELEASE}.1.6.34 +# VERSION 16.${PNGLIB_RELEASE}.1.6.37 VERSION 16.${PNGLIB_RELEASE}.0 SOVERSION 16 CLEAN_DIRECT_OUTPUT 1) endif() -# If CMake > 2.4.x, we set a variable used below to export -# targets to an export file. -# TODO: Use VERSION_GREATER after our cmake_minimum_required >= 2.6.2 -if(CMAKE_MAJOR_VERSION GREATER 1 AND CMAKE_MINOR_VERSION GREATER 4) - set(PNG_EXPORT_RULE EXPORT libpng) -elseif(CMAKE_MAJOR_VERSION GREATER 2) # future proof - set(PNG_EXPORT_RULE EXPORT libpng) -endif() - # INSTALL -if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) +if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) install(TARGETS ${PNG_LIB_TARGETS} - ${PNG_EXPORT_RULE} - RUNTIME DESTINATION bin - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}) + EXPORT libpng + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}) if(PNG_SHARED) # Create a symlink for libpng.dll.a => libpng16.dll.a on Cygwin if(CYGWIN OR MINGW) - CREATE_SYMLINK(libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} TARGET png) - install(FILES $/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(CYGWIN OR MINGW) + create_symlink(libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} TARGET png) + install(FILES $/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} + DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() if(NOT WIN32) - CREATE_SYMLINK(libpng${CMAKE_SHARED_LIBRARY_SUFFIX} TARGET png) - install(FILES $/libpng${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(NOT WIN32) - endif(PNG_SHARED) + create_symlink(libpng${CMAKE_SHARED_LIBRARY_SUFFIX} TARGET png) + install(FILES $/libpng${CMAKE_SHARED_LIBRARY_SUFFIX} + DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + endif() if(PNG_STATIC) if(NOT WIN32 OR CYGWIN OR MINGW) - CREATE_SYMLINK( libpng${CMAKE_STATIC_LIBRARY_SUFFIX} TARGET png_static) - install(FILES $/libpng${CMAKE_STATIC_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(NOT WIN32 OR CYGWIN OR MINGW) - endif() + create_symlink(libpng${CMAKE_STATIC_LIBRARY_SUFFIX} TARGET png_static) + install(FILES $/libpng${CMAKE_STATIC_LIBRARY_SUFFIX} + DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + endif() endif() -if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) - install(FILES ${libpng_public_hdrs} DESTINATION include) - install(FILES ${libpng_public_hdrs} DESTINATION include/${PNGLIB_NAME}) +if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL) + install(FILES ${libpng_public_hdrs} DESTINATION include) + install(FILES ${libpng_public_hdrs} DESTINATION include/${PNGLIB_NAME}) endif() -if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL ) +if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL) if(NOT WIN32 OR CYGWIN OR MINGW) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config DESTINATION bin) - install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config - DESTINATION bin) - endif(NOT WIN32 OR CYGWIN OR MINGW) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config DESTINATION bin) + endif() endif() -if(NOT SKIP_INSTALL_PROGRAMS AND NOT SKIP_INSTALL_ALL ) +if(NOT SKIP_INSTALL_PROGRAMS AND NOT SKIP_INSTALL_ALL) install(TARGETS ${PNG_BIN_TARGETS} - RUNTIME DESTINATION bin) + RUNTIME DESTINATION bin) endif() -if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) +if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL) # Install man pages if(NOT PNG_MAN_DIR) set(PNG_MAN_DIR "share/man") endif() - install(FILES libpng.3 libpngpf.3 DESTINATION ${PNG_MAN_DIR}/man3) - install(FILES png.5 DESTINATION ${PNG_MAN_DIR}/man5) + install(FILES libpng.3 libpngpf.3 DESTINATION ${PNG_MAN_DIR}/man3) + install(FILES png.5 DESTINATION ${PNG_MAN_DIR}/man5) # Install pkg-config files if(NOT CMAKE_HOST_WIN32 OR CYGWIN OR MINGW) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc @@ -923,12 +910,11 @@ if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config DESTINATION bin) - endif(NOT CMAKE_HOST_WIN32 OR CYGWIN OR MINGW) + endif() endif() -# On versions of CMake that support it, create an export file CMake -# users can include() to import our targets -if(PNG_EXPORT_RULE AND NOT SKIP_INSTALL_EXPORT AND NOT SKIP_INSTALL_ALL ) +# Create an export file that CMake users can include() to import our targets. +if(NOT SKIP_INSTALL_EXPORT AND NOT SKIP_INSTALL_ALL) install(EXPORT libpng DESTINATION lib/libpng FILE lib${PNG_LIB_NAME}.cmake) endif() diff --git a/Engine/lib/lpng/INSTALL b/Engine/lib/lpng/INSTALL index e8edb7240..4c1702251 100644 --- a/Engine/lib/lpng/INSTALL +++ b/Engine/lib/lpng/INSTALL @@ -284,7 +284,7 @@ those sections that are actually used will be loaded into memory. XIV. Enabling or disabling hardware optimizations -Certain hardware capabilites, such as the Intel SSE instructions, +Certain hardware capabilities, such as the Intel SSE instructions, are normally detected at run time. Enable them with configure options such as one of diff --git a/Engine/lib/lpng/LICENSE b/Engine/lib/lpng/LICENSE index 4cda4fa0a..e0c5b531c 100644 --- a/Engine/lib/lpng/LICENSE +++ b/Engine/lib/lpng/LICENSE @@ -1,53 +1,82 @@ +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE +========================================= -This copy of the libpng notices is provided for your convenience. In case of -any discrepancy between this copy and the notices in the file png.h that is -included in the libpng distribution, the latter shall prevail. +PNG Reference Library License version 2 +--------------------------------------- -COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + * Copyright (c) 1995-2019 The PNG Reference Library Authors. + * Copyright (c) 2018-2019 Cosmin Truta. + * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. + * Copyright (c) 1996-1997 Andreas Dilger. + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. -If you modify libpng you may insert additional notices immediately following -this sentence. +The software is supplied "as is", without warranty of any kind, +express or implied, including, without limitation, the warranties +of merchantability, fitness for a particular purpose, title, and +non-infringement. In no event shall the Copyright owners, or +anyone distributing the software, be liable for any damages or +other liability, whether in contract, tort or otherwise, arising +from, out of, or in connection with the software, or the use or +other dealings in the software, even if advised of the possibility +of such damage. -This code is released under the libpng license. +Permission is hereby granted to use, copy, modify, and distribute +this software, or portions hereof, for any purpose, without fee, +subject to the following restrictions: -libpng versions 1.0.7, July 1, 2000 through 1.6.34, September 29, 2017 are -Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are + 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 Copyright notice may not be removed or altered from any + source or altered source distribution. + + +PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) +----------------------------------------------------------------------- + +libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are +Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are derived from libpng-1.0.6, and are distributed according to the same disclaimer and license as libpng-1.0.6 with the following individuals added to the list of Contributing Authors: - Simon-Pierre Cadieux - Eric S. Raymond - Mans Rullgard - Cosmin Truta - Gilles Vollant - James Yu - Mandar Sahastrabuddhe - Google Inc. - Vadim Barkov + Simon-Pierre Cadieux + Eric S. Raymond + Mans Rullgard + Cosmin Truta + Gilles Vollant + James Yu + Mandar Sahastrabuddhe + Google Inc. + Vadim Barkov and with the following additions to the disclaimer: - There is no warranty against interference with your enjoyment of the - library or against infringement. There is no warranty that our - efforts or the library will fulfill any of your particular purposes - or needs. This library is provided with all faults, and the entire - risk of satisfactory quality, performance, accuracy, and effort is with - the user. + There is no warranty against interference with your enjoyment of + the library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is + with the user. Some files in the "contrib" directory and some configure-generated -files that are distributed with libpng have other copyright owners and +files that are distributed with libpng have other copyright owners, and are released under other open source licenses. libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from libpng-0.96, and are distributed according to the same disclaimer and -license as libpng-0.96, with the following individuals added to the list -of Contributing Authors: +license as libpng-0.96, with the following individuals added to the +list of Contributing Authors: - Tom Lane - Glenn Randers-Pehrson - Willem van Schaik + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik libpng versions 0.89, June 1996, through 0.96, May 1997, are Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, @@ -55,14 +84,14 @@ and are distributed according to the same disclaimer and license as libpng-0.88, with the following individuals added to the list of Contributing Authors: - John Bowler - Kevin Bracey - Sam Bushell - Magnus Holmgren - Greg Roelofs - Tom Tanner + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner -Some files in the "scripts" directory have other copyright owners +Some files in the "scripts" directory have other copyright owners, but are released under this license. libpng versions 0.5, May 1995, through 0.88, January 1996, are @@ -71,63 +100,35 @@ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. For the purposes of this copyright and license, "Contributing Authors" is defined as the following set of individuals: - Andreas Dilger - Dave Martindale - Guy Eric Schalnat - Paul Schmidt - Tim Wegner + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner -The PNG Reference Library is supplied "AS IS". The Contributing Authors -and Group 42, Inc. disclaim all warranties, expressed or implied, -including, without limitation, the warranties of merchantability and of -fitness for any purpose. The Contributing Authors and Group 42, Inc. -assume no liability for direct, indirect, incidental, special, exemplary, -or consequential damages, which may result from the use of the PNG -Reference Library, even if advised of the possibility of such damage. +The PNG Reference Library is supplied "AS IS". The Contributing +Authors and Group 42, Inc. disclaim all warranties, expressed or +implied, including, without limitation, the warranties of +merchantability and of fitness for any purpose. The Contributing +Authors and Group 42, Inc. assume no liability for direct, indirect, +incidental, special, exemplary, or consequential damages, which may +result from the use of the PNG Reference Library, even if advised of +the possibility of such damage. Permission is hereby granted to use, copy, modify, and distribute this source code, or portions hereof, for any purpose, without fee, subject to the following restrictions: - 1. The origin of this source code must not be misrepresented. + 1. The origin of this source code must not be misrepresented. - 2. Altered versions must be plainly marked as such and must not - be misrepresented as being the original source. + 2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. - 3. This Copyright notice may not be removed or altered from any - source or altered source distribution. + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. -The Contributing Authors and Group 42, Inc. specifically permit, without -fee, and encourage the use of this source code as a component to -supporting the PNG file format in commercial products. If you use this -source code in a product, acknowledgment is not required but would be -appreciated. - -END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. - -TRADEMARK: - -The name "libpng" has not been registered by the Copyright owner -as a trademark in any jurisdiction. However, because libpng has -been distributed and maintained world-wide, continually since 1995, -the Copyright owner claims "common-law trademark protection" in any -jurisdiction where common-law trademark is recognized. - -OSI CERTIFICATION: - -Libpng is OSI Certified Open Source Software. OSI Certified Open Source is -a certification mark of the Open Source Initiative. OSI has not addressed -the additional disclaimers inserted at version 1.0.7. - -EXPORT CONTROL: - -The Copyright owner believes that the Export Control Classification -Number (ECCN) for libpng is EAR99, which means not subject to export -controls or International Traffic in Arms Regulations (ITAR) because -it is open source, publicly available software, that does not contain -any encryption software. See the EAR, paragraphs 734.3(b)(3) and -734.7(b). - -Glenn Randers-Pehrson -glennrp at users.sourceforge.net -September 29, 2017 +The Contributing Authors and Group 42, Inc. specifically permit, +without fee, and encourage the use of this source code as a component +to supporting the PNG file format in commercial products. If you use +this source code in a product, acknowledgment is not required but would +be appreciated. diff --git a/Engine/lib/lpng/Makefile.am b/Engine/lib/lpng/Makefile.am new file mode 100644 index 000000000..4f621aa4d --- /dev/null +++ b/Engine/lib/lpng/Makefile.am @@ -0,0 +1,393 @@ +# Makefile.am, the source file for Makefile.in (and hence Makefile), is +# +# Copyright (c) 2018 Cosmin Truta +# Copyright (c) 2004-2016 Glenn Randers-Pehrson +# +# This code is released under the libpng license. +# For conditions of distribution and use, see the disclaimer +# and license in png.h + +PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ + +ACLOCAL_AMFLAGS = -I scripts + +# test programs - run on make check, make distcheck +check_PROGRAMS= pngtest pngunknown pngstest pngvalid pngimage pngcp +if HAVE_CLOCK_GETTIME +check_PROGRAMS += timepng +endif + +# Utilities - installed +bin_PROGRAMS= pngfix png-fix-itxt + +# This ensures that pnglibconf.h gets built at the start of 'make all' or +# 'make check', but it does not add dependencies to the individual programs, +# this is done below. +# +# IMPORTANT: always add the object modules of new programs to the list below +# because otherwise the sequence 'configure; make new-program' will *sometimes* +# result in the installed (system) pnglibconf.h being used and the result is +# always wrong and always very confusing. +BUILT_SOURCES = pnglibconf.h + +pngtest_SOURCES = pngtest.c +pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la + +pngvalid_SOURCES = contrib/libtests/pngvalid.c +pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la + +pngstest_SOURCES = contrib/libtests/pngstest.c +pngstest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la + +pngunknown_SOURCES = contrib/libtests/pngunknown.c +pngunknown_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la + +pngimage_SOURCES = contrib/libtests/pngimage.c +pngimage_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la + +timepng_SOURCES = contrib/libtests/timepng.c +timepng_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la + +pngfix_SOURCES = contrib/tools/pngfix.c +pngfix_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la + +png_fix_itxt_SOURCES = contrib/tools/png-fix-itxt.c + +pngcp_SOURCES = contrib/tools/pngcp.c +pngcp_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la + +# Generally these are single line shell scripts to run a test with a particular +# set of parameters: +TESTS =\ + tests/pngtest\ + tests/pngtest-badpngs\ + tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\ + tests/pngvalid-gamma-background tests/pngvalid-gamma-expand16-alpha-mode\ + tests/pngvalid-gamma-expand16-background\ + tests/pngvalid-gamma-expand16-transform tests/pngvalid-gamma-sbit\ + tests/pngvalid-gamma-threshold tests/pngvalid-gamma-transform\ + tests/pngvalid-progressive-size\ + tests/pngvalid-progressive-interlace-standard\ + tests/pngvalid-transform\ + tests/pngvalid-progressive-standard tests/pngvalid-standard\ + tests/pngstest-1.8 tests/pngstest-1.8-alpha tests/pngstest-linear\ + tests/pngstest-linear-alpha tests/pngstest-none tests/pngstest-none-alpha\ + tests/pngstest-sRGB tests/pngstest-sRGB-alpha tests/pngunknown-IDAT\ + tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\ + tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg\ + tests/pngimage-quick tests/pngimage-full + +# man pages +dist_man_MANS= libpng.3 libpngpf.3 png.5 + +# generate the -config scripts if required +binconfigs= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config +EXTRA_SCRIPTS= libpng-config libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config +bin_SCRIPTS= @binconfigs@ + +# rules to build libpng, only build the old library on request +lib_LTLIBRARIES=libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +# EXTRA_LTLIBRARIES= libpng.la +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c\ + pngget.c pngmem.c pngpread.c pngread.c pngrio.c pngrtran.c pngrutil.c\ + pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c\ + png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngusr.dfa + +if PNG_ARM_NEON +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\ + arm/filter_neon.S arm/filter_neon_intrinsics.c \ + arm/palette_neon_intrinsics.c +endif + +if PNG_MIPS_MSA +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += mips/mips_init.c\ + mips/filter_msa_intrinsics.c +endif + +if PNG_INTEL_SSE +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += intel/intel_init.c\ + intel/filter_sse2_intrinsics.c +endif + +if PNG_POWERPC_VSX +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += powerpc/powerpc_init.c\ + powerpc/filter_vsx_intrinsics.c +endif + +nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h + +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \ + -version-number @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0 + +if HAVE_LD_VERSION_SCRIPT +# Versioned symbols and restricted exports +if HAVE_SOLARIS_LD + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,-M -Wl,libpng.vers +else + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,--version-script=libpng.vers +endif + + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.vers +else +# Only restricted exports when possible + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -export-symbols libpng.sym + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym +endif + +#distribute headers in /usr/include/libpng/* +pkgincludedir= $(includedir)/$(PNGLIB_BASENAME) +pkginclude_HEADERS= png.h pngconf.h +nodist_pkginclude_HEADERS= pnglibconf.h + +# pkg-config stuff, note that libpng.pc is always required in order +# to get the correct library +pkgconfigdir = @pkgconfigdir@ +pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc + +# Extra source distribution files, '${srcdir}' is used below to stop build files +# from those directories being included. This only works if the configure is +# not done in the source directory! +EXTRA_DIST= \ + ANNOUNCE AUTHORS CHANGES INSTALL LICENSE README TODO TRADEMARK \ + pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \ + ${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \ + $(TESTS) $(XFAIL_TESTS) tests/pngstest \ + CMakeLists.txt example.c libpng-manual.txt + +SCRIPT_CLEANFILES=scripts/*.out scripts/*.chk + +CLEANFILES= *.tf? pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \ + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \ + check.new pnglibconf.h pngprefix.h symbols.new pngtest-log.txt \ + pnglibconf.out pnglibconf.c pnglibconf.pre pnglibconf.dfn \ + $(SCRIPT_CLEANFILES) + +MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \ +config.sub configure depcomp install-sh ltmain.sh missing + +# PNG_COPTS give extra options for the C compiler to be used on all compilation +# steps (unless targe_CFLAGS is specified; that will take precedence over +# AM_CFLAGS) +PNG_COPTS = @PNG_COPTS@ +AM_CFLAGS = ${PNG_COPTS} + +# DFNCPP is normally just CPP - the C preprocessor - but on Solaris and maybe +# other operating systems (NeXT?) the C preprocessor selected by configure +# checks input tokens for validity - effectively it performs part of the ANSI-C +# parsing - and therefore fails with the .df files. configure.ac has special +# checks for this and sets DFNCPP appropriately. +DFNCPP = @DFNCPP@ + +SUFFIXES = .chk .out + +$(PNGLIB_BASENAME).pc: libpng.pc + cp libpng.pc $@ + +$(PNGLIB_BASENAME)-config: libpng-config + cp libpng-config $@ + +scripts/sym.out scripts/vers.out: png.h pngconf.h pnglibconf.h +scripts/prefix.out: png.h pngconf.h pnglibconf.out +scripts/symbols.out: png.h pngconf.h $(srcdir)/scripts/pnglibconf.h.prebuilt +scripts/intprefix.out: pnglibconf.h + +libpng.sym: scripts/sym.out + rm -f $@ + cp $? $@ +libpng.vers: scripts/vers.out + rm -f $@ + cp $? $@ + +if DO_PNG_PREFIX +# Rename functions in scripts/prefix.out with a PNG_PREFIX prefix. +# Rename macros in scripts/macro.lst from PNG_PREFIXpng_ to PNG_ (the actual +# implementation of the macro). +pnglibconf.h: pnglibconf.out scripts/prefix.out scripts/macro.lst + rm -f $@ + $(AWK) 's==0 && NR>1{print prev}\ + s==0{prev=$$0}\ + s==1{print "#define", $$1, "@PNG_PREFIX@" $$1}\ + s==2{print "#define @PNG_PREFIX@png_" $$1, "PNG_" $$1}\ + END{print prev}' s=0 pnglibconf.out s=1 scripts/prefix.out\ + s=2 ${srcdir}/scripts/macro.lst >pnglibconf.tf8 + mv pnglibconf.tf8 $@ + +pngprefix.h: scripts/intprefix.out + rm -f pngprefix.tf1 + $(AWK) '{print "#define", $$1, "@PNG_PREFIX@" $$1}' $? >pngprefix.tf1 + mv pngprefix.tf1 $@ +else +pnglibconf.h: pnglibconf.out + rm -f $@ + cp $? $@ + +pngprefix.h: # is empty + :>$@ +endif + +$(srcdir)/scripts/pnglibconf.h.prebuilt: + @echo "Attempting to build $@" >&2 + @echo "This is a machine generated file, but if you want to make" >&2 + @echo "a new one simply make 'scripts/pnglibconf.out', copy that" >&2 + @echo "AND set PNG_ZLIB_VERNUM to 0 (you MUST do this)" >&2 + @exit 1 + +# The following is necessary to ensure that the local pnglibconf.h is used, not +# an installed one (this can happen immediately after on a clean system if +# 'make test' is the first thing the user does.) Only files which include +# one of the png source files (typically png.h or pngpriv.h) need to be listed +# here: +pngtest.o: pnglibconf.h + +contrib/libtests/makepng.o: pnglibconf.h +contrib/libtests/pngstest.o: pnglibconf.h +contrib/libtests/pngunknown.o: pnglibconf.h +contrib/libtests/pngimage.o: pnglibconf.h +contrib/libtests/pngvalid.o: pnglibconf.h +contrib/libtests/readpng.o: pnglibconf.h +contrib/libtests/tarith.o: pnglibconf.h +contrib/libtests/timepng.o: pnglibconf.h + +contrib/tools/makesRGB.o: pnglibconf.h +contrib/tools/pngfix.o: pnglibconf.h +contrib/tools/pngcp.o: pnglibconf.h + +# We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually +# be built with PNG_USE_READ_MACROS; this prevents the read macros from +# interfering with the symbol file format. +SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\ + -DPNGLIB_VERSION='@PNGLIB_VERSION@'\ + -DSYMBOL_PREFIX='$(SYMBOL_PREFIX)'\ + -DPNG_NO_USE_READ_MACROS -DPNG_BUILDING_SYMBOL_TABLE + +if DO_PNG_PREFIX +SYMBOL_CFLAGS += -DPNG_PREFIX='@PNG_PREFIX@' +endif + +.c.out: + rm -f $@ $*.tf[12] + test -d scripts || mkdir scripts || test -d scripts + $(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)\ + $(CPPFLAGS) $(SYMBOL_CFLAGS) $< > $*.tf1 + $(AWK) -f "${srcdir}/scripts/dfn.awk" out="$*.tf2" $*.tf1 1>&2 + rm -f $*.tf1 + mv $*.tf2 $@ + +# The .c file for pnglibconf.h is machine generated +pnglibconf.c: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA) + rm -f $@ $*.tf[45] + $(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf4 version=search\ + ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\ + ${srcdir}/pngusr.dfa $(DFA_XTRA) 1>&2 + $(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf5 $*.tf4 1>&2 + rm $*.tf4 + mv $*.tf5 $@ + +# Symbol checks (.def and .out files should match) +scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.out + +.out.chk: + rm -f $@ $*.new + $(AWK) -f ${srcdir}/scripts/checksym.awk ${srcdir}/scripts/${*F}.def\ + of="$*.new" $< >&2 + mv $*.new $@ + +# used on demand to regenerate the standard header, CPPFLAGS should +# be empty - no non-standard defines +scripts/pnglibconf.c: scripts/pnglibconf.dfa scripts/options.awk pngconf.h + rm -f $@ pnglibconf.tf[67] + test -z "$(CPPFLAGS)" + echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\ + $(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf6\ + logunsupported=1 version=search ${srcdir}/pngconf.h -\ + ${srcdir}/scripts/pnglibconf.dfa 1>&2 + $(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf7\ + pnglibconf.tf6 1>&2 + rm pnglibconf.tf6 + mv pnglibconf.tf7 $@ + +$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS): png.h pngconf.h \ + pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h pngprefix.h + +test: check-am + +# Extra checks +check: scripts/symbols.chk + +# Don't distribute the generated script files +dist-hook: + cd '$(top_distdir)'; rm -f $(SCRIPT_CLEANFILES) + +# Make links between installed files with release-specific names and the generic +# file names. If this install rule is run the generic names will be deleted and +# recreated - this has obvious issues for systems with multiple installations. + +install-header-links: + @set -ex; cd '$(DESTDIR)$(includedir)'; for f in $(HEADERS); do \ + rm -f "$$f"; $(LN_S) "$(PNGLIB_BASENAME)/$$f" "$$f"; done + +uninstall-header-links: + cd '$(DESTDIR)$(includedir)'; rm -f $(HEADERS) + +install-libpng-pc: + @set -ex; cd '$(DESTDIR)$(pkgconfigdir)'; rm -f libpng.pc; \ + $(LN_S) '$(PNGLIB_BASENAME).pc' libpng.pc + +uninstall-libpng-pc: + rm -f '$(DESTDIR)$(pkgconfigdir)/libpng.pc' + +# EXT_LIST is a list of the possibly library directory extensions, this exists +# because we can't find a good way of discovering the file extensions that are +# actually installed on a given system, so instead we check for every extension +# we have seen. + +EXT_LIST = a dll.a so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@ la sl dylib + +install-library-links: + @set -x; cd '$(DESTDIR)$(libdir)';\ + for ext in $(EXT_LIST); do\ + rm -f "libpng.$$ext";\ + if test -f "$(PNGLIB_BASENAME).$$ext"; then\ + $(LN_S) "$(PNGLIB_BASENAME).$$ext" "libpng.$$ext" || exit 1;\ + fi;\ + done + +uninstall-library-links: + @set -x; cd '$(DESTDIR)$(libdir)'; for ext in $(EXT_LIST); do\ + rm -f "libpng.$$ext"; done + +install-libpng-config: + @set -ex; cd '$(DESTDIR)$(bindir)'; rm -f libpng-config; \ + $(LN_S) '$(PNGLIB_BASENAME)-config' libpng-config + +uninstall-libpng-config: + rm -f '$(DESTDIR)$(bindir)/libpng-config' + +if DO_INSTALL_LINKS +# If --enable-unversioned-links is specified the header and lib file links +# will be automatically made on a 'make install': + +install-data-hook: install-header-links +uninstall-hook: uninstall-header-links +install-exec-hook: install-library-links +uninstall-hook: uninstall-library-links +endif + +if DO_INSTALL_LIBPNG_PC +# Likewise, --install-pc causes libpng.pc to be constructed: + +install-data-hook: install-libpng-pc +uninstall-hook: uninstall-libpng-pc +endif + +if DO_INSTALL_LIBPNG_CONFIG +# And --install-config: + +install-exec-hook: install-libpng-config +uninstall-hook: uninstall-libpng-config +endif + +# The following addition ensures that 'make all' always builds the test programs +# too. It used to, but some change either in libpng or configure stopped this +# working. +all-am: $(check_PROGRAMS) diff --git a/Engine/lib/lpng/Makefile.in b/Engine/lib/lpng/Makefile.in new file mode 100644 index 000000000..81ac1c855 --- /dev/null +++ b/Engine/lib/lpng/Makefile.in @@ -0,0 +1,2428 @@ +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile.am, the source file for Makefile.in (and hence Makefile), is +# +# Copyright (c) 2018 Cosmin Truta +# Copyright (c) 2004-2016 Glenn Randers-Pehrson +# +# This code is released under the libpng license. +# For conditions of distribution and use, see the disclaimer +# and license in png.h + + + + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +check_PROGRAMS = pngtest$(EXEEXT) pngunknown$(EXEEXT) \ + pngstest$(EXEEXT) pngvalid$(EXEEXT) pngimage$(EXEEXT) \ + pngcp$(EXEEXT) $(am__EXEEXT_1) +@HAVE_CLOCK_GETTIME_TRUE@am__append_1 = timepng +bin_PROGRAMS = pngfix$(EXEEXT) png-fix-itxt$(EXEEXT) +@PNG_ARM_NEON_TRUE@am__append_2 = arm/arm_init.c\ +@PNG_ARM_NEON_TRUE@ arm/filter_neon.S arm/filter_neon_intrinsics.c \ +@PNG_ARM_NEON_TRUE@ arm/palette_neon_intrinsics.c + +@PNG_MIPS_MSA_TRUE@am__append_3 = mips/mips_init.c\ +@PNG_MIPS_MSA_TRUE@ mips/filter_msa_intrinsics.c + +@PNG_INTEL_SSE_TRUE@am__append_4 = intel/intel_init.c\ +@PNG_INTEL_SSE_TRUE@ intel/filter_sse2_intrinsics.c + +@PNG_POWERPC_VSX_TRUE@am__append_5 = powerpc/powerpc_init.c\ +@PNG_POWERPC_VSX_TRUE@ powerpc/filter_vsx_intrinsics.c + + +# Versioned symbols and restricted exports +@HAVE_LD_VERSION_SCRIPT_TRUE@@HAVE_SOLARIS_LD_TRUE@am__append_6 = -Wl,-M -Wl,libpng.vers +@HAVE_LD_VERSION_SCRIPT_TRUE@@HAVE_SOLARIS_LD_FALSE@am__append_7 = -Wl,--version-script=libpng.vers +# Only restricted exports when possible +@HAVE_LD_VERSION_SCRIPT_FALSE@am__append_8 = -export-symbols libpng.sym +@DO_PNG_PREFIX_TRUE@am__append_9 = -DPNG_PREFIX='@PNG_PREFIX@' +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/scripts/libtool.m4 \ + $(top_srcdir)/scripts/ltoptions.m4 \ + $(top_srcdir)/scripts/ltsugar.m4 \ + $(top_srcdir)/scripts/ltversion.m4 \ + $(top_srcdir)/scripts/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(pkginclude_HEADERS) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = libpng.pc libpng-config +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" \ + "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man3dir)" \ + "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(pkgincludedir)" "$(DESTDIR)$(pkgincludedir)" +@HAVE_CLOCK_GETTIME_TRUE@am__EXEEXT_1 = timepng$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +LTLIBRARIES = $(lib_LTLIBRARIES) +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD = +am__libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES_DIST = png.c \ + pngerror.c pngget.c pngmem.c pngpread.c pngread.c pngrio.c \ + pngrtran.c pngrutil.c pngset.c pngtrans.c pngwio.c pngwrite.c \ + pngwtran.c pngwutil.c png.h pngconf.h pngdebug.h pnginfo.h \ + pngpriv.h pngstruct.h pngusr.dfa arm/arm_init.c \ + arm/filter_neon.S arm/filter_neon_intrinsics.c \ + arm/palette_neon_intrinsics.c mips/mips_init.c \ + mips/filter_msa_intrinsics.c intel/intel_init.c \ + intel/filter_sse2_intrinsics.c powerpc/powerpc_init.c \ + powerpc/filter_vsx_intrinsics.c +am__dirstamp = $(am__leading_dot)dirstamp +@PNG_ARM_NEON_TRUE@am__objects_1 = arm/arm_init.lo arm/filter_neon.lo \ +@PNG_ARM_NEON_TRUE@ arm/filter_neon_intrinsics.lo \ +@PNG_ARM_NEON_TRUE@ arm/palette_neon_intrinsics.lo +@PNG_MIPS_MSA_TRUE@am__objects_2 = mips/mips_init.lo \ +@PNG_MIPS_MSA_TRUE@ mips/filter_msa_intrinsics.lo +@PNG_INTEL_SSE_TRUE@am__objects_3 = intel/intel_init.lo \ +@PNG_INTEL_SSE_TRUE@ intel/filter_sse2_intrinsics.lo +@PNG_POWERPC_VSX_TRUE@am__objects_4 = powerpc/powerpc_init.lo \ +@PNG_POWERPC_VSX_TRUE@ powerpc/filter_vsx_intrinsics.lo +am_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS = png.lo pngerror.lo \ + pngget.lo pngmem.lo pngpread.lo pngread.lo pngrio.lo \ + pngrtran.lo pngrutil.lo pngset.lo pngtrans.lo pngwio.lo \ + pngwrite.lo pngwtran.lo pngwutil.lo $(am__objects_1) \ + $(am__objects_2) $(am__objects_3) $(am__objects_4) +nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS = +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS = \ + $(am_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) \ + $(nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LINK = $(LIBTOOL) $(AM_V_lt) \ + --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS) $(LDFLAGS) -o \ + $@ +am_png_fix_itxt_OBJECTS = contrib/tools/png-fix-itxt.$(OBJEXT) +png_fix_itxt_OBJECTS = $(am_png_fix_itxt_OBJECTS) +png_fix_itxt_LDADD = $(LDADD) +am_pngcp_OBJECTS = contrib/tools/pngcp.$(OBJEXT) +pngcp_OBJECTS = $(am_pngcp_OBJECTS) +pngcp_DEPENDENCIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +am_pngfix_OBJECTS = contrib/tools/pngfix.$(OBJEXT) +pngfix_OBJECTS = $(am_pngfix_OBJECTS) +pngfix_DEPENDENCIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +am_pngimage_OBJECTS = contrib/libtests/pngimage.$(OBJEXT) +pngimage_OBJECTS = $(am_pngimage_OBJECTS) +pngimage_DEPENDENCIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +am_pngstest_OBJECTS = contrib/libtests/pngstest.$(OBJEXT) +pngstest_OBJECTS = $(am_pngstest_OBJECTS) +pngstest_DEPENDENCIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +am_pngtest_OBJECTS = pngtest.$(OBJEXT) +pngtest_OBJECTS = $(am_pngtest_OBJECTS) +pngtest_DEPENDENCIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +am_pngunknown_OBJECTS = contrib/libtests/pngunknown.$(OBJEXT) +pngunknown_OBJECTS = $(am_pngunknown_OBJECTS) +pngunknown_DEPENDENCIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +am_pngvalid_OBJECTS = contrib/libtests/pngvalid.$(OBJEXT) +pngvalid_OBJECTS = $(am_pngvalid_OBJECTS) +pngvalid_DEPENDENCIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +am_timepng_OBJECTS = contrib/libtests/timepng.$(OBJEXT) +timepng_OBJECTS = $(am_timepng_OBJECTS) +timepng_DEPENDENCIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +SCRIPTS = $(bin_SCRIPTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/png.Plo ./$(DEPDIR)/pngerror.Plo \ + ./$(DEPDIR)/pngget.Plo ./$(DEPDIR)/pngmem.Plo \ + ./$(DEPDIR)/pngpread.Plo ./$(DEPDIR)/pngread.Plo \ + ./$(DEPDIR)/pngrio.Plo ./$(DEPDIR)/pngrtran.Plo \ + ./$(DEPDIR)/pngrutil.Plo ./$(DEPDIR)/pngset.Plo \ + ./$(DEPDIR)/pngtest.Po ./$(DEPDIR)/pngtrans.Plo \ + ./$(DEPDIR)/pngwio.Plo ./$(DEPDIR)/pngwrite.Plo \ + ./$(DEPDIR)/pngwtran.Plo ./$(DEPDIR)/pngwutil.Plo \ + arm/$(DEPDIR)/arm_init.Plo arm/$(DEPDIR)/filter_neon.Plo \ + arm/$(DEPDIR)/filter_neon_intrinsics.Plo \ + arm/$(DEPDIR)/palette_neon_intrinsics.Plo \ + contrib/libtests/$(DEPDIR)/pngimage.Po \ + contrib/libtests/$(DEPDIR)/pngstest.Po \ + contrib/libtests/$(DEPDIR)/pngunknown.Po \ + contrib/libtests/$(DEPDIR)/pngvalid.Po \ + contrib/libtests/$(DEPDIR)/timepng.Po \ + contrib/tools/$(DEPDIR)/png-fix-itxt.Po \ + contrib/tools/$(DEPDIR)/pngcp.Po \ + contrib/tools/$(DEPDIR)/pngfix.Po \ + intel/$(DEPDIR)/filter_sse2_intrinsics.Plo \ + intel/$(DEPDIR)/intel_init.Plo \ + mips/$(DEPDIR)/filter_msa_intrinsics.Plo \ + mips/$(DEPDIR)/mips_init.Plo \ + powerpc/$(DEPDIR)/filter_vsx_intrinsics.Plo \ + powerpc/$(DEPDIR)/powerpc_init.Plo +am__mv = mv -f +CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) +LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CCASFLAGS) $(CCASFLAGS) +AM_V_CPPAS = $(am__v_CPPAS_@AM_V@) +am__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@) +am__v_CPPAS_0 = @echo " CPPAS " $@; +am__v_CPPAS_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES) \ + $(nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES) \ + $(png_fix_itxt_SOURCES) $(pngcp_SOURCES) $(pngfix_SOURCES) \ + $(pngimage_SOURCES) $(pngstest_SOURCES) $(pngtest_SOURCES) \ + $(pngunknown_SOURCES) $(pngvalid_SOURCES) $(timepng_SOURCES) +DIST_SOURCES = \ + $(am__libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES_DIST) \ + $(png_fix_itxt_SOURCES) $(pngcp_SOURCES) $(pngfix_SOURCES) \ + $(pngimage_SOURCES) $(pngstest_SOURCES) $(pngtest_SOURCES) \ + $(pngunknown_SOURCES) $(pngvalid_SOURCES) $(timepng_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +man3dir = $(mandir)/man3 +man5dir = $(mandir)/man5 +NROFF = nroff +MANS = $(dist_man_MANS) +DATA = $(pkgconfig_DATA) +HEADERS = $(nodist_pkginclude_HEADERS) $(pkginclude_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +AM_RECURSIVE_TARGETS = cscope check recheck +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \ + $(srcdir)/config.h.in $(srcdir)/libpng-config.in \ + $(srcdir)/libpng.pc.in AUTHORS INSTALL README TODO compile \ + config.guess config.sub depcomp install-sh ltmain.sh missing \ + test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz +GZIP_ENV = --best +DIST_TARGETS = dist-xz dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print + +#distribute headers in /usr/include/libpng/* +pkgincludedir = $(includedir)/$(PNGLIB_BASENAME) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ + +# DFNCPP is normally just CPP - the C preprocessor - but on Solaris and maybe +# other operating systems (NeXT?) the C preprocessor selected by configure +# checks input tokens for validity - effectively it performs part of the ANSI-C +# parsing - and therefore fails with the .df files. configure.ac has special +# checks for this and sets DFNCPP appropriately. +DFNCPP = @DFNCPP@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PNGLIB_MAJOR = @PNGLIB_MAJOR@ +PNGLIB_MINOR = @PNGLIB_MINOR@ +PNGLIB_RELEASE = @PNGLIB_RELEASE@ +PNGLIB_VERSION = @PNGLIB_VERSION@ + +# PNG_COPTS give extra options for the C compiler to be used on all compilation +# steps (unless targe_CFLAGS is specified; that will take precedence over +# AM_CFLAGS) +PNG_COPTS = @PNG_COPTS@ +PNG_PREFIX = @PNG_PREFIX@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYMBOL_PREFIX = @SYMBOL_PREFIX@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ + +# generate the -config scripts if required +binconfigs = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ + +# pkg-config stuff, note that libpng.pc is always required in order +# to get the correct library +pkgconfigdir = @pkgconfigdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +PNGLIB_BASENAME = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ +ACLOCAL_AMFLAGS = -I scripts + +# This ensures that pnglibconf.h gets built at the start of 'make all' or +# 'make check', but it does not add dependencies to the individual programs, +# this is done below. +# +# IMPORTANT: always add the object modules of new programs to the list below +# because otherwise the sequence 'configure; make new-program' will *sometimes* +# result in the installed (system) pnglibconf.h being used and the result is +# always wrong and always very confusing. +BUILT_SOURCES = pnglibconf.h +pngtest_SOURCES = pngtest.c +pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +pngvalid_SOURCES = contrib/libtests/pngvalid.c +pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +pngstest_SOURCES = contrib/libtests/pngstest.c +pngstest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +pngunknown_SOURCES = contrib/libtests/pngunknown.c +pngunknown_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +pngimage_SOURCES = contrib/libtests/pngimage.c +pngimage_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +timepng_SOURCES = contrib/libtests/timepng.c +timepng_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +pngfix_SOURCES = contrib/tools/pngfix.c +pngfix_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +png_fix_itxt_SOURCES = contrib/tools/png-fix-itxt.c +pngcp_SOURCES = contrib/tools/pngcp.c +pngcp_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la + +# Generally these are single line shell scripts to run a test with a particular +# set of parameters: +TESTS = \ + tests/pngtest\ + tests/pngtest-badpngs\ + tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\ + tests/pngvalid-gamma-background tests/pngvalid-gamma-expand16-alpha-mode\ + tests/pngvalid-gamma-expand16-background\ + tests/pngvalid-gamma-expand16-transform tests/pngvalid-gamma-sbit\ + tests/pngvalid-gamma-threshold tests/pngvalid-gamma-transform\ + tests/pngvalid-progressive-size\ + tests/pngvalid-progressive-interlace-standard\ + tests/pngvalid-transform\ + tests/pngvalid-progressive-standard tests/pngvalid-standard\ + tests/pngstest-1.8 tests/pngstest-1.8-alpha tests/pngstest-linear\ + tests/pngstest-linear-alpha tests/pngstest-none tests/pngstest-none-alpha\ + tests/pngstest-sRGB tests/pngstest-sRGB-alpha tests/pngunknown-IDAT\ + tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\ + tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg\ + tests/pngimage-quick tests/pngimage-full + + +# man pages +dist_man_MANS = libpng.3 libpngpf.3 png.5 +EXTRA_SCRIPTS = libpng-config libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config +bin_SCRIPTS = @binconfigs@ + +# rules to build libpng, only build the old library on request +lib_LTLIBRARIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la +# EXTRA_LTLIBRARIES= libpng.la +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c \ + pngget.c pngmem.c pngpread.c pngread.c pngrio.c pngrtran.c \ + pngrutil.c pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c \ + pngwutil.c png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h \ + pngstruct.h pngusr.dfa $(am__append_2) $(am__append_3) \ + $(am__append_4) $(am__append_5) +nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined \ + -export-dynamic -version-number \ + @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0 \ + $(am__append_6) $(am__append_7) $(am__append_8) +@HAVE_LD_VERSION_SCRIPT_FALSE@libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym +@HAVE_LD_VERSION_SCRIPT_TRUE@libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.vers +pkginclude_HEADERS = png.h pngconf.h +nodist_pkginclude_HEADERS = pnglibconf.h +pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc + +# Extra source distribution files, '${srcdir}' is used below to stop build files +# from those directories being included. This only works if the configure is +# not done in the source directory! +EXTRA_DIST = \ + ANNOUNCE AUTHORS CHANGES INSTALL LICENSE README TODO TRADEMARK \ + pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \ + ${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \ + $(TESTS) $(XFAIL_TESTS) tests/pngstest \ + CMakeLists.txt example.c libpng-manual.txt + +SCRIPT_CLEANFILES = scripts/*.out scripts/*.chk +CLEANFILES = *.tf? pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \ + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \ + check.new pnglibconf.h pngprefix.h symbols.new pngtest-log.txt \ + pnglibconf.out pnglibconf.c pnglibconf.pre pnglibconf.dfn \ + $(SCRIPT_CLEANFILES) + +MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \ +config.sub configure depcomp install-sh ltmain.sh missing + +AM_CFLAGS = ${PNG_COPTS} +SUFFIXES = .chk .out + +# We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually +# be built with PNG_USE_READ_MACROS; this prevents the read macros from +# interfering with the symbol file format. +SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0' \ + -DPNGLIB_VERSION='@PNGLIB_VERSION@' \ + -DSYMBOL_PREFIX='$(SYMBOL_PREFIX)' -DPNG_NO_USE_READ_MACROS \ + -DPNG_BUILDING_SYMBOL_TABLE $(am__append_9) + +# EXT_LIST is a list of the possibly library directory extensions, this exists +# because we can't find a good way of discovering the file extensions that are +# actually installed on a given system, so instead we check for every extension +# we have seen. +EXT_LIST = a dll.a so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@ la sl dylib +all: $(BUILT_SOURCES) config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .chk .out .S .c .lo .log .o .obj .test .test$(EXEEXT) .trs +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +libpng.pc: $(top_builddir)/config.status $(srcdir)/libpng.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +libpng-config: $(top_builddir)/config.status $(srcdir)/libpng-config.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +arm/$(am__dirstamp): + @$(MKDIR_P) arm + @: > arm/$(am__dirstamp) +arm/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) arm/$(DEPDIR) + @: > arm/$(DEPDIR)/$(am__dirstamp) +arm/arm_init.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/filter_neon.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/filter_neon_intrinsics.lo: arm/$(am__dirstamp) \ + arm/$(DEPDIR)/$(am__dirstamp) +arm/palette_neon_intrinsics.lo: arm/$(am__dirstamp) \ + arm/$(DEPDIR)/$(am__dirstamp) +mips/$(am__dirstamp): + @$(MKDIR_P) mips + @: > mips/$(am__dirstamp) +mips/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) mips/$(DEPDIR) + @: > mips/$(DEPDIR)/$(am__dirstamp) +mips/mips_init.lo: mips/$(am__dirstamp) mips/$(DEPDIR)/$(am__dirstamp) +mips/filter_msa_intrinsics.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +intel/$(am__dirstamp): + @$(MKDIR_P) intel + @: > intel/$(am__dirstamp) +intel/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) intel/$(DEPDIR) + @: > intel/$(DEPDIR)/$(am__dirstamp) +intel/intel_init.lo: intel/$(am__dirstamp) \ + intel/$(DEPDIR)/$(am__dirstamp) +intel/filter_sse2_intrinsics.lo: intel/$(am__dirstamp) \ + intel/$(DEPDIR)/$(am__dirstamp) +powerpc/$(am__dirstamp): + @$(MKDIR_P) powerpc + @: > powerpc/$(am__dirstamp) +powerpc/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) powerpc/$(DEPDIR) + @: > powerpc/$(DEPDIR)/$(am__dirstamp) +powerpc/powerpc_init.lo: powerpc/$(am__dirstamp) \ + powerpc/$(DEPDIR)/$(am__dirstamp) +powerpc/filter_vsx_intrinsics.lo: powerpc/$(am__dirstamp) \ + powerpc/$(DEPDIR)/$(am__dirstamp) + +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la: $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES) $(EXTRA_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES) + $(AM_V_CCLD)$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LINK) -rpath $(libdir) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD) $(LIBS) +contrib/tools/$(am__dirstamp): + @$(MKDIR_P) contrib/tools + @: > contrib/tools/$(am__dirstamp) +contrib/tools/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) contrib/tools/$(DEPDIR) + @: > contrib/tools/$(DEPDIR)/$(am__dirstamp) +contrib/tools/png-fix-itxt.$(OBJEXT): contrib/tools/$(am__dirstamp) \ + contrib/tools/$(DEPDIR)/$(am__dirstamp) + +png-fix-itxt$(EXEEXT): $(png_fix_itxt_OBJECTS) $(png_fix_itxt_DEPENDENCIES) $(EXTRA_png_fix_itxt_DEPENDENCIES) + @rm -f png-fix-itxt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(png_fix_itxt_OBJECTS) $(png_fix_itxt_LDADD) $(LIBS) +contrib/tools/pngcp.$(OBJEXT): contrib/tools/$(am__dirstamp) \ + contrib/tools/$(DEPDIR)/$(am__dirstamp) + +pngcp$(EXEEXT): $(pngcp_OBJECTS) $(pngcp_DEPENDENCIES) $(EXTRA_pngcp_DEPENDENCIES) + @rm -f pngcp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pngcp_OBJECTS) $(pngcp_LDADD) $(LIBS) +contrib/tools/pngfix.$(OBJEXT): contrib/tools/$(am__dirstamp) \ + contrib/tools/$(DEPDIR)/$(am__dirstamp) + +pngfix$(EXEEXT): $(pngfix_OBJECTS) $(pngfix_DEPENDENCIES) $(EXTRA_pngfix_DEPENDENCIES) + @rm -f pngfix$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pngfix_OBJECTS) $(pngfix_LDADD) $(LIBS) +contrib/libtests/$(am__dirstamp): + @$(MKDIR_P) contrib/libtests + @: > contrib/libtests/$(am__dirstamp) +contrib/libtests/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) contrib/libtests/$(DEPDIR) + @: > contrib/libtests/$(DEPDIR)/$(am__dirstamp) +contrib/libtests/pngimage.$(OBJEXT): contrib/libtests/$(am__dirstamp) \ + contrib/libtests/$(DEPDIR)/$(am__dirstamp) + +pngimage$(EXEEXT): $(pngimage_OBJECTS) $(pngimage_DEPENDENCIES) $(EXTRA_pngimage_DEPENDENCIES) + @rm -f pngimage$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pngimage_OBJECTS) $(pngimage_LDADD) $(LIBS) +contrib/libtests/pngstest.$(OBJEXT): contrib/libtests/$(am__dirstamp) \ + contrib/libtests/$(DEPDIR)/$(am__dirstamp) + +pngstest$(EXEEXT): $(pngstest_OBJECTS) $(pngstest_DEPENDENCIES) $(EXTRA_pngstest_DEPENDENCIES) + @rm -f pngstest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pngstest_OBJECTS) $(pngstest_LDADD) $(LIBS) + +pngtest$(EXEEXT): $(pngtest_OBJECTS) $(pngtest_DEPENDENCIES) $(EXTRA_pngtest_DEPENDENCIES) + @rm -f pngtest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pngtest_OBJECTS) $(pngtest_LDADD) $(LIBS) +contrib/libtests/pngunknown.$(OBJEXT): \ + contrib/libtests/$(am__dirstamp) \ + contrib/libtests/$(DEPDIR)/$(am__dirstamp) + +pngunknown$(EXEEXT): $(pngunknown_OBJECTS) $(pngunknown_DEPENDENCIES) $(EXTRA_pngunknown_DEPENDENCIES) + @rm -f pngunknown$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pngunknown_OBJECTS) $(pngunknown_LDADD) $(LIBS) +contrib/libtests/pngvalid.$(OBJEXT): contrib/libtests/$(am__dirstamp) \ + contrib/libtests/$(DEPDIR)/$(am__dirstamp) + +pngvalid$(EXEEXT): $(pngvalid_OBJECTS) $(pngvalid_DEPENDENCIES) $(EXTRA_pngvalid_DEPENDENCIES) + @rm -f pngvalid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pngvalid_OBJECTS) $(pngvalid_LDADD) $(LIBS) +contrib/libtests/timepng.$(OBJEXT): contrib/libtests/$(am__dirstamp) \ + contrib/libtests/$(DEPDIR)/$(am__dirstamp) + +timepng$(EXEEXT): $(timepng_OBJECTS) $(timepng_DEPENDENCIES) $(EXTRA_timepng_DEPENDENCIES) + @rm -f timepng$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(timepng_OBJECTS) $(timepng_LDADD) $(LIBS) +install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f arm/*.$(OBJEXT) + -rm -f arm/*.lo + -rm -f contrib/libtests/*.$(OBJEXT) + -rm -f contrib/tools/*.$(OBJEXT) + -rm -f intel/*.$(OBJEXT) + -rm -f intel/*.lo + -rm -f mips/*.$(OBJEXT) + -rm -f mips/*.lo + -rm -f powerpc/*.$(OBJEXT) + -rm -f powerpc/*.lo + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/png.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngerror.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngget.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngmem.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngpread.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngread.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngrio.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngrtran.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngrutil.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngset.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngtest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngtrans.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngwio.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngwrite.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngwtran.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngwutil.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/arm_init.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/filter_neon.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/filter_neon_intrinsics.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/palette_neon_intrinsics.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@contrib/libtests/$(DEPDIR)/pngimage.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@contrib/libtests/$(DEPDIR)/pngstest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@contrib/libtests/$(DEPDIR)/pngunknown.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@contrib/libtests/$(DEPDIR)/pngvalid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@contrib/libtests/$(DEPDIR)/timepng.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@contrib/tools/$(DEPDIR)/png-fix-itxt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@contrib/tools/$(DEPDIR)/pngcp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@contrib/tools/$(DEPDIR)/pngfix.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@intel/$(DEPDIR)/filter_sse2_intrinsics.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@intel/$(DEPDIR)/intel_init.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/filter_msa_intrinsics.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/mips_init.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@powerpc/$(DEPDIR)/filter_vsx_intrinsics.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@powerpc/$(DEPDIR)/powerpc_init.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.S.o: +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $< + +.S.obj: +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.S.lo: +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCCAS_TRUE@ $(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LTCPPASCOMPILE) -c -o $@ $< + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf arm/.libs arm/_libs + -rm -rf intel/.libs intel/_libs + -rm -rf mips/.libs mips/_libs + -rm -rf powerpc/.libs powerpc/_libs + +distclean-libtool: + -rm -f libtool config.lt +install-man3: $(dist_man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_man_MANS)'; \ + test -n "$(man3dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.3[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ + done; } + +uninstall-man3: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man3dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.3[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) +install-man5: $(dist_man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_man_MANS)'; \ + test -n "$(man5dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.5[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ + done; } + +uninstall-man5: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man5dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.5[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-nodist_pkgincludeHEADERS: $(nodist_pkginclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(nodist_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ + done + +uninstall-nodist_pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nodist_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: $(check_PROGRAMS) + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +tests/pngtest.log: tests/pngtest + @p='tests/pngtest'; \ + b='tests/pngtest'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngtest-badpngs.log: tests/pngtest-badpngs + @p='tests/pngtest-badpngs'; \ + b='tests/pngtest-badpngs'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngvalid-gamma-16-to-8.log: tests/pngvalid-gamma-16-to-8 + @p='tests/pngvalid-gamma-16-to-8'; \ + b='tests/pngvalid-gamma-16-to-8'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngvalid-gamma-alpha-mode.log: tests/pngvalid-gamma-alpha-mode + @p='tests/pngvalid-gamma-alpha-mode'; \ + b='tests/pngvalid-gamma-alpha-mode'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngvalid-gamma-background.log: tests/pngvalid-gamma-background + @p='tests/pngvalid-gamma-background'; \ + b='tests/pngvalid-gamma-background'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngvalid-gamma-expand16-alpha-mode.log: tests/pngvalid-gamma-expand16-alpha-mode + @p='tests/pngvalid-gamma-expand16-alpha-mode'; \ + b='tests/pngvalid-gamma-expand16-alpha-mode'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngvalid-gamma-expand16-background.log: tests/pngvalid-gamma-expand16-background + @p='tests/pngvalid-gamma-expand16-background'; \ + b='tests/pngvalid-gamma-expand16-background'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngvalid-gamma-expand16-transform.log: tests/pngvalid-gamma-expand16-transform + @p='tests/pngvalid-gamma-expand16-transform'; \ + b='tests/pngvalid-gamma-expand16-transform'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngvalid-gamma-sbit.log: tests/pngvalid-gamma-sbit + @p='tests/pngvalid-gamma-sbit'; \ + b='tests/pngvalid-gamma-sbit'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngvalid-gamma-threshold.log: tests/pngvalid-gamma-threshold + @p='tests/pngvalid-gamma-threshold'; \ + b='tests/pngvalid-gamma-threshold'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngvalid-gamma-transform.log: tests/pngvalid-gamma-transform + @p='tests/pngvalid-gamma-transform'; \ + b='tests/pngvalid-gamma-transform'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngvalid-progressive-size.log: tests/pngvalid-progressive-size + @p='tests/pngvalid-progressive-size'; \ + b='tests/pngvalid-progressive-size'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngvalid-progressive-interlace-standard.log: tests/pngvalid-progressive-interlace-standard + @p='tests/pngvalid-progressive-interlace-standard'; \ + b='tests/pngvalid-progressive-interlace-standard'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngvalid-transform.log: tests/pngvalid-transform + @p='tests/pngvalid-transform'; \ + b='tests/pngvalid-transform'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngvalid-progressive-standard.log: tests/pngvalid-progressive-standard + @p='tests/pngvalid-progressive-standard'; \ + b='tests/pngvalid-progressive-standard'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngvalid-standard.log: tests/pngvalid-standard + @p='tests/pngvalid-standard'; \ + b='tests/pngvalid-standard'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngstest-1.8.log: tests/pngstest-1.8 + @p='tests/pngstest-1.8'; \ + b='tests/pngstest-1.8'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngstest-1.8-alpha.log: tests/pngstest-1.8-alpha + @p='tests/pngstest-1.8-alpha'; \ + b='tests/pngstest-1.8-alpha'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngstest-linear.log: tests/pngstest-linear + @p='tests/pngstest-linear'; \ + b='tests/pngstest-linear'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngstest-linear-alpha.log: tests/pngstest-linear-alpha + @p='tests/pngstest-linear-alpha'; \ + b='tests/pngstest-linear-alpha'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngstest-none.log: tests/pngstest-none + @p='tests/pngstest-none'; \ + b='tests/pngstest-none'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngstest-none-alpha.log: tests/pngstest-none-alpha + @p='tests/pngstest-none-alpha'; \ + b='tests/pngstest-none-alpha'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngstest-sRGB.log: tests/pngstest-sRGB + @p='tests/pngstest-sRGB'; \ + b='tests/pngstest-sRGB'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngstest-sRGB-alpha.log: tests/pngstest-sRGB-alpha + @p='tests/pngstest-sRGB-alpha'; \ + b='tests/pngstest-sRGB-alpha'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngunknown-IDAT.log: tests/pngunknown-IDAT + @p='tests/pngunknown-IDAT'; \ + b='tests/pngunknown-IDAT'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngunknown-discard.log: tests/pngunknown-discard + @p='tests/pngunknown-discard'; \ + b='tests/pngunknown-discard'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngunknown-if-safe.log: tests/pngunknown-if-safe + @p='tests/pngunknown-if-safe'; \ + b='tests/pngunknown-if-safe'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngunknown-sAPI.log: tests/pngunknown-sAPI + @p='tests/pngunknown-sAPI'; \ + b='tests/pngunknown-sAPI'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngunknown-sTER.log: tests/pngunknown-sTER + @p='tests/pngunknown-sTER'; \ + b='tests/pngunknown-sTER'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngunknown-save.log: tests/pngunknown-save + @p='tests/pngunknown-save'; \ + b='tests/pngunknown-save'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngunknown-vpAg.log: tests/pngunknown-vpAg + @p='tests/pngunknown-vpAg'; \ + b='tests/pngunknown-vpAg'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngimage-quick.log: tests/pngimage-quick + @p='tests/pngimage-quick'; \ + b='tests/pngimage-quick'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/pngimage-full.log: tests/pngimage-full + @p='tests/pngimage-full'; \ + b='tests/pngimage-full'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(MANS) $(DATA) \ + $(HEADERS) config.h +install-binPROGRAMS: install-libLTLIBRARIES + +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)" "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f arm/$(DEPDIR)/$(am__dirstamp) + -rm -f arm/$(am__dirstamp) + -rm -f contrib/libtests/$(DEPDIR)/$(am__dirstamp) + -rm -f contrib/libtests/$(am__dirstamp) + -rm -f contrib/tools/$(DEPDIR)/$(am__dirstamp) + -rm -f contrib/tools/$(am__dirstamp) + -rm -f intel/$(DEPDIR)/$(am__dirstamp) + -rm -f intel/$(am__dirstamp) + -rm -f mips/$(DEPDIR)/$(am__dirstamp) + -rm -f mips/$(am__dirstamp) + -rm -f powerpc/$(DEPDIR)/$(am__dirstamp) + -rm -f powerpc/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +@DO_INSTALL_LIBPNG_CONFIG_FALSE@@DO_INSTALL_LINKS_FALSE@install-exec-hook: +@DO_INSTALL_LIBPNG_PC_FALSE@@DO_INSTALL_LINKS_FALSE@install-data-hook: +@DO_INSTALL_LIBPNG_CONFIG_FALSE@@DO_INSTALL_LIBPNG_PC_FALSE@@DO_INSTALL_LINKS_FALSE@uninstall-hook: +clean: clean-am + +clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ + clean-libLTLIBRARIES clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f ./$(DEPDIR)/png.Plo + -rm -f ./$(DEPDIR)/pngerror.Plo + -rm -f ./$(DEPDIR)/pngget.Plo + -rm -f ./$(DEPDIR)/pngmem.Plo + -rm -f ./$(DEPDIR)/pngpread.Plo + -rm -f ./$(DEPDIR)/pngread.Plo + -rm -f ./$(DEPDIR)/pngrio.Plo + -rm -f ./$(DEPDIR)/pngrtran.Plo + -rm -f ./$(DEPDIR)/pngrutil.Plo + -rm -f ./$(DEPDIR)/pngset.Plo + -rm -f ./$(DEPDIR)/pngtest.Po + -rm -f ./$(DEPDIR)/pngtrans.Plo + -rm -f ./$(DEPDIR)/pngwio.Plo + -rm -f ./$(DEPDIR)/pngwrite.Plo + -rm -f ./$(DEPDIR)/pngwtran.Plo + -rm -f ./$(DEPDIR)/pngwutil.Plo + -rm -f arm/$(DEPDIR)/arm_init.Plo + -rm -f arm/$(DEPDIR)/filter_neon.Plo + -rm -f arm/$(DEPDIR)/filter_neon_intrinsics.Plo + -rm -f arm/$(DEPDIR)/palette_neon_intrinsics.Plo + -rm -f contrib/libtests/$(DEPDIR)/pngimage.Po + -rm -f contrib/libtests/$(DEPDIR)/pngstest.Po + -rm -f contrib/libtests/$(DEPDIR)/pngunknown.Po + -rm -f contrib/libtests/$(DEPDIR)/pngvalid.Po + -rm -f contrib/libtests/$(DEPDIR)/timepng.Po + -rm -f contrib/tools/$(DEPDIR)/png-fix-itxt.Po + -rm -f contrib/tools/$(DEPDIR)/pngcp.Po + -rm -f contrib/tools/$(DEPDIR)/pngfix.Po + -rm -f intel/$(DEPDIR)/filter_sse2_intrinsics.Plo + -rm -f intel/$(DEPDIR)/intel_init.Plo + -rm -f mips/$(DEPDIR)/filter_msa_intrinsics.Plo + -rm -f mips/$(DEPDIR)/mips_init.Plo + -rm -f powerpc/$(DEPDIR)/filter_vsx_intrinsics.Plo + -rm -f powerpc/$(DEPDIR)/powerpc_init.Plo + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man install-nodist_pkgincludeHEADERS \ + install-pkgconfigDATA install-pkgincludeHEADERS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS install-binSCRIPTS \ + install-libLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man3 install-man5 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f ./$(DEPDIR)/png.Plo + -rm -f ./$(DEPDIR)/pngerror.Plo + -rm -f ./$(DEPDIR)/pngget.Plo + -rm -f ./$(DEPDIR)/pngmem.Plo + -rm -f ./$(DEPDIR)/pngpread.Plo + -rm -f ./$(DEPDIR)/pngread.Plo + -rm -f ./$(DEPDIR)/pngrio.Plo + -rm -f ./$(DEPDIR)/pngrtran.Plo + -rm -f ./$(DEPDIR)/pngrutil.Plo + -rm -f ./$(DEPDIR)/pngset.Plo + -rm -f ./$(DEPDIR)/pngtest.Po + -rm -f ./$(DEPDIR)/pngtrans.Plo + -rm -f ./$(DEPDIR)/pngwio.Plo + -rm -f ./$(DEPDIR)/pngwrite.Plo + -rm -f ./$(DEPDIR)/pngwtran.Plo + -rm -f ./$(DEPDIR)/pngwutil.Plo + -rm -f arm/$(DEPDIR)/arm_init.Plo + -rm -f arm/$(DEPDIR)/filter_neon.Plo + -rm -f arm/$(DEPDIR)/filter_neon_intrinsics.Plo + -rm -f arm/$(DEPDIR)/palette_neon_intrinsics.Plo + -rm -f contrib/libtests/$(DEPDIR)/pngimage.Po + -rm -f contrib/libtests/$(DEPDIR)/pngstest.Po + -rm -f contrib/libtests/$(DEPDIR)/pngunknown.Po + -rm -f contrib/libtests/$(DEPDIR)/pngvalid.Po + -rm -f contrib/libtests/$(DEPDIR)/timepng.Po + -rm -f contrib/tools/$(DEPDIR)/png-fix-itxt.Po + -rm -f contrib/tools/$(DEPDIR)/pngcp.Po + -rm -f contrib/tools/$(DEPDIR)/pngfix.Po + -rm -f intel/$(DEPDIR)/filter_sse2_intrinsics.Plo + -rm -f intel/$(DEPDIR)/intel_init.Plo + -rm -f mips/$(DEPDIR)/filter_msa_intrinsics.Plo + -rm -f mips/$(DEPDIR)/mips_init.Plo + -rm -f powerpc/$(DEPDIR)/filter_vsx_intrinsics.Plo + -rm -f powerpc/$(DEPDIR)/powerpc_init.Plo + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ + uninstall-libLTLIBRARIES uninstall-man \ + uninstall-nodist_pkgincludeHEADERS uninstall-pkgconfigDATA \ + uninstall-pkgincludeHEADERS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook +uninstall-man: uninstall-man3 uninstall-man5 + +.MAKE: all check check-am install install-am install-data-am \ + install-exec-am install-strip uninstall-am + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \ + check-TESTS check-am clean clean-binPROGRAMS \ + clean-checkPROGRAMS clean-cscope clean-generic \ + clean-libLTLIBRARIES clean-libtool cscope cscopelist-am ctags \ + ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \ + dist-lzip dist-shar dist-tarZ dist-xz dist-zip distcheck \ + distclean distclean-compile distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-binSCRIPTS \ + install-data install-data-am install-data-hook install-dvi \ + install-dvi-am install-exec install-exec-am install-exec-hook \ + install-html install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-man3 install-man5 \ + install-nodist_pkgincludeHEADERS install-pdf install-pdf-am \ + install-pkgconfigDATA install-pkgincludeHEADERS install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am recheck tags tags-am \ + uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-binSCRIPTS uninstall-hook uninstall-libLTLIBRARIES \ + uninstall-man uninstall-man3 uninstall-man5 \ + uninstall-nodist_pkgincludeHEADERS uninstall-pkgconfigDATA \ + uninstall-pkgincludeHEADERS + +.PRECIOUS: Makefile + + +$(PNGLIB_BASENAME).pc: libpng.pc + cp libpng.pc $@ + +$(PNGLIB_BASENAME)-config: libpng-config + cp libpng-config $@ + +scripts/sym.out scripts/vers.out: png.h pngconf.h pnglibconf.h +scripts/prefix.out: png.h pngconf.h pnglibconf.out +scripts/symbols.out: png.h pngconf.h $(srcdir)/scripts/pnglibconf.h.prebuilt +scripts/intprefix.out: pnglibconf.h + +libpng.sym: scripts/sym.out + rm -f $@ + cp $? $@ +libpng.vers: scripts/vers.out + rm -f $@ + cp $? $@ + +# Rename functions in scripts/prefix.out with a PNG_PREFIX prefix. +# Rename macros in scripts/macro.lst from PNG_PREFIXpng_ to PNG_ (the actual +# implementation of the macro). +@DO_PNG_PREFIX_TRUE@pnglibconf.h: pnglibconf.out scripts/prefix.out scripts/macro.lst +@DO_PNG_PREFIX_TRUE@ rm -f $@ +@DO_PNG_PREFIX_TRUE@ $(AWK) 's==0 && NR>1{print prev}\ +@DO_PNG_PREFIX_TRUE@ s==0{prev=$$0}\ +@DO_PNG_PREFIX_TRUE@ s==1{print "#define", $$1, "@PNG_PREFIX@" $$1}\ +@DO_PNG_PREFIX_TRUE@ s==2{print "#define @PNG_PREFIX@png_" $$1, "PNG_" $$1}\ +@DO_PNG_PREFIX_TRUE@ END{print prev}' s=0 pnglibconf.out s=1 scripts/prefix.out\ +@DO_PNG_PREFIX_TRUE@ s=2 ${srcdir}/scripts/macro.lst >pnglibconf.tf8 +@DO_PNG_PREFIX_TRUE@ mv pnglibconf.tf8 $@ + +@DO_PNG_PREFIX_TRUE@pngprefix.h: scripts/intprefix.out +@DO_PNG_PREFIX_TRUE@ rm -f pngprefix.tf1 +@DO_PNG_PREFIX_TRUE@ $(AWK) '{print "#define", $$1, "@PNG_PREFIX@" $$1}' $? >pngprefix.tf1 +@DO_PNG_PREFIX_TRUE@ mv pngprefix.tf1 $@ +@DO_PNG_PREFIX_FALSE@pnglibconf.h: pnglibconf.out +@DO_PNG_PREFIX_FALSE@ rm -f $@ +@DO_PNG_PREFIX_FALSE@ cp $? $@ + +@DO_PNG_PREFIX_FALSE@pngprefix.h: # is empty +@DO_PNG_PREFIX_FALSE@ :>$@ + +$(srcdir)/scripts/pnglibconf.h.prebuilt: + @echo "Attempting to build $@" >&2 + @echo "This is a machine generated file, but if you want to make" >&2 + @echo "a new one simply make 'scripts/pnglibconf.out', copy that" >&2 + @echo "AND set PNG_ZLIB_VERNUM to 0 (you MUST do this)" >&2 + @exit 1 + +# The following is necessary to ensure that the local pnglibconf.h is used, not +# an installed one (this can happen immediately after on a clean system if +# 'make test' is the first thing the user does.) Only files which include +# one of the png source files (typically png.h or pngpriv.h) need to be listed +# here: +pngtest.o: pnglibconf.h + +contrib/libtests/makepng.o: pnglibconf.h +contrib/libtests/pngstest.o: pnglibconf.h +contrib/libtests/pngunknown.o: pnglibconf.h +contrib/libtests/pngimage.o: pnglibconf.h +contrib/libtests/pngvalid.o: pnglibconf.h +contrib/libtests/readpng.o: pnglibconf.h +contrib/libtests/tarith.o: pnglibconf.h +contrib/libtests/timepng.o: pnglibconf.h + +contrib/tools/makesRGB.o: pnglibconf.h +contrib/tools/pngfix.o: pnglibconf.h +contrib/tools/pngcp.o: pnglibconf.h + +.c.out: + rm -f $@ $*.tf[12] + test -d scripts || mkdir scripts || test -d scripts + $(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)\ + $(CPPFLAGS) $(SYMBOL_CFLAGS) $< > $*.tf1 + $(AWK) -f "${srcdir}/scripts/dfn.awk" out="$*.tf2" $*.tf1 1>&2 + rm -f $*.tf1 + mv $*.tf2 $@ + +# The .c file for pnglibconf.h is machine generated +pnglibconf.c: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA) + rm -f $@ $*.tf[45] + $(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf4 version=search\ + ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\ + ${srcdir}/pngusr.dfa $(DFA_XTRA) 1>&2 + $(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf5 $*.tf4 1>&2 + rm $*.tf4 + mv $*.tf5 $@ + +# Symbol checks (.def and .out files should match) +scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.out + +.out.chk: + rm -f $@ $*.new + $(AWK) -f ${srcdir}/scripts/checksym.awk ${srcdir}/scripts/${*F}.def\ + of="$*.new" $< >&2 + mv $*.new $@ + +# used on demand to regenerate the standard header, CPPFLAGS should +# be empty - no non-standard defines +scripts/pnglibconf.c: scripts/pnglibconf.dfa scripts/options.awk pngconf.h + rm -f $@ pnglibconf.tf[67] + test -z "$(CPPFLAGS)" + echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\ + $(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf6\ + logunsupported=1 version=search ${srcdir}/pngconf.h -\ + ${srcdir}/scripts/pnglibconf.dfa 1>&2 + $(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf7\ + pnglibconf.tf6 1>&2 + rm pnglibconf.tf6 + mv pnglibconf.tf7 $@ + +$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS): png.h pngconf.h \ + pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h pngprefix.h + +test: check-am + +# Extra checks +check: scripts/symbols.chk + +# Don't distribute the generated script files +dist-hook: + cd '$(top_distdir)'; rm -f $(SCRIPT_CLEANFILES) + +# Make links between installed files with release-specific names and the generic +# file names. If this install rule is run the generic names will be deleted and +# recreated - this has obvious issues for systems with multiple installations. + +install-header-links: + @set -ex; cd '$(DESTDIR)$(includedir)'; for f in $(HEADERS); do \ + rm -f "$$f"; $(LN_S) "$(PNGLIB_BASENAME)/$$f" "$$f"; done + +uninstall-header-links: + cd '$(DESTDIR)$(includedir)'; rm -f $(HEADERS) + +install-libpng-pc: + @set -ex; cd '$(DESTDIR)$(pkgconfigdir)'; rm -f libpng.pc; \ + $(LN_S) '$(PNGLIB_BASENAME).pc' libpng.pc + +uninstall-libpng-pc: + rm -f '$(DESTDIR)$(pkgconfigdir)/libpng.pc' + +install-library-links: + @set -x; cd '$(DESTDIR)$(libdir)';\ + for ext in $(EXT_LIST); do\ + rm -f "libpng.$$ext";\ + if test -f "$(PNGLIB_BASENAME).$$ext"; then\ + $(LN_S) "$(PNGLIB_BASENAME).$$ext" "libpng.$$ext" || exit 1;\ + fi;\ + done + +uninstall-library-links: + @set -x; cd '$(DESTDIR)$(libdir)'; for ext in $(EXT_LIST); do\ + rm -f "libpng.$$ext"; done + +install-libpng-config: + @set -ex; cd '$(DESTDIR)$(bindir)'; rm -f libpng-config; \ + $(LN_S) '$(PNGLIB_BASENAME)-config' libpng-config + +uninstall-libpng-config: + rm -f '$(DESTDIR)$(bindir)/libpng-config' + +# If --enable-unversioned-links is specified the header and lib file links +# will be automatically made on a 'make install': + +@DO_INSTALL_LINKS_TRUE@install-data-hook: install-header-links +@DO_INSTALL_LINKS_TRUE@uninstall-hook: uninstall-header-links +@DO_INSTALL_LINKS_TRUE@install-exec-hook: install-library-links +@DO_INSTALL_LINKS_TRUE@uninstall-hook: uninstall-library-links + +# Likewise, --install-pc causes libpng.pc to be constructed: + +@DO_INSTALL_LIBPNG_PC_TRUE@install-data-hook: install-libpng-pc +@DO_INSTALL_LIBPNG_PC_TRUE@uninstall-hook: uninstall-libpng-pc + +# And --install-config: + +@DO_INSTALL_LIBPNG_CONFIG_TRUE@install-exec-hook: install-libpng-config +@DO_INSTALL_LIBPNG_CONFIG_TRUE@uninstall-hook: uninstall-libpng-config + +# The following addition ensures that 'make all' always builds the test programs +# too. It used to, but some change either in libpng or configure stopped this +# working. +all-am: $(check_PROGRAMS) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Engine/lib/lpng/README b/Engine/lib/lpng/README index 0da5a5ef8..cfc1f0e3d 100644 --- a/Engine/lib/lpng/README +++ b/Engine/lib/lpng/README @@ -1,15 +1,16 @@ -README for libpng version 1.6.34 - September 29, 2017 (shared library 16.0) -See the note about version numbers near the top of png.h +README for libpng version 1.6.37 - April 14, 2019 +================================================= +See the note about version numbers near the top of png.h. See INSTALL for instructions on how to install libpng. Libpng comes in several distribution formats. Get libpng-*.tar.gz or -libpng-*.tar.xz or if you want UNIX-style line endings in the text files, -or lpng*.7z or lpng*.zip if you want DOS-style line endings. +libpng-*.tar.xz or if you want UNIX-style line endings in the text +files, or lpng*.7z or lpng*.zip if you want DOS-style line endings. Version 0.89 was the first official release of libpng. Don't let the -fact that it's the first release fool you. The libpng library has been in -extensive use and testing since mid-1995. By late 1997 it had +fact that it's the first release fool you. The libpng library has been +in extensive use and testing since mid-1995. By late 1997 it had finally gotten to the stage where there hadn't been significant changes to the API in some time, and people have a bad feeling about libraries with versions < 1.0. Version 1.0.0 was released in @@ -60,94 +61,59 @@ the library action on the detection of chunk CRC errors. It is possible to set different actions based on whether the CRC error occurred in a critical or an ancillary chunk. -The changes made to the library, and bugs fixed are based on discussions -on the PNG-implement mailing list and not on material submitted -privately to Guy, Andreas, or Glenn. They will forward any good -suggestions to the list. - -For a detailed description on using libpng, read libpng-manual.txt. For -examples of libpng in a program, see example.c and pngtest.c. For usage -information and restrictions (what little they are) on libpng, see -png.h. For a description on using zlib (the compression library used by -libpng) and zlib's restrictions, see zlib.h +For a detailed description on using libpng, read libpng-manual.txt. +For examples of libpng in a program, see example.c and pngtest.c. For +usage information and restrictions (what little they are) on libpng, +see png.h. For a description on using zlib (the compression library +used by libpng) and zlib's restrictions, see zlib.h I have included a general makefile, as well as several machine and -compiler specific ones, but you may have to modify one for your own needs. +compiler specific ones, but you may have to modify one for your own +needs. You should use zlib 1.0.4 or later to run this, but it MAY work with versions as old as zlib 0.95. Even so, there are bugs in older zlib versions which can cause the output of invalid compression streams for -some images. You will definitely need zlib 1.0.4 or later if you are -taking advantage of the MS-DOS "far" structure allocation for the small -and medium memory models. You should also note that zlib is a -compression library that is useful for more things than just PNG files. -You can use zlib as a drop-in replacement for fread() and fwrite() if -you are so inclined. +some images. -zlib should be available at the same place that libpng is, or at zlib.net. +You should also note that zlib is a compression library that is useful +for more things than just PNG files. You can use zlib as a drop-in +replacement for fread() and fwrite(), if you are so inclined. + +zlib should be available at the same place that libpng is, or at +https://zlib.net. You may also want a copy of the PNG specification. It is available as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find these at http://www.libpng.org/pub/png/pngdocs.html . This code is currently being archived at libpng.sourceforge.io in the -[DOWNLOAD] area, and at http://libpng.download/src . If you -can't find it in any of those places, e-mail me, and I'll help you find it. +[DOWNLOAD] area, and at http://libpng.download/src . -I am not a lawyer, but I believe that the Export Control Classification -Number (ECCN) for libpng is EAR99, which means not subject to export -controls or International Traffic in Arms Regulations (ITAR) because it -is open source, publicly available software, that does not contain any -encryption software. See the EAR, paragraphs 734.3(b)(3) and 734.7(b). - -If you have any code changes, requests, problems, etc., please e-mail -them to me. Also, I'd appreciate any make files or project files, -and any modifications you needed to make to get libpng to compile, -along with a #define variable to tell what compiler/system you are on. -If you needed to add transformations to libpng, or wish libpng would -provide the image in a different way, drop me a note (and code, if -possible), so I can consider supporting the transformation. -Finally, if you get any warning messages when compiling libpng -(note: not zlib), and they are easy to fix, I'd appreciate the -fix. Please mention "libpng" somewhere in the subject line. Thanks. - -This release was created and will be supported by myself (of course -based in a large way on Guy's and Andreas' earlier work), and the PNG +This release, based in a large way on Glenn's, Guy's and Andreas' +earlier work, was created and will be supported by myself and the PNG development group. Send comments/corrections/commendations to png-mng-implement at lists.sourceforge.net (subscription required; visit https://lists.sourceforge.net/lists/listinfo/png-mng-implement -to subscribe) or to glennrp at users.sourceforge.net +to subscribe). -You can't reach Guy, the original libpng author, at the addresses -given in previous versions of this document. He and Andreas will -read mail addressed to the png-implement list, however. - -Please do not send general questions about PNG. Send them to -png-mng-misc at lists.sf.net (subscription required; visit +Send general questions about the PNG specification to png-mng-misc +at lists.sourceforge.net (subscription required; visit https://lists.sourceforge.net/lists/listinfo/png-mng-misc to -subscribe). If you have a question about something -in the PNG specification that is related to using libpng, send it -to me. Send me any questions that start with "I was using libpng, -and ...". If in doubt, send questions to me. I'll bounce them -to others, if necessary. - -Please do not send suggestions on how to change PNG. We have -been discussing PNG for twenty years now, and it is official and -finished. If you have suggestions for libpng, however, I'll -gladly listen. Even if your suggestion is not used immediately, -it may be used later. +subscribe). Files in this distribution: ANNOUNCE => Announcement of this version, with recent changes + AUTHORS => List of contributing authors CHANGES => Description of changes between libpng versions KNOWNBUG => List of known bugs and deficiencies LICENSE => License to use and redistribute libpng README => This file TODO => Things not implemented in the current library - Y2KINFO => Statement of Y2K compliance + TRADEMARK => Trademark information example.c => Example code for using libpng functions libpng.3 => manual page for libpng (includes libpng-manual.txt) libpng-manual.txt => Description of libpng and its functions @@ -208,15 +174,10 @@ Files in this distribution: scripts => Directory containing scripts for building libpng: (see scripts/README.txt for the list of scripts) -Good luck, and happy coding. +Good luck, and happy coding! --Glenn Randers-Pehrson (current maintainer, since 1998) - Internet: glennrp at users.sourceforge.net - --Andreas Eric Dilger (former maintainer, 1996-1997) - Internet: adilger at enel.ucalgary.ca - Web: http://www-mddsp.enel.ucalgary.ca/People/adilger/ - --Guy Eric Schalnat (original author and former maintainer, 1995-1996) - (formerly of Group 42, Inc) - Internet: gschal at infinet.com + * Cosmin Truta (current maintainer, since 2018) + * Glenn Randers-Pehrson (former maintainer, 1998-2018) + * Andreas Eric Dilger (former maintainer, 1996-1997) + * Guy Eric Schalnat (original author and former maintainer, 1995-1996) + (formerly of Group 42, Inc.) diff --git a/Engine/lib/lpng/TODO b/Engine/lib/lpng/TODO index 36d6092a2..562dab069 100644 --- a/Engine/lib/lpng/TODO +++ b/Engine/lib/lpng/TODO @@ -1,30 +1,23 @@ -/* TODO - list of things to do for libpng: -Final bug fixes. -Better C++ wrapper/full C++ implementation? -Fix problem with C++ and EXTERN "C". -cHRM transformation. -Remove setjmp/longjmp usage in favor of returning error codes. As a start on - this, minimize the use of png_error(), replacing them with - png_warning(); return(0); or similar. -Palette creation. -Add "grayscale->palette" transformation and "palette->grayscale" detection. -Improved dithering. -Multi-lingual error and warning message support. -Complete sRGB transformation (presently it simply uses gamma=0.45455). -Man pages for function calls. -Better documentation. -Better filter selection - (counting huffman bits/precompression? filter inertia? filter costs?). -Histogram creation. -Text conversion between different code pages (Latin-1 -> Mac and DOS). -Avoid building gamma tables whenever possible. -Use greater precision when changing to linear gamma for compositing against - background and doing rgb-to-gray transformation. -Investigate pre-incremented loop counters and other loop constructions. -Add interpolated method of handling interlacing. -Extend pngvalid.c to validate more of the libpng transformations. -Refactor preprocessor conditionals to compile entire statements - -*/ +* Fix all defects (duh!) +* Better C++ wrapper / full C++ implementation (?) +* Fix the problems with C++ and 'extern "C"'. +* cHRM transformation. +* Palette creation. +* "grayscale->palette" transformation and "palette->grayscale" detection. +* Improved dithering. +* Multi-lingual error and warning message support. +* Complete sRGB transformation. (Currently it simply uses gamma=0.45455.) +* Man pages for function calls. +* Better documentation. +* Better filter selection + (e.g., counting huffman bits/precompression; filter inertia; filter costs). +* Histogram creation. +* Text conversion between different code pages (e.g., Latin-1 -> Mac). +* Avoid building gamma tables whenever possible. +* Greater precision in changing to linear gamma for compositing against + background, and in doing rgb-to-gray transformations. +* Investigate pre-incremented loop counters and other loop constructions. +* Interpolated method of handling interlacing. +* More validations for libpng transformations. diff --git a/Engine/lib/lpng/TRADEMARK b/Engine/lib/lpng/TRADEMARK new file mode 100644 index 000000000..ac667187d --- /dev/null +++ b/Engine/lib/lpng/TRADEMARK @@ -0,0 +1,8 @@ +TRADEMARK +========= + +The name "libpng" has not been registered by the Copyright owners +as a trademark in any jurisdiction. However, because libpng has +been distributed and maintained world-wide, continually since 1995, +the Copyright owners claim "common-law trademark protection" in any +jurisdiction where common-law trademark is recognized. diff --git a/Engine/lib/lpng/aclocal.m4 b/Engine/lib/lpng/aclocal.m4 new file mode 100644 index 000000000..bc18c34f0 --- /dev/null +++ b/Engine/lib/lpng/aclocal.m4 @@ -0,0 +1,1196 @@ +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.16' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.16.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.16.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# Figure out how to run the assembler. -*- Autoconf -*- + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_AS +# ---------- +AC_DEFUN([AM_PROG_AS], +[# By default we simply use the C compiler to build assembly code. +AC_REQUIRE([AC_PROG_CC]) +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS +AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) +AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl +]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. +AC_DEFUN([AM_MAKE_INCLUDE], +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([scripts/libtool.m4]) +m4_include([scripts/ltoptions.m4]) +m4_include([scripts/ltsugar.m4]) +m4_include([scripts/ltversion.m4]) +m4_include([scripts/lt~obsolete.m4]) diff --git a/Engine/lib/lpng/arm/arm_init.c b/Engine/lib/lpng/arm/arm_init.c new file mode 100644 index 000000000..a34ecdbef --- /dev/null +++ b/Engine/lib/lpng/arm/arm_init.c @@ -0,0 +1,136 @@ + +/* arm_init.c - NEON optimised filter functions + * + * Copyright (c) 2018 Cosmin Truta + * Copyright (c) 2014,2016 Glenn Randers-Pehrson + * Written by Mans Rullgard, 2011. + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are + * called. + */ +#define _POSIX_SOURCE 1 + +#include "../pngpriv.h" + +#ifdef PNG_READ_SUPPORTED + +#if PNG_ARM_NEON_OPT > 0 +#ifdef PNG_ARM_NEON_CHECK_SUPPORTED /* Do run-time checks */ +/* WARNING: it is strongly recommended that you do not build libpng with + * run-time checks for CPU features if at all possible. In the case of the ARM + * NEON instructions there is no processor-specific way of detecting the + * presence of the required support, therefore run-time detection is extremely + * OS specific. + * + * You may set the macro PNG_ARM_NEON_FILE to the file name of file containing + * a fragment of C source code which defines the png_have_neon function. There + * are a number of implementations in contrib/arm-neon, but the only one that + * has partial support is contrib/arm-neon/linux.c - a generic Linux + * implementation which reads /proc/cpufino. + */ +#ifndef PNG_ARM_NEON_FILE +# ifdef __linux__ +# define PNG_ARM_NEON_FILE "contrib/arm-neon/linux.c" +# endif +#endif + +#ifdef PNG_ARM_NEON_FILE + +#include /* for sig_atomic_t */ +static int png_have_neon(png_structp png_ptr); +#include PNG_ARM_NEON_FILE + +#else /* PNG_ARM_NEON_FILE */ +# error "PNG_ARM_NEON_FILE undefined: no support for run-time ARM NEON checks" +#endif /* PNG_ARM_NEON_FILE */ +#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */ + +#ifndef PNG_ALIGNED_MEMORY_SUPPORTED +# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED" +#endif + +void +png_init_filter_functions_neon(png_structp pp, unsigned int bpp) +{ + /* The switch statement is compiled in for ARM_NEON_API, the call to + * png_have_neon is compiled in for ARM_NEON_CHECK. If both are defined + * the check is only performed if the API has not set the NEON option on + * or off explicitly. In this case the check controls what happens. + * + * If the CHECK is not compiled in and the option is UNSET the behavior prior + * to 1.6.7 was to use the NEON code - this was a bug caused by having the + * wrong order of the 'ON' and 'default' cases. UNSET now defaults to OFF, + * as documented in png.h + */ + png_debug(1, "in png_init_filter_functions_neon"); +#ifdef PNG_ARM_NEON_API_SUPPORTED + switch ((pp->options >> PNG_ARM_NEON) & 3) + { + case PNG_OPTION_UNSET: + /* Allow the run-time check to execute if it has been enabled - + * thus both API and CHECK can be turned on. If it isn't supported + * this case will fall through to the 'default' below, which just + * returns. + */ +#endif /* PNG_ARM_NEON_API_SUPPORTED */ +#ifdef PNG_ARM_NEON_CHECK_SUPPORTED + { + static volatile sig_atomic_t no_neon = -1; /* not checked */ + + if (no_neon < 0) + no_neon = !png_have_neon(pp); + + if (no_neon) + return; + } +#ifdef PNG_ARM_NEON_API_SUPPORTED + break; +#endif +#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */ + +#ifdef PNG_ARM_NEON_API_SUPPORTED + default: /* OFF or INVALID */ + return; + + case PNG_OPTION_ON: + /* Option turned on */ + break; + } +#endif + + /* IMPORTANT: any new external functions used here must be declared using + * PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the + * 'prefix' option to configure works: + * + * ./configure --with-libpng-prefix=foobar_ + * + * Verify you have got this right by running the above command, doing a build + * and examining pngprefix.h; it must contain a #define for every external + * function you add. (Notice that this happens automatically for the + * initialization function.) + */ + pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_neon; + + if (bpp == 3) + { + pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_neon; + pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_neon; + pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = + png_read_filter_row_paeth3_neon; + } + + else if (bpp == 4) + { + pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_neon; + pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_neon; + pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = + png_read_filter_row_paeth4_neon; + } +} +#endif /* PNG_ARM_NEON_OPT > 0 */ +#endif /* READ */ diff --git a/Engine/lib/lpng/arm/filter_neon.S b/Engine/lib/lpng/arm/filter_neon.S new file mode 100644 index 000000000..2308aad13 --- /dev/null +++ b/Engine/lib/lpng/arm/filter_neon.S @@ -0,0 +1,253 @@ + +/* filter_neon.S - NEON optimised filter functions + * + * Copyright (c) 2018 Cosmin Truta + * Copyright (c) 2014,2017 Glenn Randers-Pehrson + * Written by Mans Rullgard, 2011. + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +/* This is required to get the symbol renames, which are #defines, and the + * definitions (or not) of PNG_ARM_NEON_OPT and PNG_ARM_NEON_IMPLEMENTATION. + */ +#define PNG_VERSION_INFO_ONLY +#include "../pngpriv.h" + +#if (defined(__linux__) || defined(__FreeBSD__)) && defined(__ELF__) +.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */ +#endif + +#ifdef PNG_READ_SUPPORTED + +/* Assembler NEON support - only works for 32-bit ARM (i.e. it does not work for + * ARM64). The code in arm/filter_neon_intrinsics.c supports ARM64, however it + * only works if -mfpu=neon is specified on the GCC command line. See pngpriv.h + * for the logic which sets PNG_USE_ARM_NEON_ASM: + */ +#if PNG_ARM_NEON_IMPLEMENTATION == 2 /* hand-coded assembler */ + +#if PNG_ARM_NEON_OPT > 0 + +#ifdef __ELF__ +# define ELF +#else +# define ELF @ +#endif + + .arch armv7-a + .fpu neon + +.macro func name, export=0 + .macro endfunc +ELF .size \name, . - \name + .endfunc + .purgem endfunc + .endm + .text + + /* Explicitly specifying alignment here because some versions of + * GAS don't align code correctly. This is harmless in correctly + * written versions of GAS. + */ + .align 2 + + .if \export + .global \name + .endif +ELF .type \name, STT_FUNC + .func \name +\name: +.endm + +func png_read_filter_row_sub4_neon, export=1 + ldr r3, [r0, #4] @ rowbytes + vmov.i8 d3, #0 +1: + vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128] + vadd.u8 d0, d3, d4 + vadd.u8 d1, d0, d5 + vadd.u8 d2, d1, d6 + vadd.u8 d3, d2, d7 + vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]! + subs r3, r3, #16 + bgt 1b + + bx lr +endfunc + +func png_read_filter_row_sub3_neon, export=1 + ldr r3, [r0, #4] @ rowbytes + vmov.i8 d3, #0 + mov r0, r1 + mov r2, #3 + mov r12, #12 + vld1.8 {q11}, [r0], r12 +1: + vext.8 d5, d22, d23, #3 + vadd.u8 d0, d3, d22 + vext.8 d6, d22, d23, #6 + vadd.u8 d1, d0, d5 + vext.8 d7, d23, d23, #1 + vld1.8 {q11}, [r0], r12 + vst1.32 {d0[0]}, [r1,:32], r2 + vadd.u8 d2, d1, d6 + vst1.32 {d1[0]}, [r1], r2 + vadd.u8 d3, d2, d7 + vst1.32 {d2[0]}, [r1], r2 + vst1.32 {d3[0]}, [r1], r2 + subs r3, r3, #12 + bgt 1b + + bx lr +endfunc + +func png_read_filter_row_up_neon, export=1 + ldr r3, [r0, #4] @ rowbytes +1: + vld1.8 {q0}, [r1,:128] + vld1.8 {q1}, [r2,:128]! + vadd.u8 q0, q0, q1 + vst1.8 {q0}, [r1,:128]! + subs r3, r3, #16 + bgt 1b + + bx lr +endfunc + +func png_read_filter_row_avg4_neon, export=1 + ldr r12, [r0, #4] @ rowbytes + vmov.i8 d3, #0 +1: + vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128] + vld4.32 {d16[],d17[],d18[],d19[]},[r2,:128]! + vhadd.u8 d0, d3, d16 + vadd.u8 d0, d0, d4 + vhadd.u8 d1, d0, d17 + vadd.u8 d1, d1, d5 + vhadd.u8 d2, d1, d18 + vadd.u8 d2, d2, d6 + vhadd.u8 d3, d2, d19 + vadd.u8 d3, d3, d7 + vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]! + subs r12, r12, #16 + bgt 1b + + bx lr +endfunc + +func png_read_filter_row_avg3_neon, export=1 + push {r4,lr} + ldr r12, [r0, #4] @ rowbytes + vmov.i8 d3, #0 + mov r0, r1 + mov r4, #3 + mov lr, #12 + vld1.8 {q11}, [r0], lr +1: + vld1.8 {q10}, [r2], lr + vext.8 d5, d22, d23, #3 + vhadd.u8 d0, d3, d20 + vext.8 d17, d20, d21, #3 + vadd.u8 d0, d0, d22 + vext.8 d6, d22, d23, #6 + vhadd.u8 d1, d0, d17 + vext.8 d18, d20, d21, #6 + vadd.u8 d1, d1, d5 + vext.8 d7, d23, d23, #1 + vld1.8 {q11}, [r0], lr + vst1.32 {d0[0]}, [r1,:32], r4 + vhadd.u8 d2, d1, d18 + vst1.32 {d1[0]}, [r1], r4 + vext.8 d19, d21, d21, #1 + vadd.u8 d2, d2, d6 + vhadd.u8 d3, d2, d19 + vst1.32 {d2[0]}, [r1], r4 + vadd.u8 d3, d3, d7 + vst1.32 {d3[0]}, [r1], r4 + subs r12, r12, #12 + bgt 1b + + pop {r4,pc} +endfunc + +.macro paeth rx, ra, rb, rc + vaddl.u8 q12, \ra, \rb @ a + b + vaddl.u8 q15, \rc, \rc @ 2*c + vabdl.u8 q13, \rb, \rc @ pa + vabdl.u8 q14, \ra, \rc @ pb + vabd.u16 q15, q12, q15 @ pc + vcle.u16 q12, q13, q14 @ pa <= pb + vcle.u16 q13, q13, q15 @ pa <= pc + vcle.u16 q14, q14, q15 @ pb <= pc + vand q12, q12, q13 @ pa <= pb && pa <= pc + vmovn.u16 d28, q14 + vmovn.u16 \rx, q12 + vbsl d28, \rb, \rc + vbsl \rx, \ra, d28 +.endm + +func png_read_filter_row_paeth4_neon, export=1 + ldr r12, [r0, #4] @ rowbytes + vmov.i8 d3, #0 + vmov.i8 d20, #0 +1: + vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128] + vld4.32 {d16[],d17[],d18[],d19[]},[r2,:128]! + paeth d0, d3, d16, d20 + vadd.u8 d0, d0, d4 + paeth d1, d0, d17, d16 + vadd.u8 d1, d1, d5 + paeth d2, d1, d18, d17 + vadd.u8 d2, d2, d6 + paeth d3, d2, d19, d18 + vmov d20, d19 + vadd.u8 d3, d3, d7 + vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]! + subs r12, r12, #16 + bgt 1b + + bx lr +endfunc + +func png_read_filter_row_paeth3_neon, export=1 + push {r4,lr} + ldr r12, [r0, #4] @ rowbytes + vmov.i8 d3, #0 + vmov.i8 d4, #0 + mov r0, r1 + mov r4, #3 + mov lr, #12 + vld1.8 {q11}, [r0], lr +1: + vld1.8 {q10}, [r2], lr + paeth d0, d3, d20, d4 + vext.8 d5, d22, d23, #3 + vadd.u8 d0, d0, d22 + vext.8 d17, d20, d21, #3 + paeth d1, d0, d17, d20 + vst1.32 {d0[0]}, [r1,:32], r4 + vext.8 d6, d22, d23, #6 + vadd.u8 d1, d1, d5 + vext.8 d18, d20, d21, #6 + paeth d2, d1, d18, d17 + vext.8 d7, d23, d23, #1 + vld1.8 {q11}, [r0], lr + vst1.32 {d1[0]}, [r1], r4 + vadd.u8 d2, d2, d6 + vext.8 d19, d21, d21, #1 + paeth d3, d2, d19, d18 + vst1.32 {d2[0]}, [r1], r4 + vmov d4, d19 + vadd.u8 d3, d3, d7 + vst1.32 {d3[0]}, [r1], r4 + subs r12, r12, #12 + bgt 1b + + pop {r4,pc} +endfunc +#endif /* PNG_ARM_NEON_OPT > 0 */ +#endif /* PNG_ARM_NEON_IMPLEMENTATION == 2 (assembler) */ +#endif /* READ */ diff --git a/Engine/lib/lpng/arm/filter_neon_intrinsics.c b/Engine/lib/lpng/arm/filter_neon_intrinsics.c new file mode 100644 index 000000000..553c0be21 --- /dev/null +++ b/Engine/lib/lpng/arm/filter_neon_intrinsics.c @@ -0,0 +1,402 @@ + +/* filter_neon_intrinsics.c - NEON optimised filter functions + * + * Copyright (c) 2018 Cosmin Truta + * Copyright (c) 2014,2016 Glenn Randers-Pehrson + * Written by James Yu , October 2013. + * Based on filter_neon.S, written by Mans Rullgard, 2011. + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +#include "../pngpriv.h" + +#ifdef PNG_READ_SUPPORTED + +/* This code requires -mfpu=neon on the command line: */ +#if PNG_ARM_NEON_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */ + +#if defined(_MSC_VER) && defined(_M_ARM64) +# include +#else +# include +#endif + +/* libpng row pointers are not necessarily aligned to any particular boundary, + * however this code will only work with appropriate alignment. arm/arm_init.c + * checks for this (and will not compile unless it is done). This code uses + * variants of png_aligncast to avoid compiler warnings. + */ +#define png_ptr(type,pointer) png_aligncast(type *,pointer) +#define png_ptrc(type,pointer) png_aligncastconst(const type *,pointer) + +/* The following relies on a variable 'temp_pointer' being declared with type + * 'type'. This is written this way just to hide the GCC strict aliasing + * warning; note that the code is safe because there never is an alias between + * the input and output pointers. + * + * When compiling with MSVC ARM64, the png_ldr macro can't be passed directly + * to vst4_lane_u32, because of an internal compiler error inside MSVC. + * To avoid this compiler bug, we use a temporary variable (vdest_val) to store + * the result of png_ldr. + */ +#define png_ldr(type,pointer)\ + (temp_pointer = png_ptr(type,pointer), *temp_pointer) + +#if PNG_ARM_NEON_OPT > 0 + +void +png_read_filter_row_up_neon(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) +{ + png_bytep rp = row; + png_bytep rp_stop = row + row_info->rowbytes; + png_const_bytep pp = prev_row; + + png_debug(1, "in png_read_filter_row_up_neon"); + + for (; rp < rp_stop; rp += 16, pp += 16) + { + uint8x16_t qrp, qpp; + + qrp = vld1q_u8(rp); + qpp = vld1q_u8(pp); + qrp = vaddq_u8(qrp, qpp); + vst1q_u8(rp, qrp); + } +} + +void +png_read_filter_row_sub3_neon(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) +{ + png_bytep rp = row; + png_bytep rp_stop = row + row_info->rowbytes; + + uint8x16_t vtmp = vld1q_u8(rp); + uint8x8x2_t *vrpt = png_ptr(uint8x8x2_t, &vtmp); + uint8x8x2_t vrp = *vrpt; + + uint8x8x4_t vdest; + vdest.val[3] = vdup_n_u8(0); + + png_debug(1, "in png_read_filter_row_sub3_neon"); + + for (; rp < rp_stop;) + { + uint8x8_t vtmp1, vtmp2; + uint32x2_t *temp_pointer; + + vtmp1 = vext_u8(vrp.val[0], vrp.val[1], 3); + vdest.val[0] = vadd_u8(vdest.val[3], vrp.val[0]); + vtmp2 = vext_u8(vrp.val[0], vrp.val[1], 6); + vdest.val[1] = vadd_u8(vdest.val[0], vtmp1); + + vtmp1 = vext_u8(vrp.val[1], vrp.val[1], 1); + vdest.val[2] = vadd_u8(vdest.val[1], vtmp2); + vdest.val[3] = vadd_u8(vdest.val[2], vtmp1); + + vtmp = vld1q_u8(rp + 12); + vrpt = png_ptr(uint8x8x2_t, &vtmp); + vrp = *vrpt; + + vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[0]), 0); + rp += 3; + vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[1]), 0); + rp += 3; + vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[2]), 0); + rp += 3; + vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[3]), 0); + rp += 3; + } + + PNG_UNUSED(prev_row) +} + +void +png_read_filter_row_sub4_neon(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) +{ + png_bytep rp = row; + png_bytep rp_stop = row + row_info->rowbytes; + + uint8x8x4_t vdest; + vdest.val[3] = vdup_n_u8(0); + + png_debug(1, "in png_read_filter_row_sub4_neon"); + + for (; rp < rp_stop; rp += 16) + { + uint32x2x4_t vtmp = vld4_u32(png_ptr(uint32_t,rp)); + uint8x8x4_t *vrpt = png_ptr(uint8x8x4_t,&vtmp); + uint8x8x4_t vrp = *vrpt; + uint32x2x4_t *temp_pointer; + uint32x2x4_t vdest_val; + + vdest.val[0] = vadd_u8(vdest.val[3], vrp.val[0]); + vdest.val[1] = vadd_u8(vdest.val[0], vrp.val[1]); + vdest.val[2] = vadd_u8(vdest.val[1], vrp.val[2]); + vdest.val[3] = vadd_u8(vdest.val[2], vrp.val[3]); + + vdest_val = png_ldr(uint32x2x4_t, &vdest); + vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0); + } + + PNG_UNUSED(prev_row) +} + +void +png_read_filter_row_avg3_neon(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) +{ + png_bytep rp = row; + png_const_bytep pp = prev_row; + png_bytep rp_stop = row + row_info->rowbytes; + + uint8x16_t vtmp; + uint8x8x2_t *vrpt; + uint8x8x2_t vrp; + uint8x8x4_t vdest; + vdest.val[3] = vdup_n_u8(0); + + vtmp = vld1q_u8(rp); + vrpt = png_ptr(uint8x8x2_t,&vtmp); + vrp = *vrpt; + + png_debug(1, "in png_read_filter_row_avg3_neon"); + + for (; rp < rp_stop; pp += 12) + { + uint8x8_t vtmp1, vtmp2, vtmp3; + + uint8x8x2_t *vppt; + uint8x8x2_t vpp; + + uint32x2_t *temp_pointer; + + vtmp = vld1q_u8(pp); + vppt = png_ptr(uint8x8x2_t,&vtmp); + vpp = *vppt; + + vtmp1 = vext_u8(vrp.val[0], vrp.val[1], 3); + vdest.val[0] = vhadd_u8(vdest.val[3], vpp.val[0]); + vdest.val[0] = vadd_u8(vdest.val[0], vrp.val[0]); + + vtmp2 = vext_u8(vpp.val[0], vpp.val[1], 3); + vtmp3 = vext_u8(vrp.val[0], vrp.val[1], 6); + vdest.val[1] = vhadd_u8(vdest.val[0], vtmp2); + vdest.val[1] = vadd_u8(vdest.val[1], vtmp1); + + vtmp2 = vext_u8(vpp.val[0], vpp.val[1], 6); + vtmp1 = vext_u8(vrp.val[1], vrp.val[1], 1); + + vtmp = vld1q_u8(rp + 12); + vrpt = png_ptr(uint8x8x2_t,&vtmp); + vrp = *vrpt; + + vdest.val[2] = vhadd_u8(vdest.val[1], vtmp2); + vdest.val[2] = vadd_u8(vdest.val[2], vtmp3); + + vtmp2 = vext_u8(vpp.val[1], vpp.val[1], 1); + + vdest.val[3] = vhadd_u8(vdest.val[2], vtmp2); + vdest.val[3] = vadd_u8(vdest.val[3], vtmp1); + + vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[0]), 0); + rp += 3; + vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[1]), 0); + rp += 3; + vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[2]), 0); + rp += 3; + vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[3]), 0); + rp += 3; + } +} + +void +png_read_filter_row_avg4_neon(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) +{ + png_bytep rp = row; + png_bytep rp_stop = row + row_info->rowbytes; + png_const_bytep pp = prev_row; + + uint8x8x4_t vdest; + vdest.val[3] = vdup_n_u8(0); + + png_debug(1, "in png_read_filter_row_avg4_neon"); + + for (; rp < rp_stop; rp += 16, pp += 16) + { + uint32x2x4_t vtmp; + uint8x8x4_t *vrpt, *vppt; + uint8x8x4_t vrp, vpp; + uint32x2x4_t *temp_pointer; + uint32x2x4_t vdest_val; + + vtmp = vld4_u32(png_ptr(uint32_t,rp)); + vrpt = png_ptr(uint8x8x4_t,&vtmp); + vrp = *vrpt; + vtmp = vld4_u32(png_ptrc(uint32_t,pp)); + vppt = png_ptr(uint8x8x4_t,&vtmp); + vpp = *vppt; + + vdest.val[0] = vhadd_u8(vdest.val[3], vpp.val[0]); + vdest.val[0] = vadd_u8(vdest.val[0], vrp.val[0]); + vdest.val[1] = vhadd_u8(vdest.val[0], vpp.val[1]); + vdest.val[1] = vadd_u8(vdest.val[1], vrp.val[1]); + vdest.val[2] = vhadd_u8(vdest.val[1], vpp.val[2]); + vdest.val[2] = vadd_u8(vdest.val[2], vrp.val[2]); + vdest.val[3] = vhadd_u8(vdest.val[2], vpp.val[3]); + vdest.val[3] = vadd_u8(vdest.val[3], vrp.val[3]); + + vdest_val = png_ldr(uint32x2x4_t, &vdest); + vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0); + } +} + +static uint8x8_t +paeth(uint8x8_t a, uint8x8_t b, uint8x8_t c) +{ + uint8x8_t d, e; + uint16x8_t p1, pa, pb, pc; + + p1 = vaddl_u8(a, b); /* a + b */ + pc = vaddl_u8(c, c); /* c * 2 */ + pa = vabdl_u8(b, c); /* pa */ + pb = vabdl_u8(a, c); /* pb */ + pc = vabdq_u16(p1, pc); /* pc */ + + p1 = vcleq_u16(pa, pb); /* pa <= pb */ + pa = vcleq_u16(pa, pc); /* pa <= pc */ + pb = vcleq_u16(pb, pc); /* pb <= pc */ + + p1 = vandq_u16(p1, pa); /* pa <= pb && pa <= pc */ + + d = vmovn_u16(pb); + e = vmovn_u16(p1); + + d = vbsl_u8(d, b, c); + e = vbsl_u8(e, a, d); + + return e; +} + +void +png_read_filter_row_paeth3_neon(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) +{ + png_bytep rp = row; + png_const_bytep pp = prev_row; + png_bytep rp_stop = row + row_info->rowbytes; + + uint8x16_t vtmp; + uint8x8x2_t *vrpt; + uint8x8x2_t vrp; + uint8x8_t vlast = vdup_n_u8(0); + uint8x8x4_t vdest; + vdest.val[3] = vdup_n_u8(0); + + vtmp = vld1q_u8(rp); + vrpt = png_ptr(uint8x8x2_t,&vtmp); + vrp = *vrpt; + + png_debug(1, "in png_read_filter_row_paeth3_neon"); + + for (; rp < rp_stop; pp += 12) + { + uint8x8x2_t *vppt; + uint8x8x2_t vpp; + uint8x8_t vtmp1, vtmp2, vtmp3; + uint32x2_t *temp_pointer; + + vtmp = vld1q_u8(pp); + vppt = png_ptr(uint8x8x2_t,&vtmp); + vpp = *vppt; + + vdest.val[0] = paeth(vdest.val[3], vpp.val[0], vlast); + vdest.val[0] = vadd_u8(vdest.val[0], vrp.val[0]); + + vtmp1 = vext_u8(vrp.val[0], vrp.val[1], 3); + vtmp2 = vext_u8(vpp.val[0], vpp.val[1], 3); + vdest.val[1] = paeth(vdest.val[0], vtmp2, vpp.val[0]); + vdest.val[1] = vadd_u8(vdest.val[1], vtmp1); + + vtmp1 = vext_u8(vrp.val[0], vrp.val[1], 6); + vtmp3 = vext_u8(vpp.val[0], vpp.val[1], 6); + vdest.val[2] = paeth(vdest.val[1], vtmp3, vtmp2); + vdest.val[2] = vadd_u8(vdest.val[2], vtmp1); + + vtmp1 = vext_u8(vrp.val[1], vrp.val[1], 1); + vtmp2 = vext_u8(vpp.val[1], vpp.val[1], 1); + + vtmp = vld1q_u8(rp + 12); + vrpt = png_ptr(uint8x8x2_t,&vtmp); + vrp = *vrpt; + + vdest.val[3] = paeth(vdest.val[2], vtmp2, vtmp3); + vdest.val[3] = vadd_u8(vdest.val[3], vtmp1); + + vlast = vtmp2; + + vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[0]), 0); + rp += 3; + vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[1]), 0); + rp += 3; + vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[2]), 0); + rp += 3; + vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[3]), 0); + rp += 3; + } +} + +void +png_read_filter_row_paeth4_neon(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) +{ + png_bytep rp = row; + png_bytep rp_stop = row + row_info->rowbytes; + png_const_bytep pp = prev_row; + + uint8x8_t vlast = vdup_n_u8(0); + uint8x8x4_t vdest; + vdest.val[3] = vdup_n_u8(0); + + png_debug(1, "in png_read_filter_row_paeth4_neon"); + + for (; rp < rp_stop; rp += 16, pp += 16) + { + uint32x2x4_t vtmp; + uint8x8x4_t *vrpt, *vppt; + uint8x8x4_t vrp, vpp; + uint32x2x4_t *temp_pointer; + uint32x2x4_t vdest_val; + + vtmp = vld4_u32(png_ptr(uint32_t,rp)); + vrpt = png_ptr(uint8x8x4_t,&vtmp); + vrp = *vrpt; + vtmp = vld4_u32(png_ptrc(uint32_t,pp)); + vppt = png_ptr(uint8x8x4_t,&vtmp); + vpp = *vppt; + + vdest.val[0] = paeth(vdest.val[3], vpp.val[0], vlast); + vdest.val[0] = vadd_u8(vdest.val[0], vrp.val[0]); + vdest.val[1] = paeth(vdest.val[0], vpp.val[1], vpp.val[0]); + vdest.val[1] = vadd_u8(vdest.val[1], vrp.val[1]); + vdest.val[2] = paeth(vdest.val[1], vpp.val[2], vpp.val[1]); + vdest.val[2] = vadd_u8(vdest.val[2], vrp.val[2]); + vdest.val[3] = paeth(vdest.val[2], vpp.val[3], vpp.val[2]); + vdest.val[3] = vadd_u8(vdest.val[3], vrp.val[3]); + + vlast = vpp.val[3]; + + vdest_val = png_ldr(uint32x2x4_t, &vdest); + vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0); + } +} + +#endif /* PNG_ARM_NEON_OPT > 0 */ +#endif /* PNG_ARM_NEON_IMPLEMENTATION == 1 (intrinsics) */ +#endif /* READ */ diff --git a/Engine/lib/lpng/arm/palette_neon_intrinsics.c b/Engine/lib/lpng/arm/palette_neon_intrinsics.c new file mode 100644 index 000000000..b4d1fd2ab --- /dev/null +++ b/Engine/lib/lpng/arm/palette_neon_intrinsics.c @@ -0,0 +1,149 @@ + +/* palette_neon_intrinsics.c - NEON optimised palette expansion functions + * + * Copyright (c) 2018-2019 Cosmin Truta + * Copyright (c) 2017-2018 Arm Holdings. All rights reserved. + * Written by Richard Townsend , February 2017. + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +#include "../pngpriv.h" + +#if PNG_ARM_NEON_IMPLEMENTATION == 1 + +#if defined(_MSC_VER) && defined(_M_ARM64) +# include +#else +# include +#endif + +/* Build an RGBA8 palette from the separate RGB and alpha palettes. */ +void +png_riffle_palette_neon(png_structrp png_ptr) +{ + png_const_colorp palette = png_ptr->palette; + png_bytep riffled_palette = png_ptr->riffled_palette; + png_const_bytep trans_alpha = png_ptr->trans_alpha; + int num_trans = png_ptr->num_trans; + int i; + + png_debug(1, "in png_riffle_palette_neon"); + + /* Initially black, opaque. */ + uint8x16x4_t w = {{ + vdupq_n_u8(0x00), + vdupq_n_u8(0x00), + vdupq_n_u8(0x00), + vdupq_n_u8(0xff), + }}; + + /* First, riffle the RGB colours into an RGBA8 palette. + * The alpha component is set to opaque for now. + */ + for (i = 0; i < 256; i += 16) + { + uint8x16x3_t v = vld3q_u8((png_const_bytep)(palette + i)); + w.val[0] = v.val[0]; + w.val[1] = v.val[1]; + w.val[2] = v.val[2]; + vst4q_u8(riffled_palette + (i << 2), w); + } + + /* Fix up the missing transparency values. */ + for (i = 0; i < num_trans; i++) + riffled_palette[(i << 2) + 3] = trans_alpha[i]; +} + +/* Expands a palettized row into RGBA8. */ +int +png_do_expand_palette_rgba8_neon(png_structrp png_ptr, png_row_infop row_info, + png_const_bytep row, png_bytepp ssp, png_bytepp ddp) +{ + png_uint_32 row_width = row_info->width; + const png_uint_32 *riffled_palette = + (const png_uint_32 *)png_ptr->riffled_palette; + const png_int_32 pixels_per_chunk = 4; + int i; + + png_debug(1, "in png_do_expand_palette_rgba8_neon"); + + if (row_width < pixels_per_chunk) + return 0; + + /* This function originally gets the last byte of the output row. + * The NEON part writes forward from a given position, so we have + * to seek this back by 4 pixels x 4 bytes. + */ + *ddp = *ddp - ((pixels_per_chunk * sizeof(png_uint_32)) - 1); + + for (i = 0; i < row_width; i += pixels_per_chunk) + { + uint32x4_t cur; + png_bytep sp = *ssp - i, dp = *ddp - (i << 2); + cur = vld1q_dup_u32 (riffled_palette + *(sp - 3)); + cur = vld1q_lane_u32(riffled_palette + *(sp - 2), cur, 1); + cur = vld1q_lane_u32(riffled_palette + *(sp - 1), cur, 2); + cur = vld1q_lane_u32(riffled_palette + *(sp - 0), cur, 3); + vst1q_u32((void *)dp, cur); + } + if (i != row_width) + { + /* Remove the amount that wasn't processed. */ + i -= pixels_per_chunk; + } + + /* Decrement output pointers. */ + *ssp = *ssp - i; + *ddp = *ddp - (i << 2); + return i; +} + +/* Expands a palettized row into RGB8. */ +int +png_do_expand_palette_rgb8_neon(png_structrp png_ptr, png_row_infop row_info, + png_const_bytep row, png_bytepp ssp, png_bytepp ddp) +{ + png_uint_32 row_width = row_info->width; + png_const_bytep palette = (png_const_bytep)png_ptr->palette; + const png_uint_32 pixels_per_chunk = 8; + int i; + + png_debug(1, "in png_do_expand_palette_rgb8_neon"); + + if (row_width <= pixels_per_chunk) + return 0; + + /* Seeking this back by 8 pixels x 3 bytes. */ + *ddp = *ddp - ((pixels_per_chunk * sizeof(png_color)) - 1); + + for (i = 0; i < row_width; i += pixels_per_chunk) + { + uint8x8x3_t cur; + png_bytep sp = *ssp - i, dp = *ddp - ((i << 1) + i); + cur = vld3_dup_u8(palette + sizeof(png_color) * (*(sp - 7))); + cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 6)), cur, 1); + cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 5)), cur, 2); + cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 4)), cur, 3); + cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 3)), cur, 4); + cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 2)), cur, 5); + cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 1)), cur, 6); + cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 0)), cur, 7); + vst3_u8((void *)dp, cur); + } + + if (i != row_width) + { + /* Remove the amount that wasn't processed. */ + i -= pixels_per_chunk; + } + + /* Decrement output pointers. */ + *ssp = *ssp - i; + *ddp = *ddp - ((i << 1) + i); + return i; +} + +#endif /* PNG_ARM_NEON_IMPLEMENTATION */ diff --git a/Engine/lib/lpng/autogen.sh b/Engine/lib/lpng/autogen.sh new file mode 100755 index 000000000..a46daf65a --- /dev/null +++ b/Engine/lib/lpng/autogen.sh @@ -0,0 +1,225 @@ +#! /bin/sh +# +# Run 'autoreconf' to build 'configure', 'Makefile.in' and other configure +# control files. +# +# The first time this is run on a GIT checkout the only files that exist are +# configure.ac and Makefile.am; all of the autotools support scripts are +# missing. They are instantiated with autoreconf --force --install. +# +# For regular ("tarball") distributions all the files should exist. We do not +# want them to be updated *under any circumstances*. It should never be +# necessary to run autogen.sh because ./configure --enable-maintainer-mode says +# what to do if Makefile.am or configure.ac are changed. +# +# It is *probably* OK to update the files on a GIT checkout, because they have +# come from the local tools, but leave that to the user who is assumed to know +# whether it is ok or required. +# +# This script is intended to work without arguments, there are, however, hidden +# arguments (a) for use while testing the script and (b) to fix up systems that +# have been broken. If (b) is required the script prompts for the correct +# options. For this reason the options are *NOT* documented in the help; this +# is deliberate; UTSL. +# +clean= +maintainer= +while test $# -gt 0 +do + case "$1" in + --maintainer) + maintainer=1;; + + --clean) + clean=1;; + + *) + exec >&2 + echo "$0: usage: ./autogen.sh" + if test -d .git + then + echo " ./autogen.sh generates the configure script and" + echo " Makefile.in, or refreshes them after changes to Makefile.am" + echo " or configure.ac. You may prefer to just run autoreconf." + elif test -z "$maintainer" + then + echo " DO NOT RUN THIS SCRIPT." + echo " If you need to change Makefile.am or configure.ac then you" + echo " also need to run ./configure --enable-maintainer-mode and" + echo " use the appropriate autotools, *NOT* this script, to update" + echo " everything, please check the documentation of autoreconf." + echo " WARNING: libpng is intentionally generated with a known," + echo " fixed, set of autotools. It is known *NOT* to work with" + echo " the collection of autotools distributed on highly reputable" + echo " operating systems." + echo " Remember: autotools is GNU software, you are expected to" + echo " pay for support." + else + echo " You have run autogen.sh with --maintainer enabled and you" + echo " are not using a GIT distribution, then you have given an" + echo " unrecognized argument. This is not good. --maintainer" + echo " switches off any assumptions that you might not know what" + echo " you are doing." + fi + exit 1;; + esac + + shift +done +# +# First check for a set of the autotools files; if absent then this is assumed +# to be a GIT version and the local autotools must be used. If present this +# is a tarball distribution and the script should not be used. If partially +# present bad things are happening. +# +# The autotools generated files: +libpng_autotools_files="Makefile.in aclocal.m4 config.guess config.h.in + config.sub configure depcomp install-sh ltmain.sh missing\ + test-driver" +# +# Files generated by versions of configue >2.68 or automake >1.13 (i.e. later +# versions than those required by configure.ac): +libpng_autotools_extra="compile config.h.in~" +# +# These are separate because 'maintainer-clean' does not remove them. +libpng_libtool_files="scripts/libtool.m4 scripts/ltoptions.m4\ + scripts/ltsugar.m4 scripts/ltversion.m4 scripts/lt~obsolete.m4" + +libpng_autotools_dirs="autom4te.cache" # not required +# +# The configure generated files: +libpng_configure_files="Makefile config.h config.log config.status\ + libpng-config libpng.pc libtool stamp-h1" + +libpng_configure_dirs=".deps" +# +# We must remove the configure generated files as well as the autotools +# generated files if autotools are regenerated because otherwise if configure +# has been run without "--enable-maintainer-mode" make can do a partial update +# of Makefile. These functions do the two bits of cleaning. +clean_autotools(){ + rm -rf $libpng_autotools_files $libpng_libtool_files $libpng_autotools_dirs + rm -rf $libpng_autotools_extra +} + +clean_configure(){ + rm -rf $libpng_configure_files $libpng_configure_dirs +} +# +# Clean: remove everything (this is to help with testing) +if test -n "$clean" +then + clean_configure + if test -n "$maintainer" + then + clean_autotools + fi + + exit 0 +fi +# +# Validate the distribution. +libpng_autotools_file_found= +libpng_autotools_file_missing= +for file in $libpng_autotools_files +do + if test -f "$file" + then + libpng_autotools_file_found=1 + else + libpng_autotools_file_missing=1 + fi +done +# +# Presence of one of these does not *invalidate* missing, but absence +# invalidates found. +for file in $libpng_libtool_files +do + if test ! -f "$file" + then + libpng_autotools_file_missing=1 + fi +done +# +# The cache directory doesn't matter - it will be regenerated and does not exist +# anyway in a tarball. +# +# Either everything is missing or everything is there, the --maintainer option +# just changes this so that the mode is set to generate all the files. +mode= +if test -z "$libpng_autotools_file_found" -o -n "$maintainer" +then + mode="autoreconf" +else + if test -n "$libpng_autotools_file_missing" + then + mode="broken" + else + mode="configure" + fi +fi +# +# So: +case "$mode" in + autoreconf) + # Clean in case configure files exist + clean_configure + clean_autotools + # Everything must be initialized, so use --force + if autoreconf --warnings=all --force --install + then + missing= + for file in $libpng_autotools_files + do + test -f "$file" || missing=1 + done + # ignore the cache directory + test -z "$missing" || { + exec >&2 + echo "autoreconf was run, but did not produce all the expected" + echo "files. It is likely that your autotools installation is" + echo "not compatible with that expected by libpng." + exit 1 + } + else + exec >&2 + echo "autoreconf failed: your version of autotools is incompatible" + echo "with this libpng version. Please use a distributed archive" + echo "(which includes the autotools generated files) and run configure" + echo "instead." + exit 1 + fi;; + + configure) + if test -d .git + then + exec >&2 + echo "ERROR: running autoreconf on an initialized system" + echo " This is not necessary; it is only necessary to remake the" + echo " autotools generated files if Makefile.am or configure.ac" + echo " change and make does the right thing with:" + echo + echo " ./configure --enable-maintainer-mode." + echo + echo " You can run autoreconf yourself if you don't like maintainer" + echo " mode and you can also just run autoreconf -f -i to initialize" + echo " everything in the first place; this script is only for" + echo " compatibility with prior releases." + exit 1 + else + exec >&2 + echo "autogen.sh is intended only to generate 'configure' on systems" + echo "that do not have it. You have a complete 'configure', if you" + echo "need to change Makefile.am or configure.ac you also need to" + echo "run configure with the --enable-maintainer-mode option." + exit 1 + fi;; + + broken) + exec >&2 + echo "Your system has a partial set of autotools generated files." + echo "autogen.sh is unable to proceed. The full set of files is" + echo "contained in the libpng 'tar' distribution archive and you do" + echo "not need to run autogen.sh if you use it." + exit 1;; +esac diff --git a/Engine/lib/lpng/compile b/Engine/lib/lpng/compile new file mode 100755 index 000000000..99e50524b --- /dev/null +++ b/Engine/lib/lpng/compile @@ -0,0 +1,348 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/Engine/lib/lpng/config.guess b/Engine/lib/lpng/config.guess new file mode 100755 index 000000000..256083a70 --- /dev/null +++ b/Engine/lib/lpng/config.guess @@ -0,0 +1,1476 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2018 Free Software Foundation, Inc. + +timestamp='2018-03-08' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2018 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > "$dummy.c" ; + for c in cc gcc c89 c99 ; do + if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "$UNAME_SYSTEM" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval "$set_cc_for_build" + cat <<-EOF > "$dummy.c" + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ + echo unknown)` + case "$UNAME_MACHINE_ARCH" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown + ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval "$set_cc_for_build" + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "$UNAME_VERSION" in + Debian*) + release='-gnu' + ;; + *) + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "$machine-${os}${release}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" + exit ;; + *:ekkoBSD:*:*) + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" + exit ;; + *:SolidBSD:*:*) + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:MirBSD:*:*) + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo "$UNAME_MACHINE"-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo "$UNAME_MACHINE"-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix"$UNAME_RELEASE" + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux"$UNAME_RELEASE" + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval "$set_cc_for_build" + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos"$UNAME_RELEASE" + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos"$UNAME_RELEASE" + ;; + sun4) + echo sparc-sun-sunos"$UNAME_RELEASE" + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos"$UNAME_RELEASE" + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint"$UNAME_RELEASE" + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint"$UNAME_RELEASE" + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint"$UNAME_RELEASE" + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten"$UNAME_RELEASE" + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten"$UNAME_RELEASE" + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix"$UNAME_RELEASE" + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix"$UNAME_RELEASE" + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix"$UNAME_RELEASE" + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos"$UNAME_RELEASE" + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + then + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] + then + echo m88k-dg-dgux"$UNAME_RELEASE" + else + echo m88k-dg-dguxbcs"$UNAME_RELEASE" + fi + else + echo i586-dg-dgux"$UNAME_RELEASE" + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "$HP_ARCH" = "" ]; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ "$HP_ARCH" = hppa2.0w ] + then + eval "$set_cc_for_build" + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" + exit ;; + 3050*:HI-UX:*:*) + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo "$UNAME_MACHINE"-unknown-osf1mk + else + echo "$UNAME_MACHINE"-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi"$UNAME_RELEASE" + exit ;; + *:BSD/OS:*:*) + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case "$UNAME_PROCESSOR" in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + exit ;; + i*:CYGWIN*:*) + echo "$UNAME_MACHINE"-pc-cygwin + exit ;; + *:MINGW64*:*) + echo "$UNAME_MACHINE"-pc-mingw64 + exit ;; + *:MINGW*:*) + echo "$UNAME_MACHINE"-pc-mingw32 + exit ;; + *:MSYS*:*) + echo "$UNAME_MACHINE"-pc-msys + exit ;; + i*:PW*:*) + echo "$UNAME_MACHINE"-pc-pw32 + exit ;; + *:Interix*:*) + case "$UNAME_MACHINE" in + x86) + echo i586-pc-interix"$UNAME_RELEASE" + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix"$UNAME_RELEASE" + exit ;; + IA64) + echo ia64-unknown-interix"$UNAME_RELEASE" + exit ;; + esac ;; + i*:UWIN*:*) + echo "$UNAME_MACHINE"-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + *:GNU:*:*) + # the GNU system + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" + exit ;; + i*86:Minix:*:*) + echo "$UNAME_MACHINE"-pc-minix + exit ;; + aarch64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arm*:Linux:*:*) + eval "$set_cc_for_build" + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + else + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + cris:Linux:*:*) + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + crisv32:Linux:*:*) + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + frv:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + hexagon:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:Linux:*:*) + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + exit ;; + ia64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m32r*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m68*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } + ;; + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-"$LIBC" + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-"$LIBC" + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-"$LIBC" + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-"$LIBC" + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-"$LIBC" + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-"$LIBC" + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" + exit ;; + sh64*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sh*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + tile*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + vax:Linux:*:*) + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" + exit ;; + x86_64:Linux:*:*) + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + exit ;; + xtensa*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo "$UNAME_MACHINE"-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo "$UNAME_MACHINE"-unknown-stop + exit ;; + i*86:atheos:*:*) + echo "$UNAME_MACHINE"-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo "$UNAME_MACHINE"-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos"$UNAME_RELEASE" + exit ;; + i*86:*DOS:*:*) + echo "$UNAME_MACHINE"-pc-msdosdjgpp + exit ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + else + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + else + echo "$UNAME_MACHINE"-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos"$UNAME_RELEASE" + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos"$UNAME_RELEASE" + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv"$UNAME_RELEASE" + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo "$UNAME_MACHINE"-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo "$UNAME_MACHINE"-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux"$UNAME_RELEASE" + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv"$UNAME_RELEASE" + else + echo mips-unknown-sysv"$UNAME_RELEASE" + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux"$UNAME_RELEASE" + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux"$UNAME_RELEASE" + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux"$UNAME_RELEASE" + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody"$UNAME_RELEASE" + exit ;; + *:Rhapsody:*:*) + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval "$set_cc_for_build" + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo "$UNAME_MACHINE"-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux"$UNAME_RELEASE" + exit ;; + *:DragonFly:*:*) + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "$UNAME_MACHINE" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" + exit ;; + i*86:rdos:*:*) + echo "$UNAME_MACHINE"-pc-rdos + exit ;; + i*86:AROS:*:*) + echo "$UNAME_MACHINE"-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/Engine/lib/lpng/config.h.in b/Engine/lib/lpng/config.h.in new file mode 100644 index 000000000..2931048bf --- /dev/null +++ b/Engine/lib/lpng/config.h.in @@ -0,0 +1,126 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the `feenableexcept' function. */ +#undef HAVE_FEENABLEEXCEPT + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + +/* Define to 1 if you have the `z' library (-lz). */ +#undef HAVE_LIBZ + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `pow' function. */ +#undef HAVE_POW + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Turn on ARM Neon optimizations at run-time */ +#undef PNG_ARM_NEON_API_SUPPORTED + +/* Check for ARM Neon support at run-time */ +#undef PNG_ARM_NEON_CHECK_SUPPORTED + +/* Enable ARM Neon optimizations */ +#undef PNG_ARM_NEON_OPT + +/* Enable Intel SSE optimizations */ +#undef PNG_INTEL_SSE_OPT + +/* Turn on MIPS MSA optimizations at run-time */ +#undef PNG_MIPS_MSA_API_SUPPORTED + +/* Check for MIPS MSA support at run-time */ +#undef PNG_MIPS_MSA_CHECK_SUPPORTED + +/* Enable MIPS MSA optimizations */ +#undef PNG_MIPS_MSA_OPT + +/* Turn on POWERPC VSX optimizations at run-time */ +#undef PNG_POWERPC_VSX_API_SUPPORTED + +/* Check for POWERPC VSX support at run-time */ +#undef PNG_POWERPC_VSX_CHECK_SUPPORTED + +/* Enable POWERPC VSX optimizations */ +#undef PNG_POWERPC_VSX_OPT + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#undef restrict +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +# define __restrict__ +#endif + +/* Define to `unsigned int' if does not define. */ +#undef size_t diff --git a/Engine/lib/lpng/config.sub b/Engine/lib/lpng/config.sub new file mode 100755 index 000000000..9ccf09a7a --- /dev/null +++ b/Engine/lib/lpng/config.sub @@ -0,0 +1,1801 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2018 Free Software Foundation, Inc. + +timestamp='2018-03-08' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2018 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo "$1" + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo "$1" | sed 's/-[^-]*$//'` + if [ "$basic_machine" != "$1" ] + then os=`echo "$1" | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | wasm32 \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ + | pyramid-* \ + | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | wasm32-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-pc + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2*) + basic_machine=m68k-bull + os=-sysv3 + ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=$os"spe" + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=-linux + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + nsv-tandem) + basic_machine=nsv-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + x64) + basic_machine=x86_64-pc + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases that might get confused + # with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # es1800 is here to avoid being matched by es* (a different OS) + -es1800*) + os=-ose + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ + | -midnightbsd*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -xray | -os68k* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo "$os" | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4*) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $basic_machine in + arm*) + os=-eabi + ;; + *) + os=-elf + ;; + esac + ;; + -nacl*) + ;; + -ios) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + pru-*) + os=-elf + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` + ;; +esac + +echo "$basic_machine$os" +exit + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/Engine/lib/lpng/configure b/Engine/lib/lpng/configure old mode 100644 new mode 100755 index e69de29bb..1b2c46366 --- a/Engine/lib/lpng/configure +++ b/Engine/lib/lpng/configure @@ -0,0 +1,16116 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for libpng 1.6.37. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: png-mng-implement@lists.sourceforge.net about your +$0: system, including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='libpng' +PACKAGE_TARNAME='libpng' +PACKAGE_VERSION='1.6.37' +PACKAGE_STRING='libpng 1.6.37' +PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net' +PACKAGE_URL='' + +ac_unique_file="pngget.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +PNG_POWERPC_VSX_FALSE +PNG_POWERPC_VSX_TRUE +PNG_INTEL_SSE_FALSE +PNG_INTEL_SSE_TRUE +PNG_MIPS_MSA_FALSE +PNG_MIPS_MSA_TRUE +PNG_ARM_NEON_FALSE +PNG_ARM_NEON_TRUE +DO_INSTALL_LIBPNG_CONFIG_FALSE +DO_INSTALL_LIBPNG_CONFIG_TRUE +DO_INSTALL_LIBPNG_PC_FALSE +DO_INSTALL_LIBPNG_PC_TRUE +DO_INSTALL_LINKS_FALSE +DO_INSTALL_LINKS_TRUE +DO_PNG_PREFIX_FALSE +DO_PNG_PREFIX_TRUE +PNG_PREFIX +binconfigs +pkgconfigdir +PNGLIB_RELEASE +PNGLIB_MINOR +PNGLIB_MAJOR +PNGLIB_VERSION +SYMBOL_PREFIX +HAVE_LD_VERSION_SCRIPT_FALSE +HAVE_LD_VERSION_SCRIPT_TRUE +HAVE_SOLARIS_LD_FALSE +HAVE_SOLARIS_LD_TRUE +HAVE_CLOCK_GETTIME_FALSE +HAVE_CLOCK_GETTIME_TRUE +LIBOBJS +POW_LIB +PNG_COPTS +DFNCPP +LT_SYS_LIBRARY_PATH +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +NM +ac_ct_DUMPBIN +DUMPBIN +LIBTOOL +OBJDUMP +DLLTOOL +AS +LN_S +CPP +LD +FGREP +EGREP +GREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +am__fastdepCCAS_FALSE +am__fastdepCCAS_TRUE +CCASDEPMODE +CCASFLAGS +CCAS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_maintainer_mode +enable_dependency_tracking +with_gnu_ld +enable_shared +enable_static +with_pic +enable_fast_install +with_aix_soname +with_sysroot +enable_libtool_lock +enable_werror +with_zlib_prefix +with_pkgconfigdir +with_binconfigs +with_libpng_prefix +enable_unversioned_links +enable_unversioned_libpng_pc +enable_unversioned_libpng_config +enable_hardware_optimizations +enable_arm_neon +enable_mips_msa +enable_intel_sse +enable_powerpc_vsx +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CCAS +CCASFLAGS +CPP +LT_SYS_LIBRARY_PATH +PNG_COPTS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures libpng 1.6.37 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/libpng] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of libpng 1.6.37:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-werror[=OPT] Pass -Werror or the given argument to the compiler + if it is supported + --enable-unversioned-links + Installed libpng header files are placed in a + versioned subdirectory and installed libpng library + (including DLL) files are versioned. If this option + is enabled unversioned links will be created + pointing to the corresponding installed files. If + you use libpng.pc or libpng-config for all builds + you do not need these links, but if you compile + programs directly they will typically #include + and link with -lpng; in that case you need + the links. The links can be installed manually using + 'make install-header-links' and 'make + install-library-links' and can be removed using the + corresponding uninstall- targets. If you do enable + this option every libpng 'make install' will + recreate the links to point to the just installed + version of libpng. The default is to create the + links; use --disable-unversioned-links to change + this + --enable-unversioned-libpng-pc + Install the configuration file 'libpng.pc' as a link + to the versioned version. This is done by default - + use --disable-unversioned-libpng-pc to change this. + --enable-unversioned-libpng-config + Install the configuration file 'libpng-config' as a + link to the versioned version. This is done by + default - use --disable-unversioned-libpng-config to + change this. + --enable-hardware-optimizations + Enable hardware optimizations: =no/off, yes/on: + --enable-arm-neon Enable ARM NEON optimizations: =no/off, check, api, + yes/on: no/off: disable the optimizations; check: + use internal checking code (deprecated and poorly + supported); api: disable by default, enable by a + call to png_set_option; yes/on: turn on + unconditionally. If not specified: determined by the + compiler. + --enable-mips-msa Enable MIPS MSA optimizations: =no/off, check, api, + yes/on: no/off: disable the optimizations; check: + use internal checking code (deprecated and poorly + supported); api: disable by default, enable by a + call to png_set_option; yes/on: turn on + unconditionally. If not specified: determined by the + compiler. + --enable-intel-sse Enable Intel SSE optimizations: =no/off, yes/on: + no/off: disable the optimizations; yes/on: enable + the optimizations. If not specified: determined by + the compiler. + --enable-powerpc-vsx Enable POWERPC VSX optimizations: =no/off, check, + api, yes/on: no/off: disable the optimizations; + check: use internal checking code api: disable by + default, enable by a call to png_set_option yes/on: + turn on unconditionally. If not specified: + determined by the compiler. + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). + --with-zlib-prefix prefix that may have been used in installed zlib + --with-pkgconfigdir Use the specified pkgconfig dir (default is + libdir/pkgconfig) + --with-binconfigs Generate shell libpng-config scripts as well as + pkg-config data [default=yes] + --with-libpng-prefix prefix libpng exported function (API) names with the + given value + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CCAS assembler compiler command (defaults to CC) + CCASFLAGS assembler compiler flags (defaults to CFLAGS) + CPP C preprocessor + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. + PNG_COPTS additional flags for the C compiler, use this for options that + would cause configure itself to fail + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +libpng configure 1.6.37 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by libpng $as_me 1.6.37, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +# libpng does not follow GNU file name conventions (hence 'foreign') +# color-tests requires automake 1.11 or later +# silent-rules requires automake 1.11 or later +# dist-xz requires automake 1.11 or later +# 1.12.2 fixes a security issue in 1.11.2 and 1.12.1 +# 1.13 is required for parallel tests +am__api_version='1.16' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; 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_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +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_prog_STRIP="${ac_tool_prefix}strip" + $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 + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; 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_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +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_prog_ac_ct_STRIP="strip" + $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 + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; 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_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +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_prog_AWK="$ac_prog" + $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 + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='libpng' + VERSION='1.6.37' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + +# The following line causes --disable-maintainer-mode to be the default to +# configure. This is necessary because libpng distributions cannot rely on the +# time stamps of the autotools generated files being correct + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + +PNGLIB_VERSION=1.6.37 +PNGLIB_MAJOR=1 +PNGLIB_MINOR=6 +PNGLIB_RELEASE=37 + + + +ac_config_headers="$ac_config_headers config.h" + + +# Checks for programs. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; 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_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +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_prog_CC="${ac_tool_prefix}gcc" + $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 + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; 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_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +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_prog_ac_ct_CC="gcc" + $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 + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; 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_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +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_prog_CC="${ac_tool_prefix}cc" + $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 + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; 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_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +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 + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $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 + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; 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_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +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_prog_CC="$ac_tool_prefix$ac_prog" + $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 + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; 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_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +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_prog_ac_ct_CC="$ac_prog" + $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 + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +# By default we simply use the C compiler to build assembly code. + +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS + + + +depcc="$CCAS" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CCAS_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CCAS_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CCAS_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CCAS_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; } +CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then + am__fastdepCCAS_TRUE= + am__fastdepCCAS_FALSE='#' +else + am__fastdepCCAS_TRUE='#' + am__fastdepCCAS_FALSE= +fi + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + 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_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case $ECHO in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; 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_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +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_prog_AWK="$ac_prog" + $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 + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.6' +macro_revision='2.4.6' + + + + + + + + + + + + + +ltmain=$ac_aux_dir/ltmain.sh + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; 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_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +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_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $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 + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; 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_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +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_prog_ac_ct_DUMPBIN="$ac_prog" + $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 + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n "$lt_cv_sys_max_cmd_len"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test yes != "$GCC"; then + reload_cmds=false + fi + ;; + darwin*) + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; 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_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +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_prog_OBJDUMP="${ac_tool_prefix}objdump" + $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 + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; 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_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +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_prog_ac_ct_OBJDUMP="objdump" + $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 + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; 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_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +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_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $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 + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; 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_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +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_prog_ac_ct_DLLTOOL="dlltool" + $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 + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; 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_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +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_prog_AR="$ac_tool_prefix$ac_prog" + $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 + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; 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_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +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_prog_ac_ct_AR="$ac_prog" + $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 + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; 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_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +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_prog_STRIP="${ac_tool_prefix}strip" + $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 + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; 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_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +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_prog_ac_ct_STRIP="strip" + $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 + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; 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_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +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_prog_RANLIB="${ac_tool_prefix}ranlib" + $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 + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; 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_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +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_prog_ac_ct_RANLIB="ranlib" + $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 + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +$as_echo "$with_sysroot" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +$as_echo_n "checking for a working dd... " >&6; } +if ${ac_cv_path_lt_DD+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + 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_prog in dd; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +$as_echo "$ac_cv_path_lt_DD" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +$as_echo_n "checking how to truncate binary pipes... " >&6; } +if ${lt_cv_truncate_bin+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +$as_echo "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; 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_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +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_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $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 + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; 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_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +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_prog_ac_ct_MANIFEST_TOOL="mt" + $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 + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; 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_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +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_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $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 + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; 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_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +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_prog_ac_ct_DSYMUTIL="dsymutil" + $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 + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; 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_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +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_prog_NMEDIT="${ac_tool_prefix}nmedit" + $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 + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; 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_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +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_prog_ac_ct_NMEDIT="nmedit" + $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 + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; 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_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +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_prog_LIPO="${ac_tool_prefix}lipo" + $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 + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; 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_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +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_prog_ac_ct_LIPO="lipo" + $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 + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; 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_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +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_prog_OTOOL="${ac_tool_prefix}otool" + $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 + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; 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_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +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_prog_ac_ct_OTOOL="otool" + $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 + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; 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_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +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_prog_OTOOL64="${ac_tool_prefix}otool64" + $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 + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; 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_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +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_prog_ac_ct_OTOOL64="otool64" + $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 + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[012][,.]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + + +# Set options +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; 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_prog_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +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_prog_AS="${ac_tool_prefix}as" + $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 + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; 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_prog_ac_ct_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +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_prog_ac_ct_AS="as" + $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 + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; 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_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +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_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $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 + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; 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_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +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_prog_ac_ct_DLLTOOL="dlltool" + $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 + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; 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_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +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_prog_OBJDUMP="${ac_tool_prefix}objdump" + $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 + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; 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_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +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_prog_ac_ct_OBJDUMP="objdump" + $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 + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + enable_dlopen=no + + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + pic_mode=default +fi + + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test "${with_aix_soname+set}" = set; then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else + if ${lt_cv_with_aix_soname+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +$as_echo "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/${ac_tool_prefix}file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC=$CC +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test yes = "$GCC"; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + lt_prog_compiler_pic='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works"; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works"; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test no = "$hard_links"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='$wl--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + export_dynamic_flag_spec='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test no = "$ld_shlibs"; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test yes = "$GCC"; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test yes = "$lt_cv_prog_compiler__b"; then + archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test yes = "$lt_cv_irix_exported_symbol"; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + else + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + osf3*) + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='$wl-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='$wl-z,text' + allow_undefined_flag='$wl-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='$wl-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test no = "$ld_shlibs" && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test yes = "$hardcode_automatic"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else + + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen=shl_load +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen=dlopen +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report what library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + +# Some awks crash when confronted with pnglibconf.dfa, do a test run now +# to make sure this doesn't happen +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that AWK works" >&5 +$as_echo_n "checking that AWK works... " >&6; } +if ${AWK} -f ${srcdir}/scripts/options.awk out="/dev/null" version=search\ + ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\ + ${srcdir}/pngusr.dfa 1>&2 +then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 1 "failed +See \`config.log' for more details" "$LINENO" 5; } +fi + +# This is a remnant of the old cc -E validation, where it may have been +# necessary to use a different preprocessor for .dfn files +DFNCPP="$CPP" + + +# -Werror cannot be passed to GCC in CFLAGS because configure will fail (it +# checks the compiler with a program that generates a warning), add the +# following option to deal with this + +# Check whether --enable-werror was given. +if test "${enable_werror+set}" = set; then : + enableval=$enable_werror; test "$enable_werror" = "yes" && enable_werror="-Werror" + if test "$enable_werror" != "no"; then + sav_CFLAGS="$CFLAGS" + CFLAGS="$enable_werror $CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler allows $enable_werror" >&5 +$as_echo_n "checking if the compiler allows $enable_werror... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int main(int argc, char **argv){ + return argv[argc-1][0]; + } +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + PNG_COPTS="$PNG_COPTS $enable_werror" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$sav_CFLAGS" + fi +fi + + +# For GCC 5 the default mode for C is -std=gnu11 instead of -std=gnu89 +# In pngpriv.h we request just the POSIX 1003.1 and C89 APIs by defining _POSIX_SOURCE to 1 +# This is incompatible with the new default mode, so we test for that and force the +# "-std=c89" compiler option: +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to force back C standard to C89" >&5 +$as_echo_n "checking if we need to force back C standard to C89... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define _POSIX_SOURCE 1 + #include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +else + + if test "x$GCC" != "xyes"; then + as_fn_error $? "Forcing back to C89 is required but the flags are only known for GCC" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$CFLAGS -std=c89" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +# Checks for header files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + + +# Checks for typedefs, structures, and compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if ${ac_cv_struct_tm+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_tm=time.h +else + ac_cv_struct_tm=sys/time.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +$as_echo_n "checking for C/C++ restrict keyword... " >&6; } +if ${ac_cv_c_restrict+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +typedef int * int_ptr; + int foo (int_ptr $ac_kw ip) { + return ip[0]; + } +int +main () +{ +int s[1]; + int * $ac_kw t = s; + t[0] = 0; + return foo(t) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_restrict=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break + done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +$as_echo "$ac_cv_c_restrict" >&6; } + + case $ac_cv_c_restrict in + restrict) ;; + no) $as_echo "#define restrict /**/" >>confdefs.h + ;; + *) cat >>confdefs.h <<_ACEOF +#define restrict $ac_cv_c_restrict +_ACEOF + ;; + esac + + +# Checks for library functions. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 +$as_echo_n "checking for working strtod... " >&6; } +if ${ac_cv_func_strtod+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_strtod=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +$ac_includes_default +#ifndef strtod +double strtod (); +#endif +int +main() +{ + { + /* Some versions of Linux strtod mis-parse strings with leading '+'. */ + char *string = " +69"; + char *term; + double value; + value = strtod (string, &term); + if (value != 69 || term != (string + 4)) + return 1; + } + + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + char *string = "NaN"; + char *term; + strtod (string, &term); + if (term != string && *(term - 1) == 0) + return 1; + } + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_strtod=yes +else + ac_cv_func_strtod=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 +$as_echo "$ac_cv_func_strtod" >&6; } +if test $ac_cv_func_strtod = no; then + case " $LIBOBJS " in + *" strtod.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtod.$ac_objext" + ;; +esac + +ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = xyes; then : + +fi + +if test $ac_cv_func_pow = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +$as_echo_n "checking for pow in -lm... " >&6; } +if ${ac_cv_lib_m_pow+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pow (); +int +main () +{ +return pow (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_pow=yes +else + ac_cv_lib_m_pow=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +$as_echo "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = xyes; then : + POW_LIB=-lm +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 +$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} +fi + +fi + +fi + +for ac_func in pow +do : + ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_POW 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +$as_echo_n "checking for pow in -lm... " >&6; } +if ${ac_cv_lib_m_pow+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pow (); +int +main () +{ +return pow (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_pow=yes +else + ac_cv_lib_m_pow=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +$as_echo "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +else + as_fn_error $? "cannot find pow" "$LINENO" 5 +fi + +fi +done + + +# Some later POSIX 1003.1 functions are required for test programs, failure here +# is soft (the corresponding test program is not built). +ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +if test "x$ac_cv_func_clock_gettime" = xyes; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: not building timepng" >&5 +$as_echo "$as_me: WARNING: not building timepng" >&2;} +fi + + if test "$ac_cv_func_clock_gettime" = "yes"; then + HAVE_CLOCK_GETTIME_TRUE= + HAVE_CLOCK_GETTIME_FALSE='#' +else + HAVE_CLOCK_GETTIME_TRUE='#' + HAVE_CLOCK_GETTIME_FALSE= +fi + + + +# Check whether --with-zlib-prefix was given. +if test "${with_zlib_prefix+set}" = set; then : + withval=$with_zlib_prefix; ZPREFIX=${withval} +else + ZPREFIX='z_' +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5 +$as_echo_n "checking for zlibVersion in -lz... " >&6; } +if ${ac_cv_lib_z_zlibVersion+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char zlibVersion (); +int +main () +{ +return zlibVersion (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_zlibVersion=yes +else + ac_cv_lib_z_zlibVersion=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5 +$as_echo "$ac_cv_lib_z_zlibVersion" >&6; } +if test "x$ac_cv_lib_z_zlibVersion" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +else + as_ac_Lib=`$as_echo "ac_cv_lib_z_${ZPREFIX}zlibVersion" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ZPREFIX}zlibVersion in -lz" >&5 +$as_echo_n "checking for ${ZPREFIX}zlibVersion in -lz... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ${ZPREFIX}zlibVersion (); +int +main () +{ +return ${ZPREFIX}zlibVersion (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_ac_Lib=yes" +else + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +else + as_fn_error $? "zlib not installed" "$LINENO" 5 +fi + +fi + + +# The following is for pngvalid, to ensure it catches FP errors even on +# platforms that don't enable FP exceptions, the function appears in the math +# library (typically), it's not an error if it is not found. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for feenableexcept in -lm" >&5 +$as_echo_n "checking for feenableexcept in -lm... " >&6; } +if ${ac_cv_lib_m_feenableexcept+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char feenableexcept (); +int +main () +{ +return feenableexcept (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_feenableexcept=yes +else + ac_cv_lib_m_feenableexcept=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_feenableexcept" >&5 +$as_echo "$ac_cv_lib_m_feenableexcept" >&6; } +if test "x$ac_cv_lib_m_feenableexcept" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +fi + +for ac_func in feenableexcept +do : + ac_fn_c_check_func "$LINENO" "feenableexcept" "ac_cv_func_feenableexcept" +if test "x$ac_cv_func_feenableexcept" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FEENABLEEXCEPT 1 +_ACEOF + +fi +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if using Solaris linker" >&5 +$as_echo_n "checking if using Solaris linker... " >&6; } +SLD=`$LD --version 2>&1 | grep Solaris` +if test "$SLD"; then + have_solaris_ld=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + have_solaris_ld=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "$have_solaris_ld" = "yes"; then + HAVE_SOLARIS_LD_TRUE= + HAVE_SOLARIS_LD_FALSE='#' +else + HAVE_SOLARIS_LD_TRUE='#' + HAVE_SOLARIS_LD_FALSE= +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libraries can be versioned" >&5 +$as_echo_n "checking if libraries can be versioned... " >&6; } +# Special case for PE/COFF platforms: ld reports +# support for version-script, but doesn't actually +# DO anything with it. +case $host in +*cygwin* | *mingw32* | *interix* ) + have_ld_version_script=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +;; +* ) + +if test "$have_solaris_ld" = "yes"; then + GLD=`$LD --help < /dev/null 2>&1 | grep 'M mapfile'` +else + GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` +fi + +if test "$GLD"; then + have_ld_version_script=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + have_ld_version_script=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** You have not enabled versioned symbols." >&5 +$as_echo "$as_me: WARNING: *** You have not enabled versioned symbols." >&2;} +fi +;; +esac + + if test "$have_ld_version_script" = "yes"; then + HAVE_LD_VERSION_SCRIPT_TRUE= + HAVE_LD_VERSION_SCRIPT_FALSE='#' +else + HAVE_LD_VERSION_SCRIPT_TRUE='#' + HAVE_LD_VERSION_SCRIPT_FALSE= +fi + + +if test "$have_ld_version_script" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for symbol prefix" >&5 +$as_echo_n "checking for symbol prefix... " >&6; } + SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \ + | ${CPP-${CC-gcc} -E} - 2>&1 \ + | ${EGREP-grep} "^PREFIX=" \ + | ${SED-sed} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"` + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYMBOL_PREFIX" >&5 +$as_echo "$SYMBOL_PREFIX" >&6; } +fi + +# Substitutions for .in files + + + + + +# Additional arguments (and substitutions) +# Allow the pkg-config directory to be set + +# Check whether --with-pkgconfigdir was given. +if test "${with_pkgconfigdir+set}" = set; then : + withval=$with_pkgconfigdir; pkgconfigdir=${withval} +else + pkgconfigdir='${libdir}/pkgconfig' +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: pkgconfig directory is ${pkgconfigdir}" >&5 +$as_echo "$as_me: pkgconfig directory is ${pkgconfigdir}" >&6;} + +# Make the *-config binary config scripts optional + +# Check whether --with-binconfigs was given. +if test "${with_binconfigs+set}" = set; then : + withval=$with_binconfigs; if test "${withval}" = no; then + binconfigs= + { $as_echo "$as_me:${as_lineno-$LINENO}: libpng-config scripts will not be built" >&5 +$as_echo "$as_me: libpng-config scripts will not be built" >&6;} + else + binconfigs='${binconfigs}' + fi +else + binconfigs='${binconfigs}' +fi + + + +# Support for prefixes to the API function names; this will generate defines +# at the start of the build to rename exported library functions + +# Check whether --with-libpng-prefix was given. +if test "${with_libpng_prefix+set}" = set; then : + withval=$with_libpng_prefix; if test "${withval:-no}" != "no"; then + PNG_PREFIX=${withval} + + fi +fi + + if test "${with_libpng_prefix:-no}" != "no"; then + DO_PNG_PREFIX_TRUE= + DO_PNG_PREFIX_FALSE='#' +else + DO_PNG_PREFIX_TRUE='#' + DO_PNG_PREFIX_FALSE= +fi + + +# Control over what links are made for installed files. Versioned files are +# always installed, when the following options are turned on corresponding +# unversioned links are also created (normally as symbolic links): +# Check whether --enable-unversioned-links was given. +if test "${enable_unversioned_links+set}" = set; then : + enableval=$enable_unversioned_links; +fi + + +# The AM_CONDITIONAL test is written so that the default is enabled; +# --disable-unversioned-links must be given to turn the option off. + if test "$enable_unversioned_links" != "no"; then + DO_INSTALL_LINKS_TRUE= + DO_INSTALL_LINKS_FALSE='#' +else + DO_INSTALL_LINKS_TRUE='#' + DO_INSTALL_LINKS_FALSE= +fi + + +# Check whether --enable-unversioned-libpng-pc was given. +if test "${enable_unversioned_libpng_pc+set}" = set; then : + enableval=$enable_unversioned_libpng_pc; +fi + + if test "$enable_unversioned_libpng_pc" != "no"; then + DO_INSTALL_LIBPNG_PC_TRUE= + DO_INSTALL_LIBPNG_PC_FALSE='#' +else + DO_INSTALL_LIBPNG_PC_TRUE='#' + DO_INSTALL_LIBPNG_PC_FALSE= +fi + + +# Check whether --enable-unversioned-libpng-config was given. +if test "${enable_unversioned_libpng_config+set}" = set; then : + enableval=$enable_unversioned_libpng_config; +fi + + if test "$enable_unversioned_libpng_config" != "no"; then + DO_INSTALL_LIBPNG_CONFIG_TRUE= + DO_INSTALL_LIBPNG_CONFIG_FALSE='#' +else + DO_INSTALL_LIBPNG_CONFIG_TRUE='#' + DO_INSTALL_LIBPNG_CONFIG_FALSE= +fi + + +# HOST SPECIFIC OPTIONS +# ===================== +# +# DEFAULT +# ======= +# +# Check whether --enable-hardware-optimizations was given. +if test "${enable_hardware_optimizations+set}" = set; then : + enableval=$enable_hardware_optimizations; case "$enableval" in + no|off) + # disable hardware optimization on all systems: + enable_arm_neon=no + +$as_echo "#define PNG_ARM_NEON_OPT 0" >>confdefs.h + + enable_mips_msa=no + +$as_echo "#define PNG_MIPS_MSA_OPT 0" >>confdefs.h + + enable_powerpc_vsx=no + +$as_echo "#define PNG_POWERPC_VSX_OPT 0" >>confdefs.h + + enable_intel_sse=no + +$as_echo "#define PNG_INTEL_SSE_OPT 0" >>confdefs.h + + ;; + *) + # allow enabling hardware optimization on any system: + case "$host_cpu" in + arm*|aarch64*) + enable_arm_neon=yes + +$as_echo "#define PNG_ARM_NEON_OPT 0" >>confdefs.h + + ;; + mipsel*|mips64el*) + enable_mips_msa=yes + +$as_echo "#define PNG_MIPS_MSA_OPT 0" >>confdefs.h + + ;; + i?86|x86_64) + enable_intel_sse=yes + +$as_echo "#define PNG_INTEL_SSE_OPT 1" >>confdefs.h + + ;; + powerpc*|ppc64*) + enable_powerpc_vsx=yes + +$as_echo "#define PNG_POWERPC_VSX_OPT 2" >>confdefs.h + + ;; + esac + ;; + esac +fi + + +# ARM +# === +# +# ARM NEON (SIMD) support. + +# Check whether --enable-arm-neon was given. +if test "${enable_arm_neon+set}" = set; then : + enableval=$enable_arm_neon; case "$enableval" in + no|off) + # disable the default enabling on __ARM_NEON__ systems: + +$as_echo "#define PNG_ARM_NEON_OPT 0" >>confdefs.h + + # Prevent inclusion of the assembler files below: + enable_arm_neon=no;; + check) + +$as_echo "#define PNG_ARM_NEON_CHECK_SUPPORTED /**/" >>confdefs.h +;; + api) + +$as_echo "#define PNG_ARM_NEON_API_SUPPORTED /**/" >>confdefs.h +;; + yes|on) + +$as_echo "#define PNG_ARM_NEON_OPT 2" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-arm-neon: please specify 'check' or 'api', if + you want the optimizations unconditionally pass -mfpu=neon + to the compiler." >&5 +$as_echo "$as_me: WARNING: --enable-arm-neon: please specify 'check' or 'api', if + you want the optimizations unconditionally pass -mfpu=neon + to the compiler." >&2;};; + *) + as_fn_error $? "--enable-arm-neon=${enable_arm_neon}: invalid value" "$LINENO" 5 + esac +fi + + +# Add ARM specific files to all builds where the host_cpu is arm ('arm*') or +# where ARM optimizations were explicitly requested (this allows a fallback if a +# future host CPU does not match 'arm*') + + if test "$enable_arm_neon" != 'no' && + case "$host_cpu" in + arm*|aarch64*) :;; + *) test "$enable_arm_neon" != '';; + esac; then + PNG_ARM_NEON_TRUE= + PNG_ARM_NEON_FALSE='#' +else + PNG_ARM_NEON_TRUE='#' + PNG_ARM_NEON_FALSE= +fi + + +# MIPS +# === +# +# MIPS MSA (SIMD) support. + +# Check whether --enable-mips-msa was given. +if test "${enable_mips_msa+set}" = set; then : + enableval=$enable_mips_msa; case "$enableval" in + no|off) + # disable the default enabling on __mips_msa systems: + +$as_echo "#define PNG_MIPS_MSA_OPT 0" >>confdefs.h + + # Prevent inclusion of the assembler files below: + enable_mips_msa=no;; + check) + +$as_echo "#define PNG_MIPS_MSA_CHECK_SUPPORTED /**/" >>confdefs.h +;; + api) + +$as_echo "#define PNG_MIPS_MSA_API_SUPPORTED /**/" >>confdefs.h +;; + yes|on) + +$as_echo "#define PNG_MIPS_MSA_OPT 2" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-mips-msa: please specify 'check' or 'api', if + you want the optimizations unconditionally pass '-mmsa -mfp64' + to the compiler." >&5 +$as_echo "$as_me: WARNING: --enable-mips-msa: please specify 'check' or 'api', if + you want the optimizations unconditionally pass '-mmsa -mfp64' + to the compiler." >&2;};; + *) + as_fn_error $? "--enable-mips-msa=${enable_mips_msa}: invalid value" "$LINENO" 5 + esac +fi + + +# Add MIPS specific files to all builds where the host_cpu is mips ('mips*') or +# where MIPS optimizations were explicitly requested (this allows a fallback if a +# future host CPU does not match 'mips*') + + if test "$enable_mips_msa" != 'no' && + case "$host_cpu" in + mipsel*|mips64el*) :;; + esac; then + PNG_MIPS_MSA_TRUE= + PNG_MIPS_MSA_FALSE='#' +else + PNG_MIPS_MSA_TRUE='#' + PNG_MIPS_MSA_FALSE= +fi + + +# INTEL +# ===== +# +# INTEL SSE (SIMD) support. + +# Check whether --enable-intel-sse was given. +if test "${enable_intel_sse+set}" = set; then : + enableval=$enable_intel_sse; case "$enableval" in + no|off) + # disable the default enabling: + +$as_echo "#define PNG_INTEL_SSE_OPT 0" >>confdefs.h + + # Prevent inclusion of the assembler files below: + enable_intel_sse=no;; + yes|on) + +$as_echo "#define PNG_INTEL_SSE_OPT 1" >>confdefs.h +;; + *) + as_fn_error $? "--enable-intel-sse=${enable_intel_sse}: invalid value" "$LINENO" 5 + esac +fi + + +# Add Intel specific files to all builds where the host_cpu is Intel ('x86*') +# or where Intel optimizations were explicitly requested (this allows a +# fallback if a future host CPU does not match 'x86*') + if test "$enable_intel_sse" != 'no' && + case "$host_cpu" in + i?86|x86_64) :;; + *) test "$enable_intel_sse" != '';; + esac; then + PNG_INTEL_SSE_TRUE= + PNG_INTEL_SSE_FALSE='#' +else + PNG_INTEL_SSE_TRUE='#' + PNG_INTEL_SSE_FALSE= +fi + + +# PowerPC +# === +# +# PowerPC VSX (SIMD) support. + +# Check whether --enable-powerpc-vsx was given. +if test "${enable_powerpc_vsx+set}" = set; then : + enableval=$enable_powerpc_vsx; case "$enableval" in + no|off) + # disable the default enabling on __ppc64__ systems: + +$as_echo "#define PNG_POWERPC_VSX_OPT 0" >>confdefs.h + + # Prevent inclusion of the platform specific files below: + enable_powerpc_vsx=no;; + check) + +$as_echo "#define PNG_POWERPC_VSX_CHECK_SUPPORTED /**/" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-powerpc-vsx Please check contrib/powerpc/README file + for the list of supported OSes." >&5 +$as_echo "$as_me: WARNING: --enable-powerpc-vsx Please check contrib/powerpc/README file + for the list of supported OSes." >&2;};; + api) + +$as_echo "#define PNG_POWERPC_VSX_API_SUPPORTED /**/" >>confdefs.h +;; + yes|on) + +$as_echo "#define PNG_POWERPC_VSX_OPT 2" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-powerpc-vsx: please specify 'check' or 'api', if + you want the optimizations unconditionally pass '-maltivec -mvsx' + or '-mcpu=power8'to the compiler." >&5 +$as_echo "$as_me: WARNING: --enable-powerpc-vsx: please specify 'check' or 'api', if + you want the optimizations unconditionally pass '-maltivec -mvsx' + or '-mcpu=power8'to the compiler." >&2;};; + *) + as_fn_error $? "--enable-powerpc-vsx=${enable_powerpc_vsx}: invalid value" "$LINENO" 5 + esac +fi + + +# Add PowerPC specific files to all builds where the host_cpu is powerpc('powerpc*') or +# where POWERPC optimizations were explicitly requested (this allows a fallback if a +# future host CPU does not match 'powerpc*') + + if test "$enable_powerpc_vsx" != 'no' && + case "$host_cpu" in + powerpc*|ppc64*) :;; + esac; then + PNG_POWERPC_VSX_TRUE= + PNG_POWERPC_VSX_FALSE='#' +else + PNG_POWERPC_VSX_TRUE='#' + PNG_POWERPC_VSX_FALSE= +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: Extra options for compiler: $PNG_COPTS" >&5 +$as_echo "$as_me: Extra options for compiler: $PNG_COPTS" >&6;} + +# Config files, substituting as above +ac_config_files="$ac_config_files Makefile libpng.pc:libpng.pc.in" + +ac_config_files="$ac_config_files libpng-config:libpng-config.in" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CLOCK_GETTIME_TRUE}" && test -z "${HAVE_CLOCK_GETTIME_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CLOCK_GETTIME\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_SOLARIS_LD_TRUE}" && test -z "${HAVE_SOLARIS_LD_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SOLARIS_LD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DO_PNG_PREFIX_TRUE}" && test -z "${DO_PNG_PREFIX_FALSE}"; then + as_fn_error $? "conditional \"DO_PNG_PREFIX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DO_INSTALL_LINKS_TRUE}" && test -z "${DO_INSTALL_LINKS_FALSE}"; then + as_fn_error $? "conditional \"DO_INSTALL_LINKS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DO_INSTALL_LIBPNG_PC_TRUE}" && test -z "${DO_INSTALL_LIBPNG_PC_FALSE}"; then + as_fn_error $? "conditional \"DO_INSTALL_LIBPNG_PC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DO_INSTALL_LIBPNG_CONFIG_TRUE}" && test -z "${DO_INSTALL_LIBPNG_CONFIG_FALSE}"; then + as_fn_error $? "conditional \"DO_INSTALL_LIBPNG_CONFIG\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${PNG_ARM_NEON_TRUE}" && test -z "${PNG_ARM_NEON_FALSE}"; then + as_fn_error $? "conditional \"PNG_ARM_NEON\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${PNG_MIPS_MSA_TRUE}" && test -z "${PNG_MIPS_MSA_FALSE}"; then + as_fn_error $? "conditional \"PNG_MIPS_MSA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${PNG_INTEL_SSE_TRUE}" && test -z "${PNG_INTEL_SSE_FALSE}"; then + as_fn_error $? "conditional \"PNG_INTEL_SSE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${PNG_POWERPC_VSX_TRUE}" && test -z "${PNG_POWERPC_VSX_FALSE}"; then + as_fn_error $? "conditional \"PNG_POWERPC_VSX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by libpng $as_me 1.6.37, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +libpng config.status 1.6.37 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SED \ +GREP \ +EGREP \ +FGREP \ +SHELL \ +ECHO \ +LD \ +AS \ +DLLTOOL \ +OBJDUMP \ +PATH_SEPARATOR \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ +nm_file_list_spec \ +lt_cv_truncate_bin \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' + +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "libpng.pc") CONFIG_FILES="$CONFIG_FILES libpng.pc:libpng.pc.in" ;; + "libpng-config") CONFIG_FILES="$CONFIG_FILES libpng-config:libpng-config.in" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# The names of the tagged configurations supported by this script. +available_tags='' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and where our libraries should be installed. +lt_sysroot=$lt_sysroot + +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain=$ac_aux_dir/ltmain.sh + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + "libpng-config":F) chmod +x libpng-config ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/Engine/lib/lpng/configure.ac b/Engine/lib/lpng/configure.ac new file mode 100644 index 000000000..52dba94b4 --- /dev/null +++ b/Engine/lib/lpng/configure.ac @@ -0,0 +1,532 @@ +# configure.ac + +# Copyright (c) 2018 Cosmin Truta +# Copyright (c) 2004-2016 Glenn Randers-Pehrson + +# This code is released under the libpng license. +# For conditions of distribution and use, see the disclaimer +# and license in png.h + +dnl Process this file with autoconf to produce a configure script. +dnl +dnl Minor upgrades (compatible ABI): increment the package version +dnl (third field in two places below) and set the PNGLIB_RELEASE +dnl variable. +dnl +dnl Major upgrades (incompatible ABI): increment the package major +dnl version (second field, or first if desired), set the minor +dnl to 0, set PNGLIB_MAJOR below *and* follow the instructions in +dnl Makefile.am to upgrade the package name. + +dnl This is here to prevent earlier autoconf from being used, it +dnl should not be necessary to regenerate configure if the time +dnl stamps are correct +AC_PREREQ([2.68]) + +dnl Version number stuff here: + +AC_INIT([libpng],[1.6.37],[png-mng-implement@lists.sourceforge.net]) +AC_CONFIG_MACRO_DIR([scripts]) + +# libpng does not follow GNU file name conventions (hence 'foreign') +# color-tests requires automake 1.11 or later +# silent-rules requires automake 1.11 or later +# dist-xz requires automake 1.11 or later +# 1.12.2 fixes a security issue in 1.11.2 and 1.12.1 +# 1.13 is required for parallel tests +AM_INIT_AUTOMAKE([1.13 foreign dist-xz color-tests silent-rules subdir-objects]) +# The following line causes --disable-maintainer-mode to be the default to +# configure. This is necessary because libpng distributions cannot rely on the +# time stamps of the autotools generated files being correct +AM_MAINTAINER_MODE + +dnl configure.ac and Makefile.am expect automake 1.11.2 or a compatible later +dnl version; aclocal.m4 will generate a failure if you use a prior version of +dnl automake, so the following is not necessary (and is not defined anyway): +dnl AM_PREREQ([1.11.2]) +dnl stop configure from automagically running automake + +PNGLIB_VERSION=1.6.37 +PNGLIB_MAJOR=1 +PNGLIB_MINOR=6 +PNGLIB_RELEASE=37 + +dnl End of version number stuff + +AC_CONFIG_SRCDIR([pngget.c]) +AC_CONFIG_HEADERS([config.h]) + +# Checks for programs. +AC_LANG([C]) +AC_PROG_CC +AM_PROG_AS +LT_PATH_LD +AC_PROG_CPP +AC_PROG_AWK +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET + +dnl libtool/libtoolize; version 2.4.2 is the tested version. This or any +dnl compatible later version may be used +LT_INIT([win32-dll]) +LT_PREREQ([2.4.2]) + +# Some awks crash when confronted with pnglibconf.dfa, do a test run now +# to make sure this doesn't happen +AC_MSG_CHECKING([that AWK works]) +if ${AWK} -f ${srcdir}/scripts/options.awk out="/dev/null" version=search\ + ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\ + ${srcdir}/pngusr.dfa 1>&2 +then + AC_MSG_RESULT([ok]) +else + AC_MSG_FAILURE([failed], 1) +fi + +# This is a remnant of the old cc -E validation, where it may have been +# necessary to use a different preprocessor for .dfn files +DFNCPP="$CPP" +AC_SUBST(DFNCPP) + +# -Werror cannot be passed to GCC in CFLAGS because configure will fail (it +# checks the compiler with a program that generates a warning), add the +# following option to deal with this +AC_ARG_VAR(PNG_COPTS, + [additional flags for the C compiler, use this for options that would] + [cause configure itself to fail]) +AC_ARG_ENABLE(werror, + AS_HELP_STRING([[[--enable-werror[=OPT]]]], + [Pass -Werror or the given argument to the compiler if it is supported]), + [test "$enable_werror" = "yes" && enable_werror="-Werror" + if test "$enable_werror" != "no"; then + sav_CFLAGS="$CFLAGS" + CFLAGS="$enable_werror $CFLAGS" + AC_MSG_CHECKING([if the compiler allows $enable_werror]) + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([ + [int main(int argc, char **argv){] + [return argv[argc-1][0];] + [}]])], + AC_MSG_RESULT(yes) + PNG_COPTS="$PNG_COPTS $enable_werror", + AC_MSG_RESULT(no)) + CFLAGS="$sav_CFLAGS" + fi],) + +# For GCC 5 the default mode for C is -std=gnu11 instead of -std=gnu89 +# In pngpriv.h we request just the POSIX 1003.1 and C89 APIs by defining _POSIX_SOURCE to 1 +# This is incompatible with the new default mode, so we test for that and force the +# "-std=c89" compiler option: +AC_MSG_CHECKING([if we need to force back C standard to C89]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ + [#define _POSIX_SOURCE 1] + [#include ] + ])], + AC_MSG_RESULT(no),[ + if test "x$GCC" != "xyes"; then + AC_MSG_ERROR( + [Forcing back to C89 is required but the flags are only known for GCC]) + fi + AC_MSG_RESULT(yes) + CFLAGS="$CFLAGS -std=c89" +]) + +# Checks for header files. +AC_HEADER_STDC + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_SIZE_T +AC_STRUCT_TM +AC_C_RESTRICT + +# Checks for library functions. +AC_FUNC_STRTOD +AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_MSG_ERROR(cannot find pow)) ) + +# Some later POSIX 1003.1 functions are required for test programs, failure here +# is soft (the corresponding test program is not built). +AC_CHECK_FUNC([clock_gettime],,[AC_MSG_WARN([not building timepng])]) +AM_CONDITIONAL([HAVE_CLOCK_GETTIME], [test "$ac_cv_func_clock_gettime" = "yes"]) + +AC_ARG_WITH(zlib-prefix, + AS_HELP_STRING([[[--with-zlib-prefix]]], + [prefix that may have been used in installed zlib]), + [ZPREFIX=${withval}], + [ZPREFIX='z_']) +AC_CHECK_LIB(z, zlibVersion, , + AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, , AC_MSG_ERROR(zlib not installed))) + +# The following is for pngvalid, to ensure it catches FP errors even on +# platforms that don't enable FP exceptions, the function appears in the math +# library (typically), it's not an error if it is not found. +AC_CHECK_LIB([m], [feenableexcept]) +AC_CHECK_FUNCS([feenableexcept]) + +AC_MSG_CHECKING([if using Solaris linker]) +SLD=`$LD --version 2>&1 | grep Solaris` +if test "$SLD"; then + have_solaris_ld=yes + AC_MSG_RESULT(yes) +else + have_solaris_ld=no + AC_MSG_RESULT(no) +fi +AM_CONDITIONAL(HAVE_SOLARIS_LD, test "$have_solaris_ld" = "yes") + +AC_MSG_CHECKING([if libraries can be versioned]) +# Special case for PE/COFF platforms: ld reports +# support for version-script, but doesn't actually +# DO anything with it. +case $host in +*cygwin* | *mingw32* | *interix* ) + have_ld_version_script=no + AC_MSG_RESULT(no) +;; +* ) + +if test "$have_solaris_ld" = "yes"; then + GLD=`$LD --help < /dev/null 2>&1 | grep 'M mapfile'` +else + GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` +fi + +if test "$GLD"; then + have_ld_version_script=yes + AC_MSG_RESULT(yes) +else + have_ld_version_script=no + AC_MSG_RESULT(no) + AC_MSG_WARN(*** You have not enabled versioned symbols.) +fi +;; +esac + +AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") + +if test "$have_ld_version_script" = "yes"; then + AC_MSG_CHECKING([for symbol prefix]) + SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \ + | ${CPP-${CC-gcc} -E} - 2>&1 \ + | ${EGREP-grep} "^PREFIX=" \ + | ${SED-sed} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"` + AC_SUBST(SYMBOL_PREFIX) + AC_MSG_RESULT($SYMBOL_PREFIX) +fi + +# Substitutions for .in files +AC_SUBST(PNGLIB_VERSION) +AC_SUBST(PNGLIB_MAJOR) +AC_SUBST(PNGLIB_MINOR) +AC_SUBST(PNGLIB_RELEASE) + +# Additional arguments (and substitutions) +# Allow the pkg-config directory to be set +AC_ARG_WITH(pkgconfigdir, + AS_HELP_STRING([[[--with-pkgconfigdir]]], + [Use the specified pkgconfig dir (default is libdir/pkgconfig)]), + [pkgconfigdir=${withval}], + [pkgconfigdir='${libdir}/pkgconfig']) + +AC_SUBST([pkgconfigdir]) +AC_MSG_NOTICE([[pkgconfig directory is ${pkgconfigdir}]]) + +# Make the *-config binary config scripts optional +AC_ARG_WITH(binconfigs, + AS_HELP_STRING([[[--with-binconfigs]]], + [Generate shell libpng-config scripts as well as pkg-config data] + [@<:@default=yes@:>@]), + [if test "${withval}" = no; then + binconfigs= + AC_MSG_NOTICE([[libpng-config scripts will not be built]]) + else + binconfigs='${binconfigs}' + fi], + [binconfigs='${binconfigs}']) +AC_SUBST([binconfigs]) + +# Support for prefixes to the API function names; this will generate defines +# at the start of the build to rename exported library functions +AC_ARG_WITH(libpng-prefix, + AS_HELP_STRING([[[--with-libpng-prefix]]], + [prefix libpng exported function (API) names with the given value]), + [if test "${withval:-no}" != "no"; then + AC_SUBST([PNG_PREFIX], [${withval}]) + fi]) +AM_CONDITIONAL([DO_PNG_PREFIX], [test "${with_libpng_prefix:-no}" != "no"]) + +# Control over what links are made for installed files. Versioned files are +# always installed, when the following options are turned on corresponding +# unversioned links are also created (normally as symbolic links): +AC_ARG_ENABLE([unversioned-links], + AS_HELP_STRING([[[--enable-unversioned-links]]], + [Installed libpng header files are placed in a versioned subdirectory] + [and installed libpng library (including DLL) files are versioned.] + [If this option is enabled unversioned links will be created pointing to] + [the corresponding installed files. If you use libpng.pc or] + [libpng-config for all builds you do not need these links, but if you] + [compile programs directly they will typically #include and] + [link with -lpng; in that case you need the links.] + [The links can be installed manually using 'make install-header-links'] + [and 'make install-library-links' and can be removed using the] + [corresponding uninstall- targets. If you do enable this option every] + [libpng 'make install' will recreate the links to point to the just] + [installed version of libpng. The default is to create the links;] + [use --disable-unversioned-links to change this])) + +# The AM_CONDITIONAL test is written so that the default is enabled; +# --disable-unversioned-links must be given to turn the option off. +AM_CONDITIONAL([DO_INSTALL_LINKS],[test "$enable_unversioned_links" != "no"]) + +AC_ARG_ENABLE([unversioned-libpng-pc], + AS_HELP_STRING([[[--enable-unversioned-libpng-pc]]], + [Install the configuration file 'libpng.pc' as a link to the versioned] + [version. This is done by default - use --disable-unversioned-libpng-pc] + [to change this.])) +AM_CONDITIONAL([DO_INSTALL_LIBPNG_PC], + [test "$enable_unversioned_libpng_pc" != "no"]) + +AC_ARG_ENABLE([unversioned-libpng-config], + AS_HELP_STRING([[[--enable-unversioned-libpng-config]]], + [Install the configuration file 'libpng-config' as a link to the] + [versioned version. This is done by default - use] + [--disable-unversioned-libpng-config to change this.])) +AM_CONDITIONAL([DO_INSTALL_LIBPNG_CONFIG], + [test "$enable_unversioned_libpng_config" != "no"]) + +# HOST SPECIFIC OPTIONS +# ===================== +# +# DEFAULT +# ======= +# +AC_ARG_ENABLE([hardware-optimizations], + AS_HELP_STRING([[[--enable-hardware-optimizations]]], + [Enable hardware optimizations: =no/off, yes/on:]), + [case "$enableval" in + no|off) + # disable hardware optimization on all systems: + enable_arm_neon=no + AC_DEFINE([PNG_ARM_NEON_OPT], [0], + [Disable ARM_NEON optimizations]) + enable_mips_msa=no + AC_DEFINE([PNG_MIPS_MSA_OPT], [0], + [Disable MIPS_MSA optimizations]) + enable_powerpc_vsx=no + AC_DEFINE([PNG_POWERPC_VSX_OPT], [0], + [Disable POWERPC VSX optimizations]) + enable_intel_sse=no + AC_DEFINE([PNG_INTEL_SSE_OPT], [0], + [Disable INTEL_SSE optimizations]) + ;; + *) + # allow enabling hardware optimization on any system: + case "$host_cpu" in + arm*|aarch64*) + enable_arm_neon=yes + AC_DEFINE([PNG_ARM_NEON_OPT], [0], + [Enable ARM_NEON optimizations]) + ;; + mipsel*|mips64el*) + enable_mips_msa=yes + AC_DEFINE([PNG_MIPS_MSA_OPT], [0], + [Enable MIPS_MSA optimizations]) + ;; + i?86|x86_64) + enable_intel_sse=yes + AC_DEFINE([PNG_INTEL_SSE_OPT], [1], + [Enable Intel SSE optimizations]) + ;; + powerpc*|ppc64*) + enable_powerpc_vsx=yes + AC_DEFINE([PNG_POWERPC_VSX_OPT], [2], + [Enable POWERPC VSX optimizations]) + ;; + esac + ;; + esac]) + +# ARM +# === +# +# ARM NEON (SIMD) support. + +AC_ARG_ENABLE([arm-neon], + AS_HELP_STRING([[[--enable-arm-neon]]], + [Enable ARM NEON optimizations: =no/off, check, api, yes/on:] + [no/off: disable the optimizations; check: use internal checking code] + [(deprecated and poorly supported); api: disable by default, enable by] + [a call to png_set_option; yes/on: turn on unconditionally.] + [If not specified: determined by the compiler.]), + [case "$enableval" in + no|off) + # disable the default enabling on __ARM_NEON__ systems: + AC_DEFINE([PNG_ARM_NEON_OPT], [0], + [Disable ARM Neon optimizations]) + # Prevent inclusion of the assembler files below: + enable_arm_neon=no;; + check) + AC_DEFINE([PNG_ARM_NEON_CHECK_SUPPORTED], [], + [Check for ARM Neon support at run-time]);; + api) + AC_DEFINE([PNG_ARM_NEON_API_SUPPORTED], [], + [Turn on ARM Neon optimizations at run-time]);; + yes|on) + AC_DEFINE([PNG_ARM_NEON_OPT], [2], + [Enable ARM Neon optimizations]) + AC_MSG_WARN([--enable-arm-neon: please specify 'check' or 'api', if] + [you want the optimizations unconditionally pass -mfpu=neon] + [to the compiler.]);; + *) + AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}: invalid value]) + esac]) + +# Add ARM specific files to all builds where the host_cpu is arm ('arm*') or +# where ARM optimizations were explicitly requested (this allows a fallback if a +# future host CPU does not match 'arm*') + +AM_CONDITIONAL([PNG_ARM_NEON], + [test "$enable_arm_neon" != 'no' && + case "$host_cpu" in + arm*|aarch64*) :;; + *) test "$enable_arm_neon" != '';; + esac]) + +# MIPS +# === +# +# MIPS MSA (SIMD) support. + +AC_ARG_ENABLE([mips-msa], + AS_HELP_STRING([[[--enable-mips-msa]]], + [Enable MIPS MSA optimizations: =no/off, check, api, yes/on:] + [no/off: disable the optimizations; check: use internal checking code] + [(deprecated and poorly supported); api: disable by default, enable by] + [a call to png_set_option; yes/on: turn on unconditionally.] + [If not specified: determined by the compiler.]), + [case "$enableval" in + no|off) + # disable the default enabling on __mips_msa systems: + AC_DEFINE([PNG_MIPS_MSA_OPT], [0], + [Disable MIPS MSA optimizations]) + # Prevent inclusion of the assembler files below: + enable_mips_msa=no;; + check) + AC_DEFINE([PNG_MIPS_MSA_CHECK_SUPPORTED], [], + [Check for MIPS MSA support at run-time]);; + api) + AC_DEFINE([PNG_MIPS_MSA_API_SUPPORTED], [], + [Turn on MIPS MSA optimizations at run-time]);; + yes|on) + AC_DEFINE([PNG_MIPS_MSA_OPT], [2], + [Enable MIPS MSA optimizations]) + AC_MSG_WARN([--enable-mips-msa: please specify 'check' or 'api', if] + [you want the optimizations unconditionally pass '-mmsa -mfp64'] + [to the compiler.]);; + *) + AC_MSG_ERROR([--enable-mips-msa=${enable_mips_msa}: invalid value]) + esac]) + +# Add MIPS specific files to all builds where the host_cpu is mips ('mips*') or +# where MIPS optimizations were explicitly requested (this allows a fallback if a +# future host CPU does not match 'mips*') + +AM_CONDITIONAL([PNG_MIPS_MSA], + [test "$enable_mips_msa" != 'no' && + case "$host_cpu" in + mipsel*|mips64el*) :;; + esac]) + +# INTEL +# ===== +# +# INTEL SSE (SIMD) support. + +AC_ARG_ENABLE([intel-sse], + AS_HELP_STRING([[[--enable-intel-sse]]], + [Enable Intel SSE optimizations: =no/off, yes/on:] + [no/off: disable the optimizations;] + [yes/on: enable the optimizations.] + [If not specified: determined by the compiler.]), + [case "$enableval" in + no|off) + # disable the default enabling: + AC_DEFINE([PNG_INTEL_SSE_OPT], [0], + [Disable Intel SSE optimizations]) + # Prevent inclusion of the assembler files below: + enable_intel_sse=no;; + yes|on) + AC_DEFINE([PNG_INTEL_SSE_OPT], [1], + [Enable Intel SSE optimizations]);; + *) + AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value]) + esac]) + +# Add Intel specific files to all builds where the host_cpu is Intel ('x86*') +# or where Intel optimizations were explicitly requested (this allows a +# fallback if a future host CPU does not match 'x86*') +AM_CONDITIONAL([PNG_INTEL_SSE], + [test "$enable_intel_sse" != 'no' && + case "$host_cpu" in + i?86|x86_64) :;; + *) test "$enable_intel_sse" != '';; + esac]) + +# PowerPC +# === +# +# PowerPC VSX (SIMD) support. + +AC_ARG_ENABLE([powerpc-vsx], +AS_HELP_STRING([[[--enable-powerpc-vsx]]], + [Enable POWERPC VSX optimizations: =no/off, check, api, yes/on:] + [no/off: disable the optimizations; check: use internal checking code] + [api: disable by default, enable by a call to png_set_option] + [yes/on: turn on unconditionally.] + [If not specified: determined by the compiler.]), + [case "$enableval" in + no|off) + # disable the default enabling on __ppc64__ systems: + AC_DEFINE([PNG_POWERPC_VSX_OPT], [0], + [Disable POWERPC VSX optimizations]) + # Prevent inclusion of the platform specific files below: + enable_powerpc_vsx=no;; + check) + AC_DEFINE([PNG_POWERPC_VSX_CHECK_SUPPORTED], [], + [Check for POWERPC VSX support at run-time]) + AC_MSG_WARN([--enable-powerpc-vsx Please check contrib/powerpc/README file] + [for the list of supported OSes.]);; + api) + AC_DEFINE([PNG_POWERPC_VSX_API_SUPPORTED], [], + [Turn on POWERPC VSX optimizations at run-time]);; + yes|on) + AC_DEFINE([PNG_POWERPC_VSX_OPT], [2], + [Enable POWERPC VSX optimizations]) + AC_MSG_WARN([--enable-powerpc-vsx: please specify 'check' or 'api', if] + [you want the optimizations unconditionally pass '-maltivec -mvsx'] + [or '-mcpu=power8'to the compiler.]);; + *) + AC_MSG_ERROR([--enable-powerpc-vsx=${enable_powerpc_vsx}: invalid value]) + esac]) + +# Add PowerPC specific files to all builds where the host_cpu is powerpc('powerpc*') or +# where POWERPC optimizations were explicitly requested (this allows a fallback if a +# future host CPU does not match 'powerpc*') + +AM_CONDITIONAL([PNG_POWERPC_VSX], + [test "$enable_powerpc_vsx" != 'no' && + case "$host_cpu" in + powerpc*|ppc64*) :;; + esac]) + + +AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]]) + +# Config files, substituting as above +AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in]) +AC_CONFIG_FILES([libpng-config:libpng-config.in], + [chmod +x libpng-config]) + +AC_OUTPUT diff --git a/Engine/lib/lpng/contrib/README.txt b/Engine/lib/lpng/contrib/README.txt new file mode 100644 index 000000000..97963c6d5 --- /dev/null +++ b/Engine/lib/lpng/contrib/README.txt @@ -0,0 +1,5 @@ + +This "contrib" directory contains contributions which are not necessarily under +the libpng license, although all are open source. They are not part of +libpng proper and are not used for building the library, although some are used +for testing the library via "make check". diff --git a/Engine/lib/lpng/contrib/arm-neon/README b/Engine/lib/lpng/contrib/arm-neon/README new file mode 100644 index 000000000..b4248cf28 --- /dev/null +++ b/Engine/lib/lpng/contrib/arm-neon/README @@ -0,0 +1,83 @@ +OPERATING SYSTEM SPECIFIC ARM NEON DETECTION +-------------------------------------------- + +Detection of the ability to execute ARM NEON on an ARM processor requires +operating system support. (The information is not available in user mode.) + +HOW TO USE THIS +--------------- + +This directory contains C code fragments that can be included in arm/arm_init.c +by setting the macro PNG_ARM_NEON_FILE to the file name in "" or <> at build +time. This setting is not recorded in pnglibconf.h and can be changed simply by +rebuilding arm/arm_init.o with the required macro definition. + +For any of this code to be used the ARM NEON code must be enabled and run time +checks must be supported. I.e.: + +#if PNG_ARM_NEON_OPT > 0 +#ifdef PNG_ARM_NEON_CHECK_SUPPORTED + +This is done in a 'configure' build by passing configure the argument: + + --enable-arm-neon=check + +Apart from the basic Linux implementation in contrib/arm-neon/linux.c this code +is unsupported. That means that it is not even compiled on a regular basis and +may be broken in any given minor release. + +FILE FORMAT +----------- + +Each file documents its testing status as of the last time it was tested (which +may have been a long time ago): + +STATUS: one of: + SUPPORTED: This indicates that the file is included in the regularly + performed test builds and bugs are fixed when discovered. + COMPILED: This indicates that the code did compile at least once. See the + more detailed description for the extent to which the result was + successful. + TESTED: This means the code was fully compiled into the libpng test programs + and these were run at least once. + +BUG REPORTS: an email address to which to send reports of problems + +The file is a fragment of C code. It should not define any 'extern' symbols; +everything should be static. It must define the function: + +static int png_have_neon(png_structp png_ptr); + +That function must return 1 if ARM NEON instructions are supported, 0 if not. +It must not execute png_error unless it detects a bug. A png_error will prevent +the reading of the PNG and in the future, writing too. + +BUG REPORTS +----------- + +If you mail a bug report for any file that is not SUPPORTED there may only be +limited response. Consider fixing it and sending a patch to fix the problem - +this is more likely to result in action. + +CONTRIBUTIONS +------------- + +You may send contributions of new implementations to +png-mng-implement@sourceforge.net. Please write code in strict C90 C where +possible. Obviously OS dependencies are to be expected. If you submit code you +must have the authors permission and it must have a license that is acceptable +to the current maintainer; in particular that license must permit modification +and redistribution. + +Please try to make the contribution a single file and give the file a clear and +unambiguous name that identifies the target OS. If multiple files really are +required put them all in a sub-directory. + +You must also be prepared to handle bug reports from users of the code, either +by joining the png-mng-implement mailing list or by providing an email for the +"BUG REPORTS" entry or both. Please make sure that the header of the file +contains the STATUS and BUG REPORTS fields as above. + +Please list the OS requirements as precisely as possible. Ideally you should +also list the environment in which the code has been tested and certainly list +any environments where you suspect it might not work. diff --git a/Engine/lib/lpng/contrib/arm-neon/android-ndk.c b/Engine/lib/lpng/contrib/arm-neon/android-ndk.c new file mode 100644 index 000000000..fb3a4898d --- /dev/null +++ b/Engine/lib/lpng/contrib/arm-neon/android-ndk.c @@ -0,0 +1,39 @@ +/* contrib/arm-neon/android-ndk.c + * + * Copyright (c) 2014 Glenn Randers-Pehrson + * Written by John Bowler, 2014. + * Last changed in libpng 1.6.10 [March 6, 2014] + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + * + * SEE contrib/arm-neon/README before reporting bugs + * + * STATUS: COMPILED, UNTESTED + * BUG REPORTS: png-mng-implement@sourceforge.net + * + * png_have_neon implemented for the Android NDK, see: + * + * Documentation: + * http://www.kandroid.org/ndk/docs/CPU-ARM-NEON.html + * https://code.google.com/p/android/issues/detail?id=49065 + * + * NOTE: this requires that libpng is built against the Android NDK and linked + * with an implementation of the Android ARM 'cpu-features' library. The code + * has been compiled only, not linked: no version of the library has been found, + * only the header files exist in the NDK. + */ +#include + +static int +png_have_neon(png_structp png_ptr) +{ + /* This is a whole lot easier than the linux code, however it is probably + * implemented as below, therefore it is better to cache the result (these + * function calls may be slow!) + */ + PNG_UNUSED(png_ptr) + return android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM && + (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; +} diff --git a/Engine/lib/lpng/contrib/arm-neon/linux-auxv.c b/Engine/lib/lpng/contrib/arm-neon/linux-auxv.c new file mode 100644 index 000000000..4d26bd3b3 --- /dev/null +++ b/Engine/lib/lpng/contrib/arm-neon/linux-auxv.c @@ -0,0 +1,120 @@ +/* contrib/arm-neon/linux-auxv.c + * + * Copyright (c) 2014 Glenn Randers-Pehrson + * Written by Mans Rullgard, 2011. + * Last changed in libpng 1.6.10 [March 6, 2014] + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + * + * SEE contrib/arm-neon/README before reporting bugs + * + * STATUS: COMPILED, TESTED + * BUG REPORTS: png-mng-implement@sourceforge.net + * + * png_have_neon implemented for Linux versions which allow access to + * /proc/self/auxv. This is probably faster, cleaner and safer than the code to + * read /proc/cpuinfo in contrib/arm-neon/linux, however it is yet another piece + * of potentially untested code and has more complex dependencies than the code + * to read cpuinfo. + * + * This generic __linux__ implementation requires reading /proc/self/auxv and + * looking at each element for one that records NEON capabilities. + */ +#include /* for POSIX 1003.1 */ +#include /* for EINTR */ + +#include +#include +#include +#include +#include + +/* A read call may be interrupted, in which case it returns -1 and sets errno to + * EINTR if nothing was done, otherwise (if something was done) a partial read + * may result. + */ +static size_t +safe_read(png_structp png_ptr, int fd, void *buffer_in, size_t nbytes) +{ + size_t ntotal = 0; + char *buffer = png_voidcast(char*, buffer_in); + + while (nbytes > 0) + { + unsigned int nread; + int iread; + + /* Passing nread > INT_MAX to read is implementation defined in POSIX + * 1003.1, therefore despite the unsigned argument portable code must + * limit the value to INT_MAX! + */ + if (nbytes > INT_MAX) + nread = INT_MAX; + + else + nread = (unsigned int)/*SAFE*/nbytes; + + iread = read(fd, buffer, nread); + + if (iread == -1) + { + /* This is the devil in the details, a read can terminate early with 0 + * bytes read because of EINTR, yet it still returns -1 otherwise end + * of file cannot be distinguished. + */ + if (errno != EINTR) + { + png_warning(png_ptr, "/proc read failed"); + return 0; /* I.e., a permanent failure */ + } + } + + else if (iread < 0) + { + /* Not a valid 'read' result: */ + png_warning(png_ptr, "OS /proc read bug"); + return 0; + } + + else if (iread > 0) + { + /* Continue reading until a permanent failure, or EOF */ + buffer += iread; + nbytes -= (unsigned int)/*SAFE*/iread; + ntotal += (unsigned int)/*SAFE*/iread; + } + + else + return ntotal; + } + + return ntotal; /* nbytes == 0 */ +} + +static int +png_have_neon(png_structp png_ptr) +{ + int fd = open("/proc/self/auxv", O_RDONLY); + Elf32_auxv_t aux; + + /* Failsafe: failure to open means no NEON */ + if (fd == -1) + { + png_warning(png_ptr, "/proc/self/auxv open failed"); + return 0; + } + + while (safe_read(png_ptr, fd, &aux, sizeof aux) == sizeof aux) + { + if (aux.a_type == AT_HWCAP && (aux.a_un.a_val & HWCAP_NEON) != 0) + { + close(fd); + return 1; + } + } + + close(fd); + return 0; +} diff --git a/Engine/lib/lpng/contrib/arm-neon/linux.c b/Engine/lib/lpng/contrib/arm-neon/linux.c new file mode 100644 index 000000000..a9bc360dd --- /dev/null +++ b/Engine/lib/lpng/contrib/arm-neon/linux.c @@ -0,0 +1,161 @@ +/* contrib/arm-neon/linux.c + * + * Last changed in libpng 1.6.31 [July 27, 2017] + * Copyright (c) 2014, 2017 Glenn Randers-Pehrson + * Written by John Bowler, 2014, 2017. + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + * + * SEE contrib/arm-neon/README before reporting bugs + * + * STATUS: SUPPORTED + * BUG REPORTS: png-mng-implement@sourceforge.net + * + * png_have_neon implemented for Linux by reading the widely available + * pseudo-file /proc/cpuinfo. + * + * This code is strict ANSI-C and is probably moderately portable; it does + * however use and it assumes that /proc/cpuinfo is never localized. + */ +#include + +static int +png_have_neon(png_structp png_ptr) +{ + FILE *f = fopen("/proc/cpuinfo", "rb"); + + if (f != NULL) + { + /* This is a simple state machine which reads the input byte-by-byte until + * it gets a match on the 'neon' feature or reaches the end of the stream. + */ + static const char ch_feature[] = { 70, 69, 65, 84, 85, 82, 69, 83 }; + static const char ch_neon[] = { 78, 69, 79, 78 }; + + enum + { + StartLine, Feature, Colon, StartTag, Neon, HaveNeon, SkipTag, SkipLine + } state; + int counter; + + for (state=StartLine, counter=0;;) + { + int ch = fgetc(f); + + if (ch == EOF) + { + /* EOF means error or end-of-file, return false; neon at EOF is + * assumed to be a mistake. + */ + fclose(f); + return 0; + } + + switch (state) + { + case StartLine: + /* Match spaces at the start of line */ + if (ch <= 32) /* skip control characters and space */ + break; + + counter=0; + state = Feature; + /* FALLTHROUGH */ + + case Feature: + /* Match 'FEATURE', ASCII case insensitive. */ + if ((ch & ~0x20) == ch_feature[counter]) + { + if (++counter == (sizeof ch_feature)) + state = Colon; + break; + } + + /* did not match 'feature' */ + state = SkipLine; + /* FALLTHROUGH */ + + case SkipLine: + skipLine: + /* Skip everything until we see linefeed or carriage return */ + if (ch != 10 && ch != 13) + break; + + state = StartLine; + break; + + case Colon: + /* Match any number of space or tab followed by ':' */ + if (ch == 32 || ch == 9) + break; + + if (ch == 58) /* i.e. ':' */ + { + state = StartTag; + break; + } + + /* Either a bad line format or a 'feature' prefix followed by + * other characters. + */ + state = SkipLine; + goto skipLine; + + case StartTag: + /* Skip space characters before a tag */ + if (ch == 32 || ch == 9) + break; + + state = Neon; + counter = 0; + /* FALLTHROUGH */ + + case Neon: + /* Look for 'neon' tag */ + if ((ch & ~0x20) == ch_neon[counter]) + { + if (++counter == (sizeof ch_neon)) + state = HaveNeon; + break; + } + + state = SkipTag; + /* FALLTHROUGH */ + + case SkipTag: + /* Skip non-space characters */ + if (ch == 10 || ch == 13) + state = StartLine; + + else if (ch == 32 || ch == 9) + state = StartTag; + break; + + case HaveNeon: + /* Have seen a 'neon' prefix, but there must be a space or new + * line character to terminate it. + */ + if (ch == 10 || ch == 13 || ch == 32 || ch == 9) + { + fclose(f); + return 1; + } + + state = SkipTag; + break; + + default: + png_error(png_ptr, "png_have_neon: internal error (bug)"); + } + } + } + +#ifdef PNG_WARNINGS_SUPPORTED + else + png_warning(png_ptr, "/proc/cpuinfo open failed"); +#endif + + return 0; +} diff --git a/Engine/lib/lpng/contrib/conftest/README b/Engine/lib/lpng/contrib/conftest/README new file mode 100644 index 000000000..0f472791f --- /dev/null +++ b/Engine/lib/lpng/contrib/conftest/README @@ -0,0 +1,49 @@ +This directory contains test configuration files, currently always '.dfa' files +intended to be used in the build by setting the make macro DFA_XTRA to the name +of the file. + +These files are used in release validation of the 'configure' builds of libpng +by building 'make check', or 'make all-am' for cross-builds, with each .dfa +file. + +The files in this directory may change between minor releases, however +contributions describing specific builds of libpng are welcomed. There is no +guarantee that libpng will continue to build with such configurations; support +for given configurations can be, and has been, dropped between successive minor +releases. However if a .dfa file describing a configuration is not in this +directory it is very unlikely that it will be tested before a minor release! + +You can use these .dfa files as the basis of new configurations. Files in this +directory should not have any use restrictions or restrictive licenses. + +This directory is not included in the .zip and .7z distributions, which do +not contain 'configure' scripts. + +DOCUMENTATION +============= + +Examples: + ${srcdir}/pngusr.dfa + ${srcdir}/contrib/pngminim/*/pngusr.dfa + +Documentation of the options: + ${srcdir}/scripts/pnglibconf.dfa + +Documentation of the file format: + ${srcdir}/scripts/options.awk + +FILE NAMING +=========== + +File names in this directory may NOT contain any of the five characters: + + - , + * ? + +Neither may they contain any space character. + +While other characters may be used it is strongly suggested that file names be +limited to lower case Latiin alphabetic characters (a-z), digits (0-9) and, if +necessary the underscore (_) character. File names should be about 8 characters +long (excluding the .dfa extension). Submitted .dfa files should have names +between 7 and 16 characters long, shorter names (6 characters or less) are +reserved for standard tests. diff --git a/Engine/lib/lpng/contrib/conftest/pngcp.dfa b/Engine/lib/lpng/contrib/conftest/pngcp.dfa new file mode 100644 index 000000000..31c411d5f --- /dev/null +++ b/Engine/lib/lpng/contrib/conftest/pngcp.dfa @@ -0,0 +1,57 @@ +# pngcp.dfa +# Build time configuration of libpng +# +# Author: John Bowler +# Copyright: (c) John Bowler, 2016 +# Usage rights: +# To the extent possible under law, the author has waived all copyright and +# related or neighboring rights to this work. This work is published from: +# United States. +# +# Build libpng with support for pngcp. This means just png_read_png, +# png_write_png and small number of configuration settings. +# +everything = off + +# This option is specific to this configuration; it adds a #define to the +# generated pnglibconf.h which turns on the (not portable) timing option for +# pngcp. Note that any option is automatically preceded by PNG_; there is no +# way round this and this is deliberate. +option PNGCP_TIMING + +# Because of the everything off above the option must also be turned on. This +# may not be done in one step because it is safer and avoids mis-spelled options +# in user .dfa files to error out if an unrecognized option is turned on. +option PNGCP_TIMING on + +# Options to turn on png_read_png and png_write_png: +option INFO_IMAGE on +option SEQUENTIAL_READ on +option EASY_ACCESS on +option WRITE on +option WRITE_16BIT on +option WRITE_FILTER on + +# pngcp needs this to preserve unknown chunks, switching all these on means that +# pngcp can work without explicit known chunk reading support +option UNKNOWN_CHUNKS on +option SET_UNKNOWN_CHUNKS on +option HANDLE_AS_UNKNOWN on +option SAVE_UNKNOWN_CHUNKS on +option WRITE_UNKNOWN_CHUNKS on + +# pngcp needs this to handle palette files with invalid indices: +option CHECK_FOR_INVALID_INDEX on +option GET_PALETTE_MAX on + +# Pre-libpng 1.7 pngcp has to stash text chunks manually, post 1.7 without this +# text chunks should be handled as unknown ok. +option TEXT on + +# this is used to turn off limits: +option USER_LIMITS on +option SET_USER_LIMITS on + +# these are just required for specific customizations +option WRITE_CUSTOMIZE_ZTXT_COMPRESSION on +option WRITE_CUSTOMIZE_COMPRESSION on diff --git a/Engine/lib/lpng/contrib/conftest/read.dfa b/Engine/lib/lpng/contrib/conftest/read.dfa new file mode 100644 index 000000000..21e88d01a --- /dev/null +++ b/Engine/lib/lpng/contrib/conftest/read.dfa @@ -0,0 +1,58 @@ +# read.dfa +# Build time configuration of libpng +# +# Author: John Bowler +# Copyright: (c) John Bowler, 2013 +# Usage rights: +# To the extent possible under law, the author has waived all copyright and +# related or neighboring rights to this work. This work is published from: +# United States. +# +# Build libpng with basic read support. This enables the lowest level libpng +# read API - the one where the calling code has to use a loop to read each row. +# At present this is the API used by most programs. +# +# Support is enabled only for those chunks and transformations that are +# typically required - others can be added easily. +# + +everything = off + +# The sequential read code is enabled here; the progressive code can be used +# instead but there is no point enabling both. + +option SEQUENTIAL_READ on + +# Likewise it is pointless enabling both fixed and floating point APIs. Choose +# one or the other for both the API and the internal math. + +#Fixed point: +#option FIXED_POINT on +#option FLOATING_ARITHMETIC off + +#Floating point: +option FLOATING_POINT on +option FLOATING_ARITHMETIC on + +# Basic error handling, IO and user memory support. The latter allows the +# application program to provide its own implementations of 'malloc' and 'free'. +option SETJMP on +option STDIO on +option USER_MEM on + +# To read the full set of PNG images correctly interlace, transparency and +# 16-bit support is required. The application can implement interlace itself, +# but very few do and it's no longer possible to disable it when READ is +# enabled. +option READ_tRNS on +option READ_16BIT on + +# Everything else is application dependent. This file assumes the app handles +# all the native PNG bit layouts, so it doesn't need any of layout change +# transforms, but needs libpng to perform gamma correction. It doesn't do any +# colorspace stuff and ignores the 'significant bit' information. +# +# If your app always expands the image to a limited set of bit layouts you +# probably want to consider using the simplified API instead of the low level +# one - see png.h and s_read.dfa. +option READ_GAMMA on diff --git a/Engine/lib/lpng/contrib/conftest/s_read.dfa b/Engine/lib/lpng/contrib/conftest/s_read.dfa new file mode 100644 index 000000000..cb1ce0ba6 --- /dev/null +++ b/Engine/lib/lpng/contrib/conftest/s_read.dfa @@ -0,0 +1,35 @@ +# s_read.dfa +# Build time configuration of libpng +# +# Author: John Bowler +# Copyright: (c) John Bowler, 2013 +# Usage rights: +# To the extent possible under law, the author has waived all copyright and +# related or neighboring rights to this work. This work is published from: +# United States. +# +# Build libpng with simplified read support (only). This builds a minimal +# libpng able to read all PNG formats and convert them into a small number of +# well understood memory formats. +# + +everything = off + +option SIMPLIFIED_READ on + +# It isn't necessary to chose fixed or floating point for the APIs because the +# simplified API doesn't need fixed or floating point numbers. It is necessary +# to chose an internal math implementation. The default (because of 'everything +# = off') is fixed point - turn the floating point implementation on if you have +# hardware floating point or prefer your software floating point implementation. +option FLOATING_ARITHMETIC on + +# This is not strictly necessary, but without it the message strings in the API +# will not be filled in +option ERROR_TEXT on + +# Switching these options on enables the 'AFIRST' and 'BGR' formats - you don't +# need this if you don't use them, they just allow the in-memory layout to be +# changed to match common hardware formats. +option SIMPLIFIED_READ_AFIRST on +option SIMPLIFIED_READ_BGR on diff --git a/Engine/lib/lpng/contrib/conftest/s_write.dfa b/Engine/lib/lpng/contrib/conftest/s_write.dfa new file mode 100644 index 000000000..e540a46dc --- /dev/null +++ b/Engine/lib/lpng/contrib/conftest/s_write.dfa @@ -0,0 +1,33 @@ +# s_write.dfa +# Build time configuration of libpng +# +# Author: John Bowler +# Copyright: (c) John Bowler, 2013 +# Usage rights: +# To the extent possible under law, the author has waived all copyright and +# related or neighboring rights to this work. This work is published from: +# United States. +# +# Build libpng with (just) simplified write support +# + +everything = off + +option SIMPLIFIED_WRITE on + +# It isn't necessary to chose fixed or floating point for the APIs because the +# simplified API doesn't need fixed or floating point numbers. It is necessary +# to chose an internal math implementation. The default (because of 'everything +# = off') is fixed point - turn the floating point implementation on if you have +# hardware floating point or prefer your software floating point implementation. +option FLOATING_ARITHMETIC on + +# This is not strictly necessary, but without it the message strings in the API +# will not be filled in +option ERROR_TEXT on + +# Switching these options on enables the 'AFIRST' and 'BGR' formats - you don't +# need this if you don't use them, they just allow the in-memory layout to be +# changed to match common hardware formats. +option SIMPLIFIED_WRITE_AFIRST on +option SIMPLIFIED_WRITE_BGR on diff --git a/Engine/lib/lpng/contrib/conftest/simple.dfa b/Engine/lib/lpng/contrib/conftest/simple.dfa new file mode 100644 index 000000000..041933344 --- /dev/null +++ b/Engine/lib/lpng/contrib/conftest/simple.dfa @@ -0,0 +1,36 @@ +# simple.dfa +# Build time configuration of libpng +# +# Author: John Bowler +# Copyright: (c) John Bowler, 2013 +# Usage rights: +# To the extent possible under law, the author has waived all copyright and +# related or neighboring rights to this work. This work is published from: +# United States. +# +# Build libpng with just the simplified APIs (read and write). +# + +everything = off + +option SIMPLIFIED_WRITE on +option SIMPLIFIED_READ on + +# It isn't necessary to chose fixed or floating point for the APIs because the +# simplified API doesn't need fixed or floating point numbers. It is necessary +# to chose an internal math implementation. The default (because of 'everything +# = off') is fixed point - turn the floating point implementation on if you have +# hardware floating point or prefer your software floating point implementation. +option FLOATING_ARITHMETIC on + +# This is not strictly necessary, but without it the message strings in the API +# will not be filled in +option ERROR_TEXT on + +# Switching these options on enables the 'AFIRST' and 'BGR' formats - you don't +# need this if you don't use them, they just allow the in-memory layout to be +# changed to match common hardware formats. +option SIMPLIFIED_READ_AFIRST on +option SIMPLIFIED_READ_BGR on +option SIMPLIFIED_WRITE_AFIRST on +option SIMPLIFIED_WRITE_BGR on diff --git a/Engine/lib/lpng/contrib/conftest/write.dfa b/Engine/lib/lpng/contrib/conftest/write.dfa new file mode 100644 index 000000000..3319aabee --- /dev/null +++ b/Engine/lib/lpng/contrib/conftest/write.dfa @@ -0,0 +1,45 @@ +# write.dfa +# Build time configuration of libpng +# +# Author: John Bowler +# Copyright: (c) John Bowler, 2013 +# Usage rights: +# To the extent possible under law, the author has waived all copyright and +# related or neighboring rights to this work. This work is published from: +# United States. +# +# Build libpng with no read support and minimal write support. +# + +everything = off + +# Switch on the write code - this makes a minimalist encoder + +option WRITE on + +# Choose fixed or floating point APIs and arithmetic. The choices are +# independent but normally they will match. It is typically better to use the +# floating point if you have floating point hardware. If you don't know, or +# (perhaps) to make libpng smaller used fixed point throughout. + +#Fixed point: +#option FIXED_POINT on +#option FLOATING_ARITHMETIC off + +#Floating point: +option FLOATING_POINT on +option FLOATING_ARITHMETIC on + +# Basic error handling, IO and user memory support. The latter allows the +# application program to provide its own implementations of 'malloc' and 'free'. +option SETJMP on +option STDIO on +option USER_MEM on + +# Everything else is optional. Unlike the read code in libpng the write code +# does not need to deal with arbitrary formats, so only add support for things +# you really do write! For example you might only write sRGB images, sometimes +# with transparency and never write 16 bit images, so: +option WRITE_sRGB on +option WRITE_tRNS on +#option WRITE_16BIT off (this is the default with 'everything = off') diff --git a/Engine/lib/lpng/contrib/examples/README.txt b/Engine/lib/lpng/contrib/examples/README.txt new file mode 100644 index 000000000..48dab4f0f --- /dev/null +++ b/Engine/lib/lpng/contrib/examples/README.txt @@ -0,0 +1,24 @@ + +This directory (contrib/examples) contains examples of libpng usage. + +NO COPYRIGHT RIGHTS ARE CLAIMED TO ANY OF THE FILES IN THIS DIRECTORY. + +To the extent possible under law, the authors have waived all copyright and +related or neighboring rights to this work. This work is published from: +United States. + +The files may be used freely in any way. The intention is that appropriate +parts of the files be used in other libpng-using programs without any need for +the authors of the using code to seek copyright or license from the original +authors. + +The source code and comments in this directory are the original work of the +people named below. No other person or organization has made contributions to +the work in this directory. + +ORIGINAL AUTHORS + The following people have contributed to the code in this directory. None + of the people below claim any rights with regard to the contents of this + directory. + + John Bowler diff --git a/Engine/lib/lpng/contrib/examples/iccfrompng.c b/Engine/lib/lpng/contrib/examples/iccfrompng.c new file mode 100644 index 000000000..00056abfd --- /dev/null +++ b/Engine/lib/lpng/contrib/examples/iccfrompng.c @@ -0,0 +1,185 @@ +/*- iccfrompng + * + * COPYRIGHT: Written by John Cunningham Bowler, 2011. + * To the extent possible under law, the author has waived all copyright and + * related or neighboring rights to this work. This work is published from: + * United States. + * + * Extract any icc profiles found in the given PNG files. This is a simple + * example of a program that extracts information from the header of a PNG file + * without processing the image. Notice that some header information may occur + * after the image data. Textual data and comments are an example; the approach + * in this file won't work reliably for such data because it only looks for the + * information in the section of the file that precedes the image data. + * + * Compile and link against libpng and zlib, plus anything else required on the + * system you use. + * + * To use supply a list of PNG files containing iCCP chunks, the chunks will be + * extracted to a similarly named file with the extension replaced by 'icc', + * which will be overwritten without warning. + */ +#include +#include +#include +#include + +#include + +#if defined(PNG_READ_SUPPORTED) && defined(PNG_STDIO_SUPPORTED) && \ + defined (PNG_iCCP_SUPPORTED) + + +static int verbose = 1; +static png_byte no_profile[] = "no profile"; + +static png_bytep +extract(FILE *fp, png_uint_32 *proflen) +{ + png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0); + png_infop info_ptr = NULL; + png_bytep result = NULL; + + /* Initialize for error or no profile: */ + *proflen = 0; + + if (png_ptr == NULL) + { + fprintf(stderr, "iccfrompng: version library mismatch?\n"); + return 0; + } + + if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return 0; + } + + png_init_io(png_ptr, fp); + + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) + png_error(png_ptr, "OOM allocating info structure"); + + png_read_info(png_ptr, info_ptr); + + { + png_charp name; + int compression_type; + png_bytep profile; + + if (png_get_iCCP(png_ptr, info_ptr, &name, &compression_type, &profile, + proflen) & PNG_INFO_iCCP) + { + result = malloc(*proflen); + if (result != NULL) + memcpy(result, profile, *proflen); + + else + png_error(png_ptr, "OOM allocating profile buffer"); + } + + else + result = no_profile; + } + + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return result; +} + +static int +extract_one_file(const char *filename) +{ + int result = 0; + FILE *fp = fopen(filename, "rb"); + + if (fp != NULL) + { + png_uint_32 proflen = 0; + png_bytep profile = extract(fp, &proflen); + + if (profile != NULL && profile != no_profile) + { + size_t len; + char *output; + + { + const char *ep = strrchr(filename, '.'); + + if (ep != NULL) + len = ep-filename; + + else + len = strlen(filename); + } + + output = malloc(len + 5); + if (output != NULL) + { + FILE *of; + + memcpy(output, filename, len); + strcpy(output+len, ".icc"); + + of = fopen(output, "wb"); + if (of != NULL) + { + if (fwrite(profile, proflen, 1, of) == 1 && + fflush(of) == 0 && + fclose(of) == 0) + { + if (verbose) + printf("%s -> %s\n", filename, output); + /* Success return */ + result = 1; + } + + else + { + fprintf(stderr, "%s: error writing profile\n", output); + if (remove(output)) + fprintf(stderr, "%s: could not remove file\n", output); + } + } + + else + fprintf(stderr, "%s: failed to open output file\n", output); + + free(output); + } + + else + fprintf(stderr, "%s: OOM allocating string!\n", filename); + + free(profile); + } + + else if (verbose && profile == no_profile) + printf("%s has no profile\n", filename); + } + + else + fprintf(stderr, "%s: could not open file\n", filename); + + return result; +} + +int +main(int argc, char **argv) +{ + int i; + int extracted = 0; + + for (i=1; i +#include +#include /* required for error handling */ + +/* Normally use here to get the installed libpng, but this is done to + * ensure the code picks up the local libpng implementation: + */ +#include "../../png.h" + +#if defined(PNG_READ_SUPPORTED) && defined(PNG_SEQUENTIAL_READ_SUPPORTED) + +/* Return component 'c' of pixel 'x' from the given row. */ +static unsigned int +component(png_const_bytep row, png_uint_32 x, unsigned int c, + unsigned int bit_depth, unsigned int channels) +{ + /* PNG images can be up to 2^31 pixels wide, but this means they can be up to + * 2^37 bits wide (for a 64-bit pixel - the largest possible) and hence 2^34 + * bytes wide. Since the row fitted into memory, however, the following must + * work: + */ + png_uint_32 bit_offset_hi = bit_depth * ((x >> 6) * channels); + png_uint_32 bit_offset_lo = bit_depth * ((x & 0x3f) * channels + c); + + row = (png_const_bytep)(((const png_byte (*)[8])row) + bit_offset_hi); + row += bit_offset_lo >> 3; + bit_offset_lo &= 0x07; + + /* PNG pixels are packed into bytes to put the first pixel in the highest + * bits of the byte and into two bytes for 16-bit values with the high 8 bits + * first, so: + */ + switch (bit_depth) + { + case 1: return (row[0] >> (7-bit_offset_lo)) & 0x01; + case 2: return (row[0] >> (6-bit_offset_lo)) & 0x03; + case 4: return (row[0] >> (4-bit_offset_lo)) & 0x0f; + case 8: return row[0]; + case 16: return (row[0] << 8) + row[1]; + default: + /* This should never happen; it indicates a bug in this program or in + * libpng itself: + */ + fprintf(stderr, "pngpixel: invalid bit depth %u\n", bit_depth); + exit(1); + } +} + +/* Print a pixel from a row returned by libpng; determine the row format, find + * the pixel, and print the relevant information to stdout. + */ +static void +print_pixel(png_structp png_ptr, png_infop info_ptr, png_const_bytep row, + png_uint_32 x) +{ + unsigned int bit_depth = png_get_bit_depth(png_ptr, info_ptr); + + switch (png_get_color_type(png_ptr, info_ptr)) + { + case PNG_COLOR_TYPE_GRAY: + printf("GRAY %u\n", component(row, x, 0, bit_depth, 1)); + return; + + /* The palette case is slightly more difficult - the palette and, if + * present, the tRNS ('transparency', though the values are really + * opacity) data must be read to give the full picture: + */ + case PNG_COLOR_TYPE_PALETTE: + { + int index = component(row, x, 0, bit_depth, 1); + png_colorp palette = NULL; + int num_palette = 0; + + if ((png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette) & + PNG_INFO_PLTE) && num_palette > 0 && palette != NULL) + { + png_bytep trans_alpha = NULL; + int num_trans = 0; + if ((png_get_tRNS(png_ptr, info_ptr, &trans_alpha, &num_trans, + NULL) & PNG_INFO_tRNS) && num_trans > 0 && + trans_alpha != NULL) + printf("INDEXED %u = %d %d %d %d\n", index, + palette[index].red, palette[index].green, + palette[index].blue, + index < num_trans ? trans_alpha[index] : 255); + + else /* no transparency */ + printf("INDEXED %u = %d %d %d\n", index, + palette[index].red, palette[index].green, + palette[index].blue); + } + + else + printf("INDEXED %u = invalid index\n", index); + } + return; + + case PNG_COLOR_TYPE_RGB: + printf("RGB %u %u %u\n", component(row, x, 0, bit_depth, 3), + component(row, x, 1, bit_depth, 3), + component(row, x, 2, bit_depth, 3)); + return; + + case PNG_COLOR_TYPE_GRAY_ALPHA: + printf("GRAY+ALPHA %u %u\n", component(row, x, 0, bit_depth, 2), + component(row, x, 1, bit_depth, 2)); + return; + + case PNG_COLOR_TYPE_RGB_ALPHA: + printf("RGBA %u %u %u %u\n", component(row, x, 0, bit_depth, 4), + component(row, x, 1, bit_depth, 4), + component(row, x, 2, bit_depth, 4), + component(row, x, 3, bit_depth, 4)); + return; + + default: + png_error(png_ptr, "pngpixel: invalid color type"); + } +} + +int main(int argc, const char **argv) +{ + /* This program uses the default, based, libpng error handling + * mechanism, therefore any local variable that exists before the call to + * setjmp and is changed after the call to setjmp returns successfully must + * be declared with 'volatile' to ensure that their values don't get + * destroyed by longjmp: + */ + volatile int result = 1/*fail*/; + + if (argc == 4) + { + long x = atol(argv[1]); + long y = atol(argv[2]); + FILE *f = fopen(argv[3], "rb"); + volatile png_bytep row = NULL; + + if (f != NULL) + { + /* libpng requires a callback function for handling errors; this + * callback must not return. The default callback function uses a + * stored style jmp_buf which is held in a png_struct and + * writes error messages to stderr. Creating the png_struct is a + * little tricky; just copy the following code. + */ + png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, + NULL, NULL, NULL); + + if (png_ptr != NULL) + { + png_infop info_ptr = png_create_info_struct(png_ptr); + + if (info_ptr != NULL) + { + /* Declare stack variables to hold pointers to locally allocated + * data. + */ + + /* Initialize the error control buffer: */ + if (setjmp(png_jmpbuf(png_ptr)) == 0) + { + png_uint_32 width, height; + int bit_depth, color_type, interlace_method, + compression_method, filter_method; + png_bytep row_tmp; + + /* Now associate the recently opened (FILE*) with the default + * libpng initialization functions. Sometimes libpng is + * compiled without stdio support (it can be difficult to do + * in some environments); in that case you will have to write + * your own read callback to read data from the (FILE*). + */ + png_init_io(png_ptr, f); + + /* And read the first part of the PNG file - the header and + * all the information up to the first pixel. + */ + png_read_info(png_ptr, info_ptr); + + /* This fills in enough information to tell us the width of + * each row in bytes, allocate the appropriate amount of + * space. In this case png_malloc is used - it will not + * return if memory isn't available. + */ + row = png_malloc(png_ptr, png_get_rowbytes(png_ptr, + info_ptr)); + + /* To avoid the overhead of using a volatile auto copy row_tmp + * to a local here - just use row for the png_free below. + */ + row_tmp = row; + + /* All the information we need is in the header is returned by + * png_get_IHDR, if this fails we can now use 'png_error' to + * signal the error and return control to the setjmp above. + */ + if (png_get_IHDR(png_ptr, info_ptr, &width, &height, + &bit_depth, &color_type, &interlace_method, + &compression_method, &filter_method)) + { + int passes, pass; + + /* png_set_interlace_handling returns the number of + * passes required as well as turning on libpng's + * handling, but since we do it ourselves this is + * necessary: + */ + switch (interlace_method) + { + case PNG_INTERLACE_NONE: + passes = 1; + break; + + case PNG_INTERLACE_ADAM7: + passes = PNG_INTERLACE_ADAM7_PASSES; + break; + + default: + png_error(png_ptr, "pngpixel: unknown interlace"); + } + + /* Now read the pixels, pass-by-pass, row-by-row: */ + png_start_read_image(png_ptr); + + for (pass=0; pass +#include +#include +#include + +/* Normally use here to get the installed libpng, but this is done to + * ensure the code picks up the local libpng implementation: + */ +#include "../../png.h" +#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) && \ + defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) + +int main(int argc, const char **argv) +{ + int result = 1; + + if (argc == 3) + { + png_image image; + + /* Only the image structure version number needs to be set. */ + memset(&image, 0, sizeof image); + image.version = PNG_IMAGE_VERSION; + + if (png_image_begin_read_from_file(&image, argv[1])) + { + png_bytep buffer; + + /* Change this to try different formats! If you set a colormap format + * then you must also supply a colormap below. + */ + image.format = PNG_FORMAT_RGBA; + + buffer = malloc(PNG_IMAGE_SIZE(image)); + + if (buffer != NULL) + { + if (png_image_finish_read(&image, NULL/*background*/, buffer, + 0/*row_stride*/, NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP */)) + { + if (png_image_write_to_file(&image, argv[2], + 0/*convert_to_8bit*/, buffer, 0/*row_stride*/, + NULL/*colormap*/)) + result = 0; + + else + fprintf(stderr, "pngtopng: write %s: %s\n", argv[2], + image.message); + } + + else + fprintf(stderr, "pngtopng: read %s: %s\n", argv[1], + image.message); + + free(buffer); + } + + else + { + fprintf(stderr, "pngtopng: out of memory: %lu bytes\n", + (unsigned long)PNG_IMAGE_SIZE(image)); + + /* This is the only place where a 'free' is required; libpng does + * the cleanup on error and success, but in this case we couldn't + * complete the read because of running out of memory and so libpng + * has not got to the point where it can do cleanup. + */ + png_image_free(&image); + } + } + + else + /* Failed to read the first argument: */ + fprintf(stderr, "pngtopng: %s: %s\n", argv[1], image.message); + } + + else + /* Wrong number of arguments */ + fprintf(stderr, "pngtopng: usage: pngtopng input-file output-file\n"); + + return result; +} +#endif /* READ && WRITE */ diff --git a/Engine/lib/lpng/contrib/examples/simpleover.c b/Engine/lib/lpng/contrib/examples/simpleover.c new file mode 100644 index 000000000..59dd31368 --- /dev/null +++ b/Engine/lib/lpng/contrib/examples/simpleover.c @@ -0,0 +1,648 @@ +/*- simpleover + * + * COPYRIGHT: Written by John Cunningham Bowler, 2015. + * To the extent possible under law, the author has waived all copyright and + * related or neighboring rights to this work. This work is published from: + * United States. + * + * Read several PNG files, which should have an alpha channel or transparency + * information, and composite them together to produce one or more 16-bit linear + * RGBA intermediates. This involves doing the correct 'over' composition to + * combine the alpha channels and corresponding data. + * + * Finally read an output (background) PNG using the 24-bit RGB format (the + * PNG will be composited on green (#00ff00) by default if it has an alpha + * channel), and apply the intermediate image generated above to specified + * locations in the image. + * + * The command line has the general format: + * + * simpleover [output.png] + * {--sprite=width,height,name {[--at=x,y] {sprite.png}}} + * {--add=name {x,y}} + * + * The --sprite and --add options may occur multiple times. They are executed + * in order. --add may refer to any sprite already read. + * + * This code is intended to show how to composite multiple images together + * correctly. Apart from the libpng Simplified API the only work done in here + * is to combine multiple input PNG images into a single sprite; this involves + * a Porter-Duff 'over' operation and the input PNG images may, as a result, + * be regarded as being layered one on top of the other with the first (leftmost + * on the command line) being at the bottom and the last on the top. + */ +#include +#include +#include +#include +#include + +/* Normally use here to get the installed libpng, but this is done to + * ensure the code picks up the local libpng implementation, so long as this + * file is linked against a sufficiently recent libpng (1.6+) it is ok to + * change this to : + */ +#include "../../png.h" + +#ifdef PNG_SIMPLIFIED_READ_SUPPORTED + +#define sprite_name_chars 15 +struct sprite { + FILE *file; + png_uint_16p buffer; + unsigned int width; + unsigned int height; + char name[sprite_name_chars+1]; +}; + +#if 0 /* div by 65535 test program */ +#include +#include + +int main(void) { + double err = 0; + unsigned int xerr = 0; + unsigned int r = 32769; + { + unsigned int x = 0; + + do { + unsigned int t = x + (x >> 16) /*+ (x >> 31)*/ + r; + double v = x, errtest; + + if (t < x) { + fprintf(stderr, "overflow: %u+%u -> %u\n", x, r, t); + return 1; + } + + v /= 65535; + errtest = v; + t >>= 16; + errtest -= t; + + if (errtest > err) { + err = errtest; + xerr = x; + + if (errtest >= .5) { + fprintf(stderr, "error: %u/65535 = %f, not %u, error %f\n", + x, v, t, errtest); + return 0; + } + } + } while (++x <= 65535U*65535U); + } + + printf("error %f @ %u\n", err, xerr); + + return 0; +} +#endif /* div by 65535 test program */ + +static void +sprite_op(const struct sprite *sprite, int x_offset, int y_offset, + png_imagep image, const png_uint_16 *buffer) +{ + /* This is where the Porter-Duff 'Over' operator is evaluated; change this + * code to change the operator (this could be parameterized). Any other + * image processing operation could be used here. + */ + + + /* Check for an x or y offset that pushes any part of the image beyond the + * right or bottom of the sprite: + */ + if ((y_offset < 0 || (unsigned)/*SAFE*/y_offset < sprite->height) && + (x_offset < 0 || (unsigned)/*SAFE*/x_offset < sprite->width)) + { + unsigned int y = 0; + + if (y_offset < 0) + y = -y_offset; /* Skip to first visible row */ + + do + { + unsigned int x = 0; + + if (x_offset < 0) + x = -x_offset; + + do + { + /* In and out are RGBA values, so: */ + const png_uint_16 *in_pixel = buffer + (y * image->width + x)*4; + png_uint_32 in_alpha = in_pixel[3]; + + /* This is the optimized Porter-Duff 'Over' operation, when the + * input alpha is 0 the output is not changed. + */ + if (in_alpha > 0) + { + png_uint_16 *out_pixel = sprite->buffer + + ((y+y_offset) * sprite->width + (x+x_offset))*4; + + /* This is the weight to apply to the output: */ + in_alpha = 65535-in_alpha; + + if (in_alpha > 0) + { + /* The input must be composed onto the output. This means + * multiplying the current output pixel value by the inverse + * of the input alpha (1-alpha). A division is required but + * it is by the constant 65535. Approximate this as: + * + * (x + (x >> 16) + 32769) >> 16; + * + * This is exact (and does not overflow) for all values of + * x in the range 0..65535*65535. (Note that the calculation + * produces the closest integer; the maximum error is <0.5). + */ + png_uint_32 tmp; + +# define compose(c)\ + tmp = out_pixel[c] * in_alpha;\ + tmp = (tmp + (tmp >> 16) + 32769) >> 16;\ + out_pixel[c] = tmp + in_pixel[c] + + /* The following is very vectorizable... */ + compose(0); + compose(1); + compose(2); + compose(3); + } + + else + out_pixel[0] = in_pixel[0], + out_pixel[1] = in_pixel[1], + out_pixel[2] = in_pixel[2], + out_pixel[3] = in_pixel[3]; + } + } + while (++x < image->width); + } + while (++y < image->height); + } +} + +static int +create_sprite(struct sprite *sprite, int *argc, const char ***argv) +{ + /* Read the arguments and create this sprite. The sprite buffer has already + * been allocated. This reads the input PNGs one by one in linear format, + * composes them onto the sprite buffer (the code in the function above) + * then saves the result, converting it on the fly to PNG RGBA 8-bit format. + */ + while (*argc > 0) + { + char tombstone; + int x = 0, y = 0; + + if ((*argv)[0][0] == '-' && (*argv)[0][1] == '-') + { + /* The only supported option is --at. */ + if (sscanf((*argv)[0], "--at=%d,%d%c", &x, &y, &tombstone) != 2) + break; /* success; caller will parse this option */ + + ++*argv, --*argc; + } + + else + { + /* The argument has to be a file name */ + png_image image; + + image.version = PNG_IMAGE_VERSION; + image.opaque = NULL; + + if (png_image_begin_read_from_file(&image, (*argv)[0])) + { + png_uint_16p buffer; + + image.format = PNG_FORMAT_LINEAR_RGB_ALPHA; + + buffer = malloc(PNG_IMAGE_SIZE(image)); + + if (buffer != NULL) + { + if (png_image_finish_read(&image, NULL/*background*/, buffer, + 0/*row_stride*/, + NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP*/)) + { + /* This is the place where the Porter-Duff 'Over' operator + * needs to be done by this code. In fact, any image + * processing required can be done here; the data is in + * the correct format (linear, 16-bit) and source and + * destination are in memory. + */ + sprite_op(sprite, x, y, &image, buffer); + free(buffer); + ++*argv, --*argc; + /* And continue to the next argument */ + continue; + } + + else + { + free(buffer); + fprintf(stderr, "simpleover: read %s: %s\n", (*argv)[0], + image.message); + } + } + + else + { + fprintf(stderr, "simpleover: out of memory: %lu bytes\n", + (unsigned long)PNG_IMAGE_SIZE(image)); + + /* png_image_free must be called if we abort the Simplified API + * read because of a problem detected in this code. If problems + * are detected in the Simplified API it cleans up itself. + */ + png_image_free(&image); + } + } + + else + { + /* Failed to read the first argument: */ + fprintf(stderr, "simpleover: %s: %s\n", (*argv)[0], image.message); + } + + return 0; /* failure */ + } + } + + /* All the sprite operations have completed successfully. Save the RGBA + * buffer as a PNG using the simplified write API. + */ + sprite->file = tmpfile(); + + if (sprite->file != NULL) + { + png_image save; + + memset(&save, 0, sizeof save); + save.version = PNG_IMAGE_VERSION; + save.opaque = NULL; + save.width = sprite->width; + save.height = sprite->height; + save.format = PNG_FORMAT_LINEAR_RGB_ALPHA; + save.flags = PNG_IMAGE_FLAG_FAST; + save.colormap_entries = 0; + + if (png_image_write_to_stdio(&save, sprite->file, 1/*convert_to_8_bit*/, + sprite->buffer, 0/*row_stride*/, NULL/*colormap*/)) + { + /* Success; the buffer is no longer needed: */ + free(sprite->buffer); + sprite->buffer = NULL; + return 1; /* ok */ + } + + else + fprintf(stderr, "simpleover: write sprite %s: %s\n", sprite->name, + save.message); + } + + else + fprintf(stderr, "simpleover: sprite %s: could not allocate tmpfile: %s\n", + sprite->name, strerror(errno)); + + return 0; /* fail */ +} + +static int +add_sprite(png_imagep output, png_bytep out_buf, struct sprite *sprite, + int *argc, const char ***argv) +{ + /* Given a --add argument naming this sprite, perform the operations listed + * in the following arguments. The arguments are expected to have the form + * (x,y), which is just an offset at which to add the sprite to the + * output. + */ + while (*argc > 0) + { + char tombstone; + int x, y; + + if ((*argv)[0][0] == '-' && (*argv)[0][1] == '-') + return 1; /* success */ + + if (sscanf((*argv)[0], "%d,%d%c", &x, &y, &tombstone) == 2) + { + /* Now add the new image into the sprite data, but only if it + * will fit. + */ + if (x < 0 || y < 0 || + (unsigned)/*SAFE*/x >= output->width || + (unsigned)/*SAFE*/y >= output->height || + sprite->width > output->width-x || + sprite->height > output->height-y) + { + fprintf(stderr, "simpleover: sprite %s @ (%d,%d) outside image\n", + sprite->name, x, y); + /* Could just skip this, but for the moment it is an error */ + return 0; /* error */ + } + + else + { + /* Since we know the sprite fits we can just read it into the + * output using the simplified API. + */ + png_image in; + + in.version = PNG_IMAGE_VERSION; + rewind(sprite->file); + + if (png_image_begin_read_from_stdio(&in, sprite->file)) + { + in.format = PNG_FORMAT_RGB; /* force compose */ + + if (png_image_finish_read(&in, NULL/*background*/, + out_buf + (y*output->width + x)*3/*RGB*/, + output->width*3/*row_stride*/, + NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP*/)) + { + ++*argv, --*argc; + continue; + } + } + + /* The read failed: */ + fprintf(stderr, "simpleover: add sprite %s: %s\n", sprite->name, + in.message); + return 0; /* error */ + } + } + + else + { + fprintf(stderr, "simpleover: --add='%s': invalid position %s\n", + sprite->name, (*argv)[0]); + return 0; /* error */ + } + } + + return 1; /* ok */ +} + +static int +simpleover_process(png_imagep output, png_bytep out_buf, int argc, + const char **argv) +{ + int result = 1; /* success */ +# define csprites 10/*limit*/ +# define str(a) #a + int nsprites = 0; + struct sprite sprites[csprites]; + + while (argc > 0) + { + result = 0; /* fail */ + + if (strncmp(argv[0], "--sprite=", 9) == 0) + { + char tombstone; + + if (nsprites < csprites) + { + int n; + + sprites[nsprites].width = sprites[nsprites].height = 0; + sprites[nsprites].name[0] = 0; + + n = sscanf(argv[0], "--sprite=%u,%u,%" str(sprite_name_chars) "s%c", + &sprites[nsprites].width, &sprites[nsprites].height, + sprites[nsprites].name, &tombstone); + + if ((n == 2 || n == 3) && + sprites[nsprites].width > 0 && sprites[nsprites].height > 0) + { + size_t buf_size, tmp; + + /* Default a name if not given. */ + if (sprites[nsprites].name[0] == 0) + sprintf(sprites[nsprites].name, "sprite-%d", nsprites+1); + + /* Allocate a buffer for the sprite and calculate the buffer + * size: + */ + buf_size = sizeof (png_uint_16 [4]); + buf_size *= sprites[nsprites].width; + buf_size *= sprites[nsprites].height; + + /* This can overflow a (size_t); check for this: */ + tmp = buf_size; + tmp /= sprites[nsprites].width; + tmp /= sprites[nsprites].height; + + if (tmp == sizeof (png_uint_16 [4])) + { + sprites[nsprites].buffer = malloc(buf_size); + /* This buffer must be initialized to transparent: */ + memset(sprites[nsprites].buffer, 0, buf_size); + + if (sprites[nsprites].buffer != NULL) + { + sprites[nsprites].file = NULL; + ++argv, --argc; + + if (create_sprite(sprites+nsprites++, &argc, &argv)) + { + result = 1; /* still ok */ + continue; + } + + break; /* error */ + } + } + + /* Overflow, or OOM */ + fprintf(stderr, "simpleover: %s: sprite too large\n", argv[0]); + break; + } + + else + { + fprintf(stderr, "simpleover: %s: invalid sprite (%u,%u)\n", + argv[0], sprites[nsprites].width, sprites[nsprites].height); + break; + } + } + + else + { + fprintf(stderr, "simpleover: %s: too many sprites\n", argv[0]); + break; + } + } + + else if (strncmp(argv[0], "--add=", 6) == 0) + { + const char *name = argv[0]+6; + int isprite = nsprites; + + ++argv, --argc; + + while (--isprite >= 0) + { + if (strcmp(sprites[isprite].name, name) == 0) + { + if (!add_sprite(output, out_buf, sprites+isprite, &argc, &argv)) + goto out; /* error in add_sprite */ + + break; + } + } + + if (isprite < 0) /* sprite not found */ + { + fprintf(stderr, "simpleover: --add='%s': sprite not found\n", name); + break; + } + } + + else + { + fprintf(stderr, "simpleover: %s: unrecognized operation\n", argv[0]); + break; + } + + result = 1; /* ok */ + } + + /* Clean up the cache of sprites: */ +out: + while (--nsprites >= 0) + { + if (sprites[nsprites].buffer != NULL) + free(sprites[nsprites].buffer); + + if (sprites[nsprites].file != NULL) + (void)fclose(sprites[nsprites].file); + } + + return result; +} + +int main(int argc, const char **argv) +{ + int result = 1; /* default to fail */ + + if (argc >= 2) + { + int argi = 2; + const char *output = NULL; + png_image image; + + if (argc > 2 && argv[2][0] != '-'/*an operation*/) + { + output = argv[2]; + argi = 3; + } + + image.version = PNG_IMAGE_VERSION; + image.opaque = NULL; + + if (png_image_begin_read_from_file(&image, argv[1])) + { + png_bytep buffer; + + image.format = PNG_FORMAT_RGB; /* 24-bit RGB */ + + buffer = malloc(PNG_IMAGE_SIZE(image)); + + if (buffer != NULL) + { + png_color background = {0, 0xff, 0}; /* fully saturated green */ + + if (png_image_finish_read(&image, &background, buffer, + 0/*row_stride*/, NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP */)) + { + /* At this point png_image_finish_read has cleaned up the + * allocated data in png_image, and only the buffer needs to be + * freed. + * + * Perform the remaining operations: + */ + if (simpleover_process(&image, buffer, argc-argi, argv+argi)) + { + /* Write the output: */ + if ((output != NULL && + png_image_write_to_file(&image, output, + 0/*convert_to_8bit*/, buffer, 0/*row_stride*/, + NULL/*colormap*/)) || + (output == NULL && + png_image_write_to_stdio(&image, stdout, + 0/*convert_to_8bit*/, buffer, 0/*row_stride*/, + NULL/*colormap*/))) + result = 0; + + else + fprintf(stderr, "simpleover: write %s: %s\n", + output == NULL ? "stdout" : output, image.message); + } + + /* else simpleover_process writes an error message */ + } + + else + fprintf(stderr, "simpleover: read %s: %s\n", argv[1], + image.message); + + free(buffer); + } + + else + { + fprintf(stderr, "simpleover: out of memory: %lu bytes\n", + (unsigned long)PNG_IMAGE_SIZE(image)); + + /* This is the only place where a 'free' is required; libpng does + * the cleanup on error and success, but in this case we couldn't + * complete the read because of running out of memory. + */ + png_image_free(&image); + } + } + + else + { + /* Failed to read the first argument: */ + fprintf(stderr, "simpleover: %s: %s\n", argv[1], image.message); + } + } + + else + { + /* Usage message */ + fprintf(stderr, + "simpleover: usage: simpleover background.png [output.png]\n" + " Output 'background.png' as a 24-bit RGB PNG file in 'output.png'\n" + " or, if not given, stdout. 'background.png' will be composited\n" + " on fully saturated green.\n" + "\n" + " Optionally, before output, process additional PNG files:\n" + "\n" + " --sprite=width,height,name {[--at=x,y] {sprite.png}}\n" + " Produce a transparent sprite of size (width,height) and with\n" + " name 'name'.\n" + " For each sprite.png composite it using a Porter-Duff 'Over'\n" + " operation at offset (x,y) in the sprite (defaulting to (0,0)).\n" + " Input PNGs will be truncated to the area of the sprite.\n" + "\n" + " --add='name' {x,y}\n" + " Optionally, before output, composite a sprite, 'name', which\n" + " must have been previously produced using --sprite, at each\n" + " offset (x,y) in the output image. Each sprite must fit\n" + " completely within the output image.\n" + "\n" + " PNG files are processed in the order they occur on the command\n" + " line and thus the first PNG processed appears as the bottommost\n" + " in the output image.\n"); + } + + return result; +} +#endif /* SIMPLIFIED_READ */ diff --git a/Engine/lib/lpng/contrib/gregbook/COPYING b/Engine/lib/lpng/contrib/gregbook/COPYING new file mode 100644 index 000000000..a3e977479 --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/Engine/lib/lpng/contrib/gregbook/LICENSE b/Engine/lib/lpng/contrib/gregbook/LICENSE new file mode 100644 index 000000000..d9567178c --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/LICENSE @@ -0,0 +1,50 @@ + --------------------------------------------------------------------------- + + Copyright (c) 1998-2008 Greg Roelofs. All rights reserved. + + This software is provided "as is," without warranty of any kind, + express or implied. In no event shall the author or contributors + be held liable for any damages arising in any way from the use of + this software. + + The contents of this file are DUAL-LICENSED. You may modify and/or + redistribute this software according to the terms of one of the + following two licenses (at your option): + + + LICENSE 1 ("BSD-like with advertising clause"): + + 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. Redistributions of source code must retain the above copyright + notice, disclaimer, and this list of conditions. + 2. Redistributions in binary form must reproduce the above copyright + notice, disclaimer, and this list of conditions in the documenta- + tion and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + + This product includes software developed by Greg Roelofs + and contributors for the book, "PNG: The Definitive Guide," + published by O'Reilly and Associates. + + + LICENSE 2 (GNU GPL v2 or later): + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + --------------------------------------------------------------------------- diff --git a/Engine/lib/lpng/contrib/gregbook/Makefile.mingw32 b/Engine/lib/lpng/contrib/gregbook/Makefile.mingw32 new file mode 100644 index 000000000..3a3ff607e --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/Makefile.mingw32 @@ -0,0 +1,131 @@ +# Sample makefile for rpng-win / rpng2-win / wpng using mingw32-gcc and make. +# Greg Roelofs +# Last modified: 2 June 2007 +# +# The programs built by this makefile are described in the book, +# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and +# Associates, 1999). Go buy a copy, eh? Well, OK, it's not +# generally for sale anymore, but it's the thought that counts, +# right? (Hint: http://www.libpng.org/pub/png/book/ ) +# +# Invoke this makefile from a DOS-prompt window via: +# +# make -f Makefile.mingw32 +# +# This makefile assumes libpng and zlib have already been built or downloaded +# and are in subdirectories at the same level as the current subdirectory +# (as indicated by the PNGDIR and ZDIR macros below). It makes no assumptions +# at all about the mingw32 installation tree (W32DIR). Edit as appropriate. +# +# Note that the names of the dynamic and static libpng and zlib libraries +# used below may change in later releases of the libraries. This makefile +# builds both statically and dynamically linked executables by default. +# (You need only one set, but for testing it can be handy to have both.) + + +# macros -------------------------------------------------------------------- + +#PNGDIR = ../..# for libpng-x.y.z/contrib/gregbook builds +PNGDIR = ../libpng-win32 +PNGINC = -I$(PNGDIR) +PNGLIBd = $(PNGDIR)/libpng.dll.a # dynamically linked +PNGLIBs = $(PNGDIR)/libpng.a # statically linked, local libpng + +#ZDIR = ../../../zlib-win32# for libpng-x.y.z/contrib/gregbook builds +ZDIR = ../zlib-win32 +ZINC = -I$(ZDIR) +ZLIBd = $(ZDIR)/libzdll.a +ZLIBs = $(ZDIR)/libz.a + +# change this to be the path where mingw32 installs its stuff: +W32DIR = +#W32DIR = /usr/local/cross-tools/i386-mingw32msvc +W32INC = -I$(W32DIR)/include +W32LIB = $(W32DIR)/lib/libuser32.a $(W32DIR)/lib/libgdi32.a + +CC = gcc +#CC = i386-mingw32msvc-gcc # e.g., Linux -> Win32 cross-compilation +LD = $(CC) +RM = rm -f +CPPFLAGS = $(INCS) +CFLAGS = -O -Wall $(MINGW_CCFLAGS) +# [note that -Wall is a gcc-specific compilation flag ("most warnings on")] +# [-ansi, -pedantic and -W can also be used] +LDFLAGS = $(MINGW_LDFLAGS) +O = .o +E = .exe + +INCS = $(PNGINC) $(ZINC) $(W32INC) +RLIBSd = $(PNGLIBd) $(ZLIBd) $(W32LIB) -lm +RLIBSs = $(PNGLIBs) $(ZLIBs) $(W32LIB) -lm +WLIBSd = $(PNGLIBd) $(ZLIBd) +WLIBSs = $(PNGLIBs) $(ZLIBs) + +RPNG = rpng-win +RPNG2 = rpng2-win +WPNG = wpng + +ROBJSd = $(RPNG)$(O) readpng.pic$(O) +ROBJS2d = $(RPNG2)$(O) readpng2.pic$(O) +WOBJSd = $(WPNG)$(O) writepng.pic$(O) + +RPNGs = $(RPNG)-static +RPNG2s = $(RPNG2)-static +WPNGs = $(WPNG)-static + +ROBJSs = $(RPNG)$(O) readpng$(O) +ROBJS2s = $(RPNG2)$(O) readpng2$(O) +WOBJSs = $(WPNG)$(O) writepng$(O) + +STATIC_EXES = $(RPNGs)$(E) $(RPNG2s)$(E) $(WPNGs)$(E) +DYNAMIC_EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E) + +EXES = $(STATIC_EXES) $(DYNAMIC_EXES) + + +# implicit make rules ------------------------------------------------------- + +.c$(O): + $(CC) -c $(CPPFLAGS) $(CFLAGS) $< + +%.pic$(O): %.c + $(CC) -c $(CPPFLAGS) $(CFLAGS) -DPNG_BUILD_DLL -o $@ $< + + +# dependencies -------------------------------------------------------------- + +all: $(EXES) + +$(RPNGs)$(E): $(ROBJSs) + $(LD) $(LDFLAGS) -o $@ $(ROBJSs) $(RLIBSs) + +$(RPNG)$(E): $(ROBJSd) + $(LD) $(LDFLAGS) -o $@ $(ROBJSd) $(RLIBSd) + +$(RPNG2s)$(E): $(ROBJS2s) + $(LD) $(LDFLAGS) -o $@ $(ROBJS2s) $(RLIBSs) + +$(RPNG2)$(E): $(ROBJS2d) + $(LD) $(LDFLAGS) -o $@ $(ROBJS2d) $(RLIBSd) + +$(WPNGs)$(E): $(WOBJSs) + $(LD) $(LDFLAGS) -o $@ $(WOBJSs) $(WLIBSs) + +$(WPNG)$(E): $(WOBJSd) + $(LD) $(LDFLAGS) -o $@ $(WOBJSd) $(WLIBSd) + +$(RPNG)$(O): $(RPNG).c readpng.h +$(RPNG2)$(O): $(RPNG2).c readpng2.h +$(WPNG)$(O): $(WPNG).c writepng.h + +readpng$(O) readpng.pic$(O): readpng.c readpng.h +readpng2$(O) readpng2.pic$(O): readpng2.c readpng2.h +writepng$(O) writepng.pic$(O): writepng.c writepng.h + + +# maintenance --------------------------------------------------------------- + +clean: + $(RM) $(EXES) + $(RM) $(ROBJSs) $(ROBJS2s) $(WOBJSs) + $(RM) $(ROBJSd) $(ROBJS2d) $(WOBJSd) diff --git a/Engine/lib/lpng/contrib/gregbook/Makefile.sgi b/Engine/lib/lpng/contrib/gregbook/Makefile.sgi new file mode 100644 index 000000000..94d61b465 --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/Makefile.sgi @@ -0,0 +1,105 @@ +# Sample makefile for rpng-x / rpng2-x / wpng for SGI using cc and make. +# Greg Roelofs +# Last modified: 7 March 2002 +# +# The programs built by this makefile are described in the book, +# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and +# Associates, 1999). Go buy a copy, eh? Buy some for friends +# and family, too. (Not that this is a blatant plug or anything.) +# +# Invoke this makefile from a shell prompt in the usual way; for example: +# +# make -f Makefile.sgi +# +# This makefile assumes libpng and zlib have already been built or downloaded +# and are both installed in /usr/local/{include,lib} (as indicated by the +# PNG* and Z* macros below). Edit as appropriate--choose only ONE each of +# the PNGINC, PNGLIB, ZINC and ZLIB lines. +# +# This makefile builds dynamically linked executables (against libpng and zlib, +# that is), but that can be changed by uncommenting the appropriate PNGLIB and +# ZLIB lines. + + +# macros -------------------------------------------------------------------- + +PNGINC = -I/usr/local/include/libpng16 +PNGLIB = -L/usr/local/lib -lpng16 # dynamically linked against libpng +#PNGLIB = /usr/local/lib/libpng16.a # statically linked against libpng +# or: +#PNGINC = -I../.. +#PNGLIB = -L../.. -lpng +#PNGLIB = ../../libpng.a + +ZINC = -I/usr/local/include +ZLIB = -L/usr/local/lib -lz # dynamically linked against zlib +#ZLIB = /usr/local/lib/libz.a # statically linked against zlib +#ZINC = -I../zlib +#ZLIB = -L../zlib -lz +#ZLIB = ../../../zlib/libz.a + +XINC = -I/usr/include/X11 # old-style, stock X distributions +XLIB = -L/usr/lib/X11 -lX11 +#XINC = -I/usr/openwin/include # Sun workstations (OpenWindows) +#XLIB = -L/usr/openwin/lib -lX11 +#XINC = -I/usr/X11R6/include # new X distributions (XFree86, etc.) +#XLIB = -L/usr/X11R6/lib -lX11 + +INCS = $(PNGINC) $(ZINC) $(XINC) +RLIBS = $(PNGLIB) $(ZLIB) $(XLIB) -lm +WLIBS = $(PNGLIB) $(ZLIB) + +CC = cc +LD = cc +RM = rm -f +# ABI must be the same as that used to build libpng. +ABI = +CPPFLAGS = +CFLAGS = $(ABI) -O -fullwarn $(INCS) +LDFLAGS = $(ABI) +O = .o +E = + +RPNG = rpng-x +RPNG2 = rpng2-x +WPNG = wpng + +ROBJS = $(RPNG)$(O) readpng$(O) +ROBJS2 = $(RPNG2)$(O) readpng2$(O) +WOBJS = $(WPNG)$(O) writepng$(O) + +EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E) + + +# implicit make rules ------------------------------------------------------- + +.c$(O): + $(CC) -c $(CPPFLAGS) $(CFLAGS) $< + + +# dependencies -------------------------------------------------------------- + +all: $(EXES) + +$(RPNG)$(E): $(ROBJS) + $(LD) $(LDFLAGS) -o $@ $(ROBJS) $(RLIBS) + +$(RPNG2)$(E): $(ROBJS2) + $(LD) $(LDFLAGS) -o $@ $(ROBJS2) $(RLIBS) + +$(WPNG)$(E): $(WOBJS) + $(LD) $(LDFLAGS) -o $@ $(WOBJS) $(WLIBS) + +$(RPNG)$(O): $(RPNG).c readpng.h +$(RPNG2)$(O): $(RPNG2).c readpng2.h +$(WPNG)$(O): $(WPNG).c writepng.h + +readpng$(O): readpng.c readpng.h +readpng2$(O): readpng2.c readpng2.h +writepng$(O): writepng.c writepng.h + + +# maintenance --------------------------------------------------------------- + +clean: + $(RM) $(EXES) $(ROBJS) $(ROBJS2) $(WOBJS) diff --git a/Engine/lib/lpng/contrib/gregbook/Makefile.unx b/Engine/lib/lpng/contrib/gregbook/Makefile.unx new file mode 100644 index 000000000..1a73e03bf --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/Makefile.unx @@ -0,0 +1,134 @@ +# Sample makefile for rpng-x / rpng2-x / wpng using gcc and make. +# Greg Roelofs +# Last modified: 2 June 2007 +# +# The programs built by this makefile are described in the book, +# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and +# Associates, 1999). Go buy a copy, eh? Well, OK, it's not +# generally for sale anymore, but it's the thought that counts, +# right? (Hint: http://www.libpng.org/pub/png/book/ ) +# +# Invoke this makefile from a shell prompt in the usual way; for example: +# +# make -f Makefile.unx +# +# This makefile assumes libpng and zlib have already been built or downloaded +# and are installed in /usr/local/{include,lib} or as otherwise indicated by +# the PNG* and Z* macros below. Edit as appropriate--choose only ONE each of +# the PNGINC, PNGLIBd, PNGLIBs, ZINC, ZLIBd and ZLIBs lines. +# +# This makefile builds both dynamically and statically linked executables +# (against libpng and zlib, that is), but that can be changed by modifying +# the "EXES =" line. (You need only one set, but for testing it can be handy +# to have both.) + + +# macros -------------------------------------------------------------------- + +#PNGDIR = /usr/local/lib +#PNGINC = -I/usr/local/include/libpng16 +#PNGLIBd = -L$(PNGDIR) -lpng16 # dynamically linked, installed libpng +#PNGLIBs = $(PNGDIR)/libpng16.a # statically linked, installed libpng +# or: +PNGDIR = ../..# this one is for libpng-x.y.z/contrib/gregbook builds +#PNGDIR = ../libpng +PNGINC = -I$(PNGDIR) +PNGLIBd = -Wl,-rpath,$(PNGDIR) -L$(PNGDIR) -lpng16 # dynamically linked +PNGLIBs = $(PNGDIR)/libpng.a # statically linked, local libpng + +ZDIR = /usr/local/lib +#ZDIR = /usr/lib64 +ZINC = -I/usr/local/include +ZLIBd = -L$(ZDIR) -lz # dynamically linked against zlib +ZLIBs = $(ZDIR)/libz.a # statically linked against zlib +# or: +#ZDIR = ../zlib +#ZINC = -I$(ZDIR) +#ZLIBd = -Wl,-rpath,$(ZDIR) -L$(ZDIR) -lz # -rpath allows in-place testing +#ZLIBs = $(ZDIR)/libz.a + +#XINC = -I/usr/include # old-style, stock X distributions +#XLIB = -L/usr/lib/X11 -lX11 # (including SGI IRIX) +#XINC = -I/usr/openwin/include # Sun workstations (OpenWindows) +#XLIB = -L/usr/openwin/lib -lX11 +XINC = -I/usr/X11R6/include # new X distributions (X.org, etc.) +XLIB = -L/usr/X11R6/lib -lX11 +#XLIB = -L/usr/X11R6/lib64 -lX11 # e.g., Red Hat on AMD64 + +INCS = $(PNGINC) $(ZINC) $(XINC) +RLIBSd = $(PNGLIBd) $(ZLIBd) $(XLIB) -lm +RLIBSs = $(PNGLIBs) $(ZLIBs) $(XLIB) -lm +WLIBSd = $(PNGLIBd) $(ZLIBd) -lm +WLIBSs = $(PNGLIBs) $(ZLIBs) -lm + +CC = gcc +LD = gcc +RM = rm -f +CPPFLAGS = $(INCS) -DFEATURE_LOOP +CFLAGS = -O -Wall +#CFLAGS = -O -W -Wall -Wextra -pedantic -ansi +# [note that -Wall is a gcc-specific compilation flag ("most warnings on")] +# [-ansi, -pedantic, -Wextra, and -W can also be used] +LDFLAGS = +O = .o +E = + +RPNG = rpng-x +RPNG2 = rpng2-x +WPNG = wpng + +RPNGs = $(RPNG)-static +RPNG2s = $(RPNG2)-static +WPNGs = $(WPNG)-static + +ROBJS = $(RPNG)$(O) readpng$(O) +ROBJS2 = $(RPNG2)$(O) readpng2$(O) +WOBJS = $(WPNG)$(O) writepng$(O) + +STATIC_EXES = $(RPNGs)$(E) $(RPNG2s)$(E) $(WPNGs)$(E) +DYNAMIC_EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E) + +EXES = $(STATIC_EXES) $(DYNAMIC_EXES) + + +# implicit make rules ------------------------------------------------------- + +.c$(O): + $(CC) -c $(CPPFLAGS) $(CFLAGS) $< + + +# dependencies -------------------------------------------------------------- + +all: $(EXES) + +$(RPNGs)$(E): $(ROBJS) + $(LD) $(LDFLAGS) -o $@ $(ROBJS) $(RLIBSs) + +$(RPNG)$(E): $(ROBJS) + $(LD) $(LDFLAGS) -o $@ $(ROBJS) $(RLIBSd) + +$(RPNG2s)$(E): $(ROBJS2) + $(LD) $(LDFLAGS) -o $@ $(ROBJS2) $(RLIBSs) + +$(RPNG2)$(E): $(ROBJS2) + $(LD) $(LDFLAGS) -o $@ $(ROBJS2) $(RLIBSd) + +$(WPNGs)$(E): $(WOBJS) + $(LD) $(LDFLAGS) -o $@ $(WOBJS) $(WLIBSs) + +$(WPNG)$(E): $(WOBJS) + $(LD) $(LDFLAGS) -o $@ $(WOBJS) $(WLIBSd) + +$(RPNG)$(O): $(RPNG).c readpng.h +$(RPNG2)$(O): $(RPNG2).c readpng2.h +$(WPNG)$(O): $(WPNG).c writepng.h + +readpng$(O): readpng.c readpng.h +readpng2$(O): readpng2.c readpng2.h +writepng$(O): writepng.c writepng.h + + +# maintenance --------------------------------------------------------------- + +clean: + $(RM) $(EXES) $(ROBJS) $(ROBJS2) $(WOBJS) diff --git a/Engine/lib/lpng/contrib/gregbook/Makefile.w32 b/Engine/lib/lpng/contrib/gregbook/Makefile.w32 new file mode 100644 index 000000000..ab7dcf7ca --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/Makefile.w32 @@ -0,0 +1,114 @@ +# Sample makefile for rpng-win / rpng2-win / wpng using MSVC and NMAKE. +# Greg Roelofs +# Last modified: 2 June 2007 +# +# The programs built by this makefile are described in the book, +# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and +# Associates, 1999). Go buy a copy, eh? Well, OK, it's not +# generally for sale anymore, but it's the thought that counts, +# right? (Hint: http://www.libpng.org/pub/png/book/ ) +# +# Invoke this makefile from a DOS prompt window via: +# +# %devstudio%\vc\bin\vcvars32.bat +# nmake -nologo -f Makefile.w32 +# +# where %devstudio% is the installation directory for MSVC / DevStudio. If +# you get "environment out of space" errors, create a desktop shortcut with +# "c:\windows\command.com /e:4096" as the program command line and set the +# working directory to this directory. Then double-click to open the new +# DOS-prompt window with a bigger environment and retry the commands above. +# +# This makefile assumes libpng and zlib have already been built or downloaded +# and are in subdirectories at the same level as the current subdirectory +# (as indicated by the PNGPATH and ZPATH macros below). Edit as appropriate. +# +# Note that the names of the dynamic and static libpng and zlib libraries +# used below may change in later releases of the libraries. This makefile +# builds statically linked executables, but that can be changed by uncom- +# menting the appropriate PNGLIB and ZLIB lines. + +!include + + +# macros -------------------------------------------------------------------- + +PNGPATH = ../libpng +PNGINC = -I$(PNGPATH) +#PNGLIB = $(PNGPATH)/pngdll.lib +PNGLIB = $(PNGPATH)/libpng.lib + +ZPATH = ../zlib +ZINC = -I$(ZPATH) +#ZLIB = $(ZPATH)/zlibdll.lib +ZLIB = $(ZPATH)/zlibstat.lib + +WINLIBS = -defaultlib:user32.lib gdi32.lib +# ["real" apps may also need comctl32.lib, comdlg32.lib, winmm.lib, etc.] + +INCS = $(PNGINC) $(ZINC) +RLIBS = $(PNGLIB) $(ZLIB) $(WINLIBS) +WLIBS = $(PNGLIB) $(ZLIB) + +CC = cl +LD = link +RM = del +CPPFLAGS = $(INCS) +CFLAGS = -nologo -O -W3 $(cvars) +# [note that -W3 is an MSVC-specific compilation flag ("all warnings on")] +# [see %devstudio%\vc\include\win32.mak for cvars macro definition] +O = .obj +E = .exe + +RLDFLAGS = -nologo -subsystem:windows +WLDFLAGS = -nologo + +RPNG = rpng-win +RPNG2 = rpng2-win +WPNG = wpng + +ROBJS = $(RPNG)$(O) readpng$(O) +ROBJS2 = $(RPNG2)$(O) readpng2$(O) +WOBJS = $(WPNG)$(O) writepng$(O) + +EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E) + + +# implicit make rules ------------------------------------------------------- + +.c$(O): + $(CC) -c $(CPPFLAGS) $(CFLAGS) $< + + +# dependencies -------------------------------------------------------------- + +all: $(EXES) + +$(RPNG)$(E): $(ROBJS) + $(LD) $(RLDFLAGS) -out:$@ $(ROBJS) $(RLIBS) + +$(RPNG2)$(E): $(ROBJS2) + $(LD) $(RLDFLAGS) -out:$@ $(ROBJS2) $(RLIBS) + +$(WPNG)$(E): $(WOBJS) + $(LD) $(WLDFLAGS) -out:$@ $(WOBJS) $(WLIBS) + +$(RPNG)$(O): $(RPNG).c readpng.h +$(RPNG2)$(O): $(RPNG2).c readpng2.h +$(WPNG)$(O): $(WPNG).c writepng.h + +readpng$(O): readpng.c readpng.h +readpng2$(O): readpng2.c readpng2.h +writepng$(O): writepng.c writepng.h + + +# maintenance --------------------------------------------------------------- + +clean: +# ideally we could just do this: +# $(RM) $(EXES) $(ROBJS) $(ROBJS2) $(WOBJS) +# ...but the Windows "DEL" command is none too bright, so: + $(RM) r*$(E) + $(RM) w*$(E) + $(RM) r*$(O) + $(RM) w*$(O) diff --git a/Engine/lib/lpng/contrib/gregbook/README b/Engine/lib/lpng/contrib/gregbook/README new file mode 100644 index 000000000..90e28f7ce --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/README @@ -0,0 +1,186 @@ + =========================== + PNG: The Definitive Guide + =========================== + + Source Code + +Chapters 13, 14 and 15 of "PNG: The Definitive Guide" discuss three free, +cross-platform demo programs that show how to use the libpng reference +library: rpng, rpng2 and wpng. rpng and rpng2 are viewers; the first is +a very simple example that that shows how a standard file-viewer might use +libpng, while the second is designed to process streaming data and shows +how a web browser might be written. wpng is a simple command-line program +that reads binary PGM and PPM files (the ``raw'' grayscale and RGB subsets +of PBMPLUS/NetPBM) and converts them to PNG. + +The source code for all three demo programs currently compiles under +Unix, OpenVMS, and 32-bit Windows. (Special thanks to Martin Zinser, +zinser at decus.de, for making the necessary changes for OpenVMS and for +providing an appropriate build script.) Build instructions can be found +below. + +Files: + + README this file + LICENSE terms of distribution and reuse (BSD-like or GNU GPL) + COPYING GNU General Public License (GPL) + + Makefile.unx Unix makefile + Makefile.w32 Windows (MSVC) makefile + makevms.com OpenVMS build script + + rpng-win.c Windows front end for the basic viewer + rpng-x.c X Window System (Unix, OpenVMS) front end + readpng.c generic back end for the basic viewer + readpng.h header file for the basic viewer + + rpng2-win.c Windows front end for the progressive viewer + rpng2-x.c X front end for the progressive viewer + readpng2.c generic back end for the progressive viewer + readpng2.h header file for the progressive viewer + + wpng.c generic (text) front end for the converter + writepng.c generic back end for the converter + writepng.h header file for the converter + + toucan.png transparent PNG for testing (by Stefan Schneider) + +Note that, although the programs are designed to be functional, their +primary purpose is to illustrate how to use libpng to add PNG support to +other programs. As such, their user interfaces are crude and definitely +are not intended for everyday use. + +Please see http://www.libpng.org/pub/png/pngbook.html for further infor- +mation and links to the latest version of the source code, and Chapters +13-15 of the book for detailed discussion of the three programs. + +Greg Roelofs +https://pobox.com/~newt/greg_contact.html +16 March 2008 + + +BUILD INSTRUCTIONS + + - Prerequisites (in order of compilation): + + - zlib https://zlib.net/ + - libpng http://www.libpng.org/pub/png/libpng.html + - pngbook http://www.libpng.org/pub/png/book/sources.html + + The pngbook demo programs are explicitly designed to demonstrate proper + coding techniques for using the libpng reference library. As a result, + you need to download and build both zlib (on which libpng depends) and + libpng. A common build setup is to place the zlib, libpng and pngbook + subdirectory trees ("folders") in the same parent directory. Then the + libpng build can refer to files in ../zlib (or ..\zlib or [-.zlib]), + and similarly for the pngbook build. + + Note that all three packages are designed to be built from a command + line by default; those who wish to use a graphical or other integrated + development environments are on their own. + + + - Unix: + + Unpack the latest pngbook sources (which should correspond to this + README file) into a directory and change into that directory. + + Copy Makefile.unx to Makefile and edit the PNG* and Z* variables + appropriately (possibly also the X* variables if necessary). + + make + + There is no "install" target, so copy the three executables somewhere + in your path or run them from the current directory. All three will + print a basic usage screen when run without any command-line arguments; + see the book for more details. + + + - Windows: + + Unpack the latest pngbook sources (which should correspond to this + README file) into a folder, open a "DOS shell" or "command prompt" + or equivalent command-line window, and cd into the folder where you + unpacked the source code. + + For MSVC, set up the necessary environment variables by invoking + + %devstudio%\vc\bin\vcvars32.bat + + where where %devstudio% is the installation directory for MSVC / + DevStudio. If you get "environment out of space" errors under 95/98, + create a desktop shortcut with "c:\windows\command.com /e:4096" as + the program command line and set the working directory to the pngbook + directory. Then double-click to open the new DOS-prompt window with + a bigger environment and retry the commands above. + + Copy Makefile.w32 to Makefile and edit the PNGPATH and ZPATH variables + appropriately (possibly also the "INC" and "LIB" variables if needed). + Note that the names of the dynamic and static libpng and zlib libraries + used in the makefile may change in later releases of the libraries. + Also note that, as of libpng version 1.0.5, MSVC DLL builds do not work. + This makefile therefore builds statically linked executables, but if + the DLL problems ever get fixed, uncommenting the appropriate PNGLIB + and ZLIB lines will build dynamically linked executables instead. + + Do the build by typing + + nmake + + The result should be three executables: rpng-win.exe, rpng2-win.exe, + and wpng.exe. Copy them somewhere in your PATH or run them from the + current folder. Like the Unix versions, the two windowed programs + (rpng and rpng2) now display a usage screen in a console window when + invoked without command-line arguments; this is new behavior as of + the June 2001 release. Note that the programs use the Unix-style "-" + character to specify options, instead of the more common DOS/Windows + "/" character. (For example: "rpng2-win -bgpat 4 foo.png", not + "rpng2-win /bgpat 4 foo.png") + + + - OpenVMS: + + Unpack the pngbook sources into a subdirectory and change into that + subdirectory. + + Edit makevms.com appropriately, specifically the zpath and pngpath + variables. + + @makevms + + To run the programs, they probably first need to be set up as "foreign + symbols," with "disk" and "dir" set appropriately: + + $ rpng == "$disk:[dir]rpng-x.exe" + $ rpng2 == "$disk:[dir]rpng2-x.exe" + $ wpng == "$disk:[dir]wpng.exe" + + All three will print a basic usage screen when run without any command- + line arguments; see the book for more details. Note that the options + style is Unix-like, i.e., preceded by "-" rather than "/". + + +RUNNING THE PROGRAMS: (VERY) BRIEF INTRO + + rpng is a simple PNG viewer that can display transparent PNGs with a + specified background color; for example, + + rpng -bgcolor \#ff0000 toucan.png + + would display the image with a red background. rpng2 is a progressive + viewer that simulates a web browser in some respects; it can display + images against either a background color or a dynamically generated + background image. For example: + + rpng2 -bgpat 16 toucan.png + + wpng is a purely command-line image converter from binary PBMPLUS/NetPBM + format (.pgm or .ppm) to PNG; for example, + + wpng -time < toucan-notrans.ppm > toucan-notrans.png + + would convert the specified PPM file (using redirection) to PNG, auto- + matically setting the PNG modification-time chunk. + + All options can be abbreviated to the shortest unique value; for example, + "-bgc" for -bgcolor (versus "-bgp" for -bgpat), or "-g" for -gamma. diff --git a/Engine/lib/lpng/contrib/gregbook/makevms.com b/Engine/lib/lpng/contrib/gregbook/makevms.com new file mode 100644 index 000000000..f32bcaba7 --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/makevms.com @@ -0,0 +1,132 @@ +$!------------------------------------------------------------------------------ +$! make "PNG: The Definitive Guide" demo programs (for X) under OpenVMS +$! +$! Script created by Martin Zinser for libpng; modified by Greg Roelofs +$! for standalone pngbook source distribution. +$! +$! +$! Set locations where zlib and libpng sources live. +$! +$ zpath = "" +$ pngpath = "" +$! +$ if f$search("[---.zlib]zlib.h").nes."" then zpath = "[---.zlib]" +$ if f$search("[--]png.h").nes."" then pngpath = "[--]" +$! +$ if f$search("[-.zlib]zlib.h").nes."" then zpath = "[-.zlib]" +$ if f$search("[-.libpng]png.h").nes."" then pngpath = "[-.libpng]" +$! +$ if zpath .eqs. "" +$ then +$ write sys$output "zlib include not found. Exiting..." +$ exit 2 +$ endif +$! +$ if pngpath .eqs. "" +$ then +$ write sys$output "libpng include not found. Exiting..." +$ exit 2 +$ endif +$! +$! Look for the compiler used. +$! +$ ccopt="/include=(''zpath',''pngpath')" +$ if f$getsyi("HW_MODEL").ge.1024 +$ then +$ ccopt = "/prefix=all"+ccopt +$ comp = "__decc__=1" +$ if f$trnlnm("SYS").eqs."" then define sys sys$library: +$ else +$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs."" +$ then +$ if f$trnlnm("SYS").eqs."" then define sys sys$library: +$ if f$search("SYS$SYSTEM:VAXC.EXE").eqs."" +$ then +$ comp = "__gcc__=1" +$ CC :== GCC +$ else +$ comp = "__vaxc__=1" +$ endif +$ else +$ if f$trnlnm("SYS").eqs."" then define sys decc$library_include: +$ ccopt = "/decc/prefix=all"+ccopt +$ comp = "__decc__=1" +$ endif +$ endif +$ open/write lopt lib.opt +$ write lopt "''pngpath'libpng.olb/lib" +$ write lopt "''zpath'libz.olb/lib" +$ close lopt +$ open/write xopt x11.opt +$ write xopt "sys$library:decw$xlibshr.exe/share" +$ close xopt +$! +$! Build 'em. +$! +$ write sys$output "Compiling PNG book programs ..." +$ CALL MAKE readpng.OBJ "cc ''CCOPT' readpng" - + readpng.c readpng.h +$ CALL MAKE readpng2.OBJ "cc ''CCOPT' readpng2" - + readpng2.c readpng2.h +$ CALL MAKE writepng.OBJ "cc ''CCOPT' writepng" - + writepng.c writepng.h +$ write sys$output "Building rpng-x..." +$ CALL MAKE rpng-x.OBJ "cc ''CCOPT' rpng-x" - + rpng-x.c readpng.h +$ call make rpng-x.exe - + "LINK rpng-x,readpng,lib.opt/opt,x11.opt/opt" - + rpng-x.obj readpng.obj +$ write sys$output "Building rpng2-x..." +$ CALL MAKE rpng2-x.OBJ "cc ''CCOPT' rpng2-x" - + rpng2-x.c readpng2.h +$ call make rpng2-x.exe - + "LINK rpng2-x,readpng2,lib.opt/opt,x11.opt/opt" - + rpng2-x.obj readpng2.obj +$ write sys$output "Building wpng..." +$ CALL MAKE wpng.OBJ "cc ''CCOPT' wpng" - + wpng.c writepng.h +$ call make wpng.exe - + "LINK wpng,writepng,lib.opt/opt" - + wpng.obj writepng.obj +$ exit +$! +$! +$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES +$ V = 'F$Verify(0) +$! P1 = What we are trying to make +$! P2 = Command to make it +$! P3 - P8 What it depends on +$ +$ If F$Search(P1) .Eqs. "" Then Goto Makeit +$ Time = F$CvTime(F$File(P1,"RDT")) +$arg=3 +$Loop: +$ Argument = P'arg +$ If Argument .Eqs. "" Then Goto Exit +$ El=0 +$Loop2: +$ File = F$Element(El," ",Argument) +$ If File .Eqs. " " Then Goto Endl +$ AFile = "" +$Loop3: +$ OFile = AFile +$ AFile = F$Search(File) +$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl +$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit +$ Goto Loop3 +$NextEL: +$ El = El + 1 +$ Goto Loop2 +$EndL: +$ arg=arg+1 +$ If arg .Le. 8 Then Goto Loop +$ Goto Exit +$ +$Makeit: +$ VV=F$VERIFY(0) +$ write sys$output P2 +$ 'P2 +$ VV='F$Verify(VV) +$Exit: +$ If V Then Set Verify +$ENDSUBROUTINE diff --git a/Engine/lib/lpng/contrib/gregbook/readpng.c b/Engine/lib/lpng/contrib/gregbook/readpng.c new file mode 100644 index 000000000..fad9b536a --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/readpng.c @@ -0,0 +1,323 @@ +/*--------------------------------------------------------------------------- + + rpng - simple PNG display program readpng.c + + --------------------------------------------------------------------------- + + Copyright (c) 1998-2007,2017 Greg Roelofs. All rights reserved. + + This software is provided "as is," without warranty of any kind, + express or implied. In no event shall the author or contributors + be held liable for any damages arising in any way from the use of + this software. + + The contents of this file are DUAL-LICENSED. You may modify and/or + redistribute this software according to the terms of one of the + following two licenses (at your option): + + + LICENSE 1 ("BSD-like with advertising clause"): + + 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. Redistributions of source code must retain the above copyright + notice, disclaimer, and this list of conditions. + 2. Redistributions in binary form must reproduce the above copyright + notice, disclaimer, and this list of conditions in the documenta- + tion and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + + This product includes software developed by Greg Roelofs + and contributors for the book, "PNG: The Definitive Guide," + published by O'Reilly and Associates. + + + LICENSE 2 (GNU GPL v2 or later): + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + ---------------------------------------------------------------------------*/ + +#include +#include +#include + +#include "png.h" /* libpng header */ +#include "readpng.h" /* typedefs, common macros, public prototypes */ + +/* future versions of libpng will provide this macro: */ +#ifndef png_jmpbuf +# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) +#endif + + +static png_structp png_ptr = NULL; +static png_infop info_ptr = NULL; + +png_uint_32 width, height; +int bit_depth, color_type; +uch *image_data = NULL; + + +void readpng_version_info(void) +{ + fprintf(stderr, " Compiled with libpng %s; using libpng %s.\n", + PNG_LIBPNG_VER_STRING, png_libpng_ver); + fprintf(stderr, " Compiled with zlib %s; using zlib %s.\n", + ZLIB_VERSION, zlib_version); +} + + +/* return value = 0 for success, 1 for bad sig, 2 for bad IHDR, 4 for no mem */ + +int readpng_init(FILE *infile, ulg *pWidth, ulg *pHeight) +{ + uch sig[8]; + + + /* first do a quick check that the file really is a PNG image; could + * have used slightly more general png_sig_cmp() function instead */ + + fread(sig, 1, 8, infile); + if (png_sig_cmp(sig, 0, 8)) + return 1; /* bad signature */ + + + /* could pass pointers to user-defined error handlers instead of NULLs: */ + + png_ptr = png_create_read_struct(png_get_libpng_ver(NULL), NULL, NULL, + NULL); + if (!png_ptr) + return 4; /* out of memory */ + + info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) { + png_destroy_read_struct(&png_ptr, NULL, NULL); + return 4; /* out of memory */ + } + + + /* we could create a second info struct here (end_info), but it's only + * useful if we want to keep pre- and post-IDAT chunk info separated + * (mainly for PNG-aware image editors and converters) */ + + + /* setjmp() must be called in every function that calls a PNG-reading + * libpng function */ + + if (setjmp(png_jmpbuf(png_ptr))) { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return 2; + } + + + png_init_io(png_ptr, infile); + png_set_sig_bytes(png_ptr, 8); /* we already read the 8 signature bytes */ + + png_read_info(png_ptr, info_ptr); /* read all PNG info up to image data */ + + + /* alternatively, could make separate calls to png_get_image_width(), + * etc., but want bit_depth and color_type for later [don't care about + * compression_type and filter_type => NULLs] */ + + png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, + NULL, NULL, NULL); + *pWidth = width; + *pHeight = height; + + + /* OK, that's all we need for now; return happy */ + + return 0; +} + + + + +/* returns 0 if succeeds, 1 if fails due to no bKGD chunk, 2 if libpng error; + * scales values to 8-bit if necessary */ + +int readpng_get_bgcolor(uch *red, uch *green, uch *blue) +{ + png_color_16p pBackground; + + + /* setjmp() must be called in every function that calls a PNG-reading + * libpng function */ + + if (setjmp(png_jmpbuf(png_ptr))) { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return 2; + } + + + if (!png_get_valid(png_ptr, info_ptr, PNG_INFO_bKGD)) + return 1; + + /* it is not obvious from the libpng documentation, but this function + * takes a pointer to a pointer, and it always returns valid red, green + * and blue values, regardless of color_type: */ + + png_get_bKGD(png_ptr, info_ptr, &pBackground); + + + /* however, it always returns the raw bKGD data, regardless of any + * bit-depth transformations, so check depth and adjust if necessary */ + + if (bit_depth == 16) { + *red = pBackground->red >> 8; + *green = pBackground->green >> 8; + *blue = pBackground->blue >> 8; + } else if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) { + if (bit_depth == 1) + *red = *green = *blue = pBackground->gray? 255 : 0; + else if (bit_depth == 2) + *red = *green = *blue = (255/3) * pBackground->gray; + else /* bit_depth == 4 */ + *red = *green = *blue = (255/15) * pBackground->gray; + } else { + *red = (uch)pBackground->red; + *green = (uch)pBackground->green; + *blue = (uch)pBackground->blue; + } + + return 0; +} + + + + +/* display_exponent == LUT_exponent * CRT_exponent */ + +uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes) +{ + double gamma; + png_uint_32 i, rowbytes; + png_bytepp row_pointers = NULL; + + + /* setjmp() must be called in every function that calls a PNG-reading + * libpng function */ + + if (setjmp(png_jmpbuf(png_ptr))) { + free(image_data); + image_data = NULL; + free(row_pointers); + row_pointers = NULL; + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; + } + + + /* expand palette images to RGB, low-bit-depth grayscale images to 8 bits, + * transparency chunks to full alpha channel; strip 16-bit-per-sample + * images to 8 bits per sample; and convert grayscale to RGB[A] */ + + if (color_type == PNG_COLOR_TYPE_PALETTE) + png_set_expand(png_ptr); + if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) + png_set_expand(png_ptr); + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) + png_set_expand(png_ptr); +#ifdef PNG_READ_16_TO_8_SUPPORTED + if (bit_depth == 16) +# ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED + png_set_scale_16(png_ptr); +# else + png_set_strip_16(png_ptr); +# endif +#endif + if (color_type == PNG_COLOR_TYPE_GRAY || + color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + png_set_gray_to_rgb(png_ptr); + + + /* unlike the example in the libpng documentation, we have *no* idea where + * this file may have come from--so if it doesn't have a file gamma, don't + * do any correction ("do no harm") */ + + if (png_get_gAMA(png_ptr, info_ptr, &gamma)) + png_set_gamma(png_ptr, display_exponent, gamma); + + + /* all transformations have been registered; now update info_ptr data, + * get rowbytes and channels, and allocate image memory */ + + png_read_update_info(png_ptr, info_ptr); + + *pRowbytes = rowbytes = png_get_rowbytes(png_ptr, info_ptr); + *pChannels = (int)png_get_channels(png_ptr, info_ptr); + + /* Guard against integer overflow */ + if (height > ((size_t)(-1))/rowbytes) { + fprintf(stderr, "readpng: image_data buffer would be too large\n", + return NULL; + } + + if ((image_data = (uch *)malloc(rowbytes*height)) == NULL) { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; + } + if ((row_pointers = (png_bytepp)malloc(height*sizeof(png_bytep))) == NULL) { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + free(image_data); + image_data = NULL; + return NULL; + } + + Trace((stderr, "readpng_get_image: channels = %d, rowbytes = %ld, height = %ld\n", + *pChannels, rowbytes, height)); + + + /* set the individual row_pointers to point at the correct offsets */ + + for (i = 0; i < height; ++i) + row_pointers[i] = image_data + i*rowbytes; + + + /* now we can go ahead and just read the whole image */ + + png_read_image(png_ptr, row_pointers); + + + /* and we're done! (png_read_end() can be omitted if no processing of + * post-IDAT text/time/etc. is desired) */ + + free(row_pointers); + row_pointers = NULL; + + png_read_end(png_ptr, NULL); + + return image_data; +} + + +void readpng_cleanup(int free_image_data) +{ + if (free_image_data && image_data) { + free(image_data); + image_data = NULL; + } + + if (png_ptr && info_ptr) { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + png_ptr = NULL; + info_ptr = NULL; + } +} diff --git a/Engine/lib/lpng/contrib/gregbook/readpng.h b/Engine/lib/lpng/contrib/gregbook/readpng.h new file mode 100644 index 000000000..fad9fe3b4 --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/readpng.h @@ -0,0 +1,88 @@ +/*--------------------------------------------------------------------------- + + rpng - simple PNG display program readpng.h + + --------------------------------------------------------------------------- + + Copyright (c) 1998-2007 Greg Roelofs. All rights reserved. + + This software is provided "as is," without warranty of any kind, + express or implied. In no event shall the author or contributors + be held liable for any damages arising in any way from the use of + this software. + + The contents of this file are DUAL-LICENSED. You may modify and/or + redistribute this software according to the terms of one of the + following two licenses (at your option): + + + LICENSE 1 ("BSD-like with advertising clause"): + + 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. Redistributions of source code must retain the above copyright + notice, disclaimer, and this list of conditions. + 2. Redistributions in binary form must reproduce the above copyright + notice, disclaimer, and this list of conditions in the documenta- + tion and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + + This product includes software developed by Greg Roelofs + and contributors for the book, "PNG: The Definitive Guide," + published by O'Reilly and Associates. + + + LICENSE 2 (GNU GPL v2 or later): + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + ---------------------------------------------------------------------------*/ + +#ifndef TRUE +# define TRUE 1 +# define FALSE 0 +#endif + +#ifndef MAX +# define MAX(a,b) ((a) > (b)? (a) : (b)) +# define MIN(a,b) ((a) < (b)? (a) : (b)) +#endif + +#ifdef DEBUG +# define Trace(x) {fprintf x ; fflush(stderr); fflush(stdout);} +#else +# define Trace(x) ; +#endif + +typedef unsigned char uch; +typedef unsigned short ush; +typedef unsigned long ulg; + + +/* prototypes for public functions in readpng.c */ + +void readpng_version_info(void); + +int readpng_init(FILE *infile, ulg *pWidth, ulg *pHeight); + +int readpng_get_bgcolor(uch *bg_red, uch *bg_green, uch *bg_blue); + +uch *readpng_get_image(double display_exponent, int *pChannels, + ulg *pRowbytes); + +void readpng_cleanup(int free_image_data); diff --git a/Engine/lib/lpng/contrib/gregbook/readpng2.c b/Engine/lib/lpng/contrib/gregbook/readpng2.c new file mode 100644 index 000000000..610b3cd87 --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/readpng2.c @@ -0,0 +1,521 @@ +/*--------------------------------------------------------------------------- + + rpng2 - progressive-model PNG display program readpng2.c + + --------------------------------------------------------------------------- + + Copyright (c) 1998-2015 Greg Roelofs. All rights reserved. + + This software is provided "as is," without warranty of any kind, + express or implied. In no event shall the author or contributors + be held liable for any damages arising in any way from the use of + this software. + + The contents of this file are DUAL-LICENSED. You may modify and/or + redistribute this software according to the terms of one of the + following two licenses (at your option): + + + LICENSE 1 ("BSD-like with advertising clause"): + + 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. Redistributions of source code must retain the above copyright + notice, disclaimer, and this list of conditions. + 2. Redistributions in binary form must reproduce the above copyright + notice, disclaimer, and this list of conditions in the documenta- + tion and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + + This product includes software developed by Greg Roelofs + and contributors for the book, "PNG: The Definitive Guide," + published by O'Reilly and Associates. + + + LICENSE 2 (GNU GPL v2 or later): + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + --------------------------------------------------------------------------- + + Changelog: + 2015-11-12 - Check return value of png_get_bKGD() (Glenn R-P) + 2017-04-22 - Guard against integer overflow (Glenn R-P) + + ---------------------------------------------------------------------------*/ + + +#include /* for exit() prototype */ +#include + +#include +#include "png.h" /* libpng header from the local directory */ +#include "readpng2.h" /* typedefs, common macros, public prototypes */ + + +/* local prototypes */ + +static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr); +static void readpng2_row_callback(png_structp png_ptr, png_bytep new_row, + png_uint_32 row_num, int pass); +static void readpng2_end_callback(png_structp png_ptr, png_infop info_ptr); +static void readpng2_error_handler(png_structp png_ptr, png_const_charp msg); +static void readpng2_warning_handler(png_structp png_ptr, png_const_charp msg); + + + + +void readpng2_version_info(void) +{ + fprintf(stderr, " Compiled with libpng %s; using libpng %s\n", + PNG_LIBPNG_VER_STRING, png_libpng_ver); + + fprintf(stderr, " and with zlib %s; using zlib %s.\n", + ZLIB_VERSION, zlib_version); +} + + + + +int readpng2_check_sig(uch *sig, int num) +{ + return !png_sig_cmp(sig, 0, num); +} + + + + +/* returns 0 for success, 2 for libpng problem, 4 for out of memory */ + +int readpng2_init(mainprog_info *mainprog_ptr) +{ + png_structp png_ptr; /* note: temporary variables! */ + png_infop info_ptr; + + + /* could also replace libpng warning-handler (final NULL), but no need: */ + + png_ptr = png_create_read_struct(png_get_libpng_ver(NULL), mainprog_ptr, + readpng2_error_handler, readpng2_warning_handler); + if (!png_ptr) + return 4; /* out of memory */ + + info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) { + png_destroy_read_struct(&png_ptr, NULL, NULL); + return 4; /* out of memory */ + } + + + /* we could create a second info struct here (end_info), but it's only + * useful if we want to keep pre- and post-IDAT chunk info separated + * (mainly for PNG-aware image editors and converters) */ + + + /* setjmp() must be called in every function that calls a PNG-reading + * libpng function, unless an alternate error handler was installed-- + * but compatible error handlers must either use longjmp() themselves + * (as in this program) or exit immediately, so here we are: */ + + if (setjmp(mainprog_ptr->jmpbuf)) { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return 2; + } + + +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED + /* prepare the reader to ignore all recognized chunks whose data won't be + * used, i.e., all chunks recognized by libpng except for IHDR, PLTE, IDAT, + * IEND, tRNS, bKGD, gAMA, and sRGB (small performance improvement) */ + { + /* These byte strings were copied from png.h. If a future version + * of readpng2.c recognizes more chunks, add them to this list. + */ + static const png_byte chunks_to_process[] = { + 98, 75, 71, 68, '\0', /* bKGD */ + 103, 65, 77, 65, '\0', /* gAMA */ + 115, 82, 71, 66, '\0', /* sRGB */ + }; + + /* Ignore all chunks except for IHDR, PLTE, tRNS, IDAT, and IEND */ + png_set_keep_unknown_chunks(png_ptr, -1 /* PNG_HANDLE_CHUNK_NEVER */, + NULL, -1); + + /* But do not ignore chunks in the "chunks_to_process" list */ + png_set_keep_unknown_chunks(png_ptr, + 0 /* PNG_HANDLE_CHUNK_AS_DEFAULT */, chunks_to_process, + sizeof(chunks_to_process)/5); + } +#endif /* PNG_HANDLE_AS_UNKNOWN_SUPPORTED */ + + + /* instead of doing png_init_io() here, now we set up our callback + * functions for progressive decoding */ + + png_set_progressive_read_fn(png_ptr, mainprog_ptr, + readpng2_info_callback, readpng2_row_callback, readpng2_end_callback); + + + /* make sure we save our pointers for use in readpng2_decode_data() */ + + mainprog_ptr->png_ptr = png_ptr; + mainprog_ptr->info_ptr = info_ptr; + + + /* and that's all there is to initialization */ + + return 0; +} + + + + +/* returns 0 for success, 2 for libpng (longjmp) problem */ + +int readpng2_decode_data(mainprog_info *mainprog_ptr, uch *rawbuf, ulg length) +{ + png_structp png_ptr = (png_structp)mainprog_ptr->png_ptr; + png_infop info_ptr = (png_infop)mainprog_ptr->info_ptr; + + + /* setjmp() must be called in every function that calls a PNG-reading + * libpng function */ + + if (setjmp(mainprog_ptr->jmpbuf)) { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + mainprog_ptr->png_ptr = NULL; + mainprog_ptr->info_ptr = NULL; + return 2; + } + + + /* hand off the next chunk of input data to libpng for decoding */ + + png_process_data(png_ptr, info_ptr, rawbuf, length); + + return 0; +} + + + + +static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr) +{ + mainprog_info *mainprog_ptr; + int color_type, bit_depth; + png_uint_32 width, height; +#ifdef PNG_FLOATING_POINT_SUPPORTED + double gamma; +#else + png_fixed_point gamma; +#endif + + + /* setjmp() doesn't make sense here, because we'd either have to exit(), + * longjmp() ourselves, or return control to libpng, which doesn't want + * to see us again. By not doing anything here, libpng will instead jump + * to readpng2_decode_data(), which can return an error value to the main + * program. */ + + + /* retrieve the pointer to our special-purpose struct, using the png_ptr + * that libpng passed back to us (i.e., not a global this time--there's + * no real difference for a single image, but for a multithreaded browser + * decoding several PNG images at the same time, one needs to avoid mixing + * up different images' structs) */ + + mainprog_ptr = png_get_progressive_ptr(png_ptr); + + if (mainprog_ptr == NULL) { /* we be hosed */ + fprintf(stderr, + "readpng2 error: main struct not recoverable in info_callback.\n"); + fflush(stderr); + return; + /* + * Alternatively, we could call our error-handler just like libpng + * does, which would effectively terminate the program. Since this + * can only happen if png_ptr gets redirected somewhere odd or the + * main PNG struct gets wiped, we're probably toast anyway. (If + * png_ptr itself is NULL, we would not have been called.) + */ + } + + + /* this is just like in the non-progressive case */ + + png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, + NULL, NULL, NULL); + mainprog_ptr->width = (ulg)width; + mainprog_ptr->height = (ulg)height; + + + /* since we know we've read all of the PNG file's "header" (i.e., up + * to IDAT), we can check for a background color here */ + + if (mainprog_ptr->need_bgcolor) + { + png_color_16p pBackground; + + /* it is not obvious from the libpng documentation, but this function + * takes a pointer to a pointer, and it always returns valid red, + * green and blue values, regardless of color_type: */ + if (png_get_bKGD(png_ptr, info_ptr, &pBackground)) + { + + /* however, it always returns the raw bKGD data, regardless of any + * bit-depth transformations, so check depth and adjust if necessary + */ + if (bit_depth == 16) { + mainprog_ptr->bg_red = pBackground->red >> 8; + mainprog_ptr->bg_green = pBackground->green >> 8; + mainprog_ptr->bg_blue = pBackground->blue >> 8; + } else if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) { + if (bit_depth == 1) + mainprog_ptr->bg_red = mainprog_ptr->bg_green = + mainprog_ptr->bg_blue = pBackground->gray? 255 : 0; + else if (bit_depth == 2) + mainprog_ptr->bg_red = mainprog_ptr->bg_green = + mainprog_ptr->bg_blue = (255/3) * pBackground->gray; + else /* bit_depth == 4 */ + mainprog_ptr->bg_red = mainprog_ptr->bg_green = + mainprog_ptr->bg_blue = (255/15) * pBackground->gray; + } else { + mainprog_ptr->bg_red = (uch)pBackground->red; + mainprog_ptr->bg_green = (uch)pBackground->green; + mainprog_ptr->bg_blue = (uch)pBackground->blue; + } + } + } + + + /* as before, let libpng expand palette images to RGB, low-bit-depth + * grayscale images to 8 bits, transparency chunks to full alpha channel; + * strip 16-bit-per-sample images to 8 bits per sample; and convert + * grayscale to RGB[A] */ + + if (color_type == PNG_COLOR_TYPE_PALETTE) + png_set_expand(png_ptr); + if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) + png_set_expand(png_ptr); + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) + png_set_expand(png_ptr); +#ifdef PNG_READ_16_TO_8_SUPPORTED + if (bit_depth == 16) +# ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED + png_set_scale_16(png_ptr); +# else + png_set_strip_16(png_ptr); +# endif +#endif + if (color_type == PNG_COLOR_TYPE_GRAY || + color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + png_set_gray_to_rgb(png_ptr); + + + /* Unlike the basic viewer, which was designed to operate on local files, + * this program is intended to simulate a web browser--even though we + * actually read from a local file, too. But because we are pretending + * that most of the images originate on the Internet, we follow the recom- + * mendation of the sRGB proposal and treat unlabelled images (no gAMA + * chunk) as existing in the sRGB color space. That is, we assume that + * such images have a file gamma of 0.45455, which corresponds to a PC-like + * display system. This change in assumptions will have no effect on a + * PC-like system, but on a Mac, SGI, NeXT or other system with a non- + * identity lookup table, it will darken unlabelled images, which effec- + * tively favors images from PC-like systems over those originating on + * the local platform. Note that mainprog_ptr->display_exponent is the + * "gamma" value for the entire display system, i.e., the product of + * LUT_exponent and CRT_exponent. */ + +#ifdef PNG_FLOATING_POINT_SUPPORTED + if (png_get_gAMA(png_ptr, info_ptr, &gamma)) + png_set_gamma(png_ptr, mainprog_ptr->display_exponent, gamma); + else + png_set_gamma(png_ptr, mainprog_ptr->display_exponent, 0.45455); +#else + if (png_get_gAMA_fixed(png_ptr, info_ptr, &gamma)) + png_set_gamma_fixed(png_ptr, + (png_fixed_point)(100000*mainprog_ptr->display_exponent+.5), gamma); + else + png_set_gamma_fixed(png_ptr, + (png_fixed_point)(100000*mainprog_ptr->display_exponent+.5), 45455); +#endif + + /* we'll let libpng expand interlaced images, too */ + + mainprog_ptr->passes = png_set_interlace_handling(png_ptr); + + + /* all transformations have been registered; now update info_ptr data and + * then get rowbytes and channels */ + + png_read_update_info(png_ptr, info_ptr); + + mainprog_ptr->rowbytes = (int)png_get_rowbytes(png_ptr, info_ptr); + mainprog_ptr->channels = png_get_channels(png_ptr, info_ptr); + + + /* Call the main program to allocate memory for the image buffer and + * initialize windows and whatnot. (The old-style function-pointer + * invocation is used for compatibility with a few supposedly ANSI + * compilers that nevertheless barf on "fn_ptr()"-style syntax.) */ + + (*mainprog_ptr->mainprog_init)(); + + + /* and that takes care of initialization */ + + return; +} + + + + + +static void readpng2_row_callback(png_structp png_ptr, png_bytep new_row, + png_uint_32 row_num, int pass) +{ + mainprog_info *mainprog_ptr; + + + /* first check whether the row differs from the previous pass; if not, + * nothing to combine or display */ + + if (!new_row) + return; + + + /* retrieve the pointer to our special-purpose struct so we can access + * the old rows and image-display callback function */ + + mainprog_ptr = png_get_progressive_ptr(png_ptr); + + + /* save the pass number for optional use by the front end */ + + mainprog_ptr->pass = pass; + + + /* have libpng either combine the new row data with the existing row data + * from previous passes (if interlaced) or else just copy the new row + * into the main program's image buffer */ + + png_progressive_combine_row(png_ptr, mainprog_ptr->row_pointers[row_num], + new_row); + + + /* finally, call the display routine in the main program with the number + * of the row we just updated */ + + (*mainprog_ptr->mainprog_display_row)(row_num); + + + /* and we're ready for more */ + + return; +} + + + + + +static void readpng2_end_callback(png_structp png_ptr, png_infop info_ptr) +{ + mainprog_info *mainprog_ptr; + + + /* retrieve the pointer to our special-purpose struct */ + + mainprog_ptr = png_get_progressive_ptr(png_ptr); + + + /* let the main program know that it should flush any buffered image + * data to the display now and set a "done" flag or whatever, but note + * that it SHOULD NOT DESTROY THE PNG STRUCTS YET--in other words, do + * NOT call readpng2_cleanup() either here or in the finish_display() + * routine; wait until control returns to the main program via + * readpng2_decode_data() */ + + (*mainprog_ptr->mainprog_finish_display)(); + + + /* all done */ + + (void)info_ptr; /* Unused */ + + return; +} + + + + + +void readpng2_cleanup(mainprog_info *mainprog_ptr) +{ + png_structp png_ptr = (png_structp)mainprog_ptr->png_ptr; + png_infop info_ptr = (png_infop)mainprog_ptr->info_ptr; + + if (png_ptr && info_ptr) + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + + mainprog_ptr->png_ptr = NULL; + mainprog_ptr->info_ptr = NULL; +} + + +static void readpng2_warning_handler(png_structp png_ptr, png_const_charp msg) +{ + fprintf(stderr, "readpng2 libpng warning: %s\n", msg); + fflush(stderr); + (void)png_ptr; /* Unused */ +} + + +static void readpng2_error_handler(png_structp png_ptr, png_const_charp msg) +{ + mainprog_info *mainprog_ptr; + + /* This function, aside from the extra step of retrieving the "error + * pointer" (below) and the fact that it exists within the application + * rather than within libpng, is essentially identical to libpng's + * default error handler. The second point is critical: since both + * setjmp() and longjmp() are called from the same code, they are + * guaranteed to have compatible notions of how big a jmp_buf is, + * regardless of whether _BSD_SOURCE or anything else has (or has not) + * been defined. */ + + fprintf(stderr, "readpng2 libpng error: %s\n", msg); + fflush(stderr); + + mainprog_ptr = png_get_error_ptr(png_ptr); + if (mainprog_ptr == NULL) { /* we are completely hosed now */ + fprintf(stderr, + "readpng2 severe error: jmpbuf not recoverable; terminating.\n"); + fflush(stderr); + exit(99); + } + + /* Now we have our data structure we can use the information in it + * to return control to our own higher level code (all the points + * where 'setjmp' is called in this file.) This will work with other + * error handling mechanisms as well - libpng always calls png_error + * when it can proceed no further, thus, so long as the error handler + * is intercepted, application code can do its own error recovery. + */ + longjmp(mainprog_ptr->jmpbuf, 1); +} diff --git a/Engine/lib/lpng/contrib/gregbook/readpng2.h b/Engine/lib/lpng/contrib/gregbook/readpng2.h new file mode 100644 index 000000000..6b3660d7c --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/readpng2.h @@ -0,0 +1,116 @@ +/*--------------------------------------------------------------------------- + + rpng2 - progressive-model PNG display program readpng2.h + + --------------------------------------------------------------------------- + + Copyright (c) 1998-2008 Greg Roelofs. All rights reserved. + + This software is provided "as is," without warranty of any kind, + express or implied. In no event shall the author or contributors + be held liable for any damages arising in any way from the use of + this software. + + The contents of this file are DUAL-LICENSED. You may modify and/or + redistribute this software according to the terms of one of the + following two licenses (at your option): + + + LICENSE 1 ("BSD-like with advertising clause"): + + 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. Redistributions of source code must retain the above copyright + notice, disclaimer, and this list of conditions. + 2. Redistributions in binary form must reproduce the above copyright + notice, disclaimer, and this list of conditions in the documenta- + tion and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + + This product includes software developed by Greg Roelofs + and contributors for the book, "PNG: The Definitive Guide," + published by O'Reilly and Associates. + + + LICENSE 2 (GNU GPL v2 or later): + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + ---------------------------------------------------------------------------*/ + +#ifndef TRUE +# define TRUE 1 +# define FALSE 0 +#endif + +#ifndef MAX +# define MAX(a,b) ((a) > (b)? (a) : (b)) +# define MIN(a,b) ((a) < (b)? (a) : (b)) +#endif + +#ifdef DEBUG +# define Trace(x) {fprintf x ; fflush(stderr); fflush(stdout);} +#else +# define Trace(x) ; +#endif + +enum rpng2_states { + kPreInit = 0, + kWindowInit, + kDone +}; + +typedef unsigned char uch; +typedef unsigned short ush; +typedef unsigned long ulg; + +typedef struct _mainprog_info { + double display_exponent; + ulg width; + ulg height; + void *png_ptr; + void *info_ptr; + void (*mainprog_init)(void); + void (*mainprog_display_row)(ulg row_num); + void (*mainprog_finish_display)(void); + uch *image_data; + uch **row_pointers; + jmp_buf jmpbuf; + int passes; /* not used */ + int pass; + int rowbytes; + int channels; + int need_bgcolor; + int state; + uch bg_red; + uch bg_green; + uch bg_blue; +} mainprog_info; + + +/* prototypes for public functions in readpng2.c */ + +void readpng2_version_info(void); + +int readpng2_check_sig(uch *sig, int num); + +int readpng2_init(mainprog_info *mainprog_ptr); + +int readpng2_decode_data(mainprog_info *mainprog_ptr, uch *rawbuf, ulg length); + +void readpng2_cleanup(mainprog_info *mainprog_ptr); diff --git a/Engine/lib/lpng/contrib/gregbook/readppm.c b/Engine/lib/lpng/contrib/gregbook/readppm.c new file mode 100644 index 000000000..52e702777 --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/readppm.c @@ -0,0 +1,188 @@ +/*--------------------------------------------------------------------------- + + rpng - simple PNG display program readppm.c + + --------------------------------------------------------------------------- + + This is a special-purpose replacement for readpng.c that allows binary + PPM files to be used in place of PNG images. + + --------------------------------------------------------------------------- + + Copyright (c) 1998-2007,2017 Greg Roelofs. All rights reserved. + + This software is provided "as is," without warranty of any kind, + express or implied. In no event shall the author or contributors + be held liable for any damages arising in any way from the use of + this software. + + The contents of this file are DUAL-LICENSED. You may modify and/or + redistribute this software according to the terms of one of the + following two licenses (at your option): + + + LICENSE 1 ("BSD-like with advertising clause"): + + 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. Redistributions of source code must retain the above copyright + notice, disclaimer, and this list of conditions. + 2. Redistributions in binary form must reproduce the above copyright + notice, disclaimer, and this list of conditions in the documenta- + tion and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + + This product includes software developed by Greg Roelofs + and contributors for the book, "PNG: The Definitive Guide," + published by O'Reilly and Associates. + + + LICENSE 2 (GNU GPL v2 or later): + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + ---------------------------------------------------------------------------*/ + +#include +#include + +#include "readpng.h" /* typedefs, common macros, public prototypes */ + + +ulg width, height; +int bit_depth, color_type, channels; +uch *image_data = NULL; +FILE *saved_infile; + + +void readpng_version_info() +{ + fprintf(stderr, " Compiled without libpng, zlib or PBMPLUS/NetPBM.\n"); +} + + +/* return value = 0 for success, 1 for bad sig, 2 for bad IHDR, 4 for no mem */ + +int readpng_init(FILE *infile, ulg *pWidth, ulg *pHeight) +{ + static uch ppmline[256]; + int maxval; + + + saved_infile = infile; + + fgets(ppmline, 256, infile); + if (ppmline[0] != 'P' || ppmline[1] != '6') { + fprintf(stderr, "ERROR: not a PPM file\n"); + return 1; + } + /* possible color types: P5 = grayscale (0), P6 = RGB (2), P8 = RGBA (6) */ + if (ppmline[1] == '6') { + color_type = 2; + channels = 3; + } else if (ppmline[1] == '8') { + color_type = 6; + channels = 4; + } else /* if (ppmline[1] == '5') */ { + color_type = 0; + channels = 1; + } + + do { + fgets(ppmline, 256, infile); + } while (ppmline[0] == '#'); + sscanf(ppmline, "%lu %lu", &width, &height); + + do { + fgets(ppmline, 256, infile); + } while (ppmline[0] == '#'); + sscanf(ppmline, "%d", &maxval); + if (maxval != 255) { + fprintf(stderr, "ERROR: maxval = %d\n", maxval); + return 2; + } + bit_depth = 8; + + *pWidth = width; + *pHeight = height; + + return 0; +} + + + + +/* returns 0 if succeeds, 1 if fails due to no bKGD chunk, 2 if libpng error; + * scales values to 8-bit if necessary */ + +int readpng_get_bgcolor(uch *red, uch *green, uch *blue) +{ + return 1; +} + + + + +/* display_exponent == LUT_exponent * CRT_exponent */ + +uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes) +{ + ulg rowbytes; + + + /* expand palette images to RGB, low-bit-depth grayscale images to 8 bits, + * transparency chunks to full alpha channel; strip 16-bit-per-sample + * images to 8 bits per sample; and convert grayscale to RGB[A] */ + + /* GRR WARNING: grayscale needs to be expanded and channels reset! */ + + *pRowbytes = rowbytes = channels*width; + *pChannels = channels; + + Trace((stderr, "readpng_get_image: rowbytes = %ld, height = %ld\n", rowbytes, height)); + + /* Guard against integer overflow */ + if (height > ((size_t)(-1))/rowbytes) { + fprintf(stderr, PROGNAME ": image_data buffer would be too large\n", + return NULL; + } + + if ((image_data = (uch *)malloc(rowbytes*height)) == NULL) { + return NULL; + } + + /* now we can go ahead and just read the whole image */ + + if (fread(image_data, 1L, rowbytes*height, saved_infile) < + rowbytes*height) { + free (image_data); + image_data = NULL; + return NULL; + } + + return image_data; +} + + +void readpng_cleanup(int free_image_data) +{ + if (free_image_data && image_data) { + free(image_data); + image_data = NULL; + } +} diff --git a/Engine/lib/lpng/contrib/gregbook/rpng-win.c b/Engine/lib/lpng/contrib/gregbook/rpng-win.c new file mode 100644 index 000000000..1a6f87615 --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/rpng-win.c @@ -0,0 +1,735 @@ +/*--------------------------------------------------------------------------- + + rpng - simple PNG display program rpng-win.c + + This program decodes and displays PNG images, with gamma correction and + optionally with a user-specified background color (in case the image has + transparency). It is very nearly the most basic PNG viewer possible. + This version is for 32-bit Windows; it may compile under 16-bit Windows + with a little tweaking (or maybe not). + + to do: + - handle quoted command-line args (especially filenames with spaces) + - have minimum window width: oh well + - use %.1023s to simplify truncation of title-bar string? + + --------------------------------------------------------------------------- + + Changelog: + - 1.00: initial public release + - 1.01: modified to allow abbreviated options; fixed long/ulong mis- + match; switched to png_jmpbuf() macro + - 1.02: added extra set of parentheses to png_jmpbuf() macro; fixed + command-line parsing bug + - 1.10: enabled "message window"/console (thanks to David Geldreich) + - 2.00: dual-licensed (added GNU GPL) + - 2.01: fixed improper display of usage screen on PNG error(s) + - 2.02: check for integer overflow (Glenn R-P) + + --------------------------------------------------------------------------- + + Copyright (c) 1998-2008, 2017 Greg Roelofs. All rights reserved. + + This software is provided "as is," without warranty of any kind, + express or implied. In no event shall the author or contributors + be held liable for any damages arising in any way from the use of + this software. + + The contents of this file are DUAL-LICENSED. You may modify and/or + redistribute this software according to the terms of one of the + following two licenses (at your option): + + + LICENSE 1 ("BSD-like with advertising clause"): + + 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. Redistributions of source code must retain the above copyright + notice, disclaimer, and this list of conditions. + 2. Redistributions in binary form must reproduce the above copyright + notice, disclaimer, and this list of conditions in the documenta- + tion and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + + This product includes software developed by Greg Roelofs + and contributors for the book, "PNG: The Definitive Guide," + published by O'Reilly and Associates. + + + LICENSE 2 (GNU GPL v2 or later): + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + ---------------------------------------------------------------------------*/ + +#define PROGNAME "rpng-win" +#define LONGNAME "Simple PNG Viewer for Windows" +#define VERSION "2.01 of 16 March 2008" + +#include +#include +#include +#include +#include +#ifdef __CYGWIN__ +/* getch replacement. Turns out, we don't really need this, + * but leave it here if we ever enable any of the uses of + * _getch in the main code + */ +#include +#include +#include +int repl_getch( void ) +{ + char ch; + int fd = fileno(stdin); + struct termio old_tty, new_tty; + + ioctl(fd, TCGETA, &old_tty); + new_tty = old_tty; + new_tty.c_lflag &= ~(ICANON | ECHO | ISIG); + ioctl(fd, TCSETA, &new_tty); + fread(&ch, 1, sizeof(ch), stdin); + ioctl(fd, TCSETA, &old_tty); + + return ch; +} +#define _getch repl_getch +#else +#include /* only for _getch() */ +#endif + +/* #define DEBUG : this enables the Trace() macros */ + +#include "readpng.h" /* typedefs, common macros, readpng prototypes */ + + +/* could just include png.h, but this macro is the only thing we need + * (name and typedefs changed to local versions); note that side effects + * only happen with alpha (which could easily be avoided with + * "ush acopy = (alpha);") */ + +#define alpha_composite(composite, fg, alpha, bg) { \ + ush temp = ((ush)(fg)*(ush)(alpha) + \ + (ush)(bg)*(ush)(255 - (ush)(alpha)) + (ush)128); \ + (composite) = (uch)((temp + (temp >> 8)) >> 8); \ +} + + +/* local prototypes */ +static int rpng_win_create_window(HINSTANCE hInst, int showmode); +static int rpng_win_display_image(void); +static void rpng_win_cleanup(void); +LRESULT CALLBACK rpng_win_wndproc(HWND, UINT, WPARAM, LPARAM); + + +static char titlebar[1024]; +static char *progname = PROGNAME; +static char *appname = LONGNAME; +static char *filename; +static FILE *infile; + +static char *bgstr; +static uch bg_red=0, bg_green=0, bg_blue=0; + +static double display_exponent; + +static ulg image_width, image_height, image_rowbytes; +static int image_channels; +static uch *image_data; + +/* Windows-specific variables */ +static ulg wimage_rowbytes; +static uch *dib; +static uch *wimage_data; +static BITMAPINFOHEADER *bmih; + +static HWND global_hwnd; + + + + +int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode) +{ + char *args[1024]; /* arbitrary limit, but should suffice */ + char *p, *q, **argv = args; + int argc = 0; + int rc, alen, flen; + int error = 0; + int have_bg = FALSE; + double LUT_exponent; /* just the lookup table */ + double CRT_exponent = 2.2; /* just the monitor */ + double default_display_exponent; /* whole display system */ + MSG msg; + + + filename = (char *)NULL; + +#ifndef __CYGWIN__ + /* First reenable console output, which normally goes to the bit bucket + * for windowed apps. Closing the console window will terminate the + * app. Thanks to David.Geldreich at realviz.com for supplying the magical + * incantation. */ + + AllocConsole(); + freopen("CONOUT$", "a", stderr); + freopen("CONOUT$", "a", stdout); +#endif + + + /* Next set the default value for our display-system exponent, i.e., + * the product of the CRT exponent and the exponent corresponding to + * the frame-buffer's lookup table (LUT), if any. This is not an + * exhaustive list of LUT values (e.g., OpenStep has a lot of weird + * ones), but it should cover 99% of the current possibilities. And + * yes, these ifdefs are completely wasted in a Windows program... */ + +#if defined(NeXT) + LUT_exponent = 1.0 / 2.2; + /* + if (some_next_function_that_returns_gamma(&next_gamma)) + LUT_exponent = 1.0 / next_gamma; + */ +#elif defined(sgi) + LUT_exponent = 1.0 / 1.7; + /* there doesn't seem to be any documented function to get the + * "gamma" value, so we do it the hard way */ + infile = fopen("/etc/config/system.glGammaVal", "r"); + if (infile) { + double sgi_gamma; + + fgets(tmpline, 80, infile); + fclose(infile); + sgi_gamma = atof(tmpline); + if (sgi_gamma > 0.0) + LUT_exponent = 1.0 / sgi_gamma; + } +#elif defined(Macintosh) + LUT_exponent = 1.8 / 2.61; + /* + if (some_mac_function_that_returns_gamma(&mac_gamma)) + LUT_exponent = mac_gamma / 2.61; + */ +#else + LUT_exponent = 1.0; /* assume no LUT: most PCs */ +#endif + + /* the defaults above give 1.0, 1.3, 1.5 and 2.2, respectively: */ + default_display_exponent = LUT_exponent * CRT_exponent; + + + /* If the user has set the SCREEN_GAMMA environment variable as suggested + * (somewhat imprecisely) in the libpng documentation, use that; otherwise + * use the default value we just calculated. Either way, the user may + * override this via a command-line option. */ + + if ((p = getenv("SCREEN_GAMMA")) != NULL) + display_exponent = atof(p); + else + display_exponent = default_display_exponent; + + + /* Windows really hates command lines, so we have to set up our own argv. + * Note that we do NOT bother with quoted arguments here, so don't use + * filenames with spaces in 'em! */ + + argv[argc++] = PROGNAME; + p = cmd; + for (;;) { + if (*p == ' ') + while (*++p == ' ') + ; + /* now p points at the first non-space after some spaces */ + if (*p == '\0') + break; /* nothing after the spaces: done */ + argv[argc++] = q = p; + while (*q && *q != ' ') + ++q; + /* now q points at a space or the end of the string */ + if (*q == '\0') + break; /* last argv already terminated; quit */ + *q = '\0'; /* change space to terminator */ + p = q + 1; + } + argv[argc] = NULL; /* terminate the argv array itself */ + + + /* Now parse the command line for options and the PNG filename. */ + + while (*++argv && !error) { + if (!strncmp(*argv, "-gamma", 2)) { + if (!*++argv) + ++error; + else { + display_exponent = atof(*argv); + if (display_exponent <= 0.0) + ++error; + } + } else if (!strncmp(*argv, "-bgcolor", 2)) { + if (!*++argv) + ++error; + else { + bgstr = *argv; + if (strlen(bgstr) != 7 || bgstr[0] != '#') + ++error; + else + have_bg = TRUE; + } + } else { + if (**argv != '-') { + filename = *argv; + if (argv[1]) /* shouldn't be any more args after filename */ + ++error; + } else + ++error; /* not expecting any other options */ + } + } + + if (!filename) + ++error; + + + /* print usage screen if any errors up to this point */ + + if (error) { +#ifndef __CYGWIN__ + int ch; +#endif + + fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname); + readpng_version_info(); + fprintf(stderr, "\n" + "Usage: %s [-gamma exp] [-bgcolor bg] file.png\n" + " exp \ttransfer-function exponent (``gamma'') of the display\n" + "\t\t system in floating-point format (e.g., ``%.1f''); equal\n" + "\t\t to the product of the lookup-table exponent (varies)\n" + "\t\t and the CRT exponent (usually 2.2); must be positive\n" + " bg \tdesired background color in 7-character hex RGB format\n" + "\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n" + "\t\t used with transparent images\n" + "\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n" +#ifndef __CYGWIN__ + "Press Q or Esc to quit this usage screen.\n" +#endif + "\n", PROGNAME, default_display_exponent); +#ifndef __CYGWIN__ + do + ch = _getch(); + while (ch != 'q' && ch != 'Q' && ch != 0x1B); +#endif + exit(1); + } + + + if (!(infile = fopen(filename, "rb"))) { + fprintf(stderr, PROGNAME ": can't open PNG file [%s]\n", filename); + ++error; + } else { + if ((rc = readpng_init(infile, &image_width, &image_height)) != 0) { + switch (rc) { + case 1: + fprintf(stderr, PROGNAME + ": [%s] is not a PNG file: incorrect signature\n", + filename); + break; + case 2: + fprintf(stderr, PROGNAME + ": [%s] has bad IHDR (libpng longjmp)\n", filename); + break; + case 4: + fprintf(stderr, PROGNAME ": insufficient memory\n"); + break; + default: + fprintf(stderr, PROGNAME + ": unknown readpng_init() error\n"); + break; + } + ++error; + } + if (error) + fclose(infile); + } + + + if (error) { +#ifndef __CYGWIN__ + int ch; +#endif + + fprintf(stderr, PROGNAME ": aborting.\n"); +#ifndef __CYGWIN__ + do + ch = _getch(); + while (ch != 'q' && ch != 'Q' && ch != 0x1B); +#endif + exit(2); + } else { + fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname); +#ifndef __CYGWIN__ + fprintf(stderr, + "\n [console window: closing this window will terminate %s]\n\n", + PROGNAME); +#endif + } + + + /* set the title-bar string, but make sure buffer doesn't overflow */ + + alen = strlen(appname); + flen = strlen(filename); + if (alen + flen + 3 > 1023) + sprintf(titlebar, "%s: ...%s", appname, filename+(alen+flen+6-1023)); + else + sprintf(titlebar, "%s: %s", appname, filename); + + + /* if the user didn't specify a background color on the command line, + * check for one in the PNG file--if not, the initialized values of 0 + * (black) will be used */ + + if (have_bg) { + unsigned r, g, b; /* this approach quiets compiler warnings */ + + sscanf(bgstr+1, "%2x%2x%2x", &r, &g, &b); + bg_red = (uch)r; + bg_green = (uch)g; + bg_blue = (uch)b; + } else if (readpng_get_bgcolor(&bg_red, &bg_green, &bg_blue) > 1) { + readpng_cleanup(TRUE); + fprintf(stderr, PROGNAME + ": libpng error while checking for background color\n"); + exit(2); + } + + + /* do the basic Windows initialization stuff, make the window and fill it + * with the background color */ + + if (rpng_win_create_window(hInst, showmode)) + exit(2); + + + /* decode the image, all at once */ + + Trace((stderr, "calling readpng_get_image()\n")) + image_data = readpng_get_image(display_exponent, &image_channels, + &image_rowbytes); + Trace((stderr, "done with readpng_get_image()\n")) + + + /* done with PNG file, so clean up to minimize memory usage (but do NOT + * nuke image_data!) */ + + readpng_cleanup(FALSE); + fclose(infile); + + if (!image_data) { + fprintf(stderr, PROGNAME ": unable to decode PNG image\n"); + exit(3); + } + + + /* display image (composite with background if requested) */ + + Trace((stderr, "calling rpng_win_display_image()\n")) + if (rpng_win_display_image()) { + free(image_data); + exit(4); + } + Trace((stderr, "done with rpng_win_display_image()\n")) + + + /* wait for the user to tell us when to quit */ + + printf( +#ifndef __CYGWIN__ + "Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n" +#else + "Done. Press mouse button 1 (within image window) to quit.\n" +#endif + ); + fflush(stdout); + + while (GetMessage(&msg, NULL, 0, 0)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + + /* OK, we're done: clean up all image and Windows resources and go away */ + + rpng_win_cleanup(); + + return msg.wParam; +} + + + + + +static int rpng_win_create_window(HINSTANCE hInst, int showmode) +{ + uch *dest; + int extra_width, extra_height; + ulg i, j; + WNDCLASSEX wndclass; + + +/*--------------------------------------------------------------------------- + Allocate memory for the display-specific version of the image (round up + to multiple of 4 for Windows DIB). + ---------------------------------------------------------------------------*/ + + wimage_rowbytes = ((3*image_width + 3L) >> 2) << 2; + + /* Guard against integer overflow */ + if (image_height > ((size_t)(-1))/wimage_rowbytes) { + fprintf(stderr, PROGNAME ": image_data buffer would be too large\n"); + return 4; /* fail */ + } + + if (!(dib = (uch *)malloc(sizeof(BITMAPINFOHEADER) + + wimage_rowbytes*image_height))) + { + return 4; /* fail */ + } + +/*--------------------------------------------------------------------------- + Initialize the DIB. Negative height means to use top-down BMP ordering + (must be uncompressed, but that's what we want). Bit count of 1, 4 or 8 + implies a colormap of RGBX quads, but 24-bit BMPs just use B,G,R values + directly => wimage_data begins immediately after BMP header. + ---------------------------------------------------------------------------*/ + + memset(dib, 0, sizeof(BITMAPINFOHEADER)); + bmih = (BITMAPINFOHEADER *)dib; + bmih->biSize = sizeof(BITMAPINFOHEADER); + bmih->biWidth = image_width; + bmih->biHeight = -((long)image_height); + bmih->biPlanes = 1; + bmih->biBitCount = 24; + bmih->biCompression = 0; + wimage_data = dib + sizeof(BITMAPINFOHEADER); + +/*--------------------------------------------------------------------------- + Fill in background color (black by default); data are in BGR order. + ---------------------------------------------------------------------------*/ + + for (j = 0; j < image_height; ++j) { + dest = wimage_data + j*wimage_rowbytes; + for (i = image_width; i > 0; --i) { + *dest++ = bg_blue; + *dest++ = bg_green; + *dest++ = bg_red; + } + } + +/*--------------------------------------------------------------------------- + Set the window parameters. + ---------------------------------------------------------------------------*/ + + memset(&wndclass, 0, sizeof(wndclass)); + + wndclass.cbSize = sizeof(wndclass); + wndclass.style = CS_HREDRAW | CS_VREDRAW; + wndclass.lpfnWndProc = rpng_win_wndproc; + wndclass.hInstance = hInst; + wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION); + wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); + wndclass.hbrBackground = (HBRUSH)GetStockObject(DKGRAY_BRUSH); + wndclass.lpszMenuName = NULL; + wndclass.lpszClassName = progname; + wndclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION); + + RegisterClassEx(&wndclass); + +/*--------------------------------------------------------------------------- + Finally, create the window. + ---------------------------------------------------------------------------*/ + + extra_width = 2*(GetSystemMetrics(SM_CXBORDER) + + GetSystemMetrics(SM_CXDLGFRAME)); + extra_height = 2*(GetSystemMetrics(SM_CYBORDER) + + GetSystemMetrics(SM_CYDLGFRAME)) + + GetSystemMetrics(SM_CYCAPTION); + + global_hwnd = CreateWindow(progname, titlebar, WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, CW_USEDEFAULT, image_width+extra_width, + image_height+extra_height, NULL, NULL, hInst, NULL); + + ShowWindow(global_hwnd, showmode); + UpdateWindow(global_hwnd); + + return 0; + +} /* end function rpng_win_create_window() */ + + + + + +static int rpng_win_display_image() +{ + uch *src, *dest; + uch r, g, b, a; + ulg i, row, lastrow; + RECT rect; + + + Trace((stderr, "beginning display loop (image_channels == %d)\n", + image_channels)) + Trace((stderr, "(width = %ld, rowbytes = %ld, wimage_rowbytes = %d)\n", + image_width, image_rowbytes, wimage_rowbytes)) + + +/*--------------------------------------------------------------------------- + Blast image data to buffer. This whole routine takes place before the + message loop begins, so there's no real point in any pseudo-progressive + display... + ---------------------------------------------------------------------------*/ + + for (lastrow = row = 0; row < image_height; ++row) { + src = image_data + row*image_rowbytes; + dest = wimage_data + row*wimage_rowbytes; + if (image_channels == 3) { + for (i = image_width; i > 0; --i) { + r = *src++; + g = *src++; + b = *src++; + *dest++ = b; + *dest++ = g; /* note reverse order */ + *dest++ = r; + } + } else /* if (image_channels == 4) */ { + for (i = image_width; i > 0; --i) { + r = *src++; + g = *src++; + b = *src++; + a = *src++; + if (a == 255) { + *dest++ = b; + *dest++ = g; + *dest++ = r; + } else if (a == 0) { + *dest++ = bg_blue; + *dest++ = bg_green; + *dest++ = bg_red; + } else { + /* this macro (copied from png.h) composites the + * foreground and background values and puts the + * result into the first argument; there are no + * side effects with the first argument */ + alpha_composite(*dest++, b, a, bg_blue); + alpha_composite(*dest++, g, a, bg_green); + alpha_composite(*dest++, r, a, bg_red); + } + } + } + /* display after every 16 lines */ + if (((row+1) & 0xf) == 0) { + rect.left = 0L; + rect.top = (LONG)lastrow; + rect.right = (LONG)image_width; /* possibly off by one? */ + rect.bottom = (LONG)lastrow + 16L; /* possibly off by one? */ + InvalidateRect(global_hwnd, &rect, FALSE); + UpdateWindow(global_hwnd); /* similar to XFlush() */ + lastrow = row + 1; + } + } + + Trace((stderr, "calling final image-flush routine\n")) + if (lastrow < image_height) { + rect.left = 0L; + rect.top = (LONG)lastrow; + rect.right = (LONG)image_width; /* possibly off by one? */ + rect.bottom = (LONG)image_height; /* possibly off by one? */ + InvalidateRect(global_hwnd, &rect, FALSE); + UpdateWindow(global_hwnd); /* similar to XFlush() */ + } + +/* + last param determines whether or not background is wiped before paint + InvalidateRect(global_hwnd, NULL, TRUE); + UpdateWindow(global_hwnd); + */ + + return 0; +} + + + + + +static void rpng_win_cleanup() +{ + if (image_data) { + free(image_data); + image_data = NULL; + } + + if (dib) { + free(dib); + dib = NULL; + } +} + + + + + +LRESULT CALLBACK rpng_win_wndproc(HWND hwnd, UINT iMsg, WPARAM wP, LPARAM lP) +{ + HDC hdc; + PAINTSTRUCT ps; + int rc; + + switch (iMsg) { + case WM_CREATE: + /* one-time processing here, if any */ + return 0; + + case WM_PAINT: + hdc = BeginPaint(hwnd, &ps); + /* dest */ + rc = StretchDIBits(hdc, 0, 0, image_width, image_height, + /* source */ + 0, 0, image_width, image_height, + wimage_data, (BITMAPINFO *)bmih, + /* iUsage: no clue */ + 0, SRCCOPY); + EndPaint(hwnd, &ps); + return 0; + + /* wait for the user to tell us when to quit */ + case WM_CHAR: + switch (wP) { /* only need one, so ignore repeat count */ + case 'q': + case 'Q': + case 0x1B: /* Esc key */ + PostQuitMessage(0); + } + return 0; + + case WM_LBUTTONDOWN: /* another way of quitting */ + case WM_DESTROY: + PostQuitMessage(0); + return 0; + } + + return DefWindowProc(hwnd, iMsg, wP, lP); +} diff --git a/Engine/lib/lpng/contrib/gregbook/rpng-x.c b/Engine/lib/lpng/contrib/gregbook/rpng-x.c new file mode 100644 index 000000000..92effaa6d --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/rpng-x.c @@ -0,0 +1,911 @@ +/*--------------------------------------------------------------------------- + + rpng - simple PNG display program rpng-x.c + + This program decodes and displays PNG images, with gamma correction and + optionally with a user-specified background color (in case the image has + transparency). It is very nearly the most basic PNG viewer possible. + This version is for the X Window System (tested by author under Unix and + by Martin Zinser under OpenVMS; may work under OS/2 with some tweaking). + + to do: + - 8-bit (colormapped) X support + - use %.1023s to simplify truncation of title-bar string? + + --------------------------------------------------------------------------- + + Changelog: + - 1.01: initial public release + - 1.02: modified to allow abbreviated options; fixed long/ulong mis- + match; switched to png_jmpbuf() macro + - 1.10: added support for non-default visuals; fixed X pixel-conversion + - 1.11: added extra set of parentheses to png_jmpbuf() macro; fixed + command-line parsing bug + - 1.12: fixed some small X memory leaks (thanks to François Petitjean) + - 1.13: fixed XFreeGC() crash bug (thanks to Patrick Welche) + - 1.14: added support for X resources (thanks to Gerhard Niklasch) + - 2.00: dual-licensed (added GNU GPL) + - 2.01: fixed improper display of usage screen on PNG error(s) + - 2.02: Added "void(argc);" statement to quiet pedantic compiler warnings + about unused variable (GR-P) + - 2.03: check for integer overflow (Glenn R-P) + + --------------------------------------------------------------------------- + + Copyright (c) 1998-2008, 2017 Greg Roelofs. All rights reserved. + + This software is provided "as is," without warranty of any kind, + express or implied. In no event shall the author or contributors + be held liable for any damages arising in any way from the use of + this software. + + The contents of this file are DUAL-LICENSED. You may modify and/or + redistribute this software according to the terms of one of the + following two licenses (at your option): + + + LICENSE 1 ("BSD-like with advertising clause"): + + 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. Redistributions of source code must retain the above copyright + notice, disclaimer, and this list of conditions. + 2. Redistributions in binary form must reproduce the above copyright + notice, disclaimer, and this list of conditions in the documenta- + tion and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + + This product includes software developed by Greg Roelofs + and contributors for the book, "PNG: The Definitive Guide," + published by O'Reilly and Associates. + + + LICENSE 2 (GNU GPL v2 or later): + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + ---------------------------------------------------------------------------*/ + +#define PROGNAME "rpng-x" +#define LONGNAME "Simple PNG Viewer for X" +#define VERSION "2.02 of 15 June 2014" +#define RESNAME "rpng" /* our X resource application name */ +#define RESCLASS "Rpng" /* our X resource class name */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* #define DEBUG : this enables the Trace() macros */ + +#include "readpng.h" /* typedefs, common macros, readpng prototypes */ + + +/* could just include png.h, but this macro is the only thing we need + * (name and typedefs changed to local versions); note that side effects + * only happen with alpha (which could easily be avoided with + * "ush acopy = (alpha);") */ + +#define alpha_composite(composite, fg, alpha, bg) { \ + ush temp = ((ush)(fg)*(ush)(alpha) + \ + (ush)(bg)*(ush)(255 - (ush)(alpha)) + (ush)128); \ + (composite) = (uch)((temp + (temp >> 8)) >> 8); \ +} + + +/* local prototypes */ +static int rpng_x_create_window(void); +static int rpng_x_display_image(void); +static void rpng_x_cleanup(void); +static int rpng_x_msb(ulg u32val); + + +static char titlebar[1024], *window_name = titlebar; +static char *appname = LONGNAME; +static char *icon_name = PROGNAME; +static char *res_name = RESNAME; +static char *res_class = RESCLASS; +static char *filename; +static FILE *infile; + +static char *bgstr; +static uch bg_red=0, bg_green=0, bg_blue=0; + +static double display_exponent; + +static ulg image_width, image_height, image_rowbytes; +static int image_channels; +static uch *image_data; + +/* X-specific variables */ +static char *displayname; +static XImage *ximage; +static Display *display; +static int depth; +static Visual *visual; +static XVisualInfo *visual_list; +static int RShift, GShift, BShift; +static ulg RMask, GMask, BMask; +static Window window; +static GC gc; +static Colormap colormap; + +static int have_nondefault_visual = FALSE; +static int have_colormap = FALSE; +static int have_window = FALSE; +static int have_gc = FALSE; +/* +ulg numcolors=0, pixels[256]; +ush reds[256], greens[256], blues[256]; + */ + + + + +int main(int argc, char **argv) +{ +#ifdef sgi + char tmpline[80]; +#endif + char *p; + int rc, alen, flen; + int error = 0; + int have_bg = FALSE; + double LUT_exponent; /* just the lookup table */ + double CRT_exponent = 2.2; /* just the monitor */ + double default_display_exponent; /* whole display system */ + XEvent e; + KeySym k; + + + displayname = (char *)NULL; + filename = (char *)NULL; + + + /* First set the default value for our display-system exponent, i.e., + * the product of the CRT exponent and the exponent corresponding to + * the frame-buffer's lookup table (LUT), if any. This is not an + * exhaustive list of LUT values (e.g., OpenStep has a lot of weird + * ones), but it should cover 99% of the current possibilities. */ + +#if defined(NeXT) + LUT_exponent = 1.0 / 2.2; + /* + if (some_next_function_that_returns_gamma(&next_gamma)) + LUT_exponent = 1.0 / next_gamma; + */ +#elif defined(sgi) + LUT_exponent = 1.0 / 1.7; + /* there doesn't seem to be any documented function to get the + * "gamma" value, so we do it the hard way */ + infile = fopen("/etc/config/system.glGammaVal", "r"); + if (infile) { + double sgi_gamma; + + fgets(tmpline, 80, infile); + fclose(infile); + sgi_gamma = atof(tmpline); + if (sgi_gamma > 0.0) + LUT_exponent = 1.0 / sgi_gamma; + } +#elif defined(Macintosh) + LUT_exponent = 1.8 / 2.61; + /* + if (some_mac_function_that_returns_gamma(&mac_gamma)) + LUT_exponent = mac_gamma / 2.61; + */ +#else + LUT_exponent = 1.0; /* assume no LUT: most PCs */ +#endif + + /* the defaults above give 1.0, 1.3, 1.5 and 2.2, respectively: */ + default_display_exponent = LUT_exponent * CRT_exponent; + + + /* If the user has set the SCREEN_GAMMA environment variable as suggested + * (somewhat imprecisely) in the libpng documentation, use that; otherwise + * use the default value we just calculated. Either way, the user may + * override this via a command-line option. */ + + if ((p = getenv("SCREEN_GAMMA")) != NULL) + display_exponent = atof(p); + else + display_exponent = default_display_exponent; + + + /* Now parse the command line for options and the PNG filename. */ + + while (*++argv && !error) { + if (!strncmp(*argv, "-display", 2)) { + if (!*++argv) + ++error; + else + displayname = *argv; + } else if (!strncmp(*argv, "-gamma", 2)) { + if (!*++argv) + ++error; + else { + display_exponent = atof(*argv); + if (display_exponent <= 0.0) + ++error; + } + } else if (!strncmp(*argv, "-bgcolor", 2)) { + if (!*++argv) + ++error; + else { + bgstr = *argv; + if (strlen(bgstr) != 7 || bgstr[0] != '#') + ++error; + else + have_bg = TRUE; + } + } else { + if (**argv != '-') { + filename = *argv; + if (argv[1]) /* shouldn't be any more args after filename */ + ++error; + } else + ++error; /* not expecting any other options */ + } + } + + if (!filename) + ++error; + + + /* print usage screen if any errors up to this point */ + + if (error) { + fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname); + readpng_version_info(); + fprintf(stderr, "\n" + "Usage: %s [-display xdpy] [-gamma exp] [-bgcolor bg] file.png\n" + " xdpy\tname of the target X display (e.g., ``hostname:0'')\n" + " exp \ttransfer-function exponent (``gamma'') of the display\n" + "\t\t system in floating-point format (e.g., ``%.1f''); equal\n", + PROGNAME, default_display_exponent); + + fprintf(stderr, "\n" + "\t\t to the product of the lookup-table exponent (varies)\n" + "\t\t and the CRT exponent (usually 2.2); must be positive\n" + " bg \tdesired background color in 7-character hex RGB format\n" + "\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n" + "\t\t used with transparent images\n" + "\nPress Q, Esc or mouse button 1 (within image window, after image\n" + "is displayed) to quit.\n"); + exit(1); + } + + + if (!(infile = fopen(filename, "rb"))) { + fprintf(stderr, PROGNAME ": can't open PNG file [%s]\n", filename); + ++error; + } else { + if ((rc = readpng_init(infile, &image_width, &image_height)) != 0) { + switch (rc) { + case 1: + fprintf(stderr, PROGNAME + ": [%s] is not a PNG file: incorrect signature\n", + filename); + break; + case 2: + fprintf(stderr, PROGNAME + ": [%s] has bad IHDR (libpng longjmp)\n", filename); + break; + case 4: + fprintf(stderr, PROGNAME ": insufficient memory\n"); + break; + default: + fprintf(stderr, PROGNAME + ": unknown readpng_init() error\n"); + break; + } + ++error; + } else { + display = XOpenDisplay(displayname); + if (!display) { + readpng_cleanup(TRUE); + fprintf(stderr, PROGNAME ": can't open X display [%s]\n", + displayname? displayname : "default"); + ++error; + } + } + if (error) + fclose(infile); + } + + + if (error) { + fprintf(stderr, PROGNAME ": aborting.\n"); + exit(2); + } + + + /* set the title-bar string, but make sure buffer doesn't overflow */ + + alen = strlen(appname); + flen = strlen(filename); + if (alen + flen + 3 > 1023) + sprintf(titlebar, "%s: ...%s", appname, filename+(alen+flen+6-1023)); + else + sprintf(titlebar, "%s: %s", appname, filename); + + + /* if the user didn't specify a background color on the command line, + * check for one in the PNG file--if not, the initialized values of 0 + * (black) will be used */ + + if (have_bg) { + unsigned r, g, b; /* this approach quiets compiler warnings */ + + sscanf(bgstr+1, "%2x%2x%2x", &r, &g, &b); + bg_red = (uch)r; + bg_green = (uch)g; + bg_blue = (uch)b; + } else if (readpng_get_bgcolor(&bg_red, &bg_green, &bg_blue) > 1) { + readpng_cleanup(TRUE); + fprintf(stderr, PROGNAME + ": libpng error while checking for background color\n"); + exit(2); + } + + + /* do the basic X initialization stuff, make the window and fill it + * with the background color */ + + if (rpng_x_create_window()) + exit(2); + + + /* decode the image, all at once */ + + Trace((stderr, "calling readpng_get_image()\n")) + image_data = readpng_get_image(display_exponent, &image_channels, + &image_rowbytes); + Trace((stderr, "done with readpng_get_image()\n")) + + + /* done with PNG file, so clean up to minimize memory usage (but do NOT + * nuke image_data!) */ + + readpng_cleanup(FALSE); + fclose(infile); + + if (!image_data) { + fprintf(stderr, PROGNAME ": unable to decode PNG image\n"); + exit(3); + } + + + /* display image (composite with background if requested) */ + + Trace((stderr, "calling rpng_x_display_image()\n")) + if (rpng_x_display_image()) { + free(image_data); + exit(4); + } + Trace((stderr, "done with rpng_x_display_image()\n")) + + + /* wait for the user to tell us when to quit */ + + printf( + "Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n"); + fflush(stdout); + + do + XNextEvent(display, &e); + while (!(e.type == ButtonPress && e.xbutton.button == Button1) && + !(e.type == KeyPress && /* v--- or 1 for shifted keys */ + ((k = XLookupKeysym(&e.xkey, 0)) == XK_q || k == XK_Escape) )); + + + /* OK, we're done: clean up all image and X resources and go away */ + + rpng_x_cleanup(); + + (void)argc; /* Unused */ + + return 0; +} + + + + + +static int rpng_x_create_window(void) +{ + uch *xdata; + int need_colormap = FALSE; + int screen, pad; + ulg bg_pixel = 0L; + ulg attrmask; + Window root; + XEvent e; + XGCValues gcvalues; + XSetWindowAttributes attr; + XTextProperty windowName, *pWindowName = &windowName; + XTextProperty iconName, *pIconName = &iconName; + XVisualInfo visual_info; + XSizeHints *size_hints; + XWMHints *wm_hints; + XClassHint *class_hints; + + + screen = DefaultScreen(display); + depth = DisplayPlanes(display, screen); + root = RootWindow(display, screen); + +#ifdef DEBUG + XSynchronize(display, True); +#endif + +#if 0 +/* GRR: add 8-bit support */ + if (/* depth != 8 && */ depth != 16 && depth != 24 && depth != 32) { + fprintf(stderr, + "screen depth %d not supported (only 16-, 24- or 32-bit TrueColor)\n", + depth); + return 2; + } + + XMatchVisualInfo(display, screen, depth, + (depth == 8)? PseudoColor : TrueColor, &visual_info); + visual = visual_info.visual; +#else + if (depth != 16 && depth != 24 && depth != 32) { + int visuals_matched = 0; + + Trace((stderr, "default depth is %d: checking other visuals\n", + depth)) + + /* 24-bit first */ + visual_info.screen = screen; + visual_info.depth = 24; + visual_list = XGetVisualInfo(display, + VisualScreenMask | VisualDepthMask, &visual_info, &visuals_matched); + if (visuals_matched == 0) { +/* GRR: add 15-, 16- and 32-bit TrueColor visuals (also DirectColor?) */ + fprintf(stderr, "default screen depth %d not supported, and no" + " 24-bit visuals found\n", depth); + return 2; + } + Trace((stderr, "XGetVisualInfo() returned %d 24-bit visuals\n", + visuals_matched)) + visual = visual_list[0].visual; + depth = visual_list[0].depth; +/* + colormap_size = visual_list[0].colormap_size; + visual_class = visual->class; + visualID = XVisualIDFromVisual(visual); + */ + have_nondefault_visual = TRUE; + need_colormap = TRUE; + } else { + XMatchVisualInfo(display, screen, depth, TrueColor, &visual_info); + visual = visual_info.visual; + } +#endif + + RMask = visual->red_mask; + GMask = visual->green_mask; + BMask = visual->blue_mask; + +/* GRR: add/check 8-bit support */ + if (depth == 8 || need_colormap) { + colormap = XCreateColormap(display, root, visual, AllocNone); + if (!colormap) { + fprintf(stderr, "XCreateColormap() failed\n"); + return 2; + } + have_colormap = TRUE; + } + if (depth == 15 || depth == 16) { + RShift = 15 - rpng_x_msb(RMask); /* these are right-shifts */ + GShift = 15 - rpng_x_msb(GMask); + BShift = 15 - rpng_x_msb(BMask); + } else if (depth > 16) { +#define NO_24BIT_MASKS +#ifdef NO_24BIT_MASKS + RShift = rpng_x_msb(RMask) - 7; /* these are left-shifts */ + GShift = rpng_x_msb(GMask) - 7; + BShift = rpng_x_msb(BMask) - 7; +#else + RShift = 7 - rpng_x_msb(RMask); /* these are right-shifts, too */ + GShift = 7 - rpng_x_msb(GMask); + BShift = 7 - rpng_x_msb(BMask); +#endif + } + if (depth >= 15 && (RShift < 0 || GShift < 0 || BShift < 0)) { + fprintf(stderr, "rpng internal logic error: negative X shift(s)!\n"); + return 2; + } + +/*--------------------------------------------------------------------------- + Finally, create the window. + ---------------------------------------------------------------------------*/ + + attr.backing_store = Always; + attr.event_mask = ExposureMask | KeyPressMask | ButtonPressMask; + attrmask = CWBackingStore | CWEventMask; + if (have_nondefault_visual) { + attr.colormap = colormap; + attr.background_pixel = 0; + attr.border_pixel = 1; + attrmask |= CWColormap | CWBackPixel | CWBorderPixel; + } + + window = XCreateWindow(display, root, 0, 0, image_width, image_height, 0, + depth, InputOutput, visual, attrmask, &attr); + + if (window == None) { + fprintf(stderr, "XCreateWindow() failed\n"); + return 2; + } else + have_window = TRUE; + + if (depth == 8) + XSetWindowColormap(display, window, colormap); + + if (!XStringListToTextProperty(&window_name, 1, pWindowName)) + pWindowName = NULL; + if (!XStringListToTextProperty(&icon_name, 1, pIconName)) + pIconName = NULL; + + /* OK if any hints allocation fails; XSetWMProperties() allows NULLs */ + + if ((size_hints = XAllocSizeHints()) != NULL) { + /* window will not be resizable */ + size_hints->flags = PMinSize | PMaxSize; + size_hints->min_width = size_hints->max_width = (int)image_width; + size_hints->min_height = size_hints->max_height = (int)image_height; + } + + if ((wm_hints = XAllocWMHints()) != NULL) { + wm_hints->initial_state = NormalState; + wm_hints->input = True; + /* wm_hints->icon_pixmap = icon_pixmap; */ + wm_hints->flags = StateHint | InputHint /* | IconPixmapHint */ ; + } + + if ((class_hints = XAllocClassHint()) != NULL) { + class_hints->res_name = res_name; + class_hints->res_class = res_class; + } + + XSetWMProperties(display, window, pWindowName, pIconName, NULL, 0, + size_hints, wm_hints, class_hints); + + /* various properties and hints no longer needed; free memory */ + if (pWindowName) + XFree(pWindowName->value); + if (pIconName) + XFree(pIconName->value); + if (size_hints) + XFree(size_hints); + if (wm_hints) + XFree(wm_hints); + if (class_hints) + XFree(class_hints); + + XMapWindow(display, window); + + gc = XCreateGC(display, window, 0, &gcvalues); + have_gc = TRUE; + +/*--------------------------------------------------------------------------- + Fill window with the specified background color. + ---------------------------------------------------------------------------*/ + + if (depth == 24 || depth == 32) { + bg_pixel = ((ulg)bg_red << RShift) | + ((ulg)bg_green << GShift) | + ((ulg)bg_blue << BShift); + } else if (depth == 16) { + bg_pixel = ((((ulg)bg_red << 8) >> RShift) & RMask) | + ((((ulg)bg_green << 8) >> GShift) & GMask) | + ((((ulg)bg_blue << 8) >> BShift) & BMask); + } else /* depth == 8 */ { + + /* GRR: add 8-bit support */ + + } + + XSetForeground(display, gc, bg_pixel); + XFillRectangle(display, window, gc, 0, 0, image_width, image_height); + +/*--------------------------------------------------------------------------- + Wait for first Expose event to do any drawing, then flush. + ---------------------------------------------------------------------------*/ + + do + XNextEvent(display, &e); + while (e.type != Expose || e.xexpose.count); + + XFlush(display); + +/*--------------------------------------------------------------------------- + Allocate memory for the X- and display-specific version of the image. + ---------------------------------------------------------------------------*/ + + if (depth == 24 || depth == 32) { + xdata = (uch *)malloc(4*image_width*image_height); + pad = 32; + } else if (depth == 16) { + xdata = (uch *)malloc(2*image_width*image_height); + pad = 16; + } else /* depth == 8 */ { + xdata = (uch *)malloc(image_width*image_height); + pad = 8; + } + + if (!xdata) { + fprintf(stderr, PROGNAME ": unable to allocate image memory\n"); + return 4; + } + + ximage = XCreateImage(display, visual, depth, ZPixmap, 0, + (char *)xdata, image_width, image_height, pad, 0); + + if (!ximage) { + fprintf(stderr, PROGNAME ": XCreateImage() failed\n"); + free(xdata); + return 3; + } + + /* to avoid testing the byte order every pixel (or doubling the size of + * the drawing routine with a giant if-test), we arbitrarily set the byte + * order to MSBFirst and let Xlib worry about inverting things on little- + * endian machines (like Linux/x86, old VAXen, etc.)--this is not the most + * efficient approach (the giant if-test would be better), but in the + * interest of clarity, we take the easy way out... */ + + ximage->byte_order = MSBFirst; + + return 0; + +} /* end function rpng_x_create_window() */ + + + + + +static int rpng_x_display_image(void) +{ + uch *src; + char *dest; + uch r, g, b, a; + ulg i, row, lastrow = 0; + ulg pixel; + int ximage_rowbytes = ximage->bytes_per_line; +/* int bpp = ximage->bits_per_pixel; */ + + + Trace((stderr, "beginning display loop (image_channels == %d)\n", + image_channels)) + Trace((stderr, " (width = %ld, rowbytes = %ld, ximage_rowbytes = %d)\n", + image_width, image_rowbytes, ximage_rowbytes)) + Trace((stderr, " (bpp = %d)\n", ximage->bits_per_pixel)) + Trace((stderr, " (byte_order = %s)\n", ximage->byte_order == MSBFirst? + "MSBFirst" : (ximage->byte_order == LSBFirst? "LSBFirst" : "unknown"))) + + if (depth == 24 || depth == 32) { + ulg red, green, blue; + + for (lastrow = row = 0; row < image_height; ++row) { + src = image_data + row*image_rowbytes; + dest = ximage->data + row*ximage_rowbytes; + if (image_channels == 3) { + for (i = image_width; i > 0; --i) { + red = *src++; + green = *src++; + blue = *src++; +#ifdef NO_24BIT_MASKS + pixel = (red << RShift) | + (green << GShift) | + (blue << BShift); + /* recall that we set ximage->byte_order = MSBFirst above */ + /* GRR BUG: this assumes bpp == 32, but may be 24: */ + *dest++ = (char)((pixel >> 24) & 0xff); + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); +#else + red = (RShift < 0)? red << (-RShift) : red >> RShift; + green = (GShift < 0)? green << (-GShift) : green >> GShift; + blue = (BShift < 0)? blue << (-BShift) : blue >> BShift; + pixel = (red & RMask) | (green & GMask) | (blue & BMask); + /* recall that we set ximage->byte_order = MSBFirst above */ + *dest++ = (char)((pixel >> 24) & 0xff); + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); +#endif + } + } else /* if (image_channels == 4) */ { + for (i = image_width; i > 0; --i) { + r = *src++; + g = *src++; + b = *src++; + a = *src++; + if (a == 255) { + red = r; + green = g; + blue = b; + } else if (a == 0) { + red = bg_red; + green = bg_green; + blue = bg_blue; + } else { + /* this macro (from png.h) composites the foreground + * and background values and puts the result into the + * first argument */ + alpha_composite(red, r, a, bg_red); + alpha_composite(green, g, a, bg_green); + alpha_composite(blue, b, a, bg_blue); + } + pixel = (red << RShift) | + (green << GShift) | + (blue << BShift); + /* recall that we set ximage->byte_order = MSBFirst above */ + *dest++ = (char)((pixel >> 24) & 0xff); + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } + } + /* display after every 16 lines */ + if (((row+1) & 0xf) == 0) { + XPutImage(display, window, gc, ximage, 0, (int)lastrow, 0, + (int)lastrow, image_width, 16); + XFlush(display); + lastrow = row + 1; + } + } + + } else if (depth == 16) { + ush red, green, blue; + + for (lastrow = row = 0; row < image_height; ++row) { + src = image_data + row*image_rowbytes; + dest = ximage->data + row*ximage_rowbytes; + if (image_channels == 3) { + for (i = image_width; i > 0; --i) { + red = ((ush)(*src) << 8); + ++src; + green = ((ush)(*src) << 8); + ++src; + blue = ((ush)(*src) << 8); + ++src; + pixel = ((red >> RShift) & RMask) | + ((green >> GShift) & GMask) | + ((blue >> BShift) & BMask); + /* recall that we set ximage->byte_order = MSBFirst above */ + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } + } else /* if (image_channels == 4) */ { + for (i = image_width; i > 0; --i) { + r = *src++; + g = *src++; + b = *src++; + a = *src++; + if (a == 255) { + red = ((ush)r << 8); + green = ((ush)g << 8); + blue = ((ush)b << 8); + } else if (a == 0) { + red = ((ush)bg_red << 8); + green = ((ush)bg_green << 8); + blue = ((ush)bg_blue << 8); + } else { + /* this macro (from png.h) composites the foreground + * and background values and puts the result back into + * the first argument (== fg byte here: safe) */ + alpha_composite(r, r, a, bg_red); + alpha_composite(g, g, a, bg_green); + alpha_composite(b, b, a, bg_blue); + red = ((ush)r << 8); + green = ((ush)g << 8); + blue = ((ush)b << 8); + } + pixel = ((red >> RShift) & RMask) | + ((green >> GShift) & GMask) | + ((blue >> BShift) & BMask); + /* recall that we set ximage->byte_order = MSBFirst above */ + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } + } + /* display after every 16 lines */ + if (((row+1) & 0xf) == 0) { + XPutImage(display, window, gc, ximage, 0, (int)lastrow, 0, + (int)lastrow, image_width, 16); + XFlush(display); + lastrow = row + 1; + } + } + + } else /* depth == 8 */ { + + /* GRR: add 8-bit support */ + + } + + Trace((stderr, "calling final XPutImage()\n")) + if (lastrow < image_height) { + XPutImage(display, window, gc, ximage, 0, (int)lastrow, 0, + (int)lastrow, image_width, image_height-lastrow); + XFlush(display); + } + + return 0; +} + + + + +static void rpng_x_cleanup(void) +{ + if (image_data) { + free(image_data); + image_data = NULL; + } + + if (ximage) { + if (ximage->data) { + free(ximage->data); /* we allocated it, so we free it */ + ximage->data = (char *)NULL; /* instead of XDestroyImage() */ + } + XDestroyImage(ximage); + ximage = NULL; + } + + if (have_gc) + XFreeGC(display, gc); + + if (have_window) + XDestroyWindow(display, window); + + if (have_colormap) + XFreeColormap(display, colormap); + + if (have_nondefault_visual) + XFree(visual_list); +} + + + + + +static int rpng_x_msb(ulg u32val) +{ + int i; + + for (i = 31; i >= 0; --i) { + if (u32val & 0x80000000L) + break; + u32val <<= 1; + } + return i; +} diff --git a/Engine/lib/lpng/contrib/gregbook/rpng2-win.c b/Engine/lib/lpng/contrib/gregbook/rpng2-win.c new file mode 100644 index 000000000..ed6b526ec --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/rpng2-win.c @@ -0,0 +1,1261 @@ +/*--------------------------------------------------------------------------- + + rpng2 - progressive-model PNG display program rpng2-win.c + + This program decodes and displays PNG files progressively, as if it were + a web browser (though the front end is only set up to read from files). + It supports gamma correction, user-specified background colors, and user- + specified background patterns (for transparent images). This version is + for 32-bit Windows; it may compile under 16-bit Windows with a little + tweaking (or maybe not). Thanks to Adam Costello and Pieter S. van der + Meulen for the "diamond" and "radial waves" patterns, respectively. + + to do (someday, maybe): + - handle quoted command-line args (especially filenames with spaces) + - finish resizable checkerboard-gradient (sizes 4-128?) + - use %.1023s to simplify truncation of title-bar string? + - have minimum window width: oh well + + --------------------------------------------------------------------------- + + Changelog: + - 1.01: initial public release + - 1.02: fixed cut-and-paste error in usage screen (oops...) + - 1.03: modified to allow abbreviated options + - 1.04: removed bogus extra argument from usage fprintf() [Glenn R-P?]; + fixed command-line parsing bug + - 1.10: enabled "message window"/console (thanks to David Geldreich) + - 1.20: added runtime MMX-enabling/disabling and new -mmx* options + - 1.21: made minor tweak to usage screen to fit within 25-line console + - 1.22: added AMD64/EM64T support (__x86_64__) + - 2.00: dual-licensed (added GNU GPL) + - 2.01: fixed 64-bit typo in readpng2.c + - 2.02: fixed improper display of usage screen on PNG error(s); fixed + unexpected-EOF and file-read-error cases + - 2.03: removed runtime MMX-enabling/disabling and obsolete -mmx* options + - 2.04: check for integer overflow (Glenn R-P) + + --------------------------------------------------------------------------- + + Copyright (c) 1998-2008, 2017 Greg Roelofs. All rights reserved. + + This software is provided "as is," without warranty of any kind, + express or implied. In no event shall the author or contributors + be held liable for any damages arising in any way from the use of + this software. + + The contents of this file are DUAL-LICENSED. You may modify and/or + redistribute this software according to the terms of one of the + following two licenses (at your option): + + + LICENSE 1 ("BSD-like with advertising clause"): + + 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. Redistributions of source code must retain the above copyright + notice, disclaimer, and this list of conditions. + 2. Redistributions in binary form must reproduce the above copyright + notice, disclaimer, and this list of conditions in the documenta- + tion and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + + This product includes software developed by Greg Roelofs + and contributors for the book, "PNG: The Definitive Guide," + published by O'Reilly and Associates. + + + LICENSE 2 (GNU GPL v2 or later): + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + ---------------------------------------------------------------------------*/ + +#define PROGNAME "rpng2-win" +#define LONGNAME "Progressive PNG Viewer for Windows" +#define VERSION "2.02 of 16 March 2008" + +#include +#include +#include +#include /* for jmpbuf declaration in readpng2.h */ +#include +#include /* only for PvdM background code */ +#include +#ifdef __CYGWIN__ +/* getch replacement. Turns out, we don't really need this, + * but leave it here if we ever enable any of the uses of + * _getch in the main code + */ +#include +#include +#include +int repl_getch( void ) +{ + char ch; + int fd = fileno(stdin); + struct termio old_tty, new_tty; + + ioctl(fd, TCGETA, &old_tty); + new_tty = old_tty; + new_tty.c_lflag &= ~(ICANON | ECHO | ISIG); + ioctl(fd, TCSETA, &new_tty); + fread(&ch, 1, sizeof(ch), stdin); + ioctl(fd, TCSETA, &old_tty); + + return ch; +} +#define _getch repl_getch +#else +#include /* only for _getch() */ +#endif + +/* all for PvdM background code: */ +#ifndef PI +# define PI 3.141592653589793238 +#endif +#define PI_2 (PI*0.5) +#define INV_PI_360 (360.0 / PI) +#define MAX(a,b) (a>b?a:b) +#define MIN(a,b) (a> 8)) >> 8); \ +} + + +#define INBUFSIZE 4096 /* with pseudo-timing on (1 sec delay/block), this + * block size corresponds roughly to a download + * speed 10% faster than theoretical 33.6K maximum + * (assuming 8 data bits, 1 stop bit and no other + * overhead) */ + +/* local prototypes */ +static void rpng2_win_init(void); +static int rpng2_win_create_window(void); +static int rpng2_win_load_bg_image(void); +static void rpng2_win_display_row(ulg row); +static void rpng2_win_finish_display(void); +static void rpng2_win_cleanup(void); +LRESULT CALLBACK rpng2_win_wndproc(HWND, UINT, WPARAM, LPARAM); + + +static char titlebar[1024]; +static char *progname = PROGNAME; +static char *appname = LONGNAME; +static char *filename; +static FILE *infile; + +static mainprog_info rpng2_info; + +static uch inbuf[INBUFSIZE]; +static int incount; + +static int pat = 6; /* must be less than num_bgpat */ +static int bg_image = 0; +static int bgscale = 16; +static ulg bg_rowbytes; +static uch *bg_data; + +static struct rgb_color { + uch r, g, b; +} rgb[] = { + { 0, 0, 0}, /* 0: black */ + {255, 255, 255}, /* 1: white */ + {173, 132, 57}, /* 2: tan */ + { 64, 132, 0}, /* 3: medium green */ + {189, 117, 1}, /* 4: gold */ + {253, 249, 1}, /* 5: yellow */ + { 0, 0, 255}, /* 6: blue */ + { 0, 0, 120}, /* 7: medium blue */ + {255, 0, 255}, /* 8: magenta */ + { 64, 0, 64}, /* 9: dark magenta */ + {255, 0, 0}, /* 10: red */ + { 64, 0, 0}, /* 11: dark red */ + {255, 127, 0}, /* 12: orange */ + {192, 96, 0}, /* 13: darker orange */ + { 24, 60, 0}, /* 14: dark green-yellow */ + { 85, 125, 200} /* 15: ice blue */ +}; +/* not used for now, but should be for error-checking: +static int num_rgb = sizeof(rgb) / sizeof(struct rgb_color); + */ + +/* + This whole struct is a fairly cheesy way to keep the number of + command-line options to a minimum. The radial-waves background + type is a particularly poor fit to the integer elements of the + struct...but a few macros and a little fixed-point math will do + wonders for ya. + + type bits: + F E D C B A 9 8 7 6 5 4 3 2 1 0 + | | | | | + | | +-+-+-- 0 = sharp-edged checkerboard + | | 1 = soft diamonds + | | 2 = radial waves + | | 3-7 = undefined + | +-- gradient #2 inverted? + +-- alternating columns inverted? + */ +static struct background_pattern { + ush type; + int rgb1_max, rgb1_min; /* or bg_freq, bg_gray */ + int rgb2_max, rgb2_min; /* or bg_bsat, bg_brot (both scaled by 10)*/ +} bg[] = { + {0+8, 2,0, 1,15}, /* checkered: tan/black vs. white/ice blue */ + {0+24, 2,0, 1,0}, /* checkered: tan/black vs. white/black */ + {0+8, 4,5, 0,2}, /* checkered: gold/yellow vs. black/tan */ + {0+8, 4,5, 0,6}, /* checkered: gold/yellow vs. black/blue */ + {0, 7,0, 8,9}, /* checkered: deep blue/black vs. magenta */ + {0+8, 13,0, 5,14}, /* checkered: orange/black vs. yellow */ + {0+8, 12,0, 10,11}, /* checkered: orange/black vs. red */ + {1, 7,0, 8,0}, /* diamonds: deep blue/black vs. magenta */ + {1, 12,0, 11,0}, /* diamonds: orange vs. dark red */ + {1, 10,0, 7,0}, /* diamonds: red vs. medium blue */ + {1, 4,0, 5,0}, /* diamonds: gold vs. yellow */ + {1, 3,0, 0,0}, /* diamonds: medium green vs. black */ + {2, 16, 100, 20, 0}, /* radial: ~hard radial color-beams */ + {2, 18, 100, 10, 2}, /* radial: soft, curved radial color-beams */ + {2, 16, 256, 100, 250}, /* radial: very tight spiral */ + {2, 10000, 256, 11, 0} /* radial: dipole-moire' (almost fractal) */ +}; +static int num_bgpat = sizeof(bg) / sizeof(struct background_pattern); + + +/* Windows-specific global variables (could go in struct, but messy...) */ +static ulg wimage_rowbytes; +static uch *dib; +static uch *wimage_data; +static BITMAPINFOHEADER *bmih; + +static HWND global_hwnd; +static HINSTANCE global_hInst; +static int global_showmode; + + + + +int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode) +{ + char *args[1024]; /* arbitrary limit, but should suffice */ + char **argv = args; + char *p, *q, *bgstr = NULL; + int argc = 0; + int rc, alen, flen; + int error = 0; + int timing = FALSE; + int have_bg = FALSE; + double LUT_exponent; /* just the lookup table */ + double CRT_exponent = 2.2; /* just the monitor */ + double default_display_exponent; /* whole display system */ + MSG msg; + + + /* First initialize a few things, just to be sure--memset takes care of + * default background color (black), booleans (FALSE), pointers (NULL), + * etc. */ + + global_hInst = hInst; + global_showmode = showmode; + filename = (char *)NULL; + memset(&rpng2_info, 0, sizeof(mainprog_info)); + +#ifndef __CYGWIN__ + /* Next reenable console output, which normally goes to the bit bucket + * for windowed apps. Closing the console window will terminate the + * app. Thanks to David.Geldreich at realviz.com for supplying the magical + * incantation. */ + + AllocConsole(); + freopen("CONOUT$", "a", stderr); + freopen("CONOUT$", "a", stdout); +#endif + + /* Set the default value for our display-system exponent, i.e., the + * product of the CRT exponent and the exponent corresponding to + * the frame-buffer's lookup table (LUT), if any. This is not an + * exhaustive list of LUT values (e.g., OpenStep has a lot of weird + * ones), but it should cover 99% of the current possibilities. And + * yes, these ifdefs are completely wasted in a Windows program... */ + +#if defined(NeXT) + /* third-party utilities can modify the default LUT exponent */ + LUT_exponent = 1.0 / 2.2; + /* + if (some_next_function_that_returns_gamma(&next_gamma)) + LUT_exponent = 1.0 / next_gamma; + */ +#elif defined(sgi) + LUT_exponent = 1.0 / 1.7; + /* there doesn't seem to be any documented function to + * get the "gamma" value, so we do it the hard way */ + infile = fopen("/etc/config/system.glGammaVal", "r"); + if (infile) { + double sgi_gamma; + + fgets(tmpline, 80, infile); + fclose(infile); + sgi_gamma = atof(tmpline); + if (sgi_gamma > 0.0) + LUT_exponent = 1.0 / sgi_gamma; + } +#elif defined(Macintosh) + LUT_exponent = 1.8 / 2.61; + /* + if (some_mac_function_that_returns_gamma(&mac_gamma)) + LUT_exponent = mac_gamma / 2.61; + */ +#else + LUT_exponent = 1.0; /* assume no LUT: most PCs */ +#endif + + /* the defaults above give 1.0, 1.3, 1.5 and 2.2, respectively: */ + default_display_exponent = LUT_exponent * CRT_exponent; + + + /* If the user has set the SCREEN_GAMMA environment variable as suggested + * (somewhat imprecisely) in the libpng documentation, use that; otherwise + * use the default value we just calculated. Either way, the user may + * override this via a command-line option. */ + + if ((p = getenv("SCREEN_GAMMA")) != NULL) + rpng2_info.display_exponent = atof(p); + else + rpng2_info.display_exponent = default_display_exponent; + + + /* Windows really hates command lines, so we have to set up our own argv. + * Note that we do NOT bother with quoted arguments here, so don't use + * filenames with spaces in 'em! */ + + argv[argc++] = PROGNAME; + p = cmd; + for (;;) { + if (*p == ' ') + while (*++p == ' ') + ; + /* now p points at the first non-space after some spaces */ + if (*p == '\0') + break; /* nothing after the spaces: done */ + argv[argc++] = q = p; + while (*q && *q != ' ') + ++q; + /* now q points at a space or the end of the string */ + if (*q == '\0') + break; /* last argv already terminated; quit */ + *q = '\0'; /* change space to terminator */ + p = q + 1; + } + argv[argc] = NULL; /* terminate the argv array itself */ + + + /* Now parse the command line for options and the PNG filename. */ + + while (*++argv && !error) { + if (!strncmp(*argv, "-gamma", 2)) { + if (!*++argv) + ++error; + else { + rpng2_info.display_exponent = atof(*argv); + if (rpng2_info.display_exponent <= 0.0) + ++error; + } + } else if (!strncmp(*argv, "-bgcolor", 4)) { + if (!*++argv) + ++error; + else { + bgstr = *argv; + if (strlen(bgstr) != 7 || bgstr[0] != '#') + ++error; + else { + have_bg = TRUE; + bg_image = FALSE; + } + } + } else if (!strncmp(*argv, "-bgpat", 4)) { + if (!*++argv) + ++error; + else { + pat = atoi(*argv) - 1; + if (pat < 0 || pat >= num_bgpat) + ++error; + else { + bg_image = TRUE; + have_bg = FALSE; + } + } + } else if (!strncmp(*argv, "-timing", 2)) { + timing = TRUE; + } else { + if (**argv != '-') { + filename = *argv; + if (argv[1]) /* shouldn't be any more args after filename */ + ++error; + } else + ++error; /* not expecting any other options */ + } + } + + if (!filename) + ++error; + + + /* print usage screen if any errors up to this point */ + + if (error) { +#ifndef __CYGWIN__ + int ch; +#endif + + fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname); + readpng2_version_info(); + fprintf(stderr, "\n" + "Usage: %s [-gamma exp] [-bgcolor bg | -bgpat pat] [-timing]\n" + " %*s file.png\n\n" + " exp \ttransfer-function exponent (``gamma'') of the display\n" + "\t\t system in floating-point format (e.g., ``%.1f''); equal\n" + "\t\t to the product of the lookup-table exponent (varies)\n" + "\t\t and the CRT exponent (usually 2.2); must be positive\n" + " bg \tdesired background color in 7-character hex RGB format\n" + "\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n" + "\t\t used with transparent images; overrides -bgpat option\n" + " pat \tdesired background pattern number (1-%d); used with\n" + "\t\t transparent images; overrides -bgcolor option\n" + " -timing\tenables delay for every block read, to simulate modem\n" + "\t\t download of image (~36 Kbps)\n" + "\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n" +#ifndef __CYGWIN__ + "Press Q or Esc to quit this usage screen. ", +#else + , +#endif + PROGNAME, +#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__)) && \ + !(defined(__CYGWIN__) || defined(__MINGW32__)) + (int)strlen(PROGNAME), " ", +#endif + (int)strlen(PROGNAME), " ", default_display_exponent, num_bgpat); + fflush(stderr); +#ifndef __CYGWIN__ + do + ch = _getch(); + while (ch != 'q' && ch != 'Q' && ch != 0x1B); +#endif + exit(1); + } + + + if (!(infile = fopen(filename, "rb"))) { + fprintf(stderr, PROGNAME ": can't open PNG file [%s]\n", filename); + ++error; + } else { + incount = fread(inbuf, 1, INBUFSIZE, infile); + if (incount < 8 || !readpng2_check_sig(inbuf, 8)) { + fprintf(stderr, PROGNAME + ": [%s] is not a PNG file: incorrect signature\n", + filename); + ++error; + } else if ((rc = readpng2_init(&rpng2_info)) != 0) { + switch (rc) { + case 2: + fprintf(stderr, PROGNAME + ": [%s] has bad IHDR (libpng longjmp)\n", filename); + break; + case 4: + fprintf(stderr, PROGNAME ": insufficient memory\n"); + break; + default: + fprintf(stderr, PROGNAME + ": unknown readpng2_init() error\n"); + break; + } + ++error; + } + if (error) + fclose(infile); + } + + + if (error) { +#ifndef __CYGWIN__ + int ch; +#endif + + fprintf(stderr, PROGNAME ": aborting.\n"); +#ifndef __CYGWIN__ + do + ch = _getch(); + while (ch != 'q' && ch != 'Q' && ch != 0x1B); +#endif + exit(2); + } else { + fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname); +#ifndef __CYGWIN__ + fprintf(stderr, + "\n [console window: closing this window will terminate %s]\n\n", + PROGNAME); +#endif + fflush(stderr); + } + + + /* set the title-bar string, but make sure buffer doesn't overflow */ + + alen = strlen(appname); + flen = strlen(filename); + if (alen + flen + 3 > 1023) + sprintf(titlebar, "%s: ...%s", appname, filename+(alen+flen+6-1023)); + else + sprintf(titlebar, "%s: %s", appname, filename); + + + /* set some final rpng2_info variables before entering main data loop */ + + if (have_bg) { + unsigned r, g, b; /* this approach quiets compiler warnings */ + + sscanf(bgstr+1, "%2x%2x%2x", &r, &g, &b); + rpng2_info.bg_red = (uch)r; + rpng2_info.bg_green = (uch)g; + rpng2_info.bg_blue = (uch)b; + } else + rpng2_info.need_bgcolor = TRUE; + + rpng2_info.state = kPreInit; + rpng2_info.mainprog_init = rpng2_win_init; + rpng2_info.mainprog_display_row = rpng2_win_display_row; + rpng2_info.mainprog_finish_display = rpng2_win_finish_display; + + + /* OK, this is the fun part: call readpng2_decode_data() at the start of + * the loop to deal with our first buffer of data (read in above to verify + * that the file is a PNG image), then loop through the file and continue + * calling the same routine to handle each chunk of data. It in turn + * passes the data to libpng, which will invoke one or more of our call- + * backs as decoded data become available. We optionally call Sleep() for + * one second per iteration to simulate downloading the image via an analog + * modem. */ + + for (;;) { + Trace((stderr, "about to call readpng2_decode_data()\n")) + if (readpng2_decode_data(&rpng2_info, inbuf, incount)) + ++error; + Trace((stderr, "done with readpng2_decode_data()\n")) + + if (error || incount != INBUFSIZE || rpng2_info.state == kDone) { + if (rpng2_info.state == kDone) { + Trace((stderr, "done decoding PNG image\n")) + } else if (ferror(infile)) { + fprintf(stderr, PROGNAME + ": error while reading PNG image file\n"); + exit(3); + } else if (feof(infile)) { + fprintf(stderr, PROGNAME ": end of file reached " + "(unexpectedly) while reading PNG image file\n"); + exit(3); + } else /* if (error) */ { + /* will print error message below */ + } + break; + } + + if (timing) + Sleep(1000L); + + incount = fread(inbuf, 1, INBUFSIZE, infile); + } + + + /* clean up PNG stuff and report any decoding errors */ + + fclose(infile); + Trace((stderr, "about to call readpng2_cleanup()\n")) + readpng2_cleanup(&rpng2_info); + + if (error) { + fprintf(stderr, PROGNAME ": libpng error while decoding PNG image\n"); + exit(3); + } + + + /* wait for the user to tell us when to quit */ + + while (GetMessage(&msg, NULL, 0, 0)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + + /* we're done: clean up all image and Windows resources and go away */ + + Trace((stderr, "about to call rpng2_win_cleanup()\n")) + rpng2_win_cleanup(); + + return msg.wParam; +} + + + + + +/* this function is called by readpng2_info_callback() in readpng2.c, which + * in turn is called by libpng after all of the pre-IDAT chunks have been + * read and processed--i.e., we now have enough info to finish initializing */ + +static void rpng2_win_init() +{ + ulg i; + ulg rowbytes = rpng2_info.rowbytes; + + Trace((stderr, "beginning rpng2_win_init()\n")) + Trace((stderr, " rowbytes = %d\n", rpng2_info.rowbytes)) + Trace((stderr, " width = %ld\n", rpng2_info.width)) + Trace((stderr, " height = %ld\n", rpng2_info.height)) + + /* Guard against integer overflow */ + if (rpng2_info.height > ((size_t)(-1))/rowbytes) { + fprintf(stderr, PROGNAME ": image_data buffer would be too large\n", + readpng2_cleanup(&rpng2_info); + return; + } + + rpng2_info.image_data = (uch *)malloc(rowbytes * rpng2_info.height); + if (!rpng2_info.image_data) { + readpng2_cleanup(&rpng2_info); + return; + } + + rpng2_info.row_pointers = (uch **)malloc(rpng2_info.height * sizeof(uch *)); + if (!rpng2_info.row_pointers) { + free(rpng2_info.image_data); + rpng2_info.image_data = NULL; + readpng2_cleanup(&rpng2_info); + return; + } + + for (i = 0; i < rpng2_info.height; ++i) + rpng2_info.row_pointers[i] = rpng2_info.image_data + i*rowbytes; + +/*--------------------------------------------------------------------------- + Do the basic Windows initialization stuff, make the window, and fill it + with the user-specified, file-specified or default background color. + ---------------------------------------------------------------------------*/ + + if (rpng2_win_create_window()) { + readpng2_cleanup(&rpng2_info); + return; + } + + rpng2_info.state = kWindowInit; +} + + + + + +static int rpng2_win_create_window() +{ + uch bg_red = rpng2_info.bg_red; + uch bg_green = rpng2_info.bg_green; + uch bg_blue = rpng2_info.bg_blue; + uch *dest; + int extra_width, extra_height; + ulg i, j; + WNDCLASSEX wndclass; + RECT rect; + + +/*--------------------------------------------------------------------------- + Allocate memory for the display-specific version of the image (round up + to multiple of 4 for Windows DIB). + ---------------------------------------------------------------------------*/ + + wimage_rowbytes = ((3*rpng2_info.width + 3L) >> 2) << 2; + + if (!(dib = (uch *)malloc(sizeof(BITMAPINFOHEADER) + + wimage_rowbytes*rpng2_info.height))) + { + return 4; /* fail */ + } + +/*--------------------------------------------------------------------------- + Initialize the DIB. Negative height means to use top-down BMP ordering + (must be uncompressed, but that's what we want). Bit count of 1, 4 or 8 + implies a colormap of RGBX quads, but 24-bit BMPs just use B,G,R values + directly => wimage_data begins immediately after BMP header. + ---------------------------------------------------------------------------*/ + + memset(dib, 0, sizeof(BITMAPINFOHEADER)); + bmih = (BITMAPINFOHEADER *)dib; + bmih->biSize = sizeof(BITMAPINFOHEADER); + bmih->biWidth = rpng2_info.width; + bmih->biHeight = -((long)rpng2_info.height); + bmih->biPlanes = 1; + bmih->biBitCount = 24; + bmih->biCompression = 0; + wimage_data = dib + sizeof(BITMAPINFOHEADER); + +/*--------------------------------------------------------------------------- + Fill window with the specified background color (default is black), but + defer loading faked "background image" until window is displayed (may be + slow to compute). Data are in BGR order. + ---------------------------------------------------------------------------*/ + + if (bg_image) { /* just fill with black for now */ + memset(wimage_data, 0, wimage_rowbytes*rpng2_info.height); + } else { + for (j = 0; j < rpng2_info.height; ++j) { + dest = wimage_data + j*wimage_rowbytes; + for (i = rpng2_info.width; i > 0; --i) { + *dest++ = bg_blue; + *dest++ = bg_green; + *dest++ = bg_red; + } + } + } + +/*--------------------------------------------------------------------------- + Set the window parameters. + ---------------------------------------------------------------------------*/ + + memset(&wndclass, 0, sizeof(wndclass)); + + wndclass.cbSize = sizeof(wndclass); + wndclass.style = CS_HREDRAW | CS_VREDRAW; + wndclass.lpfnWndProc = rpng2_win_wndproc; + wndclass.hInstance = global_hInst; + wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION); + wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); + wndclass.hbrBackground = (HBRUSH)GetStockObject(DKGRAY_BRUSH); + wndclass.lpszMenuName = NULL; + wndclass.lpszClassName = progname; + wndclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION); + + RegisterClassEx(&wndclass); + +/*--------------------------------------------------------------------------- + Finally, create the window. + ---------------------------------------------------------------------------*/ + + extra_width = 2*(GetSystemMetrics(SM_CXBORDER) + + GetSystemMetrics(SM_CXDLGFRAME)); + extra_height = 2*(GetSystemMetrics(SM_CYBORDER) + + GetSystemMetrics(SM_CYDLGFRAME)) + + GetSystemMetrics(SM_CYCAPTION); + + global_hwnd = CreateWindow(progname, titlebar, WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, CW_USEDEFAULT, rpng2_info.width+extra_width, + rpng2_info.height+extra_height, NULL, NULL, global_hInst, NULL); + + ShowWindow(global_hwnd, global_showmode); + UpdateWindow(global_hwnd); + +/*--------------------------------------------------------------------------- + Now compute the background image and display it. If it fails (memory + allocation), revert to a plain background color. + ---------------------------------------------------------------------------*/ + + if (bg_image) { + static const char *msg = "Computing background image..."; + int x, y, len = strlen(msg); + HDC hdc = GetDC(global_hwnd); + TEXTMETRIC tm; + + GetTextMetrics(hdc, &tm); + x = (rpng2_info.width - len*tm.tmAveCharWidth)/2; + y = (rpng2_info.height - tm.tmHeight)/2; + SetBkMode(hdc, TRANSPARENT); + SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT)); + /* this can still begin out of bounds even if x is positive (???): */ + TextOut(hdc, ((x < 0)? 0 : x), ((y < 0)? 0 : y), msg, len); + ReleaseDC(global_hwnd, hdc); + + rpng2_win_load_bg_image(); /* resets bg_image if fails */ + } + + if (!bg_image) { + for (j = 0; j < rpng2_info.height; ++j) { + dest = wimage_data + j*wimage_rowbytes; + for (i = rpng2_info.width; i > 0; --i) { + *dest++ = bg_blue; + *dest++ = bg_green; + *dest++ = bg_red; + } + } + } + + rect.left = 0L; + rect.top = 0L; + rect.right = (LONG)rpng2_info.width; /* possibly off by one? */ + rect.bottom = (LONG)rpng2_info.height; /* possibly off by one? */ + InvalidateRect(global_hwnd, &rect, FALSE); + UpdateWindow(global_hwnd); /* similar to XFlush() */ + + return 0; + +} /* end function rpng2_win_create_window() */ + + + + + +static int rpng2_win_load_bg_image() +{ + uch *src, *dest; + uch r1, r2, g1, g2, b1, b2; + uch r1_inv, r2_inv, g1_inv, g2_inv, b1_inv, b2_inv; + int k, hmax, max; + int xidx, yidx, yidx_max = (bgscale-1); + int even_odd_vert, even_odd_horiz, even_odd; + int invert_gradient2 = (bg[pat].type & 0x08); + int invert_column; + ulg i, row; + +/*--------------------------------------------------------------------------- + Allocate buffer for fake background image to be used with transparent + images; if this fails, revert to plain background color. + ---------------------------------------------------------------------------*/ + + bg_rowbytes = 3 * rpng2_info.width; + bg_data = (uch *)malloc(bg_rowbytes * rpng2_info.height); + if (!bg_data) { + fprintf(stderr, PROGNAME + ": unable to allocate memory for background image\n"); + bg_image = 0; + return 1; + } + +/*--------------------------------------------------------------------------- + Vertical gradients (ramps) in NxN squares, alternating direction and + colors (N == bgscale). + ---------------------------------------------------------------------------*/ + + if ((bg[pat].type & 0x07) == 0) { + uch r1_min = rgb[bg[pat].rgb1_min].r; + uch g1_min = rgb[bg[pat].rgb1_min].g; + uch b1_min = rgb[bg[pat].rgb1_min].b; + uch r2_min = rgb[bg[pat].rgb2_min].r; + uch g2_min = rgb[bg[pat].rgb2_min].g; + uch b2_min = rgb[bg[pat].rgb2_min].b; + int r1_diff = rgb[bg[pat].rgb1_max].r - r1_min; + int g1_diff = rgb[bg[pat].rgb1_max].g - g1_min; + int b1_diff = rgb[bg[pat].rgb1_max].b - b1_min; + int r2_diff = rgb[bg[pat].rgb2_max].r - r2_min; + int g2_diff = rgb[bg[pat].rgb2_max].g - g2_min; + int b2_diff = rgb[bg[pat].rgb2_max].b - b2_min; + + for (row = 0; row < rpng2_info.height; ++row) { + yidx = row % bgscale; + even_odd_vert = (row / bgscale) & 1; + + r1 = r1_min + (r1_diff * yidx) / yidx_max; + g1 = g1_min + (g1_diff * yidx) / yidx_max; + b1 = b1_min + (b1_diff * yidx) / yidx_max; + r1_inv = r1_min + (r1_diff * (yidx_max-yidx)) / yidx_max; + g1_inv = g1_min + (g1_diff * (yidx_max-yidx)) / yidx_max; + b1_inv = b1_min + (b1_diff * (yidx_max-yidx)) / yidx_max; + + r2 = r2_min + (r2_diff * yidx) / yidx_max; + g2 = g2_min + (g2_diff * yidx) / yidx_max; + b2 = b2_min + (b2_diff * yidx) / yidx_max; + r2_inv = r2_min + (r2_diff * (yidx_max-yidx)) / yidx_max; + g2_inv = g2_min + (g2_diff * (yidx_max-yidx)) / yidx_max; + b2_inv = b2_min + (b2_diff * (yidx_max-yidx)) / yidx_max; + + dest = bg_data + row*bg_rowbytes; + for (i = 0; i < rpng2_info.width; ++i) { + even_odd_horiz = (i / bgscale) & 1; + even_odd = even_odd_vert ^ even_odd_horiz; + invert_column = + (even_odd_horiz && (bg[pat].type & 0x10)); + if (even_odd == 0) { /* gradient #1 */ + if (invert_column) { + *dest++ = r1_inv; + *dest++ = g1_inv; + *dest++ = b1_inv; + } else { + *dest++ = r1; + *dest++ = g1; + *dest++ = b1; + } + } else { /* gradient #2 */ + if ((invert_column && invert_gradient2) || + (!invert_column && !invert_gradient2)) + { + *dest++ = r2; /* not inverted or */ + *dest++ = g2; /* doubly inverted */ + *dest++ = b2; + } else { + *dest++ = r2_inv; + *dest++ = g2_inv; /* singly inverted */ + *dest++ = b2_inv; + } + } + } + } + +/*--------------------------------------------------------------------------- + Soft gradient-diamonds with scale = bgscale. Code contributed by Adam + M. Costello. + ---------------------------------------------------------------------------*/ + + } else if ((bg[pat].type & 0x07) == 1) { + + hmax = (bgscale-1)/2; /* half the max weight of a color */ + max = 2*hmax; /* the max weight of a color */ + + r1 = rgb[bg[pat].rgb1_max].r; + g1 = rgb[bg[pat].rgb1_max].g; + b1 = rgb[bg[pat].rgb1_max].b; + r2 = rgb[bg[pat].rgb2_max].r; + g2 = rgb[bg[pat].rgb2_max].g; + b2 = rgb[bg[pat].rgb2_max].b; + + for (row = 0; row < rpng2_info.height; ++row) { + yidx = row % bgscale; + if (yidx > hmax) + yidx = bgscale-1 - yidx; + dest = bg_data + row*bg_rowbytes; + for (i = 0; i < rpng2_info.width; ++i) { + xidx = i % bgscale; + if (xidx > hmax) + xidx = bgscale-1 - xidx; + k = xidx + yidx; + *dest++ = (k*r1 + (max-k)*r2) / max; + *dest++ = (k*g1 + (max-k)*g2) / max; + *dest++ = (k*b1 + (max-k)*b2) / max; + } + } + +/*--------------------------------------------------------------------------- + Radial "starburst" with azimuthal sinusoids; [eventually number of sinu- + soids will equal bgscale?]. This one is slow but very cool. Code con- + tributed by Pieter S. van der Meulen (originally in Smalltalk). + ---------------------------------------------------------------------------*/ + + } else if ((bg[pat].type & 0x07) == 2) { + uch ch; + int ii, x, y, hw, hh, grayspot; + double freq, rotate, saturate, gray, intensity; + double angle=0.0, aoffset=0.0, maxDist, dist; + double red=0.0, green=0.0, blue=0.0, hue, s, v, f, p, q, t; + + fprintf(stderr, "%s: computing radial background...", + PROGNAME); + fflush(stderr); + + hh = rpng2_info.height / 2; + hw = rpng2_info.width / 2; + + /* variables for radial waves: + * aoffset: number of degrees to rotate hue [CURRENTLY NOT USED] + * freq: number of color beams originating from the center + * grayspot: size of the graying center area (anti-alias) + * rotate: rotation of the beams as a function of radius + * saturate: saturation of beams' shape azimuthally + */ + angle = CLIP(angle, 0.0, 360.0); + grayspot = CLIP(bg[pat].bg_gray, 1, (hh + hw)); + freq = MAX((double)bg[pat].bg_freq, 0.0); + saturate = (double)bg[pat].bg_bsat * 0.1; + rotate = (double)bg[pat].bg_brot * 0.1; + gray = 0.0; + intensity = 0.0; + maxDist = (double)((hw*hw) + (hh*hh)); + + for (row = 0; row < rpng2_info.height; ++row) { + y = row - hh; + dest = bg_data + row*bg_rowbytes; + for (i = 0; i < rpng2_info.width; ++i) { + x = i - hw; + angle = (x == 0)? PI_2 : atan((double)y / (double)x); + gray = (double)MAX(ABS(y), ABS(x)) / grayspot; + gray = MIN(1.0, gray); + dist = (double)((x*x) + (y*y)) / maxDist; + intensity = cos((angle+(rotate*dist*PI)) * freq) * + gray * saturate; + intensity = (MAX(MIN(intensity,1.0),-1.0) + 1.0) * 0.5; + hue = (angle + PI) * INV_PI_360 + aoffset; + s = gray * ((double)(ABS(x)+ABS(y)) / (double)(hw + hh)); + s = MIN(MAX(s,0.0), 1.0); + v = MIN(MAX(intensity,0.0), 1.0); + + if (s == 0.0) { + ch = (uch)(v * 255.0); + *dest++ = ch; + *dest++ = ch; + *dest++ = ch; + } else { + if ((hue < 0.0) || (hue >= 360.0)) + hue -= (((int)(hue / 360.0)) * 360.0); + hue /= 60.0; + ii = (int)hue; + f = hue - (double)ii; + p = (1.0 - s) * v; + q = (1.0 - (s * f)) * v; + t = (1.0 - (s * (1.0 - f))) * v; + if (ii == 0) { red = v; green = t; blue = p; } + else if (ii == 1) { red = q; green = v; blue = p; } + else if (ii == 2) { red = p; green = v; blue = t; } + else if (ii == 3) { red = p; green = q; blue = v; } + else if (ii == 4) { red = t; green = p; blue = v; } + else if (ii == 5) { red = v; green = p; blue = q; } + *dest++ = (uch)(red * 255.0); + *dest++ = (uch)(green * 255.0); + *dest++ = (uch)(blue * 255.0); + } + } + } + fprintf(stderr, "done.\n"); + fflush(stderr); + } + +/*--------------------------------------------------------------------------- + Blast background image to display buffer before beginning PNG decode; + calling function will handle invalidation and UpdateWindow() call. + ---------------------------------------------------------------------------*/ + + for (row = 0; row < rpng2_info.height; ++row) { + src = bg_data + row*bg_rowbytes; + dest = wimage_data + row*wimage_rowbytes; + for (i = rpng2_info.width; i > 0; --i) { + r1 = *src++; + g1 = *src++; + b1 = *src++; + *dest++ = b1; + *dest++ = g1; /* note reverse order */ + *dest++ = r1; + } + } + + return 0; + +} /* end function rpng2_win_load_bg_image() */ + + + + + +static void rpng2_win_display_row(ulg row) +{ + uch bg_red = rpng2_info.bg_red; + uch bg_green = rpng2_info.bg_green; + uch bg_blue = rpng2_info.bg_blue; + uch *src, *src2=NULL, *dest; + uch r, g, b, a; + ulg i; + static int rows=0; + static ulg firstrow; + +/*--------------------------------------------------------------------------- + rows and firstrow simply track how many rows (and which ones) have not + yet been displayed; alternatively, we could call InvalidateRect() for + every row and not bother with the records-keeping. + ---------------------------------------------------------------------------*/ + + Trace((stderr, "beginning rpng2_win_display_row()\n")) + + if (rows == 0) + firstrow = row; /* first row not yet displayed */ + + ++rows; /* count of rows received but not yet displayed */ + +/*--------------------------------------------------------------------------- + Aside from the use of the rpng2_info struct and the lack of an outer + loop (over rows), this routine is identical to rpng_win_display_image() + in the non-progressive version of the program. + ---------------------------------------------------------------------------*/ + + src = rpng2_info.image_data + row*rpng2_info.rowbytes; + if (bg_image) + src2 = bg_data + row*bg_rowbytes; + dest = wimage_data + row*wimage_rowbytes; + + if (rpng2_info.channels == 3) { + for (i = rpng2_info.width; i > 0; --i) { + r = *src++; + g = *src++; + b = *src++; + *dest++ = b; + *dest++ = g; /* note reverse order */ + *dest++ = r; + } + } else /* if (rpng2_info.channels == 4) */ { + for (i = rpng2_info.width; i > 0; --i) { + r = *src++; + g = *src++; + b = *src++; + a = *src++; + if (bg_image) { + bg_red = *src2++; + bg_green = *src2++; + bg_blue = *src2++; + } + if (a == 255) { + *dest++ = b; + *dest++ = g; + *dest++ = r; + } else if (a == 0) { + *dest++ = bg_blue; + *dest++ = bg_green; + *dest++ = bg_red; + } else { + /* this macro (copied from png.h) composites the + * foreground and background values and puts the + * result into the first argument; there are no + * side effects with the first argument */ + alpha_composite(*dest++, b, a, bg_blue); + alpha_composite(*dest++, g, a, bg_green); + alpha_composite(*dest++, r, a, bg_red); + } + } + } + +/*--------------------------------------------------------------------------- + Display after every 16 rows or when on last row. (Region may include + previously displayed lines due to interlacing--i.e., not contiguous.) + ---------------------------------------------------------------------------*/ + + if ((rows & 0xf) == 0 || row == rpng2_info.height-1) { + RECT rect; + + rect.left = 0L; + rect.top = (LONG)firstrow; + rect.right = (LONG)rpng2_info.width; /* possibly off by one? */ + rect.bottom = (LONG)row + 1L; /* possibly off by one? */ + InvalidateRect(global_hwnd, &rect, FALSE); + UpdateWindow(global_hwnd); /* similar to XFlush() */ + rows = 0; + } + +} /* end function rpng2_win_display_row() */ + + + + + +static void rpng2_win_finish_display() +{ + Trace((stderr, "beginning rpng2_win_finish_display()\n")) + + /* last row has already been displayed by rpng2_win_display_row(), so + * we have nothing to do here except set a flag and let the user know + * that the image is done */ + + rpng2_info.state = kDone; + printf( +#ifndef __CYGWIN__ + "Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n" +#else + "Done. Press mouse button 1 (within image window) to quit.\n" +#endif + ); + fflush(stdout); +} + + + + + +static void rpng2_win_cleanup() +{ + if (bg_image && bg_data) { + free(bg_data); + bg_data = NULL; + } + + if (rpng2_info.image_data) { + free(rpng2_info.image_data); + rpng2_info.image_data = NULL; + } + + if (rpng2_info.row_pointers) { + free(rpng2_info.row_pointers); + rpng2_info.row_pointers = NULL; + } + + if (dib) { + free(dib); + dib = NULL; + } +} + + + + + +LRESULT CALLBACK rpng2_win_wndproc(HWND hwnd, UINT iMsg, WPARAM wP, LPARAM lP) +{ + HDC hdc; + PAINTSTRUCT ps; + int rc; + + switch (iMsg) { + case WM_CREATE: + /* one-time processing here, if any */ + return 0; + + case WM_PAINT: + hdc = BeginPaint(hwnd, &ps); + rc = StretchDIBits(hdc, 0, 0, rpng2_info.width, rpng2_info.height, + 0, 0, rpng2_info.width, rpng2_info.height, + wimage_data, (BITMAPINFO *)bmih, + 0, SRCCOPY); + EndPaint(hwnd, &ps); + return 0; + + /* wait for the user to tell us when to quit */ + case WM_CHAR: + switch (wP) { /* only need one, so ignore repeat count */ + case 'q': + case 'Q': + case 0x1B: /* Esc key */ + PostQuitMessage(0); + } + return 0; + + case WM_LBUTTONDOWN: /* another way of quitting */ + case WM_DESTROY: + PostQuitMessage(0); + return 0; + } + + return DefWindowProc(hwnd, iMsg, wP, lP); +} diff --git a/Engine/lib/lpng/contrib/gregbook/rpng2-x.c b/Engine/lib/lpng/contrib/gregbook/rpng2-x.c new file mode 100644 index 000000000..af944c0f2 --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/rpng2-x.c @@ -0,0 +1,2143 @@ +/*--------------------------------------------------------------------------- + + rpng2 - progressive-model PNG display program rpng2-x.c + + This program decodes and displays PNG files progressively, as if it were + a web browser (though the front end is only set up to read from files). + It supports gamma correction, user-specified background colors, and user- + specified background patterns (for transparent images). This version is + for the X Window System (tested by the author under Unix and by Martin + Zinser under OpenVMS; may work under OS/2 with a little tweaking). + + Thanks to Adam Costello and Pieter S. van der Meulen for the "diamond" + and "radial waves" patterns, respectively. + + to do (someday, maybe): + - fix expose/redraw code: don't draw entire row if only part exposed + - 8-bit (colormapped) X support + - finish resizable checkerboard-gradient (sizes 4-128?) + - use %.1023s to simplify truncation of title-bar string? + + --------------------------------------------------------------------------- + + Changelog: + - 1.01: initial public release + - 1.02: modified to allow abbreviated options; fixed char/uchar mismatch + - 1.10: added support for non-default visuals; fixed X pixel-conversion + - 1.11: added -usleep option for demos; fixed command-line parsing bug + - 1.12: added -pause option for demos and testing + - 1.20: added runtime MMX-enabling/disabling and new -mmx* options + - 1.21: fixed some small X memory leaks (thanks to François Petitjean) + - 1.22: fixed XFreeGC() crash bug (thanks to Patrick Welche) + - 1.23: added -bgpat 0 mode (std white/gray checkerboard, 8x8 squares) + - 1.30: added -loop option for -bgpat (ifdef FEATURE_LOOP); fixed bpp = + 24; added support for X resources (thanks to Gerhard Niklasch) + - 1.31: added code to skip unused chunks (thanks to Glenn Randers-Pehrson) + - 1.32: added AMD64/EM64T support (__x86_64__); added basic expose/redraw + handling + - 2.00: dual-licensed (added GNU GPL) + - 2.01: fixed 64-bit typo in readpng2.c; fixed -pause usage description + - 2.02: fixed improper display of usage screen on PNG error(s); fixed + unexpected-EOF and file-read-error cases; fixed Trace() cut-and- + paste bugs + - 2.03: deleted runtime MMX-enabling/disabling and obsolete -mmx* options + - 2.04: Added "void(foo);" statements to quiet pedantic compiler warnings + about unused variables (GR-P) + - 2.05: Use nanosleep() instead of usleep(), which is deprecated (GR-P). + - 2.06: check for integer overflow (Glenn R-P) + --------------------------------------------------------------------------- + + Copyright (c) 1998-2010, 2014-2015, 2017 Greg Roelofs. All rights + reserved. + + This software is provided "as is," without warranty of any kind, + express or implied. In no event shall the author or contributors + be held liable for any damages arising in any way from the use of + this software. + + The contents of this file are DUAL-LICENSED. You may modify and/or + redistribute this software according to the terms of one of the + following two licenses (at your option): + + + LICENSE 1 ("BSD-like with advertising clause"): + + 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. Redistributions of source code must retain the above copyright + notice, disclaimer, and this list of conditions. + 2. Redistributions in binary form must reproduce the above copyright + notice, disclaimer, and this list of conditions in the documenta- + tion and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + + This product includes software developed by Greg Roelofs + and contributors for the book, "PNG: The Definitive Guide," + published by O'Reilly and Associates. + + + LICENSE 2 (GNU GPL v2 or later): + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + ---------------------------------------------------------------------------*/ + +#define PROGNAME "rpng2-x" +#define LONGNAME "Progressive PNG Viewer for X" +#define VERSION "2.04 of 15 June 2014" +#define RESNAME "rpng2" /* our X resource application name */ +#define RESCLASS "Rpng" /* our X resource class name */ + +#include +#include +#include +#include +#include /* for jmpbuf declaration in readpng2.h */ +#include +#include /* only for PvdM background code */ +#include +#include +#include +#include /* defines XK_* macros */ + +#if _POSIX_C_SOURCE >= 199309L /* have nanosleep() */ +# undef usleep +# define usleep(usec) { \ + struct timespec ts; \ + ts.tv_sec = 0; \ + ts.tv_nsec = (usec) * 1000; \ + nanosleep(&ts, NULL); } +# endif + +#ifndef usleep /* have neither nanosleep() nor usleep() */ +# define usleep(x) sleep(((x)+499999)/1000000) +#endif + +#ifdef VMS +# include +#endif + +/* all for PvdM background code: */ +#ifndef PI +# define PI 3.141592653589793238 +#endif +#define PI_2 (PI*0.5) +#define INV_PI_360 (360.0 / PI) +#define MAX(a,b) (a>b?a:b) +#define MIN(a,b) (a> 8)) >> 8); \ +} + + +#define INBUFSIZE 4096 /* with pseudo-timing on (1 sec delay/block), this + * block size corresponds roughly to a download + * speed 10% faster than theoretical 33.6K maximum + * (assuming 8 data bits, 1 stop bit and no other + * overhead) */ + +/* local prototypes */ +static void rpng2_x_init (void); +static int rpng2_x_create_window (void); +static int rpng2_x_load_bg_image (void); +static void rpng2_x_display_row (ulg row); +static void rpng2_x_finish_display (void); +static void rpng2_x_redisplay_image (ulg startcol, ulg startrow, + ulg width, ulg height); +#ifdef FEATURE_LOOP +static void rpng2_x_reload_bg_image (void); +static int is_number (char *p); +#endif +static void rpng2_x_cleanup (void); +static int rpng2_x_msb (ulg u32val); + + +static char titlebar[1024], *window_name = titlebar; +static char *appname = LONGNAME; +static char *icon_name = PROGNAME; +static char *res_name = RESNAME; +static char *res_class = RESCLASS; +static char *filename; +static FILE *infile; + +static mainprog_info rpng2_info; + +static uch inbuf[INBUFSIZE]; +static int incount; + +static int pat = 6; /* must be less than num_bgpat */ +static int bg_image = 0; +static int bgscale, bgscale_default = 16; +static ulg bg_rowbytes; +static uch *bg_data; + +int pause_after_pass = FALSE; +int demo_timing = FALSE; +ulg usleep_duration = 0L; + +static struct rgb_color { + uch r, g, b; +} rgb[] = { + { 0, 0, 0}, /* 0: black */ + {255, 255, 255}, /* 1: white */ + {173, 132, 57}, /* 2: tan */ + { 64, 132, 0}, /* 3: medium green */ + {189, 117, 1}, /* 4: gold */ + {253, 249, 1}, /* 5: yellow */ + { 0, 0, 255}, /* 6: blue */ + { 0, 0, 120}, /* 7: medium blue */ + {255, 0, 255}, /* 8: magenta */ + { 64, 0, 64}, /* 9: dark magenta */ + {255, 0, 0}, /* 10: red */ + { 64, 0, 0}, /* 11: dark red */ + {255, 127, 0}, /* 12: orange */ + {192, 96, 0}, /* 13: darker orange */ + { 24, 60, 0}, /* 14: dark green-yellow */ + { 85, 125, 200}, /* 15: ice blue */ + {192, 192, 192} /* 16: Netscape/Mosaic gray */ +}; +/* not used for now, but should be for error-checking: +static int num_rgb = sizeof(rgb) / sizeof(struct rgb_color); + */ + +/* + This whole struct is a fairly cheesy way to keep the number of + command-line options to a minimum. The radial-waves background + type is a particularly poor fit to the integer elements of the + struct...but a few macros and a little fixed-point math will do + wonders for ya. + + type bits: + F E D C B A 9 8 7 6 5 4 3 2 1 0 + | | | | | + | | +-+-+-- 0 = sharp-edged checkerboard + | | 1 = soft diamonds + | | 2 = radial waves + | | 3-7 = undefined + | +-- gradient #2 inverted? + +-- alternating columns inverted? + */ +static struct background_pattern { + ush type; + int rgb1_max, rgb1_min; /* or bg_freq, bg_gray */ + int rgb2_max, rgb2_min; /* or bg_bsat, bg_brot (both scaled by 10)*/ +} bg[] = { + {0, 1,1, 16,16}, /* checkered: white vs. light gray (basic) */ + {0+8, 2,0, 1,15}, /* checkered: tan/black vs. white/ice blue */ + {0+24, 2,0, 1,0}, /* checkered: tan/black vs. white/black */ + {0+8, 4,5, 0,2}, /* checkered: gold/yellow vs. black/tan */ + {0+8, 4,5, 0,6}, /* checkered: gold/yellow vs. black/blue */ + {0, 7,0, 8,9}, /* checkered: deep blue/black vs. magenta */ + {0+8, 13,0, 5,14}, /* checkered: orange/black vs. yellow */ + {0+8, 12,0, 10,11}, /* checkered: orange/black vs. red */ + {1, 7,0, 8,0}, /* diamonds: deep blue/black vs. magenta */ + {1, 12,0, 11,0}, /* diamonds: orange vs. dark red */ + {1, 10,0, 7,0}, /* diamonds: red vs. medium blue */ + {1, 4,0, 5,0}, /* diamonds: gold vs. yellow */ + {1, 3,0, 0,0}, /* diamonds: medium green vs. black */ + {2, 16, 100, 20, 0}, /* radial: ~hard radial color-beams */ + {2, 18, 100, 10, 2}, /* radial: soft, curved radial color-beams */ + {2, 16, 256, 100, 250}, /* radial: very tight spiral */ + {2, 10000, 256, 11, 0} /* radial: dipole-moire' (almost fractal) */ +}; +static int num_bgpat = sizeof(bg) / sizeof(struct background_pattern); + + +/* X-specific variables */ +static char *displayname; +static XImage *ximage; +static Display *display; +static int depth; +static Visual *visual; +static XVisualInfo *visual_list; +static int RShift, GShift, BShift; +static ulg RMask, GMask, BMask; +static Window window; +static GC gc; +static Colormap colormap; + +static int have_nondefault_visual = FALSE; +static int have_colormap = FALSE; +static int have_window = FALSE; +static int have_gc = FALSE; + + + + +int main(int argc, char **argv) +{ +#ifdef sgi + char tmpline[80]; +#endif + char *p, *bgstr = NULL; + int rc, alen, flen; + int error = 0; + int timing = FALSE; + int have_bg = FALSE; +#ifdef FEATURE_LOOP + int loop = FALSE; + long loop_interval = -1; /* seconds (100,000 max) */ +#endif + double LUT_exponent; /* just the lookup table */ + double CRT_exponent = 2.2; /* just the monitor */ + double default_display_exponent; /* whole display system */ + XEvent e; + KeySym k; + + + /* First initialize a few things, just to be sure--memset takes care of + * default background color (black), booleans (FALSE), pointers (NULL), + * etc. */ + + displayname = (char *)NULL; + filename = (char *)NULL; + memset(&rpng2_info, 0, sizeof(mainprog_info)); + + + /* Set the default value for our display-system exponent, i.e., the + * product of the CRT exponent and the exponent corresponding to + * the frame-buffer's lookup table (LUT), if any. This is not an + * exhaustive list of LUT values (e.g., OpenStep has a lot of weird + * ones), but it should cover 99% of the current possibilities. */ + +#if defined(NeXT) + /* third-party utilities can modify the default LUT exponent */ + LUT_exponent = 1.0 / 2.2; + /* + if (some_next_function_that_returns_gamma(&next_gamma)) + LUT_exponent = 1.0 / next_gamma; + */ +#elif defined(sgi) + LUT_exponent = 1.0 / 1.7; + /* there doesn't seem to be any documented function to + * get the "gamma" value, so we do it the hard way */ + infile = fopen("/etc/config/system.glGammaVal", "r"); + if (infile) { + double sgi_gamma; + + fgets(tmpline, 80, infile); + fclose(infile); + sgi_gamma = atof(tmpline); + if (sgi_gamma > 0.0) + LUT_exponent = 1.0 / sgi_gamma; + } +#elif defined(Macintosh) + LUT_exponent = 1.8 / 2.61; + /* + if (some_mac_function_that_returns_gamma(&mac_gamma)) + LUT_exponent = mac_gamma / 2.61; + */ +#else + LUT_exponent = 1.0; /* assume no LUT: most PCs */ +#endif + + /* the defaults above give 1.0, 1.3, 1.5 and 2.2, respectively: */ + default_display_exponent = LUT_exponent * CRT_exponent; + + + /* If the user has set the SCREEN_GAMMA environment variable as suggested + * (somewhat imprecisely) in the libpng documentation, use that; otherwise + * use the default value we just calculated. Either way, the user may + * override this via a command-line option. */ + + if ((p = getenv("SCREEN_GAMMA")) != NULL) + rpng2_info.display_exponent = atof(p); + else + rpng2_info.display_exponent = default_display_exponent; + + + /* Now parse the command line for options and the PNG filename. */ + + while (*++argv && !error) { + if (!strncmp(*argv, "-display", 2)) { + if (!*++argv) + ++error; + else + displayname = *argv; + } else if (!strncmp(*argv, "-gamma", 2)) { + if (!*++argv) + ++error; + else { + rpng2_info.display_exponent = atof(*argv); + if (rpng2_info.display_exponent <= 0.0) + ++error; + } + } else if (!strncmp(*argv, "-bgcolor", 4)) { + if (!*++argv) + ++error; + else { + bgstr = *argv; + if (strlen(bgstr) != 7 || bgstr[0] != '#') + ++error; + else { + have_bg = TRUE; + bg_image = FALSE; + } + } + } else if (!strncmp(*argv, "-bgpat", 4)) { + if (!*++argv) + ++error; + else { + pat = atoi(*argv); + if (pat >= 0 && pat < num_bgpat) { + bg_image = TRUE; + have_bg = FALSE; + } else + ++error; + } + } else if (!strncmp(*argv, "-usleep", 2)) { + if (!*++argv) + ++error; + else { + usleep_duration = (ulg)atol(*argv); + demo_timing = TRUE; + } + } else if (!strncmp(*argv, "-pause", 2)) { + pause_after_pass = TRUE; + } else if (!strncmp(*argv, "-timing", 2)) { + timing = TRUE; +#ifdef FEATURE_LOOP + } else if (!strncmp(*argv, "-loop", 2)) { + loop = TRUE; + if (!argv[1] || !is_number(argv[1])) + loop_interval = 2; + else { + ++argv; + loop_interval = atol(*argv); + if (loop_interval < 0) + loop_interval = 2; + else if (loop_interval > 100000) /* bit more than one day */ + loop_interval = 100000; + } +#endif + } else { + if (**argv != '-') { + filename = *argv; + if (argv[1]) /* shouldn't be any more args after filename */ + ++error; + } else + ++error; /* not expecting any other options */ + } + } + + if (!filename) + ++error; + + + /* print usage screen if any errors up to this point */ + + if (error) { + fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname); + readpng2_version_info(); + fprintf(stderr, "\n" + "Usage: "); + fprintf(stderr, + "%s [-display xdpy] [-gamma exp] [-bgcolor bg | -bgpat pat]\n" + " %*s [-usleep dur | -timing] [-pause]\n", + PROGNAME, (int)strlen(PROGNAME), " "); + fprintf(stderr, +#ifdef FEATURE_LOOP + " [-loop [sec]]" +#endif + " file.png\n\n"); + fprintf(stderr, + " xdpy\tname of the target X display (e.g., ``hostname:0'')\n" + " exp \ttransfer-function exponent (``gamma'') of the display\n" + "\t\t system in floating-point format (e.g., ``%.1f''); equal\n" + "\t\t to the product of the lookup-table exponent (varies)\n", + default_display_exponent); + fprintf(stderr, + "\t\t and the CRT exponent (usually 2.2); must be positive\n" + " bg \tdesired background color in 7-character hex RGB format\n" + "\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n" + "\t\t used with transparent images; overrides -bgpat\n" + " pat \tdesired background pattern number (0-%d); used with\n" + "\t\t transparent images; overrides -bgcolor\n", + num_bgpat-1); +#ifdef FEATURE_LOOP + fprintf(stderr, + " -loop\tloops through background images after initial display\n" + "\t\t is complete (depends on -bgpat)\n" + " sec \tseconds to display each background image (default = 2)\n"); +#endif + fprintf(stderr, + " dur \tduration in microseconds to wait after displaying each\n" + "\t\t row (for demo purposes)\n" + " -timing\tenables delay for every block read, to simulate modem\n" + "\t\t download of image (~36 Kbps)\n" + " -pause\tpauses after displaying each pass until mouse clicked\n" + "\nPress Q, Esc or mouse button 1 (within image window, after image\n" + "is displayed) to quit.\n"); + exit(1); + } + + if (!(infile = fopen(filename, "rb"))) { + fprintf(stderr, PROGNAME ": can't open PNG file [%s]\n", filename); + ++error; + } else { + incount = fread(inbuf, 1, INBUFSIZE, infile); + if (incount < 8 || !readpng2_check_sig(inbuf, 8)) { + fprintf(stderr, PROGNAME + ": [%s] is not a PNG file: incorrect signature\n", + filename); + ++error; + } else if ((rc = readpng2_init(&rpng2_info)) != 0) { + switch (rc) { + case 2: + fprintf(stderr, PROGNAME + ": [%s] has bad IHDR (libpng longjmp)\n", filename); + break; + case 4: + fprintf(stderr, PROGNAME ": insufficient memory\n"); + break; + default: + fprintf(stderr, PROGNAME + ": unknown readpng2_init() error\n"); + break; + } + ++error; + } else { + Trace((stderr, "about to call XOpenDisplay()\n")) + display = XOpenDisplay(displayname); + if (!display) { + readpng2_cleanup(&rpng2_info); + fprintf(stderr, PROGNAME ": can't open X display [%s]\n", + displayname? displayname : "default"); + ++error; + } + } + if (error) + fclose(infile); + } + + + if (error) { + fprintf(stderr, PROGNAME ": aborting.\n"); + exit(2); + } + + + /* set the title-bar string, but make sure buffer doesn't overflow */ + + alen = strlen(appname); + flen = strlen(filename); + if (alen + flen + 3 > 1023) + sprintf(titlebar, "%s: ...%s", appname, filename+(alen+flen+6-1023)); + else + sprintf(titlebar, "%s: %s", appname, filename); + + + /* set some final rpng2_info variables before entering main data loop */ + + if (have_bg) { + unsigned r, g, b; /* this approach quiets compiler warnings */ + + sscanf(bgstr+1, "%2x%2x%2x", &r, &g, &b); + rpng2_info.bg_red = (uch)r; + rpng2_info.bg_green = (uch)g; + rpng2_info.bg_blue = (uch)b; + } else + rpng2_info.need_bgcolor = TRUE; + + rpng2_info.state = kPreInit; + rpng2_info.mainprog_init = rpng2_x_init; + rpng2_info.mainprog_display_row = rpng2_x_display_row; + rpng2_info.mainprog_finish_display = rpng2_x_finish_display; + + + /* OK, this is the fun part: call readpng2_decode_data() at the start of + * the loop to deal with our first buffer of data (read in above to verify + * that the file is a PNG image), then loop through the file and continue + * calling the same routine to handle each chunk of data. It in turn + * passes the data to libpng, which will invoke one or more of our call- + * backs as decoded data become available. We optionally call sleep() for + * one second per iteration to simulate downloading the image via an analog + * modem. */ + + for (;;) { + Trace((stderr, "about to call readpng2_decode_data()\n")) + if (readpng2_decode_data(&rpng2_info, inbuf, incount)) + ++error; + Trace((stderr, "done with readpng2_decode_data()\n")) + + if (error || incount != INBUFSIZE || rpng2_info.state == kDone) { + if (rpng2_info.state == kDone) { + Trace((stderr, "done decoding PNG image\n")) + } else if (ferror(infile)) { + fprintf(stderr, PROGNAME + ": error while reading PNG image file\n"); + exit(3); + } else if (feof(infile)) { + fprintf(stderr, PROGNAME ": end of file reached " + "(unexpectedly) while reading PNG image file\n"); + exit(3); + } else /* if (error) */ { + /* will print error message below */ + } + break; + } + + if (timing) + sleep(1); + + incount = fread(inbuf, 1, INBUFSIZE, infile); + } + + + /* clean up PNG stuff and report any decoding errors */ + + fclose(infile); + Trace((stderr, "about to call readpng2_cleanup()\n")) + readpng2_cleanup(&rpng2_info); + + if (error) { + fprintf(stderr, PROGNAME ": libpng error while decoding PNG image\n"); + exit(3); + } + + +#ifdef FEATURE_LOOP + + if (loop && bg_image) { + Trace((stderr, "entering -loop loop (FEATURE_LOOP)\n")) + for (;;) { + int i, use_sleep; + struct timeval now, then; + + /* get current time and add loop_interval to get target time */ + if (gettimeofday(&then, NULL) == 0) { + then.tv_sec += loop_interval; + use_sleep = FALSE; + } else + use_sleep = TRUE; + + /* do quick check for a quit event but don't wait for it */ + /* GRR BUG: should also check for Expose events and redraw... */ + if (XCheckMaskEvent(display, KeyPressMask | ButtonPressMask, &e)) + if (QUIT(e,k)) + break; + + /* generate next background image */ + if (++pat >= num_bgpat) + pat = 0; + rpng2_x_reload_bg_image(); + + /* wait for timeout, using whatever means are available */ + if (use_sleep || gettimeofday(&now, NULL) != 0) { + for (i = loop_interval; i > 0; --i) { + sleep(1); + /* GRR BUG: also need to check for Expose (and redraw!) */ + if (XCheckMaskEvent(display, KeyPressMask | ButtonPressMask, + &e) && QUIT(e,k)) + break; + } + } else { + /* Y2038 BUG! */ + if (now.tv_sec < then.tv_sec || + (now.tv_sec == then.tv_sec && now.tv_usec < then.tv_usec)) + { + int quit = FALSE; + long seconds_to_go = then.tv_sec - now.tv_sec; + long usleep_usec; + + /* basically chew up most of remaining loop-interval with + * calls to sleep(1) interleaved with checks for quit + * events, but also recalc time-to-go periodically; when + * done, clean up any remaining time with usleep() call + * (could also use SIGALRM, but signals are a pain...) */ + while (seconds_to_go-- > 1) { + int seconds_done = 0; + + for (i = seconds_to_go; i > 0 && !quit; --i) { + sleep(1); + /* GRR BUG: need to check for Expose and redraw */ + if (XCheckMaskEvent(display, KeyPressMask | + ButtonPressMask, &e) && QUIT(e,k)) + quit = TRUE; + if (++seconds_done > 1000) + break; /* time to redo seconds_to_go meas. */ + } + if (quit) + break; + + /* OK, more than 1000 seconds since last check: + * correct the time-to-go measurement for drift */ + if (gettimeofday(&now, NULL) == 0) { + if (now.tv_sec >= then.tv_sec) + break; + seconds_to_go = then.tv_sec - now.tv_sec; + } else + ++seconds_to_go; /* restore what we subtracted */ + } + if (quit) + break; /* breaks outer do-loop, skips redisplay */ + + /* since difference between "now" and "then" is already + * eaten up to within a couple of seconds, don't need to + * worry about overflow--but might have overshot (neg.) */ + if (gettimeofday(&now, NULL) == 0) { + usleep_usec = 1000000L*(then.tv_sec - now.tv_sec) + + then.tv_usec - now.tv_usec; + if (usleep_usec > 0) + usleep((ulg)usleep_usec); + } + } + } + + /* composite image against new background and display (note that + * we do not take into account the time spent doing this...) */ + rpng2_x_redisplay_image (0, 0, rpng2_info.width, rpng2_info.height); + } + + } else /* FALL THROUGH and do the normal thing */ + +#endif /* FEATURE_LOOP */ + + /* wait for the user to tell us when to quit */ + + if (rpng2_info.state >= kWindowInit) { + Trace((stderr, "entering final wait-for-quit-event loop\n")) + do { + XNextEvent(display, &e); + if (e.type == Expose) { + XExposeEvent *ex = (XExposeEvent *)&e; + rpng2_x_redisplay_image (ex->x, ex->y, ex->width, ex->height); + } + } while (!QUIT(e,k)); + } else { + fprintf(stderr, PROGNAME ": init callback never called: probable " + "libpng error while decoding PNG metadata\n"); + exit(4); + } + + + /* we're done: clean up all image and X resources and go away */ + + Trace((stderr, "about to call rpng2_x_cleanup()\n")) + rpng2_x_cleanup(); + + (void)argc; /* Unused */ + + return 0; +} + + + + + +/* this function is called by readpng2_info_callback() in readpng2.c, which + * in turn is called by libpng after all of the pre-IDAT chunks have been + * read and processed--i.e., we now have enough info to finish initializing */ + +static void rpng2_x_init(void) +{ + ulg i; + ulg rowbytes = rpng2_info.rowbytes; + + Trace((stderr, "beginning rpng2_x_init()\n")) + Trace((stderr, " rowbytes = %d\n", rpng2_info.rowbytes)) + Trace((stderr, " width = %ld\n", rpng2_info.width)) + Trace((stderr, " height = %ld\n", rpng2_info.height)) + + /* Guard against integer overflow */ + if (rpng2_info.height > ((size_t)(-1))/rpng2_info.rowbytes) { + fprintf(stderr, PROGNAME ": image_data buffer would be too large\n"); + readpng2_cleanup(&rpng2_info); + return; + } + + rpng2_info.image_data = (uch *)malloc(rowbytes * rpng2_info.height); + if (!rpng2_info.image_data) { + readpng2_cleanup(&rpng2_info); + return; + } + + rpng2_info.row_pointers = (uch **)malloc(rpng2_info.height * sizeof(uch *)); + if (!rpng2_info.row_pointers) { + free(rpng2_info.image_data); + rpng2_info.image_data = NULL; + readpng2_cleanup(&rpng2_info); + return; + } + + for (i = 0; i < rpng2_info.height; ++i) + rpng2_info.row_pointers[i] = rpng2_info.image_data + i*rowbytes; + + + /* do the basic X initialization stuff, make the window, and fill it with + * the user-specified, file-specified or default background color or + * pattern */ + + if (rpng2_x_create_window()) { + + /* GRR TEMPORARY HACK: this is fundamentally no different from cases + * above; libpng should call our error handler to longjmp() back to us + * when png_ptr goes away. If we/it segfault instead, seems like a + * libpng bug... */ + + /* we're here via libpng callback, so if window fails, clean and bail */ + readpng2_cleanup(&rpng2_info); + rpng2_x_cleanup(); + exit(2); + } + + rpng2_info.state = kWindowInit; +} + + + + + +static int rpng2_x_create_window(void) +{ + ulg bg_red = rpng2_info.bg_red; + ulg bg_green = rpng2_info.bg_green; + ulg bg_blue = rpng2_info.bg_blue; + ulg bg_pixel = 0L; + ulg attrmask; + int need_colormap = FALSE; + int screen, pad; + uch *xdata; + Window root; + XEvent e; + XGCValues gcvalues; + XSetWindowAttributes attr; + XTextProperty windowName, *pWindowName = &windowName; + XTextProperty iconName, *pIconName = &iconName; + XVisualInfo visual_info; + XSizeHints *size_hints; + XWMHints *wm_hints; + XClassHint *class_hints; + + + Trace((stderr, "beginning rpng2_x_create_window()\n")) + + screen = DefaultScreen(display); + depth = DisplayPlanes(display, screen); + root = RootWindow(display, screen); + +#ifdef DEBUG + XSynchronize(display, True); +#endif + + if (depth != 16 && depth != 24 && depth != 32) { + int visuals_matched = 0; + + Trace((stderr, "default depth is %d: checking other visuals\n", + depth)) + + /* 24-bit first */ + visual_info.screen = screen; + visual_info.depth = 24; + visual_list = XGetVisualInfo(display, + VisualScreenMask | VisualDepthMask, &visual_info, &visuals_matched); + if (visuals_matched == 0) { +/* GRR: add 15-, 16- and 32-bit TrueColor visuals (also DirectColor?) */ + fprintf(stderr, "default screen depth %d not supported, and no" + " 24-bit visuals found\n", depth); + return 2; + } + Trace((stderr, "XGetVisualInfo() returned %d 24-bit visuals\n", + visuals_matched)) + visual = visual_list[0].visual; + depth = visual_list[0].depth; +/* + colormap_size = visual_list[0].colormap_size; + visual_class = visual->class; + visualID = XVisualIDFromVisual(visual); + */ + have_nondefault_visual = TRUE; + need_colormap = TRUE; + } else { + XMatchVisualInfo(display, screen, depth, TrueColor, &visual_info); + visual = visual_info.visual; + } + + RMask = visual->red_mask; + GMask = visual->green_mask; + BMask = visual->blue_mask; + +/* GRR: add/check 8-bit support */ + if (depth == 8 || need_colormap) { + colormap = XCreateColormap(display, root, visual, AllocNone); + if (!colormap) { + fprintf(stderr, "XCreateColormap() failed\n"); + return 2; + } + have_colormap = TRUE; + if (depth == 8) + bg_image = FALSE; /* gradient just wastes palette entries */ + } + if (depth == 15 || depth == 16) { + RShift = 15 - rpng2_x_msb(RMask); /* these are right-shifts */ + GShift = 15 - rpng2_x_msb(GMask); + BShift = 15 - rpng2_x_msb(BMask); + } else if (depth > 16) { + RShift = rpng2_x_msb(RMask) - 7; /* these are left-shifts */ + GShift = rpng2_x_msb(GMask) - 7; + BShift = rpng2_x_msb(BMask) - 7; + } + if (depth >= 15 && (RShift < 0 || GShift < 0 || BShift < 0)) { + fprintf(stderr, "rpng2 internal logic error: negative X shift(s)!\n"); + return 2; + } + +/*--------------------------------------------------------------------------- + Finally, create the window. + ---------------------------------------------------------------------------*/ + + attr.backing_store = Always; + attr.event_mask = ExposureMask | KeyPressMask | ButtonPressMask; + attrmask = CWBackingStore | CWEventMask; + if (have_nondefault_visual) { + attr.colormap = colormap; + attr.background_pixel = 0; + attr.border_pixel = 1; + attrmask |= CWColormap | CWBackPixel | CWBorderPixel; + } + + window = XCreateWindow(display, root, 0, 0, rpng2_info.width, + rpng2_info.height, 0, depth, InputOutput, visual, attrmask, &attr); + + if (window == None) { + fprintf(stderr, "XCreateWindow() failed\n"); + return 2; + } else + have_window = TRUE; + + if (depth == 8) + XSetWindowColormap(display, window, colormap); + + if (!XStringListToTextProperty(&window_name, 1, pWindowName)) + pWindowName = NULL; + if (!XStringListToTextProperty(&icon_name, 1, pIconName)) + pIconName = NULL; + + /* OK if either hints allocation fails; XSetWMProperties() allows NULLs */ + + if ((size_hints = XAllocSizeHints()) != NULL) { + /* window will not be resizable */ + size_hints->flags = PMinSize | PMaxSize; + size_hints->min_width = size_hints->max_width = (int)rpng2_info.width; + size_hints->min_height = size_hints->max_height = + (int)rpng2_info.height; + } + + if ((wm_hints = XAllocWMHints()) != NULL) { + wm_hints->initial_state = NormalState; + wm_hints->input = True; + /* wm_hints->icon_pixmap = icon_pixmap; */ + wm_hints->flags = StateHint | InputHint /* | IconPixmapHint */ ; + } + + if ((class_hints = XAllocClassHint()) != NULL) { + class_hints->res_name = res_name; + class_hints->res_class = res_class; + } + + XSetWMProperties(display, window, pWindowName, pIconName, NULL, 0, + size_hints, wm_hints, class_hints); + + /* various properties and hints no longer needed; free memory */ + if (pWindowName) + XFree(pWindowName->value); + if (pIconName) + XFree(pIconName->value); + if (size_hints) + XFree(size_hints); + if (wm_hints) + XFree(wm_hints); + if (class_hints) + XFree(class_hints); + + XMapWindow(display, window); + + gc = XCreateGC(display, window, 0, &gcvalues); + have_gc = TRUE; + +/*--------------------------------------------------------------------------- + Allocate memory for the X- and display-specific version of the image. + ---------------------------------------------------------------------------*/ + + if (depth == 24 || depth == 32) { + xdata = (uch *)malloc(4*rpng2_info.width*rpng2_info.height); + pad = 32; + } else if (depth == 16) { + xdata = (uch *)malloc(2*rpng2_info.width*rpng2_info.height); + pad = 16; + } else /* depth == 8 */ { + xdata = (uch *)malloc(rpng2_info.width*rpng2_info.height); + pad = 8; + } + + if (!xdata) { + fprintf(stderr, PROGNAME ": unable to allocate image memory\n"); + return 4; + } + + ximage = XCreateImage(display, visual, depth, ZPixmap, 0, + (char *)xdata, rpng2_info.width, rpng2_info.height, pad, 0); + + if (!ximage) { + fprintf(stderr, PROGNAME ": XCreateImage() failed\n"); + free(xdata); + return 3; + } + + /* to avoid testing the byte order every pixel (or doubling the size of + * the drawing routine with a giant if-test), we arbitrarily set the byte + * order to MSBFirst and let Xlib worry about inverting things on little- + * endian machines (e.g., Linux/x86, old VAXen, etc.)--this is not the + * most efficient approach (the giant if-test would be better), but in + * the interest of clarity, we'll take the easy way out... */ + + ximage->byte_order = MSBFirst; + +/*--------------------------------------------------------------------------- + Fill window with the specified background color (default is black) or + faked "background image" (but latter is disabled if 8-bit; gradients + just waste palette entries). + ---------------------------------------------------------------------------*/ + + if (bg_image) + rpng2_x_load_bg_image(); /* resets bg_image if fails */ + + if (!bg_image) { + if (depth == 24 || depth == 32) { + bg_pixel = (bg_red << RShift) | + (bg_green << GShift) | + (bg_blue << BShift); + } else if (depth == 16) { + bg_pixel = (((bg_red << 8) >> RShift) & RMask) | + (((bg_green << 8) >> GShift) & GMask) | + (((bg_blue << 8) >> BShift) & BMask); + } else /* depth == 8 */ { + + /* GRR: add 8-bit support */ + + } + XSetForeground(display, gc, bg_pixel); + XFillRectangle(display, window, gc, 0, 0, rpng2_info.width, + rpng2_info.height); + } + +/*--------------------------------------------------------------------------- + Wait for first Expose event to do any drawing, then flush and return. + ---------------------------------------------------------------------------*/ + + do + XNextEvent(display, &e); + while (e.type != Expose || e.xexpose.count); + + XFlush(display); + + return 0; + +} /* end function rpng2_x_create_window() */ + + + + + +static int rpng2_x_load_bg_image(void) +{ + uch *src; + char *dest; + uch r1, r2, g1, g2, b1, b2; + uch r1_inv, r2_inv, g1_inv, g2_inv, b1_inv, b2_inv; + int k, hmax, max; + int xidx, yidx, yidx_max; + int even_odd_vert, even_odd_horiz, even_odd; + int invert_gradient2 = (bg[pat].type & 0x08); + int invert_column; + int ximage_rowbytes = ximage->bytes_per_line; + ulg i, row; + ulg pixel; + +/*--------------------------------------------------------------------------- + Allocate buffer for fake background image to be used with transparent + images; if this fails, revert to plain background color. + ---------------------------------------------------------------------------*/ + + bg_rowbytes = 3 * rpng2_info.width; + bg_data = (uch *)malloc(bg_rowbytes * rpng2_info.height); + if (!bg_data) { + fprintf(stderr, PROGNAME + ": unable to allocate memory for background image\n"); + bg_image = 0; + return 1; + } + + bgscale = (pat == 0)? 8 : bgscale_default; + yidx_max = bgscale - 1; + +/*--------------------------------------------------------------------------- + Vertical gradients (ramps) in NxN squares, alternating direction and + colors (N == bgscale). + ---------------------------------------------------------------------------*/ + + if ((bg[pat].type & 0x07) == 0) { + uch r1_min = rgb[bg[pat].rgb1_min].r; + uch g1_min = rgb[bg[pat].rgb1_min].g; + uch b1_min = rgb[bg[pat].rgb1_min].b; + uch r2_min = rgb[bg[pat].rgb2_min].r; + uch g2_min = rgb[bg[pat].rgb2_min].g; + uch b2_min = rgb[bg[pat].rgb2_min].b; + int r1_diff = rgb[bg[pat].rgb1_max].r - r1_min; + int g1_diff = rgb[bg[pat].rgb1_max].g - g1_min; + int b1_diff = rgb[bg[pat].rgb1_max].b - b1_min; + int r2_diff = rgb[bg[pat].rgb2_max].r - r2_min; + int g2_diff = rgb[bg[pat].rgb2_max].g - g2_min; + int b2_diff = rgb[bg[pat].rgb2_max].b - b2_min; + + for (row = 0; row < rpng2_info.height; ++row) { + yidx = (int)(row % bgscale); + even_odd_vert = (int)((row / bgscale) & 1); + + r1 = r1_min + (r1_diff * yidx) / yidx_max; + g1 = g1_min + (g1_diff * yidx) / yidx_max; + b1 = b1_min + (b1_diff * yidx) / yidx_max; + r1_inv = r1_min + (r1_diff * (yidx_max-yidx)) / yidx_max; + g1_inv = g1_min + (g1_diff * (yidx_max-yidx)) / yidx_max; + b1_inv = b1_min + (b1_diff * (yidx_max-yidx)) / yidx_max; + + r2 = r2_min + (r2_diff * yidx) / yidx_max; + g2 = g2_min + (g2_diff * yidx) / yidx_max; + b2 = b2_min + (b2_diff * yidx) / yidx_max; + r2_inv = r2_min + (r2_diff * (yidx_max-yidx)) / yidx_max; + g2_inv = g2_min + (g2_diff * (yidx_max-yidx)) / yidx_max; + b2_inv = b2_min + (b2_diff * (yidx_max-yidx)) / yidx_max; + + dest = (char *)bg_data + row*bg_rowbytes; + for (i = 0; i < rpng2_info.width; ++i) { + even_odd_horiz = (int)((i / bgscale) & 1); + even_odd = even_odd_vert ^ even_odd_horiz; + invert_column = + (even_odd_horiz && (bg[pat].type & 0x10)); + if (even_odd == 0) { /* gradient #1 */ + if (invert_column) { + *dest++ = r1_inv; + *dest++ = g1_inv; + *dest++ = b1_inv; + } else { + *dest++ = r1; + *dest++ = g1; + *dest++ = b1; + } + } else { /* gradient #2 */ + if ((invert_column && invert_gradient2) || + (!invert_column && !invert_gradient2)) + { + *dest++ = r2; /* not inverted or */ + *dest++ = g2; /* doubly inverted */ + *dest++ = b2; + } else { + *dest++ = r2_inv; + *dest++ = g2_inv; /* singly inverted */ + *dest++ = b2_inv; + } + } + } + } + +/*--------------------------------------------------------------------------- + Soft gradient-diamonds with scale = bgscale. Code contributed by Adam + M. Costello. + ---------------------------------------------------------------------------*/ + + } else if ((bg[pat].type & 0x07) == 1) { + + hmax = (bgscale-1)/2; /* half the max weight of a color */ + max = 2*hmax; /* the max weight of a color */ + + r1 = rgb[bg[pat].rgb1_max].r; + g1 = rgb[bg[pat].rgb1_max].g; + b1 = rgb[bg[pat].rgb1_max].b; + r2 = rgb[bg[pat].rgb2_max].r; + g2 = rgb[bg[pat].rgb2_max].g; + b2 = rgb[bg[pat].rgb2_max].b; + + for (row = 0; row < rpng2_info.height; ++row) { + yidx = (int)(row % bgscale); + if (yidx > hmax) + yidx = bgscale-1 - yidx; + dest = (char *)bg_data + row*bg_rowbytes; + for (i = 0; i < rpng2_info.width; ++i) { + xidx = (int)(i % bgscale); + if (xidx > hmax) + xidx = bgscale-1 - xidx; + k = xidx + yidx; + *dest++ = (k*r1 + (max-k)*r2) / max; + *dest++ = (k*g1 + (max-k)*g2) / max; + *dest++ = (k*b1 + (max-k)*b2) / max; + } + } + +/*--------------------------------------------------------------------------- + Radial "starburst" with azimuthal sinusoids; [eventually number of sinu- + soids will equal bgscale?]. This one is slow but very cool. Code con- + tributed by Pieter S. van der Meulen (originally in Smalltalk). + ---------------------------------------------------------------------------*/ + + } else if ((bg[pat].type & 0x07) == 2) { + uch ch; + int ii, x, y, hw, hh, grayspot; + double freq, rotate, saturate, gray, intensity; + double angle=0.0, aoffset=0.0, maxDist, dist; + double red=0.0, green=0.0, blue=0.0, hue, s, v, f, p, q, t; + + fprintf(stderr, "%s: computing radial background...", + PROGNAME); + fflush(stderr); + + hh = (int)(rpng2_info.height / 2); + hw = (int)(rpng2_info.width / 2); + + /* variables for radial waves: + * aoffset: number of degrees to rotate hue [CURRENTLY NOT USED] + * freq: number of color beams originating from the center + * grayspot: size of the graying center area (anti-alias) + * rotate: rotation of the beams as a function of radius + * saturate: saturation of beams' shape azimuthally + */ + angle = CLIP(angle, 0.0, 360.0); + grayspot = CLIP(bg[pat].bg_gray, 1, (hh + hw)); + freq = MAX((double)bg[pat].bg_freq, 0.0); + saturate = (double)bg[pat].bg_bsat * 0.1; + rotate = (double)bg[pat].bg_brot * 0.1; + gray = 0.0; + intensity = 0.0; + maxDist = (double)((hw*hw) + (hh*hh)); + + for (row = 0; row < rpng2_info.height; ++row) { + y = (int)(row - hh); + dest = (char *)bg_data + row*bg_rowbytes; + for (i = 0; i < rpng2_info.width; ++i) { + x = (int)(i - hw); + angle = (x == 0)? PI_2 : atan((double)y / (double)x); + gray = (double)MAX(ABS(y), ABS(x)) / grayspot; + gray = MIN(1.0, gray); + dist = (double)((x*x) + (y*y)) / maxDist; + intensity = cos((angle+(rotate*dist*PI)) * freq) * + gray * saturate; + intensity = (MAX(MIN(intensity,1.0),-1.0) + 1.0) * 0.5; + hue = (angle + PI) * INV_PI_360 + aoffset; + s = gray * ((double)(ABS(x)+ABS(y)) / (double)(hw + hh)); + s = MIN(MAX(s,0.0), 1.0); + v = MIN(MAX(intensity,0.0), 1.0); + + if (s == 0.0) { + ch = (uch)(v * 255.0); + *dest++ = ch; + *dest++ = ch; + *dest++ = ch; + } else { + if ((hue < 0.0) || (hue >= 360.0)) + hue -= (((int)(hue / 360.0)) * 360.0); + hue /= 60.0; + ii = (int)hue; + f = hue - (double)ii; + p = (1.0 - s) * v; + q = (1.0 - (s * f)) * v; + t = (1.0 - (s * (1.0 - f))) * v; + if (ii == 0) { red = v; green = t; blue = p; } + else if (ii == 1) { red = q; green = v; blue = p; } + else if (ii == 2) { red = p; green = v; blue = t; } + else if (ii == 3) { red = p; green = q; blue = v; } + else if (ii == 4) { red = t; green = p; blue = v; } + else if (ii == 5) { red = v; green = p; blue = q; } + *dest++ = (uch)(red * 255.0); + *dest++ = (uch)(green * 255.0); + *dest++ = (uch)(blue * 255.0); + } + } + } + fprintf(stderr, "done.\n"); + fflush(stderr); + } + +/*--------------------------------------------------------------------------- + Blast background image to display buffer before beginning PNG decode. + ---------------------------------------------------------------------------*/ + + if (depth == 24 || depth == 32) { + ulg red, green, blue; + int bpp = ximage->bits_per_pixel; + + for (row = 0; row < rpng2_info.height; ++row) { + src = bg_data + row*bg_rowbytes; + dest = ximage->data + row*ximage_rowbytes; + if (bpp == 32) { /* slightly optimized version */ + for (i = rpng2_info.width; i > 0; --i) { + red = *src++; + green = *src++; + blue = *src++; + pixel = (red << RShift) | + (green << GShift) | + (blue << BShift); + /* recall that we set ximage->byte_order = MSBFirst above */ + *dest++ = (char)((pixel >> 24) & 0xff); + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } + } else { + for (i = rpng2_info.width; i > 0; --i) { + red = *src++; + green = *src++; + blue = *src++; + pixel = (red << RShift) | + (green << GShift) | + (blue << BShift); + /* recall that we set ximage->byte_order = MSBFirst above */ + /* GRR BUG? this assumes bpp == 24 & bits are packed low */ + /* (probably need to use RShift, RMask, etc.) */ + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } + } + } + + } else if (depth == 16) { + ush red, green, blue; + + for (row = 0; row < rpng2_info.height; ++row) { + src = bg_data + row*bg_rowbytes; + dest = ximage->data + row*ximage_rowbytes; + for (i = rpng2_info.width; i > 0; --i) { + red = ((ush)(*src) << 8); ++src; + green = ((ush)(*src) << 8); ++src; + blue = ((ush)(*src) << 8); ++src; + pixel = ((red >> RShift) & RMask) | + ((green >> GShift) & GMask) | + ((blue >> BShift) & BMask); + /* recall that we set ximage->byte_order = MSBFirst above */ + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } + } + + } else /* depth == 8 */ { + + /* GRR: add 8-bit support */ + + } + + XPutImage(display, window, gc, ximage, 0, 0, 0, 0, rpng2_info.width, + rpng2_info.height); + + return 0; + +} /* end function rpng2_x_load_bg_image() */ + + + + + +static void rpng2_x_display_row(ulg row) +{ + uch bg_red = rpng2_info.bg_red; + uch bg_green = rpng2_info.bg_green; + uch bg_blue = rpng2_info.bg_blue; + uch *src, *src2=NULL; + char *dest; + uch r, g, b, a; + int ximage_rowbytes = ximage->bytes_per_line; + ulg i, pixel; + static int rows=0, prevpass=(-1); + static ulg firstrow; + +/*--------------------------------------------------------------------------- + rows and firstrow simply track how many rows (and which ones) have not + yet been displayed; alternatively, we could call XPutImage() for every + row and not bother with the records-keeping. + ---------------------------------------------------------------------------*/ + + Trace((stderr, "beginning rpng2_x_display_row()\n")) + + if (rpng2_info.pass != prevpass) { + if (pause_after_pass && rpng2_info.pass > 0) { + XEvent e; + KeySym k; + + fprintf(stderr, + "%s: end of pass %d of 7; click in image window to continue\n", + PROGNAME, prevpass + 1); + do + XNextEvent(display, &e); + while (!QUIT(e,k)); + } + fprintf(stderr, "%s: pass %d of 7\r", PROGNAME, rpng2_info.pass + 1); + fflush(stderr); + prevpass = rpng2_info.pass; + } + + if (rows == 0) + firstrow = row; /* first row that is not yet displayed */ + + ++rows; /* count of rows received but not yet displayed */ + +/*--------------------------------------------------------------------------- + Aside from the use of the rpng2_info struct, the lack of an outer loop + (over rows) and moving the XPutImage() call outside the "if (depth)" + tests, this routine is identical to rpng_x_display_image() in the non- + progressive version of the program. + ---------------------------------------------------------------------------*/ + + if (depth == 24 || depth == 32) { + ulg red, green, blue; + int bpp = ximage->bits_per_pixel; + + src = rpng2_info.image_data + row*rpng2_info.rowbytes; + if (bg_image) + src2 = bg_data + row*bg_rowbytes; + dest = ximage->data + row*ximage_rowbytes; + if (rpng2_info.channels == 3) { + for (i = rpng2_info.width; i > 0; --i) { + red = *src++; + green = *src++; + blue = *src++; + pixel = (red << RShift) | + (green << GShift) | + (blue << BShift); + /* recall that we set ximage->byte_order = MSBFirst above */ + if (bpp == 32) { + *dest++ = (char)((pixel >> 24) & 0xff); + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } else { + /* GRR BUG? this assumes bpp == 24 & bits are packed low */ + /* (probably need to use RShift, RMask, etc.) */ + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } + } + } else /* if (rpng2_info.channels == 4) */ { + for (i = rpng2_info.width; i > 0; --i) { + r = *src++; + g = *src++; + b = *src++; + a = *src++; + if (bg_image) { + bg_red = *src2++; + bg_green = *src2++; + bg_blue = *src2++; + } + if (a == 255) { + red = r; + green = g; + blue = b; + } else if (a == 0) { + red = bg_red; + green = bg_green; + blue = bg_blue; + } else { + /* this macro (from png.h) composites the foreground + * and background values and puts the result into the + * first argument */ + alpha_composite(red, r, a, bg_red); + alpha_composite(green, g, a, bg_green); + alpha_composite(blue, b, a, bg_blue); + } + pixel = (red << RShift) | + (green << GShift) | + (blue << BShift); + /* recall that we set ximage->byte_order = MSBFirst above */ + if (bpp == 32) { + *dest++ = (char)((pixel >> 24) & 0xff); + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } else { + /* GRR BUG? this assumes bpp == 24 & bits are packed low */ + /* (probably need to use RShift, RMask, etc.) */ + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } + } + } + + } else if (depth == 16) { + ush red, green, blue; + + src = rpng2_info.row_pointers[row]; + if (bg_image) + src2 = bg_data + row*bg_rowbytes; + dest = ximage->data + row*ximage_rowbytes; + if (rpng2_info.channels == 3) { + for (i = rpng2_info.width; i > 0; --i) { + red = ((ush)(*src) << 8); + ++src; + green = ((ush)(*src) << 8); + ++src; + blue = ((ush)(*src) << 8); + ++src; + pixel = ((red >> RShift) & RMask) | + ((green >> GShift) & GMask) | + ((blue >> BShift) & BMask); + /* recall that we set ximage->byte_order = MSBFirst above */ + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } + } else /* if (rpng2_info.channels == 4) */ { + for (i = rpng2_info.width; i > 0; --i) { + r = *src++; + g = *src++; + b = *src++; + a = *src++; + if (bg_image) { + bg_red = *src2++; + bg_green = *src2++; + bg_blue = *src2++; + } + if (a == 255) { + red = ((ush)r << 8); + green = ((ush)g << 8); + blue = ((ush)b << 8); + } else if (a == 0) { + red = ((ush)bg_red << 8); + green = ((ush)bg_green << 8); + blue = ((ush)bg_blue << 8); + } else { + /* this macro (from png.h) composites the foreground + * and background values and puts the result back into + * the first argument (== fg byte here: safe) */ + alpha_composite(r, r, a, bg_red); + alpha_composite(g, g, a, bg_green); + alpha_composite(b, b, a, bg_blue); + red = ((ush)r << 8); + green = ((ush)g << 8); + blue = ((ush)b << 8); + } + pixel = ((red >> RShift) & RMask) | + ((green >> GShift) & GMask) | + ((blue >> BShift) & BMask); + /* recall that we set ximage->byte_order = MSBFirst above */ + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } + } + + } else /* depth == 8 */ { + + /* GRR: add 8-bit support */ + + } + + +/*--------------------------------------------------------------------------- + Display after every 16 rows or when on one of last two rows. (Region + may include previously displayed lines due to interlacing--i.e., not + contiguous. Also, second-to-last row is final one in interlaced images + with odd number of rows.) For demos, flush (and delay) after every 16th + row so "sparse" passes don't go twice as fast. + ---------------------------------------------------------------------------*/ + + if (demo_timing && (row - firstrow >= 16 || row >= rpng2_info.height-2)) { + XPutImage(display, window, gc, ximage, 0, (int)firstrow, 0, + (int)firstrow, rpng2_info.width, row - firstrow + 1); + XFlush(display); + rows = 0; + usleep(usleep_duration); + } else + if (!demo_timing && ((rows & 0xf) == 0 || row >= rpng2_info.height-2)) { + XPutImage(display, window, gc, ximage, 0, (int)firstrow, 0, + (int)firstrow, rpng2_info.width, row - firstrow + 1); + XFlush(display); + rows = 0; + } + +} + + + + + +static void rpng2_x_finish_display(void) +{ + Trace((stderr, "beginning rpng2_x_finish_display()\n")) + + /* last row has already been displayed by rpng2_x_display_row(), so we + * have nothing to do here except set a flag and let the user know that + * the image is done */ + + rpng2_info.state = kDone; + printf( + "Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n"); + fflush(stdout); +} + + + + + +static void rpng2_x_redisplay_image(ulg startcol, ulg startrow, + ulg width, ulg height) +{ + uch bg_red = rpng2_info.bg_red; + uch bg_green = rpng2_info.bg_green; + uch bg_blue = rpng2_info.bg_blue; + uch *src, *src2=NULL; + char *dest; + uch r, g, b, a; + ulg i, row, lastrow = 0; + ulg pixel; + int ximage_rowbytes = ximage->bytes_per_line; + + + Trace((stderr, "beginning display loop (image_channels == %d)\n", + rpng2_info.channels)) + Trace((stderr, " (width = %ld, rowbytes = %d, ximage_rowbytes = %d)\n", + rpng2_info.width, rpng2_info.rowbytes, ximage_rowbytes)) + Trace((stderr, " (bpp = %d)\n", ximage->bits_per_pixel)) + Trace((stderr, " (byte_order = %s)\n", ximage->byte_order == MSBFirst? + "MSBFirst" : (ximage->byte_order == LSBFirst? "LSBFirst" : "unknown"))) + +/*--------------------------------------------------------------------------- + Aside from the use of the rpng2_info struct and of src2 (for background + image), this routine is identical to rpng_x_display_image() in the non- + progressive version of the program--for the simple reason that redisplay + of the image against a new background happens after the image is fully + decoded and therefore is, by definition, non-progressive. + ---------------------------------------------------------------------------*/ + + if (depth == 24 || depth == 32) { + ulg red, green, blue; + int bpp = ximage->bits_per_pixel; + + for (lastrow = row = startrow; row < startrow+height; ++row) { + src = rpng2_info.image_data + row*rpng2_info.rowbytes; + if (bg_image) + src2 = bg_data + row*bg_rowbytes; + dest = ximage->data + row*ximage_rowbytes; + if (rpng2_info.channels == 3) { + for (i = rpng2_info.width; i > 0; --i) { + red = *src++; + green = *src++; + blue = *src++; +#ifdef NO_24BIT_MASKS + pixel = (red << RShift) | + (green << GShift) | + (blue << BShift); + /* recall that we set ximage->byte_order = MSBFirst above */ + if (bpp == 32) { + *dest++ = (char)((pixel >> 24) & 0xff); + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } else { + /* this assumes bpp == 24 & bits are packed low */ + /* (probably need to use RShift, RMask, etc.) */ + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } +#else + red = (RShift < 0)? red << (-RShift) : red >> RShift; + green = (GShift < 0)? green << (-GShift) : green >> GShift; + blue = (BShift < 0)? blue << (-BShift) : blue >> BShift; + pixel = (red & RMask) | (green & GMask) | (blue & BMask); + /* recall that we set ximage->byte_order = MSBFirst above */ + if (bpp == 32) { + *dest++ = (char)((pixel >> 24) & 0xff); + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } else { + /* GRR BUG */ + /* this assumes bpp == 24 & bits are packed low */ + /* (probably need to use RShift/RMask/etc. here, too) */ + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } +#endif + } + + } else /* if (rpng2_info.channels == 4) */ { + for (i = rpng2_info.width; i > 0; --i) { + r = *src++; + g = *src++; + b = *src++; + a = *src++; + if (bg_image) { + bg_red = *src2++; + bg_green = *src2++; + bg_blue = *src2++; + } + if (a == 255) { + red = r; + green = g; + blue = b; + } else if (a == 0) { + red = bg_red; + green = bg_green; + blue = bg_blue; + } else { + /* this macro (from png.h) composites the foreground + * and background values and puts the result into the + * first argument */ + alpha_composite(red, r, a, bg_red); + alpha_composite(green, g, a, bg_green); + alpha_composite(blue, b, a, bg_blue); + } +#ifdef NO_24BIT_MASKS + pixel = (red << RShift) | + (green << GShift) | + (blue << BShift); + /* recall that we set ximage->byte_order = MSBFirst above */ + if (bpp == 32) { + *dest++ = (char)((pixel >> 24) & 0xff); + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } else { + /* this assumes bpp == 24 & bits are packed low */ + /* (probably need to use RShift, RMask, etc.) */ + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } +#else + red = (RShift < 0)? red << (-RShift) : red >> RShift; + green = (GShift < 0)? green << (-GShift) : green >> GShift; + blue = (BShift < 0)? blue << (-BShift) : blue >> BShift; + pixel = (red & RMask) | (green & GMask) | (blue & BMask); + /* recall that we set ximage->byte_order = MSBFirst above */ + if (bpp == 32) { + *dest++ = (char)((pixel >> 24) & 0xff); + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } else { + /* GRR BUG */ + /* this assumes bpp == 24 & bits are packed low */ + /* (probably need to use RShift/RMask/etc. here, too) */ + *dest++ = (char)((pixel >> 16) & 0xff); + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } +#endif + } + } + /* display after every 16 lines */ + if (((row+1) & 0xf) == 0) { + XPutImage(display, window, gc, ximage, 0, (int)lastrow, 0, + (int)lastrow, rpng2_info.width, 16); + XFlush(display); + lastrow = row + 1; + } + } + + } else if (depth == 16) { + ush red, green, blue; + + for (lastrow = row = startrow; row < startrow+height; ++row) { + src = rpng2_info.row_pointers[row]; + if (bg_image) + src2 = bg_data + row*bg_rowbytes; + dest = ximage->data + row*ximage_rowbytes; + if (rpng2_info.channels == 3) { + for (i = rpng2_info.width; i > 0; --i) { + red = ((ush)(*src) << 8); + ++src; + green = ((ush)(*src) << 8); + ++src; + blue = ((ush)(*src) << 8); + ++src; + pixel = ((red >> RShift) & RMask) | + ((green >> GShift) & GMask) | + ((blue >> BShift) & BMask); + /* recall that we set ximage->byte_order = MSBFirst above */ + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } + } else /* if (rpng2_info.channels == 4) */ { + for (i = rpng2_info.width; i > 0; --i) { + r = *src++; + g = *src++; + b = *src++; + a = *src++; + if (bg_image) { + bg_red = *src2++; + bg_green = *src2++; + bg_blue = *src2++; + } + if (a == 255) { + red = ((ush)r << 8); + green = ((ush)g << 8); + blue = ((ush)b << 8); + } else if (a == 0) { + red = ((ush)bg_red << 8); + green = ((ush)bg_green << 8); + blue = ((ush)bg_blue << 8); + } else { + /* this macro (from png.h) composites the foreground + * and background values and puts the result back into + * the first argument (== fg byte here: safe) */ + alpha_composite(r, r, a, bg_red); + alpha_composite(g, g, a, bg_green); + alpha_composite(b, b, a, bg_blue); + red = ((ush)r << 8); + green = ((ush)g << 8); + blue = ((ush)b << 8); + } + pixel = ((red >> RShift) & RMask) | + ((green >> GShift) & GMask) | + ((blue >> BShift) & BMask); + /* recall that we set ximage->byte_order = MSBFirst above */ + *dest++ = (char)((pixel >> 8) & 0xff); + *dest++ = (char)( pixel & 0xff); + } + } + /* display after every 16 lines */ + if (((row+1) & 0xf) == 0) { + XPutImage(display, window, gc, ximage, 0, (int)lastrow, 0, + (int)lastrow, rpng2_info.width, 16); + XFlush(display); + lastrow = row + 1; + } + } + + } else /* depth == 8 */ { + + /* GRR: add 8-bit support */ + + } + + Trace((stderr, "calling final XPutImage()\n")) + if (lastrow < startrow+height) { + XPutImage(display, window, gc, ximage, 0, (int)lastrow, 0, + (int)lastrow, rpng2_info.width, rpng2_info.height-lastrow); + XFlush(display); + } + + (void)startcol; + (void)width; + +} /* end function rpng2_x_redisplay_image() */ + + + + + +#ifdef FEATURE_LOOP + +static void rpng2_x_reload_bg_image(void) +{ + char *dest; + uch r1, r2, g1, g2, b1, b2; + uch r1_inv, r2_inv, g1_inv, g2_inv, b1_inv, b2_inv; + int k, hmax, max; + int xidx, yidx, yidx_max; + int even_odd_vert, even_odd_horiz, even_odd; + int invert_gradient2 = (bg[pat].type & 0x08); + int invert_column; + ulg i, row; + + + bgscale = (pat == 0)? 8 : bgscale_default; + yidx_max = bgscale - 1; + +/*--------------------------------------------------------------------------- + Vertical gradients (ramps) in NxN squares, alternating direction and + colors (N == bgscale). + ---------------------------------------------------------------------------*/ + + if ((bg[pat].type & 0x07) == 0) { + uch r1_min = rgb[bg[pat].rgb1_min].r; + uch g1_min = rgb[bg[pat].rgb1_min].g; + uch b1_min = rgb[bg[pat].rgb1_min].b; + uch r2_min = rgb[bg[pat].rgb2_min].r; + uch g2_min = rgb[bg[pat].rgb2_min].g; + uch b2_min = rgb[bg[pat].rgb2_min].b; + int r1_diff = rgb[bg[pat].rgb1_max].r - r1_min; + int g1_diff = rgb[bg[pat].rgb1_max].g - g1_min; + int b1_diff = rgb[bg[pat].rgb1_max].b - b1_min; + int r2_diff = rgb[bg[pat].rgb2_max].r - r2_min; + int g2_diff = rgb[bg[pat].rgb2_max].g - g2_min; + int b2_diff = rgb[bg[pat].rgb2_max].b - b2_min; + + for (row = 0; row < rpng2_info.height; ++row) { + yidx = (int)(row % bgscale); + even_odd_vert = (int)((row / bgscale) & 1); + + r1 = r1_min + (r1_diff * yidx) / yidx_max; + g1 = g1_min + (g1_diff * yidx) / yidx_max; + b1 = b1_min + (b1_diff * yidx) / yidx_max; + r1_inv = r1_min + (r1_diff * (yidx_max-yidx)) / yidx_max; + g1_inv = g1_min + (g1_diff * (yidx_max-yidx)) / yidx_max; + b1_inv = b1_min + (b1_diff * (yidx_max-yidx)) / yidx_max; + + r2 = r2_min + (r2_diff * yidx) / yidx_max; + g2 = g2_min + (g2_diff * yidx) / yidx_max; + b2 = b2_min + (b2_diff * yidx) / yidx_max; + r2_inv = r2_min + (r2_diff * (yidx_max-yidx)) / yidx_max; + g2_inv = g2_min + (g2_diff * (yidx_max-yidx)) / yidx_max; + b2_inv = b2_min + (b2_diff * (yidx_max-yidx)) / yidx_max; + + dest = (char *)bg_data + row*bg_rowbytes; + for (i = 0; i < rpng2_info.width; ++i) { + even_odd_horiz = (int)((i / bgscale) & 1); + even_odd = even_odd_vert ^ even_odd_horiz; + invert_column = + (even_odd_horiz && (bg[pat].type & 0x10)); + if (even_odd == 0) { /* gradient #1 */ + if (invert_column) { + *dest++ = r1_inv; + *dest++ = g1_inv; + *dest++ = b1_inv; + } else { + *dest++ = r1; + *dest++ = g1; + *dest++ = b1; + } + } else { /* gradient #2 */ + if ((invert_column && invert_gradient2) || + (!invert_column && !invert_gradient2)) + { + *dest++ = r2; /* not inverted or */ + *dest++ = g2; /* doubly inverted */ + *dest++ = b2; + } else { + *dest++ = r2_inv; + *dest++ = g2_inv; /* singly inverted */ + *dest++ = b2_inv; + } + } + } + } + +/*--------------------------------------------------------------------------- + Soft gradient-diamonds with scale = bgscale. Code contributed by Adam + M. Costello. + ---------------------------------------------------------------------------*/ + + } else if ((bg[pat].type & 0x07) == 1) { + + hmax = (bgscale-1)/2; /* half the max weight of a color */ + max = 2*hmax; /* the max weight of a color */ + + r1 = rgb[bg[pat].rgb1_max].r; + g1 = rgb[bg[pat].rgb1_max].g; + b1 = rgb[bg[pat].rgb1_max].b; + r2 = rgb[bg[pat].rgb2_max].r; + g2 = rgb[bg[pat].rgb2_max].g; + b2 = rgb[bg[pat].rgb2_max].b; + + for (row = 0; row < rpng2_info.height; ++row) { + yidx = (int)(row % bgscale); + if (yidx > hmax) + yidx = bgscale-1 - yidx; + dest = (char *)bg_data + row*bg_rowbytes; + for (i = 0; i < rpng2_info.width; ++i) { + xidx = (int)(i % bgscale); + if (xidx > hmax) + xidx = bgscale-1 - xidx; + k = xidx + yidx; + *dest++ = (k*r1 + (max-k)*r2) / max; + *dest++ = (k*g1 + (max-k)*g2) / max; + *dest++ = (k*b1 + (max-k)*b2) / max; + } + } + +/*--------------------------------------------------------------------------- + Radial "starburst" with azimuthal sinusoids; [eventually number of sinu- + soids will equal bgscale?]. This one is slow but very cool. Code con- + tributed by Pieter S. van der Meulen (originally in Smalltalk). + ---------------------------------------------------------------------------*/ + + } else if ((bg[pat].type & 0x07) == 2) { + uch ch; + int ii, x, y, hw, hh, grayspot; + double freq, rotate, saturate, gray, intensity; + double angle=0.0, aoffset=0.0, maxDist, dist; + double red=0.0, green=0.0, blue=0.0, hue, s, v, f, p, q, t; + + hh = (int)(rpng2_info.height / 2); + hw = (int)(rpng2_info.width / 2); + + /* variables for radial waves: + * aoffset: number of degrees to rotate hue [CURRENTLY NOT USED] + * freq: number of color beams originating from the center + * grayspot: size of the graying center area (anti-alias) + * rotate: rotation of the beams as a function of radius + * saturate: saturation of beams' shape azimuthally + */ + angle = CLIP(angle, 0.0, 360.0); + grayspot = CLIP(bg[pat].bg_gray, 1, (hh + hw)); + freq = MAX((double)bg[pat].bg_freq, 0.0); + saturate = (double)bg[pat].bg_bsat * 0.1; + rotate = (double)bg[pat].bg_brot * 0.1; + gray = 0.0; + intensity = 0.0; + maxDist = (double)((hw*hw) + (hh*hh)); + + for (row = 0; row < rpng2_info.height; ++row) { + y = (int)(row - hh); + dest = (char *)bg_data + row*bg_rowbytes; + for (i = 0; i < rpng2_info.width; ++i) { + x = (int)(i - hw); + angle = (x == 0)? PI_2 : atan((double)y / (double)x); + gray = (double)MAX(ABS(y), ABS(x)) / grayspot; + gray = MIN(1.0, gray); + dist = (double)((x*x) + (y*y)) / maxDist; + intensity = cos((angle+(rotate*dist*PI)) * freq) * + gray * saturate; + intensity = (MAX(MIN(intensity,1.0),-1.0) + 1.0) * 0.5; + hue = (angle + PI) * INV_PI_360 + aoffset; + s = gray * ((double)(ABS(x)+ABS(y)) / (double)(hw + hh)); + s = MIN(MAX(s,0.0), 1.0); + v = MIN(MAX(intensity,0.0), 1.0); + + if (s == 0.0) { + ch = (uch)(v * 255.0); + *dest++ = ch; + *dest++ = ch; + *dest++ = ch; + } else { + if ((hue < 0.0) || (hue >= 360.0)) + hue -= (((int)(hue / 360.0)) * 360.0); + hue /= 60.0; + ii = (int)hue; + f = hue - (double)ii; + p = (1.0 - s) * v; + q = (1.0 - (s * f)) * v; + t = (1.0 - (s * (1.0 - f))) * v; + if (ii == 0) { red = v; green = t; blue = p; } + else if (ii == 1) { red = q; green = v; blue = p; } + else if (ii == 2) { red = p; green = v; blue = t; } + else if (ii == 3) { red = p; green = q; blue = v; } + else if (ii == 4) { red = t; green = p; blue = v; } + else if (ii == 5) { red = v; green = p; blue = q; } + *dest++ = (uch)(red * 255.0); + *dest++ = (uch)(green * 255.0); + *dest++ = (uch)(blue * 255.0); + } + } + } + } + +} /* end function rpng2_x_reload_bg_image() */ + + + + + +static int is_number(char *p) +{ + while (*p) { + if (!isdigit(*p)) + return FALSE; + ++p; + } + return TRUE; +} + +#endif /* FEATURE_LOOP */ + + + + + +static void rpng2_x_cleanup(void) +{ + if (bg_image && bg_data) { + free(bg_data); + bg_data = NULL; + } + + if (rpng2_info.image_data) { + free(rpng2_info.image_data); + rpng2_info.image_data = NULL; + } + + if (rpng2_info.row_pointers) { + free(rpng2_info.row_pointers); + rpng2_info.row_pointers = NULL; + } + + if (ximage) { + if (ximage->data) { + free(ximage->data); /* we allocated it, so we free it */ + ximage->data = (char *)NULL; /* instead of XDestroyImage() */ + } + XDestroyImage(ximage); + ximage = NULL; + } + + if (have_gc) + XFreeGC(display, gc); + + if (have_window) + XDestroyWindow(display, window); + + if (have_colormap) + XFreeColormap(display, colormap); + + if (have_nondefault_visual) + XFree(visual_list); +} + + + + + +static int rpng2_x_msb(ulg u32val) +{ + int i; + + for (i = 31; i >= 0; --i) { + if (u32val & 0x80000000L) + break; + u32val <<= 1; + } + return i; +} diff --git a/Engine/lib/lpng/contrib/gregbook/toucan.png b/Engine/lib/lpng/contrib/gregbook/toucan.png new file mode 100644 index 0000000000000000000000000000000000000000..03960d4939938541ca3f8efee4bf13ffdecbb2f5 GIT binary patch literal 12901 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 z916my +#include +#include +#include /* for jmpbuf declaration in writepng.h */ +#include + +#ifdef DOS_OS2_W32 +# include /* for isatty(), setmode() prototypes */ +# include /* O_BINARY for fdopen() without text translation */ +# ifdef __EMX__ +# ifndef getch +# define getch() _read_kbd(0, 1, 0) /* need getche() */ +# endif +# else /* !__EMX__ */ +# ifdef __GO32__ +# include +# define getch() getkey() /* GRR: need getche() */ +# else +# include /* for getche() console input */ +# endif +# endif /* ?__EMX__ */ +# define FGETS(buf,len,stream) dos_kbd_gets(buf,len) +#else +# include /* for isatty() prototype */ +# define FGETS fgets +#endif + +/* #define DEBUG : this enables the Trace() macros */ + +/* #define FORBID_LATIN1_CTRL : this requires the user to re-enter any + text that includes control characters discouraged by the PNG spec; text + that includes an escape character (27) must be re-entered regardless */ + +#include "writepng.h" /* typedefs, common macros, writepng prototypes */ + + + +/* local prototypes */ + +static int wpng_isvalid_latin1(uch *p, int len); +static void wpng_cleanup(void); + +#ifdef DOS_OS2_W32 + static char *dos_kbd_gets(char *buf, int len); +#endif + + + +static mainprog_info wpng_info; /* lone global */ + + + +int main(int argc, char **argv) +{ +#ifndef DOS_OS2_W32 + FILE *keybd; +#endif +#ifdef sgi + FILE *tmpfile; /* or we could just use keybd, since no overlap */ + char tmpline[80]; +#endif + char *inname = NULL, outname[256]; + char *p, pnmchar, pnmline[256]; + char *bgstr, *textbuf = NULL; + ulg rowbytes; + int rc, len = 0; + int error = 0; + int text = FALSE; + int maxval; + double LUT_exponent; /* just the lookup table */ + double CRT_exponent = 2.2; /* just the monitor */ + double default_display_exponent; /* whole display system */ + double default_gamma = 0.0; + + + wpng_info.infile = NULL; + wpng_info.outfile = NULL; + wpng_info.image_data = NULL; + wpng_info.row_pointers = NULL; + wpng_info.filter = FALSE; + wpng_info.interlaced = FALSE; + wpng_info.have_bg = FALSE; + wpng_info.have_time = FALSE; + wpng_info.have_text = 0; + wpng_info.gamma = 0.0; + + + /* First get the default value for our display-system exponent, i.e., + * the product of the CRT exponent and the exponent corresponding to + * the frame-buffer's lookup table (LUT), if any. If the PNM image + * looks correct on the user's display system, its file gamma is the + * inverse of this value. (Note that this is not an exhaustive list + * of LUT values--e.g., OpenStep has a lot of weird ones--but it should + * cover 99% of the current possibilities. This section must ensure + * that default_display_exponent is positive.) */ + +#if defined(NeXT) + /* third-party utilities can modify the default LUT exponent */ + LUT_exponent = 1.0 / 2.2; + /* + if (some_next_function_that_returns_gamma(&next_gamma)) + LUT_exponent = 1.0 / next_gamma; + */ +#elif defined(sgi) + LUT_exponent = 1.0 / 1.7; + /* there doesn't seem to be any documented function to + * get the "gamma" value, so we do it the hard way */ + tmpfile = fopen("/etc/config/system.glGammaVal", "r"); + if (tmpfile) { + double sgi_gamma; + + fgets(tmpline, 80, tmpfile); + fclose(tmpfile); + sgi_gamma = atof(tmpline); + if (sgi_gamma > 0.0) + LUT_exponent = 1.0 / sgi_gamma; + } +#elif defined(Macintosh) + LUT_exponent = 1.8 / 2.61; + /* + if (some_mac_function_that_returns_gamma(&mac_gamma)) + LUT_exponent = mac_gamma / 2.61; + */ +#else + LUT_exponent = 1.0; /* assume no LUT: most PCs */ +#endif + + /* the defaults above give 1.0, 1.3, 1.5 and 2.2, respectively: */ + default_display_exponent = LUT_exponent * CRT_exponent; + + + /* If the user has set the SCREEN_GAMMA environment variable as suggested + * (somewhat imprecisely) in the libpng documentation, use that; otherwise + * use the default value we just calculated. Either way, the user may + * override this via a command-line option. */ + + if ((p = getenv("SCREEN_GAMMA")) != NULL) { + double exponent = atof(p); + + if (exponent > 0.0) + default_gamma = 1.0 / exponent; + } + + if (default_gamma == 0.0) + default_gamma = 1.0 / default_display_exponent; + + + /* Now parse the command line for options and the PNM filename. */ + + while (*++argv && !error) { + if (!strncmp(*argv, "-i", 2)) { + wpng_info.interlaced = TRUE; + } else if (!strncmp(*argv, "-time", 3)) { + wpng_info.modtime = time(NULL); + wpng_info.have_time = TRUE; + } else if (!strncmp(*argv, "-text", 3)) { + text = TRUE; + } else if (!strncmp(*argv, "-gamma", 2)) { + if (!*++argv) + ++error; + else { + wpng_info.gamma = atof(*argv); + if (wpng_info.gamma <= 0.0) + ++error; + else if (wpng_info.gamma > 1.01) + fprintf(stderr, PROGNAME + " warning: file gammas are usually less than 1.0\n"); + } + } else if (!strncmp(*argv, "-bgcolor", 4)) { + if (!*++argv) + ++error; + else { + bgstr = *argv; + if (strlen(bgstr) != 7 || bgstr[0] != '#') + ++error; + else { + unsigned r, g, b; /* this way quiets compiler warnings */ + + sscanf(bgstr+1, "%2x%2x%2x", &r, &g, &b); + wpng_info.bg_red = (uch)r; + wpng_info.bg_green = (uch)g; + wpng_info.bg_blue = (uch)b; + wpng_info.have_bg = TRUE; + } + } + } else { + if (**argv != '-') { + inname = *argv; + if (argv[1]) /* shouldn't be any more args after filename */ + ++error; + } else + ++error; /* not expecting any other options */ + } + } + + + /* open the input and output files, or register an error and abort */ + + if (!inname) { + if (isatty(0)) { + fprintf(stderr, PROGNAME + ": must give input filename or provide image data via stdin\n"); + ++error; + } else { +#ifdef DOS_OS2_W32 + /* some buggy C libraries require BOTH setmode() and fdopen(bin) */ + setmode(fileno(stdin), O_BINARY); + setmode(fileno(stdout), O_BINARY); +#endif + if ((wpng_info.infile = fdopen(fileno(stdin), "rb")) == NULL) { + fprintf(stderr, PROGNAME + ": unable to reopen stdin in binary mode\n"); + ++error; + } else + if ((wpng_info.outfile = fdopen(fileno(stdout), "wb")) == NULL) { + fprintf(stderr, PROGNAME + ": unable to reopen stdout in binary mode\n"); + fclose(wpng_info.infile); + ++error; + } else + wpng_info.filter = TRUE; + } + } else if ((len = strlen(inname)) > 250) { + fprintf(stderr, PROGNAME ": input filename is too long [%d chars]\n", + len); + ++error; + } else if (!(wpng_info.infile = fopen(inname, "rb"))) { + fprintf(stderr, PROGNAME ": can't open input file [%s]\n", inname); + ++error; + } + + if (!error) { + fgets(pnmline, 256, wpng_info.infile); + if (pnmline[0] != 'P' || ((pnmchar = pnmline[1]) != '5' && + pnmchar != '6' && pnmchar != '8')) + { + fprintf(stderr, PROGNAME + ": input file [%s] is not a binary PGM, PPM or PAM file\n", + inname); + ++error; + } else { + wpng_info.pnmtype = (int)(pnmchar - '0'); + if (wpng_info.pnmtype != 8) + wpng_info.have_bg = FALSE; /* no need for bg if opaque */ + do { + fgets(pnmline, 256, wpng_info.infile); /* lose any comments */ + } while (pnmline[0] == '#'); + sscanf(pnmline, "%ld %ld", &wpng_info.width, &wpng_info.height); + do { + fgets(pnmline, 256, wpng_info.infile); /* more comment lines */ + } while (pnmline[0] == '#'); + sscanf(pnmline, "%d", &maxval); + if (wpng_info.width <= 0L || wpng_info.height <= 0L || + maxval != 255) + { + fprintf(stderr, PROGNAME + ": only positive width/height, maxval == 255 allowed \n"); + ++error; + } + wpng_info.sample_depth = 8; /* <==> maxval 255 */ + + if (!wpng_info.filter) { + /* make outname from inname */ + if ((p = strrchr(inname, '.')) == NULL || + (p - inname) != (len - 4)) + { + strcpy(outname, inname); + strcpy(outname+len, ".png"); + } else { + len -= 4; + strncpy(outname, inname, len); + strcpy(outname+len, ".png"); + } + /* check if outname already exists; if not, open */ + if ((wpng_info.outfile = fopen(outname, "rb")) != NULL) { + fprintf(stderr, PROGNAME ": output file exists [%s]\n", + outname); + fclose(wpng_info.outfile); + ++error; + } else if (!(wpng_info.outfile = fopen(outname, "wb"))) { + fprintf(stderr, PROGNAME ": can't open output file [%s]\n", + outname); + ++error; + } + } + } + if (error) { + fclose(wpng_info.infile); + wpng_info.infile = NULL; + if (wpng_info.filter) { + fclose(wpng_info.outfile); + wpng_info.outfile = NULL; + } + } + } + + + /* if we had any errors, print usage and die horrible death...arrr! */ + + if (error) { + fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, APPNAME); + writepng_version_info(); + fprintf(stderr, "\n" +"Usage: %s [-gamma exp] [-bgcolor bg] [-text] [-time] [-interlace] pnmfile\n" +"or: ... | %s [-gamma exp] [-bgcolor bg] [-text] [-time] [-interlace] | ...\n" + " exp \ttransfer-function exponent (``gamma'') of the image in\n" + "\t\t floating-point format (e.g., ``%.5f''); if image looks\n" + "\t\t correct on given display system, image gamma is equal to\n" + "\t\t inverse of display-system exponent, i.e., 1 / (LUT * CRT)\n" + "\t\t (where LUT = lookup-table exponent and CRT = CRT exponent;\n" + "\t\t first varies, second is usually 2.2, all are positive)\n" + " bg \tdesired background color for alpha-channel images, in\n" + "\t\t 7-character hex RGB format (e.g., ``#ff7700'' for orange:\n" + "\t\t same as HTML colors)\n" + " -text\tprompt interactively for text info (tEXt chunks)\n" + " -time\tinclude a tIME chunk (last modification time)\n" + " -interlace\twrite interlaced PNG image\n" + "\n" +"pnmfile or stdin must be a binary PGM (`P5'), PPM (`P6') or (extremely\n" +"unofficial and unsupported!) PAM (`P8') file. Currently it is required\n" +"to have maxval == 255 (i.e., no scaling). If pnmfile is specified, it\n" +"is converted to the corresponding PNG file with the same base name but a\n" +"``.png'' extension; files read from stdin are converted and sent to stdout.\n" +"The conversion is progressive (low memory usage) unless interlacing is\n" +"requested; in that case the whole image will be buffered in memory and\n" +"written in one call.\n" + "\n", PROGNAME, PROGNAME, default_gamma); + exit(1); + } + + + /* prepare the text buffers for libpng's use; note that even though + * PNG's png_text struct includes a length field, we don't have to fill + * it out */ + + if (text && +#ifndef DOS_OS2_W32 + (keybd = fdopen(fileno(stderr), "r")) != NULL && +#endif + (textbuf = (char *)malloc((5 + 9)*75)) != NULL) + { + int i, valid, result; + + fprintf(stderr, + "Enter text info (no more than 72 characters per line);\n"); + fprintf(stderr, "to skip a field, hit the key.\n"); + /* note: just leaves len == 1 */ + + do { + valid = TRUE; + p = textbuf + TEXT_TITLE_OFFSET; + fprintf(stderr, " Title: "); + fflush(stderr); + if (FGETS(p, 74, keybd) && (len = strlen(p)) > 1) { + if (p[len-1] == '\n') + p[--len] = '\0'; + wpng_info.title = p; + wpng_info.have_text |= TEXT_TITLE; + if ((result = wpng_isvalid_latin1((uch *)p, len)) >= 0) { + fprintf(stderr, " " PROGNAME " warning: character code" + " %u is %sdiscouraged by the PNG\n specification " + "[first occurrence was at character position #%d]\n", + (unsigned)p[result], (p[result] == 27)? "strongly " : "", + result+1); + fflush(stderr); +#ifdef FORBID_LATIN1_CTRL + wpng_info.have_text &= ~TEXT_TITLE; + valid = FALSE; +#else + if (p[result] == 27) { /* escape character */ + wpng_info.have_text &= ~TEXT_TITLE; + valid = FALSE; + } +#endif + } + } + } while (!valid); + + do { + valid = TRUE; + p = textbuf + TEXT_AUTHOR_OFFSET; + fprintf(stderr, " Author: "); + fflush(stderr); + if (FGETS(p, 74, keybd) && (len = strlen(p)) > 1) { + if (p[len-1] == '\n') + p[--len] = '\0'; + wpng_info.author = p; + wpng_info.have_text |= TEXT_AUTHOR; + if ((result = wpng_isvalid_latin1((uch *)p, len)) >= 0) { + fprintf(stderr, " " PROGNAME " warning: character code" + " %u is %sdiscouraged by the PNG\n specification " + "[first occurrence was at character position #%d]\n", + (unsigned)p[result], (p[result] == 27)? "strongly " : "", + result+1); + fflush(stderr); +#ifdef FORBID_LATIN1_CTRL + wpng_info.have_text &= ~TEXT_AUTHOR; + valid = FALSE; +#else + if (p[result] == 27) { /* escape character */ + wpng_info.have_text &= ~TEXT_AUTHOR; + valid = FALSE; + } +#endif + } + } + } while (!valid); + + do { + valid = TRUE; + p = textbuf + TEXT_DESC_OFFSET; + fprintf(stderr, " Description (up to 9 lines):\n"); + for (i = 1; i < 10; ++i) { + fprintf(stderr, " [%d] ", i); + fflush(stderr); + if (FGETS(p, 74, keybd) && (len = strlen(p)) > 1) + p += len; /* now points at NULL; char before is newline */ + else + break; + } + if ((len = p - (textbuf + TEXT_DESC_OFFSET)) > 1) { + if (p[-1] == '\n') { + p[-1] = '\0'; + --len; + } + wpng_info.desc = textbuf + TEXT_DESC_OFFSET; + wpng_info.have_text |= TEXT_DESC; + p = textbuf + TEXT_DESC_OFFSET; + if ((result = wpng_isvalid_latin1((uch *)p, len)) >= 0) { + fprintf(stderr, " " PROGNAME " warning: character code" + " %u is %sdiscouraged by the PNG\n specification " + "[first occurrence was at character position #%d]\n", + (unsigned)p[result], (p[result] == 27)? "strongly " : "", + result+1); + fflush(stderr); +#ifdef FORBID_LATIN1_CTRL + wpng_info.have_text &= ~TEXT_DESC; + valid = FALSE; +#else + if (p[result] == 27) { /* escape character */ + wpng_info.have_text &= ~TEXT_DESC; + valid = FALSE; + } +#endif + } + } + } while (!valid); + + do { + valid = TRUE; + p = textbuf + TEXT_COPY_OFFSET; + fprintf(stderr, " Copyright: "); + fflush(stderr); + if (FGETS(p, 74, keybd) && (len = strlen(p)) > 1) { + if (p[len-1] == '\n') + p[--len] = '\0'; + wpng_info.copyright = p; + wpng_info.have_text |= TEXT_COPY; + if ((result = wpng_isvalid_latin1((uch *)p, len)) >= 0) { + fprintf(stderr, " " PROGNAME " warning: character code" + " %u is %sdiscouraged by the PNG\n specification " + "[first occurrence was at character position #%d]\n", + (unsigned)p[result], (p[result] == 27)? "strongly " : "", + result+1); + fflush(stderr); +#ifdef FORBID_LATIN1_CTRL + wpng_info.have_text &= ~TEXT_COPY; + valid = FALSE; +#else + if (p[result] == 27) { /* escape character */ + wpng_info.have_text &= ~TEXT_COPY; + valid = FALSE; + } +#endif + } + } + } while (!valid); + + do { + valid = TRUE; + p = textbuf + TEXT_EMAIL_OFFSET; + fprintf(stderr, " E-mail: "); + fflush(stderr); + if (FGETS(p, 74, keybd) && (len = strlen(p)) > 1) { + if (p[len-1] == '\n') + p[--len] = '\0'; + wpng_info.email = p; + wpng_info.have_text |= TEXT_EMAIL; + if ((result = wpng_isvalid_latin1((uch *)p, len)) >= 0) { + fprintf(stderr, " " PROGNAME " warning: character code" + " %u is %sdiscouraged by the PNG\n specification " + "[first occurrence was at character position #%d]\n", + (unsigned)p[result], (p[result] == 27)? "strongly " : "", + result+1); + fflush(stderr); +#ifdef FORBID_LATIN1_CTRL + wpng_info.have_text &= ~TEXT_EMAIL; + valid = FALSE; +#else + if (p[result] == 27) { /* escape character */ + wpng_info.have_text &= ~TEXT_EMAIL; + valid = FALSE; + } +#endif + } + } + } while (!valid); + + do { + valid = TRUE; + p = textbuf + TEXT_URL_OFFSET; + fprintf(stderr, " URL: "); + fflush(stderr); + if (FGETS(p, 74, keybd) && (len = strlen(p)) > 1) { + if (p[len-1] == '\n') + p[--len] = '\0'; + wpng_info.url = p; + wpng_info.have_text |= TEXT_URL; + if ((result = wpng_isvalid_latin1((uch *)p, len)) >= 0) { + fprintf(stderr, " " PROGNAME " warning: character code" + " %u is %sdiscouraged by the PNG\n specification " + "[first occurrence was at character position #%d]\n", + (unsigned)p[result], (p[result] == 27)? "strongly " : "", + result+1); + fflush(stderr); +#ifdef FORBID_LATIN1_CTRL + wpng_info.have_text &= ~TEXT_URL; + valid = FALSE; +#else + if (p[result] == 27) { /* escape character */ + wpng_info.have_text &= ~TEXT_URL; + valid = FALSE; + } +#endif + } + } + } while (!valid); + +#ifndef DOS_OS2_W32 + fclose(keybd); +#endif + + } else if (text) { + fprintf(stderr, PROGNAME ": unable to allocate memory for text\n"); + text = FALSE; + wpng_info.have_text = 0; + } + + + /* allocate libpng stuff, initialize transformations, write pre-IDAT data */ + + if ((rc = writepng_init(&wpng_info)) != 0) { + switch (rc) { + case 2: + fprintf(stderr, PROGNAME + ": libpng initialization problem (longjmp)\n"); + break; + case 4: + fprintf(stderr, PROGNAME ": insufficient memory\n"); + break; + case 11: + fprintf(stderr, PROGNAME + ": internal logic error (unexpected PNM type)\n"); + break; + default: + fprintf(stderr, PROGNAME + ": unknown writepng_init() error\n"); + break; + } + exit(rc); + } + + + /* free textbuf, since it's a completely local variable and all text info + * has just been written to the PNG file */ + + if (text && textbuf) { + free(textbuf); + textbuf = NULL; + } + + + /* calculate rowbytes on basis of image type; note that this becomes much + * more complicated if we choose to support PBM type, ASCII PNM types, or + * 16-bit-per-sample binary data [currently not an official NetPBM type] */ + + if (wpng_info.pnmtype == 5) + rowbytes = wpng_info.width; + else if (wpng_info.pnmtype == 6) + rowbytes = wpng_info.width * 3; + else /* if (wpng_info.pnmtype == 8) */ + rowbytes = wpng_info.width * 4; + + + /* read and write the image, either in its entirety (if writing interlaced + * PNG) or row by row (if non-interlaced) */ + + fprintf(stderr, "Encoding image data...\n"); + fflush(stderr); + + if (wpng_info.interlaced) { + long i; + ulg bytes; + ulg image_bytes; + + /* Guard against integer overflow */ + if (wpng_info_height > ((size_t)(-1)/rowbytes || + wpng_info_height > ((ulg)(-1)/rowbytes) { + fprintf(stderr, PROGNAME ": image_data buffer too large\n"); + writepng_cleanup(&wpng_info); + wpng_cleanup(); + exit(5); + } + + image_bytes = rowbytes * wpng_info.height; + + wpng_info.image_data = (uch *)malloc(image_bytes); + wpng_info.row_pointers = (uch **)malloc(wpng_info.height*sizeof(uch *)); + if (wpng_info.image_data == NULL || wpng_info.row_pointers == NULL) { + fprintf(stderr, PROGNAME ": insufficient memory for image data\n"); + writepng_cleanup(&wpng_info); + wpng_cleanup(); + exit(5); + } + for (i = 0; i < wpng_info.height; ++i) + wpng_info.row_pointers[i] = wpng_info.image_data + i*rowbytes; + bytes = fread(wpng_info.image_data, 1, image_bytes, wpng_info.infile); + if (bytes != image_bytes) { + fprintf(stderr, PROGNAME ": expected %lu bytes, got %lu bytes\n", + image_bytes, bytes); + fprintf(stderr, " (continuing anyway)\n"); + } + if (writepng_encode_image(&wpng_info) != 0) { + fprintf(stderr, PROGNAME + ": libpng problem (longjmp) while writing image data\n"); + writepng_cleanup(&wpng_info); + wpng_cleanup(); + exit(2); + } + + } else /* not interlaced: write progressively (row by row) */ { + long j; + ulg bytes; + + wpng_info.image_data = (uch *)malloc(rowbytes); + if (wpng_info.image_data == NULL) { + fprintf(stderr, PROGNAME ": insufficient memory for row data\n"); + writepng_cleanup(&wpng_info); + wpng_cleanup(); + exit(5); + } + error = 0; + for (j = wpng_info.height; j > 0L; --j) { + bytes = fread(wpng_info.image_data, 1, rowbytes, wpng_info.infile); + if (bytes != rowbytes) { + fprintf(stderr, PROGNAME + ": expected %lu bytes, got %lu bytes (row %ld)\n", rowbytes, + bytes, wpng_info.height-j); + ++error; + break; + } + if (writepng_encode_row(&wpng_info) != 0) { + fprintf(stderr, PROGNAME + ": libpng problem (longjmp) while writing row %ld\n", + wpng_info.height-j); + ++error; + break; + } + } + if (error) { + writepng_cleanup(&wpng_info); + wpng_cleanup(); + exit(2); + } + if (writepng_encode_finish(&wpng_info) != 0) { + fprintf(stderr, PROGNAME ": error on final libpng call\n"); + writepng_cleanup(&wpng_info); + wpng_cleanup(); + exit(2); + } + } + + + /* OK, we're done (successfully): clean up all resources and quit */ + + fprintf(stderr, "Done.\n"); + fflush(stderr); + + writepng_cleanup(&wpng_info); + wpng_cleanup(); + + return 0; +} + + + + + +static int wpng_isvalid_latin1(uch *p, int len) +{ + int i, result = -1; + + for (i = 0; i < len; ++i) { + if (p[i] == 10 || (p[i] > 31 && p[i] < 127) || p[i] > 160) + continue; /* character is completely OK */ + if (result < 0 || (p[result] != 27 && p[i] == 27)) + result = i; /* mark location of first questionable one */ + } /* or of first escape character (bad) */ + + return result; +} + + + + + +static void wpng_cleanup(void) +{ + if (wpng_info.outfile) { + fclose(wpng_info.outfile); + wpng_info.outfile = NULL; + } + + if (wpng_info.infile) { + fclose(wpng_info.infile); + wpng_info.infile = NULL; + } + + if (wpng_info.image_data) { + free(wpng_info.image_data); + wpng_info.image_data = NULL; + } + + if (wpng_info.row_pointers) { + free(wpng_info.row_pointers); + wpng_info.row_pointers = NULL; + } +} + + + + +#ifdef DOS_OS2_W32 + +static char *dos_kbd_gets(char *buf, int len) +{ + int ch, count=0; + + do { + buf[count++] = ch = getche(); + } while (ch != '\r' && count < len-1); + + buf[count--] = '\0'; /* terminate string */ + if (buf[count] == '\r') /* Enter key makes CR, so change to newline */ + buf[count] = '\n'; + + fprintf(stderr, "\n"); /* Enter key does *not* cause a newline */ + fflush(stderr); + + return buf; +} + +#endif /* DOS_OS2_W32 */ diff --git a/Engine/lib/lpng/contrib/gregbook/writepng.c b/Engine/lib/lpng/contrib/gregbook/writepng.c new file mode 100644 index 000000000..055c74374 --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/writepng.c @@ -0,0 +1,401 @@ +/*--------------------------------------------------------------------------- + + wpng - simple PNG-writing program writepng.c + + --------------------------------------------------------------------------- + + Copyright (c) 1998-2007, 2017 Greg Roelofs. All rights reserved. + + This software is provided "as is," without warranty of any kind, + express or implied. In no event shall the author or contributors + be held liable for any damages arising in any way from the use of + this software. + + The contents of this file are DUAL-LICENSED. You may modify and/or + redistribute this software according to the terms of one of the + following two licenses (at your option): + + + LICENSE 1 ("BSD-like with advertising clause"): + + 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. Redistributions of source code must retain the above copyright + notice, disclaimer, and this list of conditions. + 2. Redistributions in binary form must reproduce the above copyright + notice, disclaimer, and this list of conditions in the documenta- + tion and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + + This product includes software developed by Greg Roelofs + and contributors for the book, "PNG: The Definitive Guide," + published by O'Reilly and Associates. + + + LICENSE 2 (GNU GPL v2 or later): + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + ---------------------------------------------------------------------------*/ + + +#include /* for exit() prototype */ +#include + +#include "png.h" /* libpng header, includes setjmp.h */ +#include "writepng.h" /* typedefs, common macros, public prototypes */ + + +/* local prototype */ + +static void writepng_error_handler(png_structp png_ptr, png_const_charp msg); + + + +void writepng_version_info(void) +{ + fprintf(stderr, " Compiled with libpng %s; using libpng %s.\n", + PNG_LIBPNG_VER_STRING, png_libpng_ver); + fprintf(stderr, " Compiled with zlib %s; using zlib %s.\n", + ZLIB_VERSION, zlib_version); +} + + + + +/* returns 0 for success, 2 for libpng problem, 4 for out of memory, 11 for + * unexpected pnmtype; note that outfile might be stdout */ + +int writepng_init(mainprog_info *mainprog_ptr) +{ + png_structp png_ptr; /* note: temporary variables! */ + png_infop info_ptr; + int color_type, interlace_type; + + + /* could also replace libpng warning-handler (final NULL), but no need: */ + + png_ptr = png_create_write_struct(png_get_libpng_ver(NULL), mainprog_ptr, + writepng_error_handler, NULL); + if (!png_ptr) + return 4; /* out of memory */ + + info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) { + png_destroy_write_struct(&png_ptr, NULL); + return 4; /* out of memory */ + } + + + /* setjmp() must be called in every function that calls a PNG-writing + * libpng function, unless an alternate error handler was installed-- + * but compatible error handlers must either use longjmp() themselves + * (as in this program) or some other method to return control to + * application code, so here we go: */ + + if (setjmp(mainprog_ptr->jmpbuf)) { + png_destroy_write_struct(&png_ptr, &info_ptr); + return 2; + } + + + /* make sure outfile is (re)opened in BINARY mode */ + + png_init_io(png_ptr, mainprog_ptr->outfile); + + + /* set the compression levels--in general, always want to leave filtering + * turned on (except for palette images) and allow all of the filters, + * which is the default; want 32K zlib window, unless entire image buffer + * is 16K or smaller (unknown here)--also the default; usually want max + * compression (NOT the default); and remaining compression flags should + * be left alone */ + + png_set_compression_level(png_ptr, Z_BEST_COMPRESSION); +/* + >> this is default for no filtering; Z_FILTERED is default otherwise: + png_set_compression_strategy(png_ptr, Z_DEFAULT_STRATEGY); + >> these are all defaults: + png_set_compression_mem_level(png_ptr, 8); + png_set_compression_window_bits(png_ptr, 15); + png_set_compression_method(png_ptr, 8); + */ + + + /* set the image parameters appropriately */ + + if (mainprog_ptr->pnmtype == 5) + color_type = PNG_COLOR_TYPE_GRAY; + else if (mainprog_ptr->pnmtype == 6) + color_type = PNG_COLOR_TYPE_RGB; + else if (mainprog_ptr->pnmtype == 8) + color_type = PNG_COLOR_TYPE_RGB_ALPHA; + else { + png_destroy_write_struct(&png_ptr, &info_ptr); + return 11; + } + + interlace_type = mainprog_ptr->interlaced? PNG_INTERLACE_ADAM7 : + PNG_INTERLACE_NONE; + + png_set_IHDR(png_ptr, info_ptr, mainprog_ptr->width, mainprog_ptr->height, + mainprog_ptr->sample_depth, color_type, interlace_type, + PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); + + if (mainprog_ptr->gamma > 0.0) + png_set_gAMA(png_ptr, info_ptr, mainprog_ptr->gamma); + + if (mainprog_ptr->have_bg) { /* we know it's RGBA, not gray+alpha */ + png_color_16 background; + + background.red = mainprog_ptr->bg_red; + background.green = mainprog_ptr->bg_green; + background.blue = mainprog_ptr->bg_blue; + png_set_bKGD(png_ptr, info_ptr, &background); + } + + if (mainprog_ptr->have_time) { + png_time modtime; + + png_convert_from_time_t(&modtime, mainprog_ptr->modtime); + png_set_tIME(png_ptr, info_ptr, &modtime); + } + + if (mainprog_ptr->have_text) { + png_text text[6]; + int num_text = 0; + + if (mainprog_ptr->have_text & TEXT_TITLE) { + text[num_text].compression = PNG_TEXT_COMPRESSION_NONE; + text[num_text].key = "Title"; + text[num_text].text = mainprog_ptr->title; + ++num_text; + } + if (mainprog_ptr->have_text & TEXT_AUTHOR) { + text[num_text].compression = PNG_TEXT_COMPRESSION_NONE; + text[num_text].key = "Author"; + text[num_text].text = mainprog_ptr->author; + ++num_text; + } + if (mainprog_ptr->have_text & TEXT_DESC) { + text[num_text].compression = PNG_TEXT_COMPRESSION_NONE; + text[num_text].key = "Description"; + text[num_text].text = mainprog_ptr->desc; + ++num_text; + } + if (mainprog_ptr->have_text & TEXT_COPY) { + text[num_text].compression = PNG_TEXT_COMPRESSION_NONE; + text[num_text].key = "Copyright"; + text[num_text].text = mainprog_ptr->copyright; + ++num_text; + } + if (mainprog_ptr->have_text & TEXT_EMAIL) { + text[num_text].compression = PNG_TEXT_COMPRESSION_NONE; + text[num_text].key = "E-mail"; + text[num_text].text = mainprog_ptr->email; + ++num_text; + } + if (mainprog_ptr->have_text & TEXT_URL) { + text[num_text].compression = PNG_TEXT_COMPRESSION_NONE; + text[num_text].key = "URL"; + text[num_text].text = mainprog_ptr->url; + ++num_text; + } + png_set_text(png_ptr, info_ptr, text, num_text); + } + + + /* write all chunks up to (but not including) first IDAT */ + + png_write_info(png_ptr, info_ptr); + + + /* if we wanted to write any more text info *after* the image data, we + * would set up text struct(s) here and call png_set_text() again, with + * just the new data; png_set_tIME() could also go here, but it would + * have no effect since we already called it above (only one tIME chunk + * allowed) */ + + + /* set up the transformations: for now, just pack low-bit-depth pixels + * into bytes (one, two or four pixels per byte) */ + + png_set_packing(png_ptr); +/* png_set_shift(png_ptr, &sig_bit); to scale low-bit-depth values */ + + + /* make sure we save our pointers for use in writepng_encode_image() */ + + mainprog_ptr->png_ptr = png_ptr; + mainprog_ptr->info_ptr = info_ptr; + + + /* OK, that's all we need to do for now; return happy */ + + return 0; +} + + + + + +/* returns 0 for success, 2 for libpng (longjmp) problem */ + +int writepng_encode_image(mainprog_info *mainprog_ptr) +{ + png_structp png_ptr = (png_structp)mainprog_ptr->png_ptr; + png_infop info_ptr = (png_infop)mainprog_ptr->info_ptr; + + + /* as always, setjmp() must be called in every function that calls a + * PNG-writing libpng function */ + + if (setjmp(mainprog_ptr->jmpbuf)) { + png_destroy_write_struct(&png_ptr, &info_ptr); + mainprog_ptr->png_ptr = NULL; + mainprog_ptr->info_ptr = NULL; + return 2; + } + + + /* and now we just write the whole image; libpng takes care of interlacing + * for us */ + + png_write_image(png_ptr, mainprog_ptr->row_pointers); + + + /* since that's it, we also close out the end of the PNG file now--if we + * had any text or time info to write after the IDATs, second argument + * would be info_ptr, but we optimize slightly by sending NULL pointer: */ + + png_write_end(png_ptr, NULL); + + return 0; +} + + + + + +/* returns 0 if succeeds, 2 if libpng problem */ + +int writepng_encode_row(mainprog_info *mainprog_ptr) /* NON-interlaced only! */ +{ + png_structp png_ptr = (png_structp)mainprog_ptr->png_ptr; + png_infop info_ptr = (png_infop)mainprog_ptr->info_ptr; + + + /* as always, setjmp() must be called in every function that calls a + * PNG-writing libpng function */ + + if (setjmp(mainprog_ptr->jmpbuf)) { + png_destroy_write_struct(&png_ptr, &info_ptr); + mainprog_ptr->png_ptr = NULL; + mainprog_ptr->info_ptr = NULL; + return 2; + } + + + /* image_data points at our one row of image data */ + + png_write_row(png_ptr, mainprog_ptr->image_data); + + return 0; +} + + + + + +/* returns 0 if succeeds, 2 if libpng problem */ + +int writepng_encode_finish(mainprog_info *mainprog_ptr) /* NON-interlaced! */ +{ + png_structp png_ptr = (png_structp)mainprog_ptr->png_ptr; + png_infop info_ptr = (png_infop)mainprog_ptr->info_ptr; + + + /* as always, setjmp() must be called in every function that calls a + * PNG-writing libpng function */ + + if (setjmp(mainprog_ptr->jmpbuf)) { + png_destroy_write_struct(&png_ptr, &info_ptr); + mainprog_ptr->png_ptr = NULL; + mainprog_ptr->info_ptr = NULL; + return 2; + } + + + /* close out PNG file; if we had any text or time info to write after + * the IDATs, second argument would be info_ptr: */ + + png_write_end(png_ptr, NULL); + + return 0; +} + + + + + +void writepng_cleanup(mainprog_info *mainprog_ptr) +{ + png_structp png_ptr = (png_structp)mainprog_ptr->png_ptr; + png_infop info_ptr = (png_infop)mainprog_ptr->info_ptr; + + if (png_ptr && info_ptr) + png_destroy_write_struct(&png_ptr, &info_ptr); +} + + + + + +static void writepng_error_handler(png_structp png_ptr, png_const_charp msg) +{ + mainprog_info *mainprog_ptr; + + /* This function, aside from the extra step of retrieving the "error + * pointer" (below) and the fact that it exists within the application + * rather than within libpng, is essentially identical to libpng's + * default error handler. The second point is critical: since both + * setjmp() and longjmp() are called from the same code, they are + * guaranteed to have compatible notions of how big a jmp_buf is, + * regardless of whether _BSD_SOURCE or anything else has (or has not) + * been defined. */ + + fprintf(stderr, "writepng libpng error: %s\n", msg); + fflush(stderr); + + mainprog_ptr = png_get_error_ptr(png_ptr); + if (mainprog_ptr == NULL) { /* we are completely hosed now */ + fprintf(stderr, + "writepng severe error: jmpbuf not recoverable; terminating.\n"); + fflush(stderr); + exit(99); + } + + /* Now we have our data structure we can use the information in it + * to return control to our own higher level code (all the points + * where 'setjmp' is called in this file.) This will work with other + * error handling mechanisms as well - libpng always calls png_error + * when it can proceed no further, thus, so long as the error handler + * is intercepted, application code can do its own error recovery. + */ + longjmp(mainprog_ptr->jmpbuf, 1); +} diff --git a/Engine/lib/lpng/contrib/gregbook/writepng.h b/Engine/lib/lpng/contrib/gregbook/writepng.h new file mode 100644 index 000000000..78b966b58 --- /dev/null +++ b/Engine/lib/lpng/contrib/gregbook/writepng.h @@ -0,0 +1,133 @@ +/*--------------------------------------------------------------------------- + + wpng - simple PNG-writing program writepng.h + + --------------------------------------------------------------------------- + + Copyright (c) 1998-2007 Greg Roelofs. All rights reserved. + + This software is provided "as is," without warranty of any kind, + express or implied. In no event shall the author or contributors + be held liable for any damages arising in any way from the use of + this software. + + The contents of this file are DUAL-LICENSED. You may modify and/or + redistribute this software according to the terms of one of the + following two licenses (at your option): + + + LICENSE 1 ("BSD-like with advertising clause"): + + 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. Redistributions of source code must retain the above copyright + notice, disclaimer, and this list of conditions. + 2. Redistributions in binary form must reproduce the above copyright + notice, disclaimer, and this list of conditions in the documenta- + tion and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + + This product includes software developed by Greg Roelofs + and contributors for the book, "PNG: The Definitive Guide," + published by O'Reilly and Associates. + + + LICENSE 2 (GNU GPL v2 or later): + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + ---------------------------------------------------------------------------*/ + +#ifndef TRUE +# define TRUE 1 +# define FALSE 0 +#endif + +#ifndef MAX +# define MAX(a,b) ((a) > (b)? (a) : (b)) +# define MIN(a,b) ((a) < (b)? (a) : (b)) +#endif + +#ifdef DEBUG +# define Trace(x) {fprintf x ; fflush(stderr); fflush(stdout);} +#else +# define Trace(x) ; +#endif + +#define TEXT_TITLE 0x01 +#define TEXT_AUTHOR 0x02 +#define TEXT_DESC 0x04 +#define TEXT_COPY 0x08 +#define TEXT_EMAIL 0x10 +#define TEXT_URL 0x20 + +#define TEXT_TITLE_OFFSET 0 +#define TEXT_AUTHOR_OFFSET 72 +#define TEXT_COPY_OFFSET (2*72) +#define TEXT_EMAIL_OFFSET (3*72) +#define TEXT_URL_OFFSET (4*72) +#define TEXT_DESC_OFFSET (5*72) + +typedef unsigned char uch; +typedef unsigned short ush; +typedef unsigned long ulg; + +typedef struct _mainprog_info { + double gamma; + long width; + long height; + time_t modtime; + FILE *infile; + FILE *outfile; + void *png_ptr; + void *info_ptr; + uch *image_data; + uch **row_pointers; + char *title; + char *author; + char *desc; + char *copyright; + char *email; + char *url; + int filter; /* command-line-filter flag, not PNG row filter! */ + int pnmtype; + int sample_depth; + int interlaced; + int have_bg; + int have_time; + int have_text; + jmp_buf jmpbuf; + uch bg_red; + uch bg_green; + uch bg_blue; +} mainprog_info; + + +/* prototypes for public functions in writepng.c */ + +void writepng_version_info(void); + +int writepng_init(mainprog_info *mainprog_ptr); + +int writepng_encode_image(mainprog_info *mainprog_ptr); + +int writepng_encode_row(mainprog_info *mainprog_ptr); + +int writepng_encode_finish(mainprog_info *mainprog_ptr); + +void writepng_cleanup(mainprog_info *mainprog_ptr); diff --git a/Engine/lib/lpng/contrib/libtests/fakepng.c b/Engine/lib/lpng/contrib/libtests/fakepng.c new file mode 100644 index 000000000..6512c1401 --- /dev/null +++ b/Engine/lib/lpng/contrib/libtests/fakepng.c @@ -0,0 +1,65 @@ +/* Fake a PNG - just write it out directly. + * + * COPYRIGHT: Written by John Cunningham Bowler, 2014. + * To the extent possible under law, the author has waived all copyright and + * related or neighboring rights to this work. This work is published from: + * United States. + * + */ + +#include +#include /* for crc32 */ + +void +put_uLong(uLong val) +{ + putchar(val >> 24); + putchar(val >> 16); + putchar(val >> 8); + putchar(val >> 0); +} + +void +put_chunk(const unsigned char *chunk, uInt length) +{ + uLong crc; + + put_uLong(length-4); /* Exclude the tag */ + + fwrite(chunk, length, 1, stdout); + + crc = crc32(0, Z_NULL, 0); + put_uLong(crc32(crc, chunk, length)); +} + +const unsigned char signature[] = +{ + 137, 80, 78, 71, 13, 10, 26, 10 +}; + +const unsigned char IHDR[] = +{ + 73, 72, 68, 82, /* IHDR */ + 0, 0, 0, 1, /* width */ + 0, 0, 0, 1, /* height */ + 1, /* bit depth */ + 0, /* color type: greyscale */ + 0, /* compression method */ + 0, /* filter method */ + 0 /* interlace method: none */ +}; + +const unsigned char unknown[] = +{ + 'u', 'n', 'K', 'n' /* "unKn" - private safe to copy */ +}; + +int +main(void) +{ + fwrite(signature, sizeof signature, 1, stdout); + put_chunk(IHDR, sizeof IHDR); + + for (;;) + put_chunk(unknown, sizeof unknown); +} diff --git a/Engine/lib/lpng/contrib/libtests/gentests.sh b/Engine/lib/lpng/contrib/libtests/gentests.sh new file mode 100755 index 000000000..f0f8d2395 --- /dev/null +++ b/Engine/lib/lpng/contrib/libtests/gentests.sh @@ -0,0 +1,102 @@ +#!/bin/sh +# +# Copyright (c) 2013 John Cunningham Bowler +# +# Last changed in libpng 1.6.0 [February 14, 2013] +# +# This code is released under the libpng license. +# For conditions of distribution and use, see the disclaimer +# and license in png.h +# +# Generate a set of PNG test images. The images are generated in a +# sub-directory called 'tests' by default, however a command line argument will +# change that name. The generation requires a built version of makepng in the +# current directory. +# +usage(){ + exec >&2 + echo "$0 []" + echo ' Generate a set of PNG test files in "directory" ("tests" by default)' + exit 1 +} + +mp="$PWD/makepng" +test -x "$mp" || { + exec >&2 + echo "$0: the 'makepng' program must exist" + echo " in the directory within which this program:" + echo " $mp" + echo " is executed" + usage +} + +# Just one argument: the directory +testdir="tests" +test $# -gt 1 && { + testdir="$1" + shift +} +test $# -eq 0 || usage + +# Take care not to clobber something +if test -e "$testdir" +then + test -d "$testdir" || usage +else + # mkdir -p isn't portable, so do the following + mkdir "$testdir" 2>/dev/null || mkdir -p "$testdir" || usage +fi + +# This fails in a very satisfactory way if it's not accessible +cd "$testdir" +:>"test$$.png" || { + exec >&2 + echo "$testdir: directory not writable" + usage +} +rm "test$$.png" || { + exec >&2 + echo "$testdir: you have create but not write privileges here." + echo " This is unexpected. You have a spurion; "'"'"test$$.png"'"'"." + echo " You need to remove this yourself. Try a different directory." + exit 1 +} + +# Now call makepng ($mp) to create every file we can think of with a +# reasonable name +doit(){ + for gamma in "" --sRGB --linear --1.8 + do + case "$gamma" in + "") + gname=;; + --sRGB) + gname="-srgb";; + --linear) + gname="-lin";; + --1.8) + gname="-18";; + *) + gname="-$gamma";; + esac + "$mp" $gamma "$1" "$2" "test-$1-$2$gname.png" + done +} +# +for ct in gray palette +do + for bd in 1 2 4 8 + do + doit "$ct" "$bd" + done +done +# +doit "gray" "16" +# +for ct in gray-alpha rgb rgb-alpha +do + for bd in 8 16 + do + doit "$ct" "$bd" + done +done diff --git a/Engine/lib/lpng/contrib/libtests/makepng.c b/Engine/lib/lpng/contrib/libtests/makepng.c new file mode 100644 index 000000000..312062bda --- /dev/null +++ b/Engine/lib/lpng/contrib/libtests/makepng.c @@ -0,0 +1,1941 @@ +/* makepng.c */ +#define _ISOC99_SOURCE +/* Copyright: */ +#define COPYRIGHT "\251 2013,2015 John Cunningham Bowler" +/* + * Last changed in libpng 1.6.20 [November 24, 2015] + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + * + * Make a test PNG image. The arguments are as follows: + * + * makepng [--sRGB|--linear|--1.8] [--tRNS] [--nofilters] \ + * color-type bit-depth [file-name] + * + * The color-type may be numeric (and must match the numbers used by the PNG + * specification) or one of the format names listed below. The bit-depth is the + * component bit depth, or the pixel bit-depth for a color-mapped image. + * + * Without any options no color-space information is written, with the options + * an sRGB or the appropriate gAMA chunk is written. "1.8" refers to the + * display system used on older Apple computers to correct for high ambient + * light levels in the viewing environment; it applies a transform of + * approximately value^(1/1.45) to the color values and so a gAMA chunk of 65909 + * is written (1.45/2.2). + * + * The image data is generated internally. Unless --color is given the images + * used are as follows: + * + * 1 channel: a square image with a diamond, the least luminous colors are on + * the edge of the image, the most luminous in the center. + * + * 2 channels: the color channel increases in luminosity from top to bottom, the + * alpha channel increases in opacity from left to right. + * + * 3 channels: linear combinations of, from the top-left corner clockwise, + * black, green, white, red. + * + * 4 channels: linear combinations of, from the top-left corner clockwise, + * transparent, red, green, blue. + * + * For color-mapped images a four channel color-map is used and if --tRNS is + * given the PNG file has a tRNS chunk, as follows: + * + * 1-bit: entry 0 is transparent-red, entry 1 is opaque-white + * 2-bit: entry 0: transparent-green + * entry 1: 40%-red + * entry 2: 80%-blue + * entry 3: opaque-white + * 4-bit: the 16 combinations of the 2-bit case + * 8-bit: the 256 combinations of the 4-bit case + * + * The palette always has 2^bit-depth entries and the tRNS chunk one fewer. The + * image is the 1-channel diamond, but using palette index, not luminosity. + * + * For formats other than color-mapped ones if --tRNS is specified a tRNS chunk + * is generated with all channels equal to the low bits of 0x0101. + * + * Image size is determined by the final pixel depth in bits, i.e. channels x + * bit-depth, as follows: + * + * 8 bits or less: 64x64 + * 16 bits: 256x256 + * More than 16 bits: 1024x1024 + * + * Row filtering is the libpng default but may be turned off (the 'none' filter + * is used on every row) with the --nofilters option. + * + * The images are not interlaced. + * + * If file-name is given then the PNG is written to that file, else it is + * written to stdout. Notice that stdout is not supported on systems where, by + * default, it assumes text output; this program makes no attempt to change the + * text mode of stdout! + * + * makepng --color= ... + * + * If --color is given then the whole image has that color, color-mapped images + * will have exactly one palette entry and all image files with be 16x16 in + * size. The color value is 1 to 4 decimal numbers as appropriate for the color + * type. + * + * makepng --small ... + * + * If --small is given the images are no larger than required to include every + * possible pixel value for the format. + * + * For formats with pixels 8 bits or fewer in size the images consist of a + * single row with 2^pixel-depth pixels, one of every possible value. + * + * For formats with 16-bit pixels a 256x256 image is generated containing every + * possible pixel value. + * + * For larger pixel sizes a 256x256 image is generated where the first row + * consists of each pixel that has identical byte values throughout the pixel + * followed by rows where the byte values differ within the pixel. + * + * In all cases the pixel values are arranged in such a way that the SUB and UP + * filters give byte sequences for maximal zlib compression. By default (if + * --nofilters is not given) the SUB filter is used on the first row and the UP + * filter on all following rows. + * + * The --small option is meant to provide good test-case coverage, however the + * images are not easy to examine visually. Without the --small option the + * images contain identical color values; the pixel values are adjusted + * according to the gamma encoding with no gamma encoding being interpreted as + * sRGB. + * + * LICENSING + * ========= + * + * This code is copyright of the authors, see the COPYRIGHT define above. The + * code is licensed as above, using the libpng license. The code generates + * images which are solely the product of the code; the options choose which of + * the many possibilities to generate. The images that result (but not the code + * which generates them) are licensed as defined here: + * + * IMPORTANT: the COPYRIGHT #define must contain ISO-Latin-1 characters, the + * IMAGE_LICENSING #define must contain UTF-8 characters. The 'copyright' + * symbol 0xA9U (\251) in ISO-Latin-1 encoding and 0xC20xA9 (\302\251) in UTF-8. + */ +#define IMAGE_LICENSING "Dedicated to the public domain per Creative Commons "\ + "license \"CC0 1.0\"; https://creativecommons.org/publicdomain/zero/1.0/" + +#include /* for offsetof */ +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H) +# include +#endif + +/* Define the following to use this test against your installed libpng, rather + * than the one being built here: + */ +#ifdef PNG_FREESTANDING_TESTS +# include +#else +# include "../../png.h" +#endif + +#include + +/* Work round for GCC complaints about casting a (double) function result to + * an unsigned: + */ +static unsigned int +flooru(double d) +{ + d = floor(d); + return (unsigned int)d; +} + +static png_byte +floorb(double d) +{ + d = floor(d); + return (png_byte)d; +} + +/* This structure is used for inserting extra chunks (the --insert argument, not + * documented above.) + */ +typedef struct chunk_insert +{ + struct chunk_insert *next; + void (*insert)(png_structp, png_infop, int, png_charpp); + int nparams; + png_charp parameters[1]; +} chunk_insert; + +static unsigned int +channels_of_type(int color_type) +{ + if (color_type & PNG_COLOR_MASK_PALETTE) + return 1; + + else + { + int channels = 1; + + if (color_type & PNG_COLOR_MASK_COLOR) + channels = 3; + + if (color_type & PNG_COLOR_MASK_ALPHA) + return channels + 1; + + else + return channels; + } +} + +static unsigned int +pixel_depth_of_type(int color_type, int bit_depth) +{ + return channels_of_type(color_type) * bit_depth; +} + +static unsigned int +image_size_of_type(int color_type, int bit_depth, unsigned int *colors, + int small) +{ + if (*colors) + return 16; + + else + { + int pixel_depth = pixel_depth_of_type(color_type, bit_depth); + + if (small) + { + if (pixel_depth <= 8) /* there will be one row */ + return 1 << pixel_depth; + + else + return 256; + } + + else if (pixel_depth < 8) + return 64; + + else if (pixel_depth > 16) + return 1024; + + else + return 256; + } +} + +static void +set_color(png_colorp color, png_bytep trans, unsigned int red, + unsigned int green, unsigned int blue, unsigned int alpha, + png_const_bytep gamma_table) +{ + color->red = gamma_table[red]; + color->green = gamma_table[green]; + color->blue = gamma_table[blue]; + *trans = (png_byte)alpha; +} + +static int +generate_palette(png_colorp palette, png_bytep trans, int bit_depth, + png_const_bytep gamma_table, unsigned int *colors) +{ + /* + * 1-bit: entry 0 is transparent-red, entry 1 is opaque-white + * 2-bit: entry 0: transparent-green + * entry 1: 40%-red + * entry 2: 80%-blue + * entry 3: opaque-white + * 4-bit: the 16 combinations of the 2-bit case + * 8-bit: the 256 combinations of the 4-bit case + */ + switch (colors[0]) + { + default: + fprintf(stderr, "makepng: --colors=...: invalid count %u\n", + colors[0]); + exit(1); + + case 1: + set_color(palette+0, trans+0, colors[1], colors[1], colors[1], 255, + gamma_table); + return 1; + + case 2: + set_color(palette+0, trans+0, colors[1], colors[1], colors[1], + colors[2], gamma_table); + return 1; + + case 3: + set_color(palette+0, trans+0, colors[1], colors[2], colors[3], 255, + gamma_table); + return 1; + + case 4: + set_color(palette+0, trans+0, colors[1], colors[2], colors[3], + colors[4], gamma_table); + return 1; + + case 0: + if (bit_depth == 1) + { + set_color(palette+0, trans+0, 255, 0, 0, 0, gamma_table); + set_color(palette+1, trans+1, 255, 255, 255, 255, gamma_table); + return 2; + } + + else + { + unsigned int size = 1U << (bit_depth/2); /* 2, 4 or 16 */ + unsigned int x, y; + volatile unsigned int ip = 0; + + for (x=0; x> 3; + + if (offset < rowbytes && (bit_depth < 16 || offset+1 < rowbytes)) + { + row += offset; + + switch (bit_depth) + { + case 1: + case 2: + case 4: + /* Don't gamma correct - values get smashed */ + { + unsigned int shift = (8 - bit_depth) - (x & 0x7U); + + mask <<= shift; + value = (value << shift) & mask; + *row = (png_byte)((*row & ~mask) | value); + } + return; + + default: + fprintf(stderr, "makepng: bad bit depth (internal error)\n"); + exit(1); + + case 16: + value = flooru(65535*pow(value/65535.,conv)+.5); + *row++ = (png_byte)(value >> 8); + *row = (png_byte)value; + return; + + case 8: + *row = gamma_table[value]; + return; + } + } + + else + { + fprintf(stderr, "makepng: row buffer overflow (internal error)\n"); + exit(1); + } + } + + else + { + fprintf(stderr, "makepng: component overflow (internal error)\n"); + exit(1); + } +} + +static int /* filter mask for row */ +generate_row(png_bytep row, size_t rowbytes, unsigned int y, int color_type, + int bit_depth, png_const_bytep gamma_table, double conv, + unsigned int *colors, int small) +{ + int filters = 0; /* file *MASK*, 0 means the default, not NONE */ + png_uint_32 size_max = + image_size_of_type(color_type, bit_depth, colors, small)-1; + png_uint_32 depth_max = (1U << bit_depth)-1; /* up to 65536 */ + + if (colors[0] == 0) if (small) + { + unsigned int pixel_depth = pixel_depth_of_type(color_type, bit_depth); + + /* For pixel depths less than 16 generate a single row containing all the + * possible pixel values. For 16 generate all 65536 byte pair + * combinations in a 256x256 pixel array. + */ + switch (pixel_depth) + { + case 1: + assert(y == 0 && rowbytes == 1 && size_max == 1); + row[0] = 0x6CU; /* binary: 01101100, only top 2 bits used */ + filters = PNG_FILTER_NONE; + break; + + case 2: + assert(y == 0 && rowbytes == 1 && size_max == 3); + row[0] = 0x1BU; /* binary 00011011, all bits used */ + filters = PNG_FILTER_NONE; + break; + + case 4: + assert(y == 0 && rowbytes == 8 && size_max == 15); + row[0] = 0x01U; + row[1] = 0x23U; /* SUB gives 0x22U for all following bytes */ + row[2] = 0x45U; + row[3] = 0x67U; + row[4] = 0x89U; + row[5] = 0xABU; + row[6] = 0xCDU; + row[7] = 0xEFU; + filters = PNG_FILTER_SUB; + break; + + case 8: + /* The row will have all the pixel values in order starting with + * '1', the SUB filter will change every byte into '1' (including + * the last, which generates pixel value '0'). Since the SUB filter + * has value 1 this should result in maximum compression. + */ + assert(y == 0 && rowbytes == 256 && size_max == 255); + for (;;) + { + row[size_max] = 0xFFU & (size_max+1); + if (size_max == 0) + break; + --size_max; + } + filters = PNG_FILTER_SUB; + break; + + case 16: + /* Rows are generated such that each row has a constant difference + * between the first and second byte of each pixel and so that the + * difference increases by 1 at each row. The rows start with the + * first byte value of 0 and the value increases to 255 across the + * row. + * + * The difference starts at 1, so the first row is: + * + * 0 1 1 2 2 3 3 4 ... 254 255 255 0 + * + * This means that running the SUB filter on the first row produces: + * + * [SUB==1] 0 1 0 1 0 1... + * + * Then the difference is 2 on the next row, giving: + * + * 0 2 1 3 2 4 3 5 ... 254 0 255 1 + * + * When the UP filter is run on this libpng produces: + * + * [UP ==2] 0 1 0 1 0 1... + * + * And so on for all the remain rows to the final two * rows: + * + * row 254: 0 255 1 0 2 1 3 2 4 3 ... 254 253 255 254 + * row 255: 0 0 1 1 2 2 3 3 4 4 ... 254 254 255 255 + */ + assert(rowbytes == 512 && size_max == 255); + for (;;) + { + row[2*size_max ] = 0xFFU & size_max; + row[2*size_max+1] = 0xFFU & (size_max+y+1); + if (size_max == 0) + break; + --size_max; + } + /* The first row must include PNG_FILTER_UP so that libpng knows we + * need to keep it for the following row: + */ + filters = (y == 0 ? PNG_FILTER_SUB+PNG_FILTER_UP : PNG_FILTER_UP); + break; + + case 24: + case 32: + case 48: + case 64: + /* The rows are filled by an alogorithm similar to the above, in the + * first row pixel bytes are all equal, increasing from 0 by 1 for + * each pixel. In the second row the bytes within a pixel are + * incremented 1,3,5,7,... from the previous row byte. Using an odd + * number ensures all the possible byte values are used. + */ + assert(size_max == 255 && rowbytes == 256*(pixel_depth>>3)); + pixel_depth >>= 3; /* now in bytes */ + while (rowbytes > 0) + { + const size_t pixel_index = --rowbytes/pixel_depth; + + if (y == 0) + row[rowbytes] = 0xFFU & pixel_index; + + else + { + const size_t byte_offset = + rowbytes - pixel_index * pixel_depth; + + row[rowbytes] = + 0xFFU & (pixel_index + (byte_offset * 2*y) + 1); + } + } + filters = (y == 0 ? PNG_FILTER_SUB+PNG_FILTER_UP : PNG_FILTER_UP); + break; + + default: + assert(0/*NOT REACHED*/); + } + } + + else switch (channels_of_type(color_type)) + { + /* 1 channel: a square image with a diamond, the least luminous colors are on + * the edge of the image, the most luminous in the center. + */ + case 1: + { + png_uint_32 x; + png_uint_32 base = 2*size_max - abs(2*y-size_max); + + for (x=0; x<=size_max; ++x) + { + png_uint_32 luma = base - abs(2*x-size_max); + + /* 'luma' is now in the range 0..2*size_max, we need + * 0..depth_max + */ + luma = (luma*depth_max + size_max) / (2*size_max); + set_value(row, rowbytes, x, bit_depth, luma, gamma_table, conv); + } + } + break; + + /* 2 channels: the color channel increases in luminosity from top to bottom, + * the alpha channel increases in opacity from left to right. + */ + case 2: + { + png_uint_32 alpha = (depth_max * y * 2 + size_max) / (2 * size_max); + png_uint_32 x; + + for (x=0; x<=size_max; ++x) + { + set_value(row, rowbytes, 2*x, bit_depth, + (depth_max * x * 2 + size_max) / (2 * size_max), gamma_table, + conv); + set_value(row, rowbytes, 2*x+1, bit_depth, alpha, gamma_table, + conv); + } + } + break; + + /* 3 channels: linear combinations of, from the top-left corner clockwise, + * black, green, white, red. + */ + case 3: + { + /* x0: the black->red scale (the value of the red component) at the + * start of the row (blue and green are 0). + * x1: the green->white scale (the value of the red and blue + * components at the end of the row; green is depth_max). + */ + png_uint_32 Y = (depth_max * y * 2 + size_max) / (2 * size_max); + png_uint_32 x; + + /* Interpolate x/depth_max from start to end: + * + * start end difference + * red: Y Y 0 + * green: 0 depth_max depth_max + * blue: 0 Y Y + */ + for (x=0; x<=size_max; ++x) + { + set_value(row, rowbytes, 3*x+0, bit_depth, /* red */ Y, + gamma_table, conv); + set_value(row, rowbytes, 3*x+1, bit_depth, /* green */ + (depth_max * x * 2 + size_max) / (2 * size_max), + gamma_table, conv); + set_value(row, rowbytes, 3*x+2, bit_depth, /* blue */ + (Y * x * 2 + size_max) / (2 * size_max), + gamma_table, conv); + } + } + break; + + /* 4 channels: linear combinations of, from the top-left corner clockwise, + * transparent, red, green, blue. + */ + case 4: + { + /* x0: the transparent->blue scale (the value of the blue and alpha + * components) at the start of the row (red and green are 0). + * x1: the red->green scale (the value of the red and green + * components at the end of the row; blue is 0 and alpha is + * depth_max). + */ + png_uint_32 Y = (depth_max * y * 2 + size_max) / (2 * size_max); + png_uint_32 x; + + /* Interpolate x/depth_max from start to end: + * + * start end difference + * red: 0 depth_max-Y depth_max-Y + * green: 0 Y Y + * blue: Y 0 -Y + * alpha: Y depth_max depth_max-Y + */ + for (x=0; x<=size_max; ++x) + { + set_value(row, rowbytes, 4*x+0, bit_depth, /* red */ + ((depth_max-Y) * x * 2 + size_max) / (2 * size_max), + gamma_table, conv); + set_value(row, rowbytes, 4*x+1, bit_depth, /* green */ + (Y * x * 2 + size_max) / (2 * size_max), + gamma_table, conv); + set_value(row, rowbytes, 4*x+2, bit_depth, /* blue */ + Y - (Y * x * 2 + size_max) / (2 * size_max), + gamma_table, conv); + set_value(row, rowbytes, 4*x+3, bit_depth, /* alpha */ + Y + ((depth_max-Y) * x * 2 + size_max) / (2 * size_max), + gamma_table, conv); + } + } + break; + + default: + fprintf(stderr, "makepng: internal bad channel count\n"); + exit(2); + } + + else if (color_type & PNG_COLOR_MASK_PALETTE) + { + /* Palette with fixed color: the image rows are all 0 and the image width + * is 16. + */ + memset(row, 0, rowbytes); + } + + else if (colors[0] == channels_of_type(color_type)) + switch (channels_of_type(color_type)) + { + case 1: + { + png_uint_32 luma = colors[1]; + png_uint_32 x; + + for (x=0; x<=size_max; ++x) + set_value(row, rowbytes, x, bit_depth, luma, gamma_table, + conv); + } + break; + + case 2: + { + png_uint_32 luma = colors[1]; + png_uint_32 alpha = colors[2]; + png_uint_32 x; + + for (x=0; x 0 && gamma < 1000) + gamma = PNG_FP_1; + + if (gamma > 0) + real_gamma = gamma; + + { + unsigned int i; + + if (real_gamma == 45455) for (i=0; i<256; ++i) + { + gamma_table[i] = (png_byte)i; + conv = 1.; + } + + else + { + /* Convert 'i' from sRGB (45455) to real_gamma, this makes + * the images look the same regardless of the gAMA chunk. + */ + conv = real_gamma; + conv /= 45455; + + gamma_table[0] = 0; + + for (i=1; i<255; ++i) + gamma_table[i] = floorb(pow(i/255.,conv) * 255 + .5); + + gamma_table[255] = 255; + } + } + + png_set_IHDR(png_ptr, info_ptr, size, ysize, bit_depth, color_type, + PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + + if (color_type & PNG_COLOR_MASK_PALETTE) + { + int npalette; + png_color palette[256]; + png_byte trans[256]; + + npalette = generate_palette(palette, trans, bit_depth, gamma_table, + colors); + png_set_PLTE(png_ptr, info_ptr, palette, npalette); + + if (tRNS) + png_set_tRNS(png_ptr, info_ptr, trans, npalette-1, + NULL/*transparent color*/); + + /* Reset gamma_table to prevent the image rows being changed */ + for (npalette=0; npalette<256; ++npalette) + gamma_table[npalette] = (png_byte)npalette; + } + + else if (tRNS) + { + png_color_16 col; + + col.red = col.green = col.blue = col.gray = + 0x0101U & ((1U< 0) /* Else don't set color space information */ + { + png_set_gAMA_fixed(png_ptr, info_ptr, real_gamma); + + /* Just use the sRGB values here. */ + png_set_cHRM_fixed(png_ptr, info_ptr, + /* color x y */ + /* white */ 31270, 32900, + /* red */ 64000, 33000, + /* green */ 30000, 60000, + /* blue */ 15000, 6000 + ); + } + + /* Insert extra information. */ + while (insert != NULL) + { + insert->insert(png_ptr, info_ptr, insert->nparams, insert->parameters); + insert = insert->next; + } + + /* Write the file header. */ + png_write_info(png_ptr, info_ptr); + + /* Restrict the filters */ + png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE, filters); + + { +# ifdef PNG_WRITE_INTERLACING_SUPPORTED + int passes = png_set_interlace_handling(png_ptr); +# else /* !WRITE_INTERLACING */ + int passes = 1; +# endif /* !WRITE_INTERLACING */ + int pass; + size_t rowbytes = png_get_rowbytes(png_ptr, info_ptr); + + row = malloc(rowbytes); + + if (row == NULL) + png_error(png_ptr, "OOM allocating row buffer"); + + for (pass = 0; pass < passes; ++pass) + { + unsigned int y; + + for (y=0; y 0) + { + /* Round up to a multiple of 4 here to allow an iCCP profile + * to be padded to a 4x boundary. + */ + png_bytep data = malloc((total+3)&~3); + + if (data != NULL) + { + size_t new_size = 0; + + for (;;) + { + ch = getc(fp); + if (ch == EOF) break; + data[new_size++] = (png_byte)ch; + } + + if (ferror(fp) || new_size != total) + { + perror("temporary file"); + fprintf(stderr, "temporary file read error\n"); + free(data); + } + + else + { + (void)fclose(fp); + *result = data; + return total; + } + } + + else + fprintf(stderr, "%s: out of memory loading file\n", name); + } + + else + fprintf(stderr, "%s: empty file\n", name); + } + } + } + + else + { + perror(name); + fprintf(stderr, "%s: open failed\n", name); + } + + fclose(fp); + } + + else + fprintf(stderr, "makepng: %s: could not open temporary file\n", name); + + exit(1); + return 0; +} + +static size_t +load_fake(png_charp param, png_bytepp profile) +{ + char *endptr = NULL; + uint64_t size = strtoull(param, &endptr, 0/*base*/); + + /* The 'fake' format is *[string] */ + if (endptr != NULL && *endptr == '*') + { + size_t len = strlen(++endptr); + size_t result = (size_t)size; + + if (len == 0) len = 1; /* capture the terminating '\0' */ + + /* Now repeat that string to fill 'size' bytes. */ + if (result == size && (*profile = malloc(result)) != NULL) + { + png_bytep out = *profile; + + if (len == 1) + memset(out, *endptr, result); + + else + { + while (size >= len) + { + memcpy(out, endptr, len); + out += len; + size -= len; + } + memcpy(out, endptr, size); + } + + return result; + } + + else + { + fprintf(stderr, "%s: size exceeds system limits\n", param); + exit(1); + } + } + + return 0; +} + +static void +check_param_count(int nparams, int expect) +{ + if (nparams != expect) + { + fprintf(stderr, "bad parameter count (internal error)\n"); + exit(1); + } +} + +static void +insert_iCCP(png_structp png_ptr, png_infop info_ptr, int nparams, + png_charpp params) +{ + png_bytep profile = NULL; + png_uint_32 proflen = 0; + int result; + + check_param_count(nparams, 2); + + switch (params[1][0]) + { + case '<': + { + size_t filelen = load_file(params[1]+1, &profile); + if (filelen > 0xfffffffc) /* Maximum profile length */ + { + fprintf(stderr, "%s: file too long (%lu) for an ICC profile\n", + params[1]+1, (unsigned long)filelen); + exit(1); + } + + proflen = (png_uint_32)filelen; + } + break; + + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + { + size_t fake_len = load_fake(params[1], &profile); + + if (fake_len > 0) /* else a simple parameter */ + { + if (fake_len > 0xffffffff) /* Maximum profile length */ + { + fprintf(stderr, + "%s: fake data too long (%lu) for an ICC profile\n", + params[1], (unsigned long)fake_len); + exit(1); + } + proflen = (png_uint_32)(fake_len & ~3U); + /* Always fix up the profile length. */ + png_save_uint_32(profile, proflen); + break; + } + } + + default: + fprintf(stderr, "--insert iCCP \"%s\": unrecognized\n", params[1]); + fprintf(stderr, " use '<' to read a file: \" 3) + { + png_uint_32 prof_header = png_get_uint_32(profile); + + if (prof_header != proflen) + { + fprintf(stderr, "--insert iCCP %s: profile length field wrong:\n", + params[1]); + fprintf(stderr, " actual %lu, recorded value %lu (corrected)\n", + (unsigned long)proflen, (unsigned long)prof_header); + png_save_uint_32(profile, proflen); + } + } + + if (result && profile != NULL && proflen >=4) + png_set_iCCP(png_ptr, info_ptr, params[0], PNG_COMPRESSION_TYPE_BASE, + profile, proflen); + + if (profile) + free(profile); + + if (!result) + exit(1); +} + +static void +clear_text(png_text *text, png_charp keyword) +{ + text->compression = -1; /* none */ + text->key = keyword; + text->text = NULL; + text->text_length = 0; /* libpng calculates this */ + text->itxt_length = 0; /* libpng calculates this */ + text->lang = NULL; + text->lang_key = NULL; +} + +static void +set_text(png_structp png_ptr, png_infop info_ptr, png_textp text, + png_charp param) +{ + switch (param[0]) + { + case '<': + { + png_bytep file = NULL; + + text->text_length = load_file(param+1, &file); + text->text = (png_charp)file; + } + break; + + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + { + png_bytep data = NULL; + size_t fake_len = load_fake(param, &data); + + if (fake_len > 0) /* else a simple parameter */ + { + text->text_length = fake_len; + text->text = (png_charp)data; + break; + } + } + + default: + text->text = param; + break; + } + + png_set_text(png_ptr, info_ptr, text, 1); + + if (text->text != param) + free(text->text); +} + +static void +insert_tEXt(png_structp png_ptr, png_infop info_ptr, int nparams, + png_charpp params) +{ + png_text text; + + check_param_count(nparams, 2); + clear_text(&text, params[0]); + set_text(png_ptr, info_ptr, &text, params[1]); +} + +static void +insert_zTXt(png_structp png_ptr, png_infop info_ptr, int nparams, + png_charpp params) +{ + png_text text; + + check_param_count(nparams, 2); + clear_text(&text, params[0]); + text.compression = 0; /* deflate */ + set_text(png_ptr, info_ptr, &text, params[1]); +} + +static void +insert_iTXt(png_structp png_ptr, png_infop info_ptr, int nparams, + png_charpp params) +{ + png_text text; + + check_param_count(nparams, 4); + clear_text(&text, params[0]); + text.compression = 2; /* iTXt + deflate */ + text.lang = params[1];/* language tag */ + text.lang_key = params[2]; /* translated keyword */ + set_text(png_ptr, info_ptr, &text, params[3]); +} + +static void +insert_hIST(png_structp png_ptr, png_infop info_ptr, int nparams, + png_charpp params) +{ + int i; + png_uint_16 freq[256]; + + /* libpng takes the count from the PLTE count; we don't check it here but we + * do set the array to 0 for unspecified entries. + */ + memset(freq, 0, sizeof freq); + for (i=0; inext = NULL; + cip->insert = insert; + cip->nparams = nparams; + for (i=0; iparameters[i] = list[i]; + + return cip; +} + +static chunk_insert * +find_insert(png_const_charp what, png_charp param) +{ + png_uint_32 chunk = 0; + png_charp parameter_list[1024]; + int i, nparams; + + /* Assemble the chunk name */ + for (i=0; i<4; ++i) + { + char ch = what[i]; + + if ((ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122)) + chunk = (chunk << 8) + what[i]; + + else + break; + } + + if (i < 4 || what[4] != 0) + { + fprintf(stderr, "makepng --insert \"%s\": invalid chunk name\n", what); + exit(1); + } + + /* Assemble the parameter list. */ + nparams = find_parameters(what, param, parameter_list, 1024); + +# define CHUNK(a,b,c,d) (((a)<<24)+((b)<<16)+((c)<<8)+(d)) + + switch (chunk) + { + case CHUNK(105,67,67,80): /* iCCP */ + if (nparams == 2) + return make_insert(what, insert_iCCP, nparams, parameter_list); + break; + + case CHUNK(116,69,88,116): /* tEXt */ + if (nparams == 2) + return make_insert(what, insert_tEXt, nparams, parameter_list); + break; + + case CHUNK(122,84,88,116): /* zTXt */ + if (nparams == 2) + return make_insert(what, insert_zTXt, nparams, parameter_list); + break; + + case CHUNK(105,84,88,116): /* iTXt */ + if (nparams == 4) + return make_insert(what, insert_iTXt, nparams, parameter_list); + break; + + case CHUNK(104,73,83,84): /* hIST */ + if (nparams <= 256) + return make_insert(what, insert_hIST, nparams, parameter_list); + break; + + case CHUNK(115,66,73,84): /* sBIT */ + if (nparams <= 4) + return make_insert(what, insert_sBIT, nparams, parameter_list); + break; + +#if 0 + case CHUNK(115,80,76,84): /* sPLT */ + return make_insert(what, insert_sPLT, nparams, parameter_list); +#endif + + default: + fprintf(stderr, "makepng --insert \"%s\": unrecognized chunk name\n", + what); + exit(1); + } + + bad_parameter_count(what, nparams); + return NULL; +} + +/* This is necessary because libpng expects writeable strings for things like + * text chunks (maybe this should be fixed...) + */ +static png_charp +strstash(png_const_charp foo) +{ + /* The program indicates a memory allocation error by crashing, this is by + * design. + */ + if (foo != NULL) + { + png_charp bar = malloc(strlen(foo)+1); + return strcpy(bar, foo); + } + + return NULL; +} + +static png_charp +strstash_list(const png_const_charp *text) +{ + size_t foo = 0; + png_charp result, bar; + const png_const_charp *line = text; + + while (*line != NULL) + foo += strlen(*line++); + + result = bar = malloc(foo+1); + + line = text; + while (*line != NULL) + { + foo = strlen(*line); + memcpy(bar, *line++, foo); + bar += foo; + } + + *bar = 0; + return result; +} + +/* These are used to insert Copyright and Licence fields, they allow the text to + * have \n unlike the --insert option. + */ +static chunk_insert * +add_tEXt(const char *key, const png_const_charp *text) +{ + static char what[5] = { 116, 69, 88, 116, 0 }; + png_charp parameter_list[3]; + + parameter_list[0] = strstash(key); + parameter_list[1] = strstash_list(text); + parameter_list[2] = NULL; + + return make_insert(what, insert_tEXt, 2, parameter_list); +} + +static chunk_insert * +add_iTXt(const char *key, const char *language, const char *language_key, + const png_const_charp *text) +{ + static char what[5] = { 105, 84, 88, 116, 0 }; + png_charp parameter_list[5]; + + parameter_list[0] = strstash(key); + parameter_list[1] = strstash(language); + parameter_list[2] = strstash(language_key); + parameter_list[3] = strstash_list(text); + parameter_list[4] = NULL; + + return make_insert(what, insert_iTXt, 4, parameter_list); +} + +/* This is a not-very-good parser for a sequence of numbers (including 0). It + * doesn't accept some apparently valid things, but it accepts all the sensible + * combinations. + */ +static void +parse_color(char *arg, unsigned int *colors) +{ + unsigned int ncolors = 0; + + while (*arg && ncolors < 4) + { + char *ep = arg; + + unsigned long ul = strtoul(arg, &ep, 0); + + if (ul > 65535) + { + fprintf(stderr, "makepng --color=...'%s': too big\n", arg); + exit(1); + } + + if (ep == arg) + { + fprintf(stderr, "makepng --color=...'%s': not a valid color\n", arg); + exit(1); + } + + if (*ep) ++ep; /* skip a separator */ + arg = ep; + + colors[++ncolors] = (unsigned int)ul; /* checked above */ + } + + if (*arg) + { + fprintf(stderr, "makepng --color=...'%s': too many values\n", arg); + exit(1); + } + + *colors = ncolors; +} + +int +main(int argc, char **argv) +{ + FILE *fp = stdout; + const char *file_name = NULL; + int color_type = 8; /* invalid */ + int bit_depth = 32; /* invalid */ + int small = 0; /* make full size images */ + int tRNS = 0; /* don't output a tRNS chunk */ + unsigned int colors[5]; + unsigned int filters = PNG_ALL_FILTERS; + png_fixed_point gamma = 0; /* not set */ + chunk_insert *head_insert = NULL; + chunk_insert **insert_ptr = &head_insert; + + memset(colors, 0, sizeof colors); + + while (--argc > 0) + { + char *arg = *++argv; + + if (strcmp(arg, "--small") == 0) + { + small = 1; + continue; + } + + if (strcmp(arg, "--tRNS") == 0) + { + tRNS = 1; + continue; + } + + if (strcmp(arg, "--sRGB") == 0) + { + gamma = PNG_DEFAULT_sRGB; + continue; + } + + if (strcmp(arg, "--linear") == 0) + { + gamma = PNG_FP_1; + continue; + } + + if (strcmp(arg, "--1.8") == 0) + { + gamma = PNG_GAMMA_MAC_18; + continue; + } + + if (strcmp(arg, "--nofilters") == 0) + { + filters = PNG_FILTER_NONE; + continue; + } + + if (strncmp(arg, "--color=", 8) == 0) + { + parse_color(arg+8, colors); + continue; + } + + if (argc >= 3 && strcmp(arg, "--insert") == 0) + { + png_const_charp what = *++argv; + png_charp param = *++argv; + chunk_insert *new_insert; + + argc -= 2; + + new_insert = find_insert(what, param); + + if (new_insert != NULL) + { + *insert_ptr = new_insert; + insert_ptr = &new_insert->next; + } + + continue; + } + + if (arg[0] == '-') + { + fprintf(stderr, "makepng: %s: invalid option\n", arg); + exit(1); + } + + if (strcmp(arg, "palette") == 0) + { + color_type = PNG_COLOR_TYPE_PALETTE; + continue; + } + + if (strncmp(arg, "gray", 4) == 0) + { + if (arg[4] == 0) + { + color_type = PNG_COLOR_TYPE_GRAY; + continue; + } + + else if (strcmp(arg+4, "a") == 0 || + strcmp(arg+4, "alpha") == 0 || + strcmp(arg+4, "-alpha") == 0) + { + color_type = PNG_COLOR_TYPE_GRAY_ALPHA; + continue; + } + } + + if (strncmp(arg, "rgb", 3) == 0) + { + if (arg[3] == 0) + { + color_type = PNG_COLOR_TYPE_RGB; + continue; + } + + else if (strcmp(arg+3, "a") == 0 || + strcmp(arg+3, "alpha") == 0 || + strcmp(arg+3, "-alpha") == 0) + { + color_type = PNG_COLOR_TYPE_RGB_ALPHA; + continue; + } + } + + if (color_type == 8 && isdigit(arg[0])) + { + color_type = atoi(arg); + if (color_type < 0 || color_type > 6 || color_type == 1 || + color_type == 5) + { + fprintf(stderr, "makepng: %s: not a valid color type\n", arg); + exit(1); + } + + continue; + } + + if (bit_depth == 32 && isdigit(arg[0])) + { + bit_depth = atoi(arg); + if (bit_depth <= 0 || bit_depth > 16 || + (bit_depth & -bit_depth) != bit_depth) + { + fprintf(stderr, "makepng: %s: not a valid bit depth\n", arg); + exit(1); + } + + continue; + } + + if (argc == 1) /* It's the file name */ + { + fp = fopen(arg, "wb"); + if (fp == NULL) + { + fprintf(stderr, "%s: %s: could not open\n", arg, strerror(errno)); + exit(1); + } + + file_name = arg; + continue; + } + + fprintf(stderr, "makepng: %s: unknown argument\n", arg); + exit(1); + } /* argument while loop */ + + if (color_type == 8 || bit_depth == 32) + { + fprintf(stderr, "usage: makepng [--small] [--sRGB|--linear|--1.8] " + "[--color=...] color-type bit-depth [file-name]\n" + " Make a test PNG file, by default writes to stdout.\n" + " Other options are available, UTSL.\n"); + exit(1); + } + + /* Check the colors */ + { + unsigned int lim = (color_type == PNG_COLOR_TYPE_PALETTE ? 255U : + (1U< lim) + { + fprintf(stderr, "makepng: --color=...: %u out of range [0..%u]\n", + colors[i], lim); + exit(1); + } + } + + /* small and colors are incomparible (will probably crash if both are used at + * the same time!) + */ + if (small && colors[0] != 0) + { + fprintf(stderr, "makepng: --color --small: only one at a time!\n"); + exit(1); + } + + /* Restrict the filters for more speed to those we know are used for the + * generated images. + */ + if (filters == PNG_ALL_FILTERS && !small/*small provides defaults*/) + { + if ((color_type & PNG_COLOR_MASK_PALETTE) != 0 || bit_depth < 8) + filters = PNG_FILTER_NONE; + + else if (color_type & PNG_COLOR_MASK_COLOR) /* rgb */ + { + if (bit_depth == 8) + filters &= ~(PNG_FILTER_NONE | PNG_FILTER_AVG); + + else + filters = PNG_FILTER_SUB | PNG_FILTER_PAETH; + } + + else /* gray 8 or 16-bit */ + filters &= ~PNG_FILTER_NONE; + } + + /* Insert standard copyright and licence text. */ + { + static png_const_charp copyright[] = + { + COPYRIGHT, /* ISO-Latin-1 */ + NULL + }; + static png_const_charp licensing[] = + { + IMAGE_LICENSING, /* UTF-8 */ + NULL + }; + + chunk_insert *new_insert; + + new_insert = add_tEXt("Copyright", copyright); + if (new_insert != NULL) + { + *insert_ptr = new_insert; + insert_ptr = &new_insert->next; + } + + new_insert = add_iTXt("Licensing", "en", NULL, licensing); + if (new_insert != NULL) + { + *insert_ptr = new_insert; + insert_ptr = &new_insert->next; + } + } + + { + int ret = write_png(&file_name, fp, color_type, bit_depth, gamma, + head_insert, filters, colors, small, tRNS); + + if (ret != 0 && file_name != NULL) + remove(file_name); + + return ret; + } +} diff --git a/Engine/lib/lpng/contrib/libtests/pngimage.c b/Engine/lib/lpng/contrib/libtests/pngimage.c new file mode 100644 index 000000000..f130c043d --- /dev/null +++ b/Engine/lib/lpng/contrib/libtests/pngimage.c @@ -0,0 +1,1712 @@ +/* pngimage.c + * + * Copyright (c) 2015,2016 John Cunningham Bowler + * + * Last changed in libpng 1.6.24 [August 4, 2016] + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + * + * Test the png_read_png and png_write_png interfaces. Given a PNG file load it + * using png_read_png and then write with png_write_png. Test all possible + * transforms. + */ +#include +#include +#include +#include +#include +#include + +#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H) +# include +#endif + +/* Define the following to use this test against your installed libpng, rather + * than the one being built here: + */ +#ifdef PNG_FREESTANDING_TESTS +# include +#else +# include "../../png.h" +#endif + +#ifndef PNG_SETJMP_SUPPORTED +# include /* because png.h did *not* include this */ +#endif + +/* 1.6.1 added support for the configure test harness, which uses 77 to indicate + * a skipped test, in earlier versions we need to succeed on a skipped test, so: + */ +#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H) +# define SKIP 77 +#else +# define SKIP 0 +#endif + +#if PNG_LIBPNG_VER < 10700 + /* READ_PNG and WRITE_PNG were not defined, so: */ +# ifdef PNG_INFO_IMAGE_SUPPORTED +# ifdef PNG_SEQUENTIAL_READ_SUPPORTED +# define PNG_READ_PNG_SUPPORTED +# endif /* SEQUENTIAL_READ */ +# ifdef PNG_WRITE_SUPPORTED +# define PNG_WRITE_PNG_SUPPORTED +# endif /* WRITE */ +# endif /* INFO_IMAGE */ +#endif /* pre 1.7.0 */ + +#ifdef PNG_READ_PNG_SUPPORTED +/* If a transform is valid on both read and write this implies that if the + * transform is applied to read it must also be applied on write to produce + * meaningful data. This is because these transforms when performed on read + * produce data with a memory format that does not correspond to a PNG format. + * + * Most of these transforms are invertible; after applying the transform on + * write the result is the original PNG data that would have would have been + * read if no transform were applied. + * + * The exception is _SHIFT, which destroys the low order bits marked as not + * significant in a PNG with the sBIT chunk. + * + * The following table lists, for each transform, the conditions under which it + * is expected to do anything. Conditions are defined as follows: + * + * 1) Color mask bits required - simply a mask to AND with color_type; one of + * these must be present for the transform to fire, except that 0 means + * 'always'. + * 2) Color mask bits which must be absent - another mask - none of these must + * be present. + * 3) Bit depths - a mask of component bit depths for the transform to fire. + * 4) 'read' - the transform works in png_read_png. + * 5) 'write' - the transform works in png_write_png. + * 6) PNG_INFO_chunk; a mask of the chunks that must be present for the + * transform to fire. All must be present - the requirement is that + * png_get_valid() & mask == mask, so if mask is 0 there is no requirement. + * + * The condition refers to the original image state - if multiple transforms are + * used together it is possible to cause a transform that wouldn't fire on the + * original image to fire. + */ +static struct transform_info +{ + const char *name; + int transform; + png_uint_32 valid_chunks; +# define CHUNK_NONE 0 +# define CHUNK_sBIT PNG_INFO_sBIT +# define CHUNK_tRNS PNG_INFO_tRNS + png_byte color_mask_required; + png_byte color_mask_absent; +# define COLOR_MASK_X 0 +# define COLOR_MASK_P PNG_COLOR_MASK_PALETTE +# define COLOR_MASK_C PNG_COLOR_MASK_COLOR +# define COLOR_MASK_A PNG_COLOR_MASK_ALPHA +# define COLOR_MASK_ALL (PALETTE+COLOR+ALPHA) /* absent = gray, no alpha */ + png_byte bit_depths; +# define BD_ALL (1 + 2 + 4 + 8 + 16) +# define BD_PAL (1 + 2 + 4 + 8) +# define BD_LOW (1 + 2 + 4) +# define BD_16 16 +# define BD_TRUE (8+16) /* i.e. true-color depths */ + png_byte when; +# define TRANSFORM_R 1 +# define TRANSFORM_W 2 +# define TRANSFORM_RW 3 + png_byte tested; /* the transform was tested somewhere */ +} transform_info[] = +{ + /* List ALL the PNG_TRANSFORM_ macros here. Check for support using the READ + * macros; even if the transform is supported on write it cannot be tested + * without the read support. + */ +# define T(name,chunk,cm_required,cm_absent,bd,when)\ + { #name, PNG_TRANSFORM_ ## name, CHUNK_ ## chunk,\ + COLOR_MASK_ ## cm_required, COLOR_MASK_ ## cm_absent, BD_ ## bd,\ + TRANSFORM_ ## when, 0/*!tested*/ } + +#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED + T(STRIP_16, NONE, X, X, 16, R), + /* drops the bottom 8 bits when bit depth is 16 */ +#endif +#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED + T(STRIP_ALPHA, NONE, A, X, ALL, R), + /* removes the alpha channel if present */ +#endif +#ifdef PNG_WRITE_PACK_SUPPORTED +# define TRANSFORM_RW_PACK TRANSFORM_RW +#else +# define TRANSFORM_RW_PACK TRANSFORM_R +#endif +#ifdef PNG_READ_PACK_SUPPORTED + T(PACKING, NONE, X, X, LOW, RW_PACK), + /* unpacks low-bit-depth components into 1 byte per component on read, + * reverses this on write. + */ +#endif +#ifdef PNG_WRITE_PACKSWAP_SUPPORTED +# define TRANSFORM_RW_PACKSWAP TRANSFORM_RW +#else +# define TRANSFORM_RW_PACKSWAP TRANSFORM_R +#endif +#ifdef PNG_READ_PACKSWAP_SUPPORTED + T(PACKSWAP, NONE, X, X, LOW, RW_PACKSWAP), + /* reverses the order of low-bit-depth components packed into a byte */ +#endif +#ifdef PNG_READ_EXPAND_SUPPORTED + T(EXPAND, NONE, P, X, ALL, R), + /* expands PLTE PNG files to RGB (no tRNS) or RGBA (tRNS) * + * Note that the 'EXPAND' transform does lots of different things: */ + T(EXPAND, NONE, X, C, ALL, R), + /* expands grayscale PNG files to RGB, or RGBA */ + T(EXPAND, tRNS, X, A, ALL, R), + /* expands the tRNS chunk in files without alpha */ +#endif +#ifdef PNG_WRITE_INVERT_SUPPORTED +# define TRANSFORM_RW_INVERT TRANSFORM_RW +#else +# define TRANSFORM_RW_INVERT TRANSFORM_R +#endif +#ifdef PNG_READ_INVERT_SUPPORTED + T(INVERT_MONO, NONE, X, C, ALL, RW_INVERT), + /* converts gray-scale components to 1..0 from 0..1 */ +#endif +#ifdef PNG_WRITE_SHIFT_SUPPORTED +# define TRANSFORM_RW_SHIFT TRANSFORM_RW +#else +# define TRANSFORM_RW_SHIFT TRANSFORM_R +#endif +#ifdef PNG_READ_SHIFT_SUPPORTED + T(SHIFT, sBIT, X, X, ALL, RW_SHIFT), + /* reduces component values to the original range based on the sBIT chunk, + * this is only partially reversible - the low bits are lost and cannot be + * recovered on write. In fact write code replicates the bits to generate + * new low-order bits. + */ +#endif +#ifdef PNG_WRITE_BGR_SUPPORTED +# define TRANSFORM_RW_BGR TRANSFORM_RW +#else +# define TRANSFORM_RW_BGR TRANSFORM_R +#endif +#ifdef PNG_READ_BGR_SUPPORTED + T(BGR, NONE, C, P, TRUE, RW_BGR), + /* reverses the rgb component values of true-color pixels */ +#endif +#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED +# define TRANSFORM_RW_SWAP_ALPHA TRANSFORM_RW +#else +# define TRANSFORM_RW_SWAP_ALPHA TRANSFORM_R +#endif +#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED + T(SWAP_ALPHA, NONE, A, X, TRUE, RW_SWAP_ALPHA), + /* swaps the alpha channel of RGBA or GA pixels to the front - ARGB or + * AG, on write reverses the process. + */ +#endif +#ifdef PNG_WRITE_SWAP_SUPPORTED +# define TRANSFORM_RW_SWAP TRANSFORM_RW +#else +# define TRANSFORM_RW_SWAP TRANSFORM_R +#endif +#ifdef PNG_READ_SWAP_SUPPORTED + T(SWAP_ENDIAN, NONE, X, P, 16, RW_SWAP), + /* byte-swaps 16-bit component values */ +#endif +#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED +# define TRANSFORM_RW_INVERT_ALPHA TRANSFORM_RW +#else +# define TRANSFORM_RW_INVERT_ALPHA TRANSFORM_R +#endif +#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED + T(INVERT_ALPHA, NONE, A, X, TRUE, RW_INVERT_ALPHA), + /* converts an alpha channel from 0..1 to 1..0 */ +#endif +#ifdef PNG_WRITE_FILLER_SUPPORTED + T(STRIP_FILLER_BEFORE, NONE, A, P, TRUE, W), /* 'A' for a filler! */ + /* on write skips a leading filler channel; testing requires data with a + * filler channel so this is produced from RGBA or GA images by removing + * the 'alpha' flag from the color type in place. + */ + T(STRIP_FILLER_AFTER, NONE, A, P, TRUE, W), + /* on write strips a trailing filler channel */ +#endif +#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED + T(GRAY_TO_RGB, NONE, X, C, ALL, R), + /* expands grayscale images to RGB, also causes the palette part of + * 'EXPAND' to happen. Low bit depth grayscale images are expanded to + * 8-bits per component and no attempt is made to convert the image to a + * palette image. While this transform is partially reversible + * png_write_png does not currently support this. + */ + T(GRAY_TO_RGB, NONE, P, X, ALL, R), + /* The 'palette' side effect mentioned above; a bit bogus but this is the + * way the libpng code works. + */ +#endif +#ifdef PNG_READ_EXPAND_16_SUPPORTED + T(EXPAND_16, NONE, X, X, PAL, R), + /* expands images to 16-bits per component, as a side effect expands + * palette images to RGB and expands the tRNS chunk if present, so it can + * modify 16-bit per component images as well: + */ + T(EXPAND_16, tRNS, X, A, 16, R), + /* side effect of EXPAND_16 - expands the tRNS chunk in an RGB or G 16-bit + * image. + */ +#endif +#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED + T(SCALE_16, NONE, X, X, 16, R), + /* scales 16-bit components to 8-bits. */ +#endif + + { NULL /*name*/, 0, 0, 0, 0, 0, 0, 0/*!tested*/ } + +#undef T +}; + +#define ARRAY_SIZE(a) ((sizeof a)/(sizeof a[0])) +#define TTABLE_SIZE ARRAY_SIZE(transform_info) + +/* Some combinations of options that should be reversible are not; these cases + * are bugs. + */ +static int known_bad_combos[][2] = +{ + /* problem, antidote */ + { PNG_TRANSFORM_SHIFT | PNG_TRANSFORM_INVERT_ALPHA, 0/*antidote*/ } +}; + +static int +is_combo(int transforms) +{ + return transforms & (transforms-1); /* non-zero if more than one set bit */ +} + +static int +first_transform(int transforms) +{ + return transforms & -transforms; /* lowest set bit */ +} + +static int +is_bad_combo(int transforms) +{ + unsigned int i; + + for (i=0; ifirst.next = NULL; + buffer->last = NULL; + buffer->current = NULL; +} + +static void +buffer_destroy_list(struct buffer_list *list) +{ + if (list != NULL) + { + struct buffer_list *next = list->next; + DELETE(list); + buffer_destroy_list(next); + } +} + +static void +buffer_destroy(struct buffer *buffer) +{ + struct buffer_list *list = buffer->first.next; + buffer_init(buffer); + buffer_destroy_list(list); +} + +#ifdef PNG_WRITE_PNG_SUPPORTED +static void +buffer_start_write(struct buffer *buffer) +{ + buffer->last = &buffer->first; + buffer->end_count = 0; + buffer->current = NULL; +} +#endif + +static void +buffer_start_read(struct buffer *buffer) +{ + buffer->current = &buffer->first; + buffer->read_count = 0; +} + +#ifdef ENOMEM /* required by POSIX 1003.1 */ +# define MEMORY ENOMEM +#else +# define MEMORY ERANGE /* required by ANSI-C */ +#endif +static struct buffer * +get_buffer(png_structp pp) + /* Used from libpng callbacks to get the current buffer */ +{ + return (struct buffer*)png_get_io_ptr(pp); +} + +static struct buffer_list * +buffer_extend(struct buffer_list *current) +{ + struct buffer_list *add; + + assert(current->next == NULL); + + add = NEW(struct buffer_list); + if (add == NULL) + return NULL; + + add->next = NULL; + current->next = add; + + return add; +} + +/* Load a buffer from a file; does the equivalent of buffer_start_write. On a + * read error returns an errno value, else returns 0. + */ +static int +buffer_from_file(struct buffer *buffer, FILE *fp) +{ + struct buffer_list *last = &buffer->first; + size_t count = 0; + + for (;;) + { + size_t r = fread(last->buffer+count, 1/*size*/, + (sizeof last->buffer)-count, fp); + + if (r > 0) + { + count += r; + + if (count >= sizeof last->buffer) + { + assert(count == sizeof last->buffer); + count = 0; + + if (last->next == NULL) + { + last = buffer_extend(last); + if (last == NULL) + return MEMORY; + } + + else + last = last->next; + } + } + + else /* fread failed - probably end of file */ + { + if (feof(fp)) + { + buffer->last = last; + buffer->end_count = count; + return 0; /* no error */ + } + + /* Some kind of funky error; errno should be non-zero */ + return errno == 0 ? ERANGE : errno; + } + } +} + +/* This structure is used to control the test of a single file. */ +typedef enum +{ + VERBOSE, /* switches on all messages */ + INFORMATION, + WARNINGS, /* switches on warnings */ + LIBPNG_WARNING, + APP_WARNING, + ERRORS, /* just errors */ + APP_FAIL, /* continuable error - no need to longjmp */ + LIBPNG_ERROR, /* this and higher cause a longjmp */ + LIBPNG_BUG, /* erroneous behavior in libpng */ + APP_ERROR, /* such as out-of-memory in a callback */ + QUIET, /* no normal messages */ + USER_ERROR, /* such as file-not-found */ + INTERNAL_ERROR +} error_level; +#define LEVEL_MASK 0xf /* where the level is in 'options' */ + +#define EXHAUSTIVE 0x010 /* Test all combinations of active options */ +#define STRICT 0x020 /* Fail on warnings as well as errors */ +#define LOG 0x040 /* Log pass/fail to stdout */ +#define CONTINUE 0x080 /* Continue on APP_FAIL errors */ +#define SKIP_BUGS 0x100 /* Skip over known bugs */ +#define LOG_SKIPPED 0x200 /* Log skipped bugs */ +#define FIND_BAD_COMBOS 0x400 /* Attempt to deduce bad combos */ +#define LIST_COMBOS 0x800 /* List combos by name */ + +/* Result masks apply to the result bits in the 'results' field below; these + * bits are simple 1U<options = WARNINGS; /* default to !verbose, !quiet */ + dp->filename = NULL; + dp->operation = NULL; + dp->original_pp = NULL; + dp->original_ip = NULL; + dp->original_rows = NULL; + dp->read_pp = NULL; + dp->read_ip = NULL; + buffer_init(&dp->original_file); + +# ifdef PNG_WRITE_PNG_SUPPORTED + dp->write_pp = NULL; + buffer_init(&dp->written_file); +# endif +} + +static void +display_clean_read(struct display *dp) +{ + if (dp->read_pp != NULL) + png_destroy_read_struct(&dp->read_pp, &dp->read_ip, NULL); +} + +#ifdef PNG_WRITE_PNG_SUPPORTED +static void +display_clean_write(struct display *dp) +{ + if (dp->write_pp != NULL) + png_destroy_write_struct(&dp->write_pp, NULL); +} +#endif + +static void +display_clean(struct display *dp) +{ +# ifdef PNG_WRITE_PNG_SUPPORTED + display_clean_write(dp); +# endif + display_clean_read(dp); + + dp->original_rowbytes = 0; + dp->original_rows = NULL; + dp->chunks = 0; + + png_destroy_read_struct(&dp->original_pp, &dp->original_ip, NULL); + /* leave the filename for error detection */ + dp->results = 0; /* reset for next time */ +} + +static void +display_destroy(struct display *dp) +{ + /* Release any memory held in the display. */ +# ifdef PNG_WRITE_PNG_SUPPORTED + buffer_destroy(&dp->written_file); +# endif + + buffer_destroy(&dp->original_file); +} + +static struct display * +get_dp(png_structp pp) + /* The display pointer is always stored in the png_struct error pointer */ +{ + struct display *dp = (struct display*)png_get_error_ptr(pp); + + if (dp == NULL) + { + fprintf(stderr, "pngimage: internal error (no display)\n"); + exit(99); /* prevents a crash */ + } + + return dp; +} + +/* error handling */ +#ifdef __GNUC__ +# define VGATTR __attribute__((__format__ (__printf__,3,4))) + /* Required to quiet GNUC warnings when the compiler sees a stdarg function + * that calls one of the stdio v APIs. + */ +#else +# define VGATTR +#endif +static void VGATTR +display_log(struct display *dp, error_level level, const char *fmt, ...) + /* 'level' is as above, fmt is a stdio style format string. This routine + * does not return if level is above LIBPNG_WARNING + */ +{ + dp->results |= 1U << level; + + if (level > (error_level)(dp->options & LEVEL_MASK)) + { + const char *lp; + va_list ap; + + switch (level) + { + case INFORMATION: lp = "information"; break; + case LIBPNG_WARNING: lp = "warning(libpng)"; break; + case APP_WARNING: lp = "warning(pngimage)"; break; + case APP_FAIL: lp = "error(continuable)"; break; + case LIBPNG_ERROR: lp = "error(libpng)"; break; + case LIBPNG_BUG: lp = "bug(libpng)"; break; + case APP_ERROR: lp = "error(pngimage)"; break; + case USER_ERROR: lp = "error(user)"; break; + + case INTERNAL_ERROR: /* anything unexpected is an internal error: */ + case VERBOSE: case WARNINGS: case ERRORS: case QUIET: + default: lp = "bug(pngimage)"; break; + } + + fprintf(stderr, "%s: %s: %s", + dp->filename != NULL ? dp->filename : "", lp, dp->operation); + + if (dp->transforms != 0) + { + int tr = dp->transforms; + + if (is_combo(tr)) + { + if (dp->options & LIST_COMBOS) + { + int trx = tr; + + fprintf(stderr, "("); + if (trx) + { + int start = 0; + + while (trx) + { + int trz = trx & -trx; + + if (start) fprintf(stderr, "+"); + fprintf(stderr, "%s", transform_name(trz)); + start = 1; + trx &= ~trz; + } + } + + else + fprintf(stderr, "-"); + fprintf(stderr, ")"); + } + + else + fprintf(stderr, "(0x%x)", tr); + } + + else + fprintf(stderr, "(%s)", transform_name(tr)); + } + + fprintf(stderr, ": "); + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + + fputc('\n', stderr); + } + /* else do not output any message */ + + /* Errors cause this routine to exit to the fail code */ + if (level > APP_FAIL || (level > ERRORS && !(dp->options & CONTINUE))) + longjmp(dp->error_return, level); +} + +/* error handler callbacks for libpng */ +static void PNGCBAPI +display_warning(png_structp pp, png_const_charp warning) +{ + display_log(get_dp(pp), LIBPNG_WARNING, "%s", warning); +} + +static void PNGCBAPI +display_error(png_structp pp, png_const_charp error) +{ + struct display *dp = get_dp(pp); + + display_log(dp, LIBPNG_ERROR, "%s", error); +} + +static void +display_cache_file(struct display *dp, const char *filename) + /* Does the initial cache of the file. */ +{ + FILE *fp; + int ret; + + dp->filename = filename; + + if (filename != NULL) + { + fp = fopen(filename, "rb"); + if (fp == NULL) + display_log(dp, USER_ERROR, "open failed: %s", strerror(errno)); + } + + else + fp = stdin; + + ret = buffer_from_file(&dp->original_file, fp); + + fclose(fp); + + if (ret != 0) + display_log(dp, APP_ERROR, "read failed: %s", strerror(ret)); +} + +static void +buffer_read(struct display *dp, struct buffer *bp, png_bytep data, + size_t size) +{ + struct buffer_list *last = bp->current; + size_t read_count = bp->read_count; + + while (size > 0) + { + size_t avail; + + if (last == NULL || + (last == bp->last && read_count >= bp->end_count)) + { + display_log(dp, USER_ERROR, "file truncated (%lu bytes)", + (unsigned long)size); + /*NOTREACHED*/ + break; + } + + else if (read_count >= sizeof last->buffer) + { + /* Move to the next buffer: */ + last = last->next; + read_count = 0; + bp->current = last; /* Avoid update outside the loop */ + + /* And do a sanity check (the EOF case is caught above) */ + if (last == NULL) + { + display_log(dp, INTERNAL_ERROR, "damaged buffer list"); + /*NOTREACHED*/ + break; + } + } + + avail = (sizeof last->buffer) - read_count; + if (avail > size) + avail = size; + + memcpy(data, last->buffer + read_count, avail); + read_count += avail; + size -= avail; + data += avail; + } + + bp->read_count = read_count; +} + +static void PNGCBAPI +read_function(png_structp pp, png_bytep data, size_t size) +{ + buffer_read(get_dp(pp), get_buffer(pp), data, size); +} + +static void +read_png(struct display *dp, struct buffer *bp, const char *operation, + int transforms) +{ + png_structp pp; + png_infop ip; + + /* This cleans out any previous read and sets operation and transforms to + * empty. + */ + display_clean_read(dp); + + if (operation != NULL) /* else this is a verify and do not overwrite info */ + { + dp->operation = operation; + dp->transforms = transforms; + } + + dp->read_pp = pp = png_create_read_struct(PNG_LIBPNG_VER_STRING, dp, + display_error, display_warning); + if (pp == NULL) + display_log(dp, LIBPNG_ERROR, "failed to create read struct"); + + /* The png_read_png API requires us to make the info struct, but it does the + * call to png_read_info. + */ + dp->read_ip = ip = png_create_info_struct(pp); + if (ip == NULL) + display_log(dp, LIBPNG_ERROR, "failed to create info struct"); + +# ifdef PNG_SET_USER_LIMITS_SUPPORTED + /* Remove the user limits, if any */ + png_set_user_limits(pp, 0x7fffffff, 0x7fffffff); +# endif + + /* Set the IO handling */ + buffer_start_read(bp); + png_set_read_fn(pp, bp, read_function); + + png_read_png(pp, ip, transforms, NULL/*params*/); + +#if 0 /* crazy debugging */ + { + png_bytep pr = png_get_rows(pp, ip)[0]; + size_t rb = png_get_rowbytes(pp, ip); + size_t cb; + char c = ' '; + + fprintf(stderr, "%.4x %2d (%3lu bytes):", transforms, png_get_bit_depth(pp,ip), (unsigned long)rb); + + for (cb=0; cboriginal_file, "original read", 0/*no transform*/); + + /* Move the result to the 'original' fields */ + dp->original_pp = pp = dp->read_pp, dp->read_pp = NULL; + dp->original_ip = ip = dp->read_ip, dp->read_ip = NULL; + + dp->original_rowbytes = png_get_rowbytes(pp, ip); + if (dp->original_rowbytes == 0) + display_log(dp, LIBPNG_BUG, "png_get_rowbytes returned 0"); + + dp->chunks = png_get_valid(pp, ip, 0xffffffff); + if ((dp->chunks & PNG_INFO_IDAT) == 0) /* set by png_read_png */ + display_log(dp, LIBPNG_BUG, "png_read_png did not set IDAT flag"); + + dp->original_rows = png_get_rows(pp, ip); + if (dp->original_rows == NULL) + display_log(dp, LIBPNG_BUG, "png_read_png did not create row buffers"); + + if (!png_get_IHDR(pp, ip, + &dp->width, &dp->height, &dp->bit_depth, &dp->color_type, + &dp->interlace_method, &dp->compression_method, &dp->filter_method)) + display_log(dp, LIBPNG_BUG, "png_get_IHDR failed"); + + /* 'active' transforms are discovered based on the original image format; + * running one active transform can activate others. At present the code + * does not attempt to determine the closure. + */ + { + png_uint_32 chunks = dp->chunks; + int active = 0, inactive = 0; + int ct = dp->color_type; + int bd = dp->bit_depth; + unsigned int i; + + for (i=0; iactive_transforms = active; + dp->ignored_transforms = inactive; /* excluding write-only transforms */ + } +} + +static int +compare_read(struct display *dp, int applied_transforms) +{ + /* Compare the png_info from read_ip with original_info */ + size_t rowbytes; + png_uint_32 width, height; + int bit_depth, color_type; + int interlace_method, compression_method, filter_method; + const char *e = NULL; + + png_get_IHDR(dp->read_pp, dp->read_ip, &width, &height, &bit_depth, + &color_type, &interlace_method, &compression_method, &filter_method); + +# define C(item) if (item != dp->item) \ + display_log(dp, APP_WARNING, "IHDR " #item "(%lu) changed to %lu",\ + (unsigned long)dp->item, (unsigned long)item), e = #item + + /* The IHDR should be identical: */ + C(width); + C(height); + C(bit_depth); + C(color_type); + C(interlace_method); + C(compression_method); + C(filter_method); + + /* 'e' remains set to the name of the last thing changed: */ + if (e) + display_log(dp, APP_ERROR, "IHDR changed (%s)", e); + + /* All the chunks from the original PNG should be preserved in the output PNG + * because the PNG format has not been changed. + */ + { + unsigned long chunks = + png_get_valid(dp->read_pp, dp->read_ip, 0xffffffff); + + if (chunks != dp->chunks) + display_log(dp, APP_FAIL, "PNG chunks changed from 0x%lx to 0x%lx", + (unsigned long)dp->chunks, chunks); + } + + /* rowbytes should be the same */ + rowbytes = png_get_rowbytes(dp->read_pp, dp->read_ip); + + /* NOTE: on 64-bit systems this may trash the top bits of rowbytes, + * which could lead to weird error messages. + */ + if (rowbytes != dp->original_rowbytes) + display_log(dp, APP_ERROR, "PNG rowbytes changed from %lu to %lu", + (unsigned long)dp->original_rowbytes, (unsigned long)rowbytes); + + /* The rows should be the same too, unless the applied transforms includes + * the shift transform, in which case low bits may have been lost. + */ + { + png_bytepp rows = png_get_rows(dp->read_pp, dp->read_ip); + unsigned int mask; /* mask (if not zero) for the final byte */ + + if (bit_depth < 8) + { + /* Need the stray bits at the end, this depends only on the low bits + * of the image width; overflow does not matter. If the width is an + * exact multiple of 8 bits this gives a mask of 0, not 0xff. + */ + mask = 0xff & (0xff00 >> ((bit_depth * width) & 7)); + } + + else + mask = 0; + + if (rows == NULL) + display_log(dp, LIBPNG_BUG, "png_get_rows returned NULL"); + + if ((applied_transforms & PNG_TRANSFORM_SHIFT) == 0 || + (dp->active_transforms & PNG_TRANSFORM_SHIFT) == 0 || + color_type == PNG_COLOR_TYPE_PALETTE) + { + unsigned long y; + + for (y=0; yoriginal_rows[y]; + + if (memcmp(row, orig, rowbytes-(mask != 0)) != 0 || (mask != 0 && + ((row[rowbytes-1] & mask) != (orig[rowbytes-1] & mask)))) + { + size_t x; + + /* Find the first error */ + for (x=0; x 0x%.2x", + (unsigned long)x, (unsigned long)y, orig[x], row[x]); + return 0; /* don't keep reporting failed rows on 'continue' */ + } + } + } + + else +# ifdef PNG_sBIT_SUPPORTED + { + unsigned long y; + int bpp; /* bits-per-pixel then bytes-per-pixel */ + /* components are up to 8 bytes in size */ + png_byte sig_bits[8]; + png_color_8p sBIT; + + if (png_get_sBIT(dp->read_pp, dp->read_ip, &sBIT) != PNG_INFO_sBIT) + display_log(dp, INTERNAL_ERROR, + "active shift transform but no sBIT in file"); + + switch (color_type) + { + case PNG_COLOR_TYPE_GRAY: + sig_bits[0] = sBIT->gray; + bpp = bit_depth; + break; + + case PNG_COLOR_TYPE_GA: + sig_bits[0] = sBIT->gray; + sig_bits[1] = sBIT->alpha; + bpp = 2 * bit_depth; + break; + + case PNG_COLOR_TYPE_RGB: + sig_bits[0] = sBIT->red; + sig_bits[1] = sBIT->green; + sig_bits[2] = sBIT->blue; + bpp = 3 * bit_depth; + break; + + case PNG_COLOR_TYPE_RGBA: + sig_bits[0] = sBIT->red; + sig_bits[1] = sBIT->green; + sig_bits[2] = sBIT->blue; + sig_bits[3] = sBIT->alpha; + bpp = 4 * bit_depth; + break; + + default: + display_log(dp, LIBPNG_ERROR, "invalid colour type %d", + color_type); + /*NOTREACHED*/ + bpp = 0; + break; + } + + { + int b; + + for (b=0; 8*b bit_depth/*!palette*/) + display_log(dp, LIBPNG_BUG, + "invalid sBIT[%u] value %d returned for PNG bit depth %d", + b, sig_bits[b], bit_depth); + } + } + + if (bpp < 8 && bpp != bit_depth) + { + /* sanity check; this is a grayscale PNG; something is wrong in the + * code above. + */ + display_log(dp, INTERNAL_ERROR, "invalid bpp %u for bit_depth %u", + bpp, bit_depth); + } + + switch (bit_depth) + { + int b; + + case 16: /* Two bytes per component, big-endian */ + for (b = (bpp >> 4); b > 0; --b) + { + unsigned int sig = (unsigned int)(0xffff0000 >> sig_bits[b]); + + sig_bits[2*b+1] = (png_byte)sig; + sig_bits[2*b+0] = (png_byte)(sig >> 8); /* big-endian */ + } + break; + + case 8: /* One byte per component */ + for (b=0; b*8 < bpp; ++b) + sig_bits[b] = (png_byte)(0xff00 >> sig_bits[b]); + break; + + case 1: /* allowed, but dumb */ + /* Value is 1 */ + sig_bits[0] = 0xff; + break; + + case 2: /* Replicate 4 times */ + /* Value is 1 or 2 */ + b = 0x3 & ((0x3<<2) >> sig_bits[0]); + b |= b << 2; + b |= b << 4; + sig_bits[0] = (png_byte)b; + break; + + case 4: /* Relicate twice */ + /* Value is 1, 2, 3 or 4 */ + b = 0xf & ((0xf << 4) >> sig_bits[0]); + b |= b << 4; + sig_bits[0] = (png_byte)b; + break; + + default: + display_log(dp, LIBPNG_BUG, "invalid bit depth %d", bit_depth); + break; + } + + /* Convert bpp to bytes; this gives '1' for low-bit depth grayscale, + * where there are multiple pixels per byte. + */ + bpp = (bpp+7) >> 3; + + /* The mask can be combined with sig_bits[0] */ + if (mask != 0) + { + mask &= sig_bits[0]; + + if (bpp != 1 || mask == 0) + display_log(dp, INTERNAL_ERROR, "mask calculation error %u, %u", + bpp, mask); + } + + for (y=0; yoriginal_rows[y]; + unsigned long x; + + for (x=0; x<(width-(mask!=0)); ++x) + { + int b; + + for (b=0; b%.2x", + x, b, y, orig[-1], row[-1]); + return 0; + } + } + } + + if (mask != 0 && (*row & mask) != (*orig & mask)) + { + display_log(dp, APP_FAIL, + "significant bits at (%lu[end],%lu) changed", x, y); + return 0; + } + } /* for y */ + } +# else /* !sBIT */ + display_log(dp, INTERNAL_ERROR, + "active shift transform but no sBIT support"); +# endif /* !sBIT */ + } + + return 1; /* compare succeeded */ +} + +#ifdef PNG_WRITE_PNG_SUPPORTED +static void +buffer_write(struct display *dp, struct buffer *buffer, png_bytep data, + size_t size) + /* Generic write function used both from the write callback provided to + * libpng and from the generic read code. + */ +{ + /* Write the data into the buffer, adding buffers as required */ + struct buffer_list *last = buffer->last; + size_t end_count = buffer->end_count; + + while (size > 0) + { + size_t avail; + + if (end_count >= sizeof last->buffer) + { + if (last->next == NULL) + { + last = buffer_extend(last); + + if (last == NULL) + display_log(dp, APP_ERROR, "out of memory saving file"); + } + + else + last = last->next; + + buffer->last = last; /* avoid the need to rewrite every time */ + end_count = 0; + } + + avail = (sizeof last->buffer) - end_count; + if (avail > size) + avail = size; + + memcpy(last->buffer + end_count, data, avail); + end_count += avail; + size -= avail; + data += avail; + } + + buffer->end_count = end_count; +} + +static void PNGCBAPI +write_function(png_structp pp, png_bytep data, size_t size) +{ + buffer_write(get_dp(pp), get_buffer(pp), data, size); +} + +static void +write_png(struct display *dp, png_infop ip, int transforms) +{ + display_clean_write(dp); /* safety */ + + buffer_start_write(&dp->written_file); + dp->operation = "write"; + dp->transforms = transforms; + + dp->write_pp = png_create_write_struct(PNG_LIBPNG_VER_STRING, dp, + display_error, display_warning); + + if (dp->write_pp == NULL) + display_log(dp, APP_ERROR, "failed to create write png_struct"); + + png_set_write_fn(dp->write_pp, &dp->written_file, write_function, + NULL/*flush*/); + +# ifdef PNG_SET_USER_LIMITS_SUPPORTED + /* Remove the user limits, if any */ + png_set_user_limits(dp->write_pp, 0x7fffffff, 0x7fffffff); +# endif + + /* Certain transforms require the png_info to be zapped to allow the + * transform to work correctly. + */ + if (transforms & (PNG_TRANSFORM_PACKING| + PNG_TRANSFORM_STRIP_FILLER| + PNG_TRANSFORM_STRIP_FILLER_BEFORE)) + { + int ct = dp->color_type; + + if (transforms & (PNG_TRANSFORM_STRIP_FILLER| + PNG_TRANSFORM_STRIP_FILLER_BEFORE)) + ct &= ~PNG_COLOR_MASK_ALPHA; + + png_set_IHDR(dp->write_pp, ip, dp->width, dp->height, dp->bit_depth, ct, + dp->interlace_method, dp->compression_method, dp->filter_method); + } + + png_write_png(dp->write_pp, ip, transforms, NULL/*params*/); + + /* Clean it on the way out - if control returns to the caller then the + * written_file contains the required data. + */ + display_clean_write(dp); +} +#endif /* WRITE_PNG */ + +static int +skip_transform(struct display *dp, int tr) + /* Helper to test for a bad combo and log it if it is skipped */ +{ + if ((dp->options & SKIP_BUGS) != 0 && is_bad_combo(tr)) + { + /* Log this to stdout if logging is on, otherwise just do an information + * display_log. + */ + if ((dp->options & LOG_SKIPPED) != 0) + { + printf("SKIP: %s transforms ", dp->filename); + + while (tr != 0) + { + int next = first_transform(tr); + tr &= ~next; + + printf("%s", transform_name(next)); + if (tr != 0) + putchar('+'); + } + + putchar('\n'); + } + + else + display_log(dp, INFORMATION, "%s: skipped known bad combo 0x%x", + dp->filename, tr); + + return 1; /* skip */ + } + + return 0; /* don't skip */ +} + +static void +test_one_file(struct display *dp, const char *filename) +{ + /* First cache the file and update the display original file + * information for the new file. + */ + dp->operation = "cache file"; + dp->transforms = 0; + display_cache_file(dp, filename); + update_display(dp); + + /* First test: if there are options that should be ignored for this file + * verify that they really are ignored. + */ + if (dp->ignored_transforms != 0) + { + read_png(dp, &dp->original_file, "ignored transforms", + dp->ignored_transforms); + + /* The result should be identical to the original_rows */ + if (!compare_read(dp, 0/*transforms applied*/)) + return; /* no point testing more */ + } + +#ifdef PNG_WRITE_PNG_SUPPORTED + /* Second test: write the original PNG data out to a new file (to test the + * write side) then read the result back in and make sure that it hasn't + * changed. + */ + dp->operation = "write"; + write_png(dp, dp->original_ip, 0/*transforms*/); + read_png(dp, &dp->written_file, NULL, 0/*transforms*/); + if (!compare_read(dp, 0/*transforms applied*/)) + return; +#endif + + /* Third test: the active options. Test each in turn, or, with the + * EXHAUSTIVE option, test all possible combinations. + */ + { + /* Use unsigned int here because the code below to increment through all + * the possibilities exhaustively has to use a compare and that must be + * unsigned, because some transforms are negative on a 16-bit system. + */ + unsigned int active = dp->active_transforms; + int exhaustive = (dp->options & EXHAUSTIVE) != 0; + unsigned int current = first_transform(active); + unsigned int bad_transforms = 0; + unsigned int bad_combo = ~0U; /* bitwise AND of failing transforms */ + unsigned int bad_combo_list = 0; /* bitwise OR of failures */ + + for (;;) + { + read_png(dp, &dp->original_file, "active transforms", current); + + /* If this involved any irreversible transformations then if we write + * it out with just the reversible transformations and read it in again + * with the same transforms we should get the same thing. At present + * this isn't done - it just seems like a waste of time and it would + * require two sets of read png_struct/png_info. + * + * If there were no irreversible transformations then if we write it + * out and read it back in again (without the reversible transforms) + * we should get back to the place where we started. + */ +#ifdef PNG_WRITE_PNG_SUPPORTED + if ((current & write_transforms) == current) + { + /* All transforms reversible: write the PNG with the transformations + * reversed, then read it back in with no transformations. The + * result should be the same as the original apart from the loss of + * low order bits because of the SHIFT/sBIT transform. + */ + dp->operation = "reversible transforms"; + write_png(dp, dp->read_ip, current); + + /* And if this is read back in, because all the transformations were + * reversible, the result should be the same. + */ + read_png(dp, &dp->written_file, NULL, 0); + if (!compare_read(dp, current/*for the SHIFT/sBIT transform*/)) + { + /* This set of transforms failed. If a single bit is set - if + * there is just one transform - don't include this in further + * 'exhaustive' tests. Notice that each transform is tested on + * its own before testing combos in the exhaustive case. + */ + if (is_combo(current)) + { + bad_combo &= current; + bad_combo_list |= current; + } + + else + bad_transforms |= current; + } + } +#endif + + /* Now move to the next transform */ + if (exhaustive) /* all combinations */ + { + unsigned int next = current; + + do + { + if (next == read_transforms) /* Everything tested */ + goto combo; + + ++next; + } /* skip known bad combos if the relevant option is set; skip + * combos involving known bad single transforms in all cases. + */ + while ( (next & read_transforms) <= current + || (next & active) == 0 /* skip cases that do nothing */ + || (next & bad_transforms) != 0 + || skip_transform(dp, next)); + + assert((next & read_transforms) == next); + current = next; + } + + else /* one at a time */ + { + active &= ~current; + + if (active == 0) + goto combo; + + current = first_transform(active); + } + } + +combo: + if (dp->options & FIND_BAD_COMBOS) + { + /* bad_combos identifies the combos that occur in all failing cases; + * bad_combo_list identifies transforms that do not prevent the + * failure. + */ + if (bad_combo != ~0U) + printf("%s[0x%x]: PROBLEM: 0x%x[0x%x] ANTIDOTE: 0x%x\n", + dp->filename, active, bad_combo, bad_combo_list, + rw_transforms & ~bad_combo_list); + + else + printf("%s: no %sbad combos found\n", dp->filename, + (dp->options & SKIP_BUGS) ? "additional " : ""); + } + } +} + +static int +do_test(struct display *dp, const char *file) + /* Exists solely to isolate the setjmp clobbers */ +{ + int ret = setjmp(dp->error_return); + + if (ret == 0) + { + test_one_file(dp, file); + return 0; + } + + else if (ret < ERRORS) /* shouldn't longjmp on warnings */ + display_log(dp, INTERNAL_ERROR, "unexpected return code %d", ret); + + return ret; +} + +int +main(int argc, char **argv) +{ + /* For each file on the command line test it with a range of transforms */ + int option_end, ilog = 0; + struct display d; + + validate_T(); + display_init(&d); + + for (option_end=1; option_end QUIET) /* abort on user or internal error */ + return 99; + } + + /* Here on any return, including failures, except user/internal issues + */ + { + int pass = (d.options & STRICT) ? + RESULT_STRICT(d.results) : RESULT_RELAXED(d.results); + + if (!pass) + ++errors; + + if (d.options & LOG) + { + int j; + + printf("%s: pngimage ", pass ? "PASS" : "FAIL"); + + for (j=1; j +#include +#include +#include +#include +#include +#include + +#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H) +# include +#endif + +/* Define the following to use this test against your installed libpng, rather + * than the one being built here: + */ +#ifdef PNG_FREESTANDING_TESTS +# include +#else +# include "../../png.h" +#endif + +/* 1.6.1 added support for the configure test harness, which uses 77 to indicate + * a skipped test, in earlier versions we need to succeed on a skipped test, so: + */ +#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H) +# define SKIP 77 +#else +# define SKIP 0 +#endif + +#ifdef PNG_SIMPLIFIED_READ_SUPPORTED /* Else nothing can be done */ +#include "../tools/sRGB.h" + +/* KNOWN ISSUES + * + * These defines switch on alternate algorithms for format conversions to match + * the current libpng implementation; they are set to allow pngstest to pass + * even though libpng is producing answers that are not as correct as they + * should be. + */ +#define ALLOW_UNUSED_GPC 0 + /* If true include unused static GPC functions and declare an external array + * of them to hide the fact that they are unused. This is for development + * use while testing the correct function to use to take into account libpng + * misbehavior, such as using a simple power law to correct sRGB to linear. + */ + +/* The following is to support direct compilation of this file as C++ */ +#ifdef __cplusplus +# define voidcast(type, value) static_cast(value) +# define aligncastconst(type, value) \ + static_cast(static_cast(value)) +#else +# define voidcast(type, value) (value) +# define aligncastconst(type, value) ((const void*)(value)) +#endif /* __cplusplus */ + +/* During parallel runs of pngstest each temporary file needs a unique name, + * this is used to permit uniqueness using a command line argument which can be + * up to 22 characters long. + */ +static char tmpf[23] = "TMP"; + +/* Generate random bytes. This uses a boring repeatable algorithm and it + * is implemented here so that it gives the same set of numbers on every + * architecture. It's a linear congruential generator (Knuth or Sedgewick + * "Algorithms") but it comes from the 'feedback taps' table in Horowitz and + * Hill, "The Art of Electronics". + */ +static void +make_random_bytes(png_uint_32* seed, void* pv, size_t size) +{ + png_uint_32 u0 = seed[0], u1 = seed[1]; + png_bytep bytes = voidcast(png_bytep, pv); + + /* There are thirty three bits, the next bit in the sequence is bit-33 XOR + * bit-20. The top 1 bit is in u1, the bottom 32 are in u0. + */ + size_t i; + for (i=0; i> (20-8)) ^ ((u1 << 7) | (u0 >> (32-7)))) & 0xff; + u1 <<= 8; + u1 |= u0 >> 24; + u0 <<= 8; + u0 |= u; + *bytes++ = (png_byte)u; + } + + seed[0] = u0; + seed[1] = u1; +} + +static png_uint_32 color_seed[2]; + +static void +reseed(void) +{ + color_seed[0] = 0x12345678U; + color_seed[1] = 0x9abcdefU; +} + +static void +random_color(png_colorp color) +{ + make_random_bytes(color_seed, color, sizeof *color); +} + +/* Math support - neither Cygwin nor Visual Studio have C99 support and we need + * a predictable rounding function, so make one here: + */ +static double +closestinteger(double x) +{ + return floor(x + .5); +} + +/* Cast support: remove GCC whines. */ +static png_byte +u8d(double d) +{ + d = closestinteger(d); + return (png_byte)d; +} + +static png_uint_16 +u16d(double d) +{ + d = closestinteger(d); + return (png_uint_16)d; +} + +/* sRGB support: use exact calculations rounded to the nearest int, see the + * fesetround() call in main(). sRGB_to_d optimizes the 8 to 16-bit conversion. + */ +static double sRGB_to_d[256]; +static double g22_to_d[256]; + +static void +init_sRGB_to_d(void) +{ + int i; + + sRGB_to_d[0] = 0; + for (i=1; i<255; ++i) + sRGB_to_d[i] = linear_from_sRGB(i/255.); + sRGB_to_d[255] = 1; + + g22_to_d[0] = 0; + for (i=1; i<255; ++i) + g22_to_d[i] = pow(i/255., 1/.45455); + g22_to_d[255] = 1; +} + +static png_byte +sRGB(double linear /*range 0.0 .. 1.0*/) +{ + return u8d(255 * sRGB_from_linear(linear)); +} + +static png_byte +isRGB(int fixed_linear) +{ + return sRGB(fixed_linear / 65535.); +} + +#if 0 /* not used */ +static png_byte +unpremultiply(int component, int alpha) +{ + if (alpha <= component) + return 255; /* Arbitrary, but consistent with the libpng code */ + + else if (alpha >= 65535) + return isRGB(component); + + else + return sRGB((double)component / alpha); +} +#endif + +static png_uint_16 +ilinear(int fixed_srgb) +{ + return u16d(65535 * sRGB_to_d[fixed_srgb]); +} + +static png_uint_16 +ilineara(int fixed_srgb, int alpha) +{ + return u16d((257 * alpha) * sRGB_to_d[fixed_srgb]); +} + +static png_uint_16 +ilinear_g22(int fixed_srgb) +{ + return u16d(65535 * g22_to_d[fixed_srgb]); +} + +#if ALLOW_UNUSED_GPC +static png_uint_16 +ilineara_g22(int fixed_srgb, int alpha) +{ + return u16d((257 * alpha) * g22_to_d[fixed_srgb]); +} +#endif + +static double +YfromRGBint(int ir, int ig, int ib) +{ + double r = ir; + double g = ig; + double b = ib; + return YfromRGB(r, g, b); +} + +#if 0 /* unused */ +/* The error that results from using a 2.2 power law in place of the correct + * sRGB transform, given an 8-bit value which might be either sRGB or power-law. + */ +static int +power_law_error8(int value) +{ + if (value > 0 && value < 255) + { + double vd = value / 255.; + double e = fabs( + pow(sRGB_to_d[value], 1/2.2) - sRGB_from_linear(pow(vd, 2.2))); + + /* Always allow an extra 1 here for rounding errors */ + e = 1+floor(255 * e); + return (int)e; + } + + return 0; +} + +static int error_in_sRGB_roundtrip = 56; /* by experiment */ +static int +power_law_error16(int value) +{ + if (value > 0 && value < 65535) + { + /* Round trip the value through an 8-bit representation but using + * non-matching to/from conversions. + */ + double vd = value / 65535.; + double e = fabs( + pow(sRGB_from_linear(vd), 2.2) - linear_from_sRGB(pow(vd, 1/2.2))); + + /* Always allow an extra 1 here for rounding errors */ + e = error_in_sRGB_roundtrip+floor(65535 * e); + return (int)e; + } + + return 0; +} + +static int +compare_8bit(int v1, int v2, int error_limit, int multiple_algorithms) +{ + int e = abs(v1-v2); + int ev1, ev2; + + if (e <= error_limit) + return 1; + + if (!multiple_algorithms) + return 0; + + ev1 = power_law_error8(v1); + if (e <= ev1) + return 1; + + ev2 = power_law_error8(v2); + if (e <= ev2) + return 1; + + return 0; +} + +static int +compare_16bit(int v1, int v2, int error_limit, int multiple_algorithms) +{ + int e = abs(v1-v2); + int ev1, ev2; + + if (e <= error_limit) + return 1; + + /* "multiple_algorithms" in this case means that a color-map has been + * involved somewhere, so we can deduce that the values were forced to 8-bit + * (like the via_linear case for 8-bit.) + */ + if (!multiple_algorithms) + return 0; + + ev1 = power_law_error16(v1); + if (e <= ev1) + return 1; + + ev2 = power_law_error16(v2); + if (e <= ev2) + return 1; + + return 0; +} +#endif /* unused */ + +#define USE_FILE 1 /* else memory */ +#define USE_STDIO 2 /* else use file name */ +#define STRICT 4 /* fail on warnings too */ +#define VERBOSE 8 +#define KEEP_TMPFILES 16 /* else delete temporary files */ +#define KEEP_GOING 32 +#define ACCUMULATE 64 +#define FAST_WRITE 128 +#define sRGB_16BIT 256 +#define NO_RESEED 512 /* do not reseed on each new file */ +#define GBG_ERROR 1024 /* do not ignore the gamma+background_rgb_to_gray + * libpng warning. */ + +static void +print_opts(png_uint_32 opts) +{ + if (opts & USE_FILE) + printf(" --file"); + if (opts & USE_STDIO) + printf(" --stdio"); + if (!(opts & STRICT)) + printf(" --nostrict"); + if (opts & VERBOSE) + printf(" --verbose"); + if (opts & KEEP_TMPFILES) + printf(" --preserve"); + if (opts & KEEP_GOING) + printf(" --keep-going"); + if (opts & ACCUMULATE) + printf(" --accumulate"); + if (!(opts & FAST_WRITE)) /* --fast is currently the default */ + printf(" --slow"); + if (opts & sRGB_16BIT) + printf(" --sRGB-16bit"); + if (opts & NO_RESEED) + printf(" --noreseed"); +#if PNG_LIBPNG_VER < 10700 /* else on by default */ + if (opts & GBG_ERROR) + printf(" --fault-gbg-warning"); +#endif +} + +#define FORMAT_NO_CHANGE 0x80000000 /* additional flag */ + +/* A name table for all the formats - defines the format of the '+' arguments to + * pngstest. + */ +#define FORMAT_COUNT 64 +#define FORMAT_MASK 0x3f +static const char * const format_names[FORMAT_COUNT] = +{ + "sRGB-gray", + "sRGB-gray+alpha", + "sRGB-rgb", + "sRGB-rgb+alpha", + "linear-gray", + "linear-gray+alpha", + "linear-rgb", + "linear-rgb+alpha", + + "color-mapped-sRGB-gray", + "color-mapped-sRGB-gray+alpha", + "color-mapped-sRGB-rgb", + "color-mapped-sRGB-rgb+alpha", + "color-mapped-linear-gray", + "color-mapped-linear-gray+alpha", + "color-mapped-linear-rgb", + "color-mapped-linear-rgb+alpha", + + "sRGB-gray", + "sRGB-gray+alpha", + "sRGB-bgr", + "sRGB-bgr+alpha", + "linear-gray", + "linear-gray+alpha", + "linear-bgr", + "linear-bgr+alpha", + + "color-mapped-sRGB-gray", + "color-mapped-sRGB-gray+alpha", + "color-mapped-sRGB-bgr", + "color-mapped-sRGB-bgr+alpha", + "color-mapped-linear-gray", + "color-mapped-linear-gray+alpha", + "color-mapped-linear-bgr", + "color-mapped-linear-bgr+alpha", + + "sRGB-gray", + "alpha+sRGB-gray", + "sRGB-rgb", + "alpha+sRGB-rgb", + "linear-gray", + "alpha+linear-gray", + "linear-rgb", + "alpha+linear-rgb", + + "color-mapped-sRGB-gray", + "color-mapped-alpha+sRGB-gray", + "color-mapped-sRGB-rgb", + "color-mapped-alpha+sRGB-rgb", + "color-mapped-linear-gray", + "color-mapped-alpha+linear-gray", + "color-mapped-linear-rgb", + "color-mapped-alpha+linear-rgb", + + "sRGB-gray", + "alpha+sRGB-gray", + "sRGB-bgr", + "alpha+sRGB-bgr", + "linear-gray", + "alpha+linear-gray", + "linear-bgr", + "alpha+linear-bgr", + + "color-mapped-sRGB-gray", + "color-mapped-alpha+sRGB-gray", + "color-mapped-sRGB-bgr", + "color-mapped-alpha+sRGB-bgr", + "color-mapped-linear-gray", + "color-mapped-alpha+linear-gray", + "color-mapped-linear-bgr", + "color-mapped-alpha+linear-bgr", +}; + +/* Decode an argument to a format number. */ +static png_uint_32 +formatof(const char *arg) +{ + char *ep; + unsigned long format = strtoul(arg, &ep, 0); + + if (ep > arg && *ep == 0 && format < FORMAT_COUNT) + return (png_uint_32)format; + + else for (format=0; format < FORMAT_COUNT; ++format) + { + if (strcmp(format_names[format], arg) == 0) + return (png_uint_32)format; + } + + fprintf(stderr, "pngstest: format name '%s' invalid\n", arg); + return FORMAT_COUNT; +} + +/* Bitset/test functions for formats */ +#define FORMAT_SET_COUNT (FORMAT_COUNT / 32) +typedef struct +{ + png_uint_32 bits[FORMAT_SET_COUNT]; +} +format_list; + +static void format_init(format_list *pf) +{ + int i; + for (i=0; ibits[i] = 0; /* All off */ +} + +#if 0 /* currently unused */ +static void format_clear(format_list *pf) +{ + int i; + for (i=0; ibits[i] = 0; +} +#endif + +static int format_is_initial(format_list *pf) +{ + int i; + for (i=0; ibits[i] != 0) + return 0; + + return 1; +} + +static int format_set(format_list *pf, png_uint_32 format) +{ + if (format < FORMAT_COUNT) + return pf->bits[format >> 5] |= ((png_uint_32)1) << (format & 31); + + return 0; +} + +#if 0 /* currently unused */ +static int format_unset(format_list *pf, png_uint_32 format) +{ + if (format < FORMAT_COUNT) + return pf->bits[format >> 5] &= ~((png_uint_32)1) << (format & 31); + + return 0; +} +#endif + +static int format_isset(format_list *pf, png_uint_32 format) +{ + return format < FORMAT_COUNT && + (pf->bits[format >> 5] & (((png_uint_32)1) << (format & 31))) != 0; +} + +static void format_default(format_list *pf, int redundant) +{ + if (redundant) + { + int i; + + /* set everything, including flags that are pointless */ + for (i=0; ibits[i] = ~(png_uint_32)0; + } + + else + { + png_uint_32 f; + + for (f=0; finput_file != NULL) + rewind(image->input_file); +} + +/* Free the image buffer; the buffer is re-used on a re-read, this is just for + * cleanup. + */ +static void +freebuffer(Image *image) +{ + if (image->buffer) free(image->buffer); + image->buffer = NULL; + image->bufsize = 0; + image->allocsize = 0; +} + +/* Delete function; cleans out all the allocated data and the temporary file in + * the image. + */ +static void +freeimage(Image *image) +{ + freebuffer(image); + png_image_free(&image->image); + + if (image->input_file != NULL) + { + fclose(image->input_file); + image->input_file = NULL; + } + + if (image->input_memory != NULL) + { + free(image->input_memory); + image->input_memory = NULL; + image->input_memory_size = 0; + } + + if (image->tmpfile_name[0] != 0 && (image->opts & KEEP_TMPFILES) == 0) + { + (void)remove(image->tmpfile_name); + image->tmpfile_name[0] = 0; + } +} + +/* This is actually a re-initializer; allows an image structure to be re-used by + * freeing everything that relates to an old image. + */ +static void initimage(Image *image, png_uint_32 opts, const char *file_name, + int stride_extra) +{ + freeimage(image); + memset(&image->image, 0, sizeof image->image); + image->opts = opts; + image->file_name = file_name; + image->stride_extra = stride_extra; +} + +/* Make sure the image buffer is big enough; allows re-use of the buffer if the + * image is re-read. + */ +#define BUFFER_INIT8 73 +static void +allocbuffer(Image *image) +{ + size_t size = PNG_IMAGE_BUFFER_SIZE(image->image, image->stride); + + if (size+32 > image->bufsize) + { + freebuffer(image); + image->buffer = voidcast(png_bytep, malloc(size+32)); + if (image->buffer == NULL) + { + fflush(stdout); + fprintf(stderr, + "simpletest: out of memory allocating %lu(+32) byte buffer\n", + (unsigned long)size); + exit(1); + } + image->bufsize = size+32; + } + + memset(image->buffer, 95, image->bufsize); + memset(image->buffer+16, BUFFER_INIT8, size); + image->allocsize = size; +} + +/* Make sure 16 bytes match the given byte. */ +static int +check16(png_const_bytep bp, int b) +{ + int i = 16; + + do + if (*bp != b) return 1; + while (--i); + + return 0; +} + +/* Check for overwrite in the image buffer. */ +static void +checkbuffer(Image *image, const char *arg) +{ + if (check16(image->buffer, 95)) + { + fflush(stdout); + fprintf(stderr, "%s: overwrite at start of image buffer\n", arg); + exit(1); + } + + if (check16(image->buffer+16+image->allocsize, 95)) + { + fflush(stdout); + fprintf(stderr, "%s: overwrite at end of image buffer\n", arg); + exit(1); + } +} + +/* ERROR HANDLING */ +/* Log a terminal error, also frees the libpng part of the image if necessary. + */ +static int +logerror(Image *image, const char *a1, const char *a2, const char *a3) +{ + fflush(stdout); + if (image->image.warning_or_error) + fprintf(stderr, "%s%s%s: %s\n", a1, a2, a3, image->image.message); + + else + fprintf(stderr, "%s%s%s\n", a1, a2, a3); + + if (image->image.opaque != NULL) + { + fprintf(stderr, "%s: image opaque pointer non-NULL on error\n", + image->file_name); + png_image_free(&image->image); + } + + return 0; +} + +/* Log an error and close a file (just a utility to do both things in one + * function call.) + */ +static int +logclose(Image *image, FILE *f, const char *name, const char *operation) +{ + int e = errno; + + fclose(f); + return logerror(image, name, operation, strerror(e)); +} + +/* Make sure the png_image has been freed - validates that libpng is doing what + * the spec says and freeing the image. + */ +static int +checkopaque(Image *image) +{ + if (image->image.opaque != NULL) + { + png_image_free(&image->image); + return logerror(image, image->file_name, ": opaque not NULL", ""); + } + + /* Separate out the gamma+background_rgb_to_gray warning because it may + * produce opaque component errors: + */ + else if (image->image.warning_or_error != 0 && + (strcmp(image->image.message, + "libpng does not support gamma+background+rgb_to_gray") == 0 ? + (image->opts & GBG_ERROR) != 0 : (image->opts & STRICT) != 0)) + return logerror(image, image->file_name, (image->opts & GBG_ERROR) != 0 ? + " --fault-gbg-warning" : " --strict", ""); + + else + return 1; +} + +/* IMAGE COMPARISON/CHECKING */ +/* Compare the pixels of two images, which should be the same but aren't. The + * images must have been checked for a size match. + */ +typedef struct +{ + /* The components, for grayscale images the gray value is in 'g' and if alpha + * is not present 'a' is set to 255 or 65535 according to format. + */ + int r, g, b, a; +} Pixel; + +typedef struct +{ + /* The background as the original sRGB 8-bit value converted to the final + * integer format and as a double precision linear value in the range 0..1 + * for with partially transparent pixels. + */ + int ir, ig, ib; + double dr, dg, db; /* linear r,g,b scaled to 0..1 */ +} Background; + +/* Basic image formats; control the data but not the layout thereof. */ +#define BASE_FORMATS\ + (PNG_FORMAT_FLAG_ALPHA|PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_LINEAR) + +/* Read a Pixel from a buffer. The code below stores the correct routine for + * the format in a function pointer, these are the routines: + */ +static void +gp_g8(Pixel *p, png_const_voidp pb) +{ + png_const_bytep pp = voidcast(png_const_bytep, pb); + + p->r = p->g = p->b = pp[0]; + p->a = 255; +} + +static void +gp_ga8(Pixel *p, png_const_voidp pb) +{ + png_const_bytep pp = voidcast(png_const_bytep, pb); + + p->r = p->g = p->b = pp[0]; + p->a = pp[1]; +} + +#ifdef PNG_FORMAT_AFIRST_SUPPORTED +static void +gp_ag8(Pixel *p, png_const_voidp pb) +{ + png_const_bytep pp = voidcast(png_const_bytep, pb); + + p->r = p->g = p->b = pp[1]; + p->a = pp[0]; +} +#endif + +static void +gp_rgb8(Pixel *p, png_const_voidp pb) +{ + png_const_bytep pp = voidcast(png_const_bytep, pb); + + p->r = pp[0]; + p->g = pp[1]; + p->b = pp[2]; + p->a = 255; +} + +#ifdef PNG_FORMAT_BGR_SUPPORTED +static void +gp_bgr8(Pixel *p, png_const_voidp pb) +{ + png_const_bytep pp = voidcast(png_const_bytep, pb); + + p->r = pp[2]; + p->g = pp[1]; + p->b = pp[0]; + p->a = 255; +} +#endif + +static void +gp_rgba8(Pixel *p, png_const_voidp pb) +{ + png_const_bytep pp = voidcast(png_const_bytep, pb); + + p->r = pp[0]; + p->g = pp[1]; + p->b = pp[2]; + p->a = pp[3]; +} + +#ifdef PNG_FORMAT_BGR_SUPPORTED +static void +gp_bgra8(Pixel *p, png_const_voidp pb) +{ + png_const_bytep pp = voidcast(png_const_bytep, pb); + + p->r = pp[2]; + p->g = pp[1]; + p->b = pp[0]; + p->a = pp[3]; +} +#endif + +#ifdef PNG_FORMAT_AFIRST_SUPPORTED +static void +gp_argb8(Pixel *p, png_const_voidp pb) +{ + png_const_bytep pp = voidcast(png_const_bytep, pb); + + p->r = pp[1]; + p->g = pp[2]; + p->b = pp[3]; + p->a = pp[0]; +} +#endif + +#if defined(PNG_FORMAT_AFIRST_SUPPORTED) && defined(PNG_FORMAT_BGR_SUPPORTED) +static void +gp_abgr8(Pixel *p, png_const_voidp pb) +{ + png_const_bytep pp = voidcast(png_const_bytep, pb); + + p->r = pp[3]; + p->g = pp[2]; + p->b = pp[1]; + p->a = pp[0]; +} +#endif + +static void +gp_g16(Pixel *p, png_const_voidp pb) +{ + png_const_uint_16p pp = voidcast(png_const_uint_16p, pb); + + p->r = p->g = p->b = pp[0]; + p->a = 65535; +} + +static void +gp_ga16(Pixel *p, png_const_voidp pb) +{ + png_const_uint_16p pp = voidcast(png_const_uint_16p, pb); + + p->r = p->g = p->b = pp[0]; + p->a = pp[1]; +} + +#ifdef PNG_FORMAT_AFIRST_SUPPORTED +static void +gp_ag16(Pixel *p, png_const_voidp pb) +{ + png_const_uint_16p pp = voidcast(png_const_uint_16p, pb); + + p->r = p->g = p->b = pp[1]; + p->a = pp[0]; +} +#endif + +static void +gp_rgb16(Pixel *p, png_const_voidp pb) +{ + png_const_uint_16p pp = voidcast(png_const_uint_16p, pb); + + p->r = pp[0]; + p->g = pp[1]; + p->b = pp[2]; + p->a = 65535; +} + +#ifdef PNG_FORMAT_BGR_SUPPORTED +static void +gp_bgr16(Pixel *p, png_const_voidp pb) +{ + png_const_uint_16p pp = voidcast(png_const_uint_16p, pb); + + p->r = pp[2]; + p->g = pp[1]; + p->b = pp[0]; + p->a = 65535; +} +#endif + +static void +gp_rgba16(Pixel *p, png_const_voidp pb) +{ + png_const_uint_16p pp = voidcast(png_const_uint_16p, pb); + + p->r = pp[0]; + p->g = pp[1]; + p->b = pp[2]; + p->a = pp[3]; +} + +#ifdef PNG_FORMAT_BGR_SUPPORTED +static void +gp_bgra16(Pixel *p, png_const_voidp pb) +{ + png_const_uint_16p pp = voidcast(png_const_uint_16p, pb); + + p->r = pp[2]; + p->g = pp[1]; + p->b = pp[0]; + p->a = pp[3]; +} +#endif + +#ifdef PNG_FORMAT_AFIRST_SUPPORTED +static void +gp_argb16(Pixel *p, png_const_voidp pb) +{ + png_const_uint_16p pp = voidcast(png_const_uint_16p, pb); + + p->r = pp[1]; + p->g = pp[2]; + p->b = pp[3]; + p->a = pp[0]; +} +#endif + +#if defined(PNG_FORMAT_AFIRST_SUPPORTED) && defined(PNG_FORMAT_BGR_SUPPORTED) +static void +gp_abgr16(Pixel *p, png_const_voidp pb) +{ + png_const_uint_16p pp = voidcast(png_const_uint_16p, pb); + + p->r = pp[3]; + p->g = pp[2]; + p->b = pp[1]; + p->a = pp[0]; +} +#endif + +/* Given a format, return the correct one of the above functions. */ +static void (* +get_pixel(png_uint_32 format))(Pixel *p, png_const_voidp pb) +{ + /* The color-map flag is irrelevant here - the caller of the function + * returned must either pass the buffer or, for a color-mapped image, the + * correct entry in the color-map. + */ + if (format & PNG_FORMAT_FLAG_LINEAR) + { + if (format & PNG_FORMAT_FLAG_COLOR) + { +# ifdef PNG_FORMAT_BGR_SUPPORTED + if (format & PNG_FORMAT_FLAG_BGR) + { + if (format & PNG_FORMAT_FLAG_ALPHA) + { +# ifdef PNG_FORMAT_AFIRST_SUPPORTED + if (format & PNG_FORMAT_FLAG_AFIRST) + return gp_abgr16; + + else +# endif + return gp_bgra16; + } + + else + return gp_bgr16; + } + + else +# endif + { + if (format & PNG_FORMAT_FLAG_ALPHA) + { +# ifdef PNG_FORMAT_AFIRST_SUPPORTED + if (format & PNG_FORMAT_FLAG_AFIRST) + return gp_argb16; + + else +# endif + return gp_rgba16; + } + + else + return gp_rgb16; + } + } + + else + { + if (format & PNG_FORMAT_FLAG_ALPHA) + { +# ifdef PNG_FORMAT_AFIRST_SUPPORTED + if (format & PNG_FORMAT_FLAG_AFIRST) + return gp_ag16; + + else +# endif + return gp_ga16; + } + + else + return gp_g16; + } + } + + else + { + if (format & PNG_FORMAT_FLAG_COLOR) + { +# ifdef PNG_FORMAT_BGR_SUPPORTED + if (format & PNG_FORMAT_FLAG_BGR) + { + if (format & PNG_FORMAT_FLAG_ALPHA) + { +# ifdef PNG_FORMAT_AFIRST_SUPPORTED + if (format & PNG_FORMAT_FLAG_AFIRST) + return gp_abgr8; + + else +# endif + return gp_bgra8; + } + + else + return gp_bgr8; + } + + else +# endif + { + if (format & PNG_FORMAT_FLAG_ALPHA) + { +# ifdef PNG_FORMAT_AFIRST_SUPPORTED + if (format & PNG_FORMAT_FLAG_AFIRST) + return gp_argb8; + + else +# endif + return gp_rgba8; + } + + else + return gp_rgb8; + } + } + + else + { + if (format & PNG_FORMAT_FLAG_ALPHA) + { +# ifdef PNG_FORMAT_AFIRST_SUPPORTED + if (format & PNG_FORMAT_FLAG_AFIRST) + return gp_ag8; + + else +# endif + return gp_ga8; + } + + else + return gp_g8; + } + } +} + +/* Conversion between pixel formats. The code above effectively eliminates the + * component ordering changes leaving three basic changes: + * + * 1) Remove an alpha channel by pre-multiplication or compositing on a + * background color. (Adding an alpha channel is a no-op.) + * + * 2) Remove color by mapping to grayscale. (Grayscale to color is a no-op.) + * + * 3) Convert between 8-bit and 16-bit components. (Both directtions are + * relevant.) + * + * This gives the following base format conversion matrix: + * + * OUT: ----- 8-bit ----- ----- 16-bit ----- + * IN G GA RGB RGBA G GA RGB RGBA + * 8 G . . . . lin lin lin lin + * 8 GA bckg . bckc . pre' pre pre' pre + * 8 RGB g8 g8 . . glin glin lin lin + * 8 RGBA g8b g8 bckc . gpr' gpre pre' pre + * 16 G sRGB sRGB sRGB sRGB . . . . + * 16 GA b16g unpg b16c unpc A . A . + * 16 RGB sG sG sRGB sRGB g16 g16 . . + * 16 RGBA gb16 sGp cb16 sCp g16 g16' A . + * + * 8-bit to 8-bit: + * bckg: composite on gray background + * bckc: composite on color background + * g8: convert sRGB components to sRGB grayscale + * g8b: convert sRGB components to grayscale and composite on gray background + * + * 8-bit to 16-bit: + * lin: make sRGB components linear, alpha := 65535 + * pre: make sRGB components linear and premultiply by alpha (scale alpha) + * pre': as 'pre' but alpha := 65535 + * glin: make sRGB components linear, convert to grayscale, alpha := 65535 + * gpre: make sRGB components grayscale and linear and premultiply by alpha + * gpr': as 'gpre' but alpha := 65535 + * + * 16-bit to 8-bit: + * sRGB: convert linear components to sRGB, alpha := 255 + * unpg: unpremultiply gray component and convert to sRGB (scale alpha) + * unpc: unpremultiply color components and convert to sRGB (scale alpha) + * b16g: composite linear onto gray background and convert the result to sRGB + * b16c: composite linear onto color background and convert the result to sRGB + * sG: convert linear RGB to sRGB grayscale + * sGp: unpremultiply RGB then convert to sRGB grayscale + * sCp: unpremultiply RGB then convert to sRGB + * gb16: composite linear onto background and convert to sRGB grayscale + * (order doesn't matter, the composite and grayscale operations permute) + * cb16: composite linear onto background and convert to sRGB + * + * 16-bit to 16-bit: + * A: set alpha to 65535 + * g16: convert linear RGB to linear grayscale (alpha := 65535) + * g16': as 'g16' but alpha is unchanged + */ +/* Simple copy: */ +static void +gpc_noop(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + out->r = in->r; + out->g = in->g; + out->b = in->b; + out->a = in->a; +} + +#if ALLOW_UNUSED_GPC +static void +gpc_nop8(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + if (in->a == 0) + out->r = out->g = out->b = 255; + + else + { + out->r = in->r; + out->g = in->g; + out->b = in->b; + } + + out->a = in->a; +} +#endif + +#if ALLOW_UNUSED_GPC +static void +gpc_nop6(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + if (in->a == 0) + out->r = out->g = out->b = 65535; + + else + { + out->r = in->r; + out->g = in->g; + out->b = in->b; + } + + out->a = in->a; +} +#endif + +/* 8-bit to 8-bit conversions */ +/* bckg: composite on gray background */ +static void +gpc_bckg(Pixel *out, const Pixel *in, const Background *back) +{ + if (in->a <= 0) + out->r = out->g = out->b = back->ig; + + else if (in->a >= 255) + out->r = out->g = out->b = in->g; + + else + { + double a = in->a / 255.; + + out->r = out->g = out->b = sRGB(sRGB_to_d[in->g] * a + back->dg * (1-a)); + } + + out->a = 255; +} + +/* bckc: composite on color background */ +static void +gpc_bckc(Pixel *out, const Pixel *in, const Background *back) +{ + if (in->a <= 0) + { + out->r = back->ir; + out->g = back->ig; + out->b = back->ib; + } + + else if (in->a >= 255) + { + out->r = in->r; + out->g = in->g; + out->b = in->b; + } + + else + { + double a = in->a / 255.; + + out->r = sRGB(sRGB_to_d[in->r] * a + back->dr * (1-a)); + out->g = sRGB(sRGB_to_d[in->g] * a + back->dg * (1-a)); + out->b = sRGB(sRGB_to_d[in->b] * a + back->db * (1-a)); + } + + out->a = 255; +} + +/* g8: convert sRGB components to sRGB grayscale */ +static void +gpc_g8(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + if (in->r == in->g && in->g == in->b) + out->r = out->g = out->b = in->g; + + else + out->r = out->g = out->b = + sRGB(YfromRGB(sRGB_to_d[in->r], sRGB_to_d[in->g], sRGB_to_d[in->b])); + + out->a = in->a; +} + +/* g8b: convert sRGB components to grayscale and composite on gray background */ +static void +gpc_g8b(Pixel *out, const Pixel *in, const Background *back) +{ + if (in->a <= 0) + out->r = out->g = out->b = back->ig; + + else if (in->a >= 255) + { + if (in->r == in->g && in->g == in->b) + out->r = out->g = out->b = in->g; + + else + out->r = out->g = out->b = sRGB(YfromRGB( + sRGB_to_d[in->r], sRGB_to_d[in->g], sRGB_to_d[in->b])); + } + + else + { + double a = in->a/255.; + + out->r = out->g = out->b = sRGB(a * YfromRGB(sRGB_to_d[in->r], + sRGB_to_d[in->g], sRGB_to_d[in->b]) + back->dg * (1-a)); + } + + out->a = 255; +} + +/* 8-bit to 16-bit conversions */ +/* lin: make sRGB components linear, alpha := 65535 */ +static void +gpc_lin(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + out->r = ilinear(in->r); + + if (in->g == in->r) + { + out->g = out->r; + + if (in->b == in->r) + out->b = out->r; + + else + out->b = ilinear(in->b); + } + + else + { + out->g = ilinear(in->g); + + if (in->b == in->r) + out->b = out->r; + + else if (in->b == in->g) + out->b = out->g; + + else + out->b = ilinear(in->b); + } + + out->a = 65535; +} + +/* pre: make sRGB components linear and premultiply by alpha (scale alpha) */ +static void +gpc_pre(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + out->r = ilineara(in->r, in->a); + + if (in->g == in->r) + { + out->g = out->r; + + if (in->b == in->r) + out->b = out->r; + + else + out->b = ilineara(in->b, in->a); + } + + else + { + out->g = ilineara(in->g, in->a); + + if (in->b == in->r) + out->b = out->r; + + else if (in->b == in->g) + out->b = out->g; + + else + out->b = ilineara(in->b, in->a); + } + + out->a = in->a * 257; +} + +/* pre': as 'pre' but alpha := 65535 */ +static void +gpc_preq(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + out->r = ilineara(in->r, in->a); + + if (in->g == in->r) + { + out->g = out->r; + + if (in->b == in->r) + out->b = out->r; + + else + out->b = ilineara(in->b, in->a); + } + + else + { + out->g = ilineara(in->g, in->a); + + if (in->b == in->r) + out->b = out->r; + + else if (in->b == in->g) + out->b = out->g; + + else + out->b = ilineara(in->b, in->a); + } + + out->a = 65535; +} + +/* glin: make sRGB components linear, convert to grayscale, alpha := 65535 */ +static void +gpc_glin(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + if (in->r == in->g && in->g == in->b) + out->r = out->g = out->b = ilinear(in->g); + + else + out->r = out->g = out->b = u16d(65535 * + YfromRGB(sRGB_to_d[in->r], sRGB_to_d[in->g], sRGB_to_d[in->b])); + + out->a = 65535; +} + +/* gpre: make sRGB components grayscale and linear and premultiply by alpha */ +static void +gpc_gpre(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + if (in->r == in->g && in->g == in->b) + out->r = out->g = out->b = ilineara(in->g, in->a); + + else + out->r = out->g = out->b = u16d(in->a * 257 * + YfromRGB(sRGB_to_d[in->r], sRGB_to_d[in->g], sRGB_to_d[in->b])); + + out->a = 257 * in->a; +} + +/* gpr': as 'gpre' but alpha := 65535 */ +static void +gpc_gprq(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + if (in->r == in->g && in->g == in->b) + out->r = out->g = out->b = ilineara(in->g, in->a); + + else + out->r = out->g = out->b = u16d(in->a * 257 * + YfromRGB(sRGB_to_d[in->r], sRGB_to_d[in->g], sRGB_to_d[in->b])); + + out->a = 65535; +} + +/* 8-bit to 16-bit conversions for gAMA 45455 encoded values */ +/* Lin: make gAMA 45455 components linear, alpha := 65535 */ +static void +gpc_Lin(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + out->r = ilinear_g22(in->r); + + if (in->g == in->r) + { + out->g = out->r; + + if (in->b == in->r) + out->b = out->r; + + else + out->b = ilinear_g22(in->b); + } + + else + { + out->g = ilinear_g22(in->g); + + if (in->b == in->r) + out->b = out->r; + + else if (in->b == in->g) + out->b = out->g; + + else + out->b = ilinear_g22(in->b); + } + + out->a = 65535; +} + +#if ALLOW_UNUSED_GPC +/* Pre: make gAMA 45455 components linear and premultiply by alpha (scale alpha) + */ +static void +gpc_Pre(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + out->r = ilineara_g22(in->r, in->a); + + if (in->g == in->r) + { + out->g = out->r; + + if (in->b == in->r) + out->b = out->r; + + else + out->b = ilineara_g22(in->b, in->a); + } + + else + { + out->g = ilineara_g22(in->g, in->a); + + if (in->b == in->r) + out->b = out->r; + + else if (in->b == in->g) + out->b = out->g; + + else + out->b = ilineara_g22(in->b, in->a); + } + + out->a = in->a * 257; +} +#endif + +#if ALLOW_UNUSED_GPC +/* Pre': as 'Pre' but alpha := 65535 */ +static void +gpc_Preq(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + out->r = ilineara_g22(in->r, in->a); + + if (in->g == in->r) + { + out->g = out->r; + + if (in->b == in->r) + out->b = out->r; + + else + out->b = ilineara_g22(in->b, in->a); + } + + else + { + out->g = ilineara_g22(in->g, in->a); + + if (in->b == in->r) + out->b = out->r; + + else if (in->b == in->g) + out->b = out->g; + + else + out->b = ilineara_g22(in->b, in->a); + } + + out->a = 65535; +} +#endif + +#if ALLOW_UNUSED_GPC +/* Glin: make gAMA 45455 components linear, convert to grayscale, alpha := 65535 + */ +static void +gpc_Glin(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + if (in->r == in->g && in->g == in->b) + out->r = out->g = out->b = ilinear_g22(in->g); + + else + out->r = out->g = out->b = u16d(65535 * + YfromRGB(g22_to_d[in->r], g22_to_d[in->g], g22_to_d[in->b])); + + out->a = 65535; +} +#endif + +#if ALLOW_UNUSED_GPC +/* Gpre: make gAMA 45455 components grayscale and linear and premultiply by + * alpha. + */ +static void +gpc_Gpre(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + if (in->r == in->g && in->g == in->b) + out->r = out->g = out->b = ilineara_g22(in->g, in->a); + + else + out->r = out->g = out->b = u16d(in->a * 257 * + YfromRGB(g22_to_d[in->r], g22_to_d[in->g], g22_to_d[in->b])); + + out->a = 257 * in->a; +} +#endif + +#if ALLOW_UNUSED_GPC +/* Gpr': as 'Gpre' but alpha := 65535 */ +static void +gpc_Gprq(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + if (in->r == in->g && in->g == in->b) + out->r = out->g = out->b = ilineara_g22(in->g, in->a); + + else + out->r = out->g = out->b = u16d(in->a * 257 * + YfromRGB(g22_to_d[in->r], g22_to_d[in->g], g22_to_d[in->b])); + + out->a = 65535; +} +#endif + +/* 16-bit to 8-bit conversions */ +/* sRGB: convert linear components to sRGB, alpha := 255 */ +static void +gpc_sRGB(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + out->r = isRGB(in->r); + + if (in->g == in->r) + { + out->g = out->r; + + if (in->b == in->r) + out->b = out->r; + + else + out->b = isRGB(in->b); + } + + else + { + out->g = isRGB(in->g); + + if (in->b == in->r) + out->b = out->r; + + else if (in->b == in->g) + out->b = out->g; + + else + out->b = isRGB(in->b); + } + + out->a = 255; +} + +/* unpg: unpremultiply gray component and convert to sRGB (scale alpha) */ +static void +gpc_unpg(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + if (in->a <= 128) + { + out->r = out->g = out->b = 255; + out->a = 0; + } + + else + { + out->r = out->g = out->b = sRGB((double)in->g / in->a); + out->a = u8d(in->a / 257.); + } +} + +/* unpc: unpremultiply color components and convert to sRGB (scale alpha) */ +static void +gpc_unpc(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + if (in->a <= 128) + { + out->r = out->g = out->b = 255; + out->a = 0; + } + + else + { + out->r = sRGB((double)in->r / in->a); + out->g = sRGB((double)in->g / in->a); + out->b = sRGB((double)in->b / in->a); + out->a = u8d(in->a / 257.); + } +} + +/* b16g: composite linear onto gray background and convert the result to sRGB */ +static void +gpc_b16g(Pixel *out, const Pixel *in, const Background *back) +{ + if (in->a <= 0) + out->r = out->g = out->b = back->ig; + + else + { + double a = in->a/65535.; + double a1 = 1-a; + + a /= 65535; + out->r = out->g = out->b = sRGB(in->g * a + back->dg * a1); + } + + out->a = 255; +} + +/* b16c: composite linear onto color background and convert the result to sRGB*/ +static void +gpc_b16c(Pixel *out, const Pixel *in, const Background *back) +{ + if (in->a <= 0) + { + out->r = back->ir; + out->g = back->ig; + out->b = back->ib; + } + + else + { + double a = in->a/65535.; + double a1 = 1-a; + + a /= 65535; + out->r = sRGB(in->r * a + back->dr * a1); + out->g = sRGB(in->g * a + back->dg * a1); + out->b = sRGB(in->b * a + back->db * a1); + } + + out->a = 255; +} + +/* sG: convert linear RGB to sRGB grayscale */ +static void +gpc_sG(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + out->r = out->g = out->b = sRGB(YfromRGBint(in->r, in->g, in->b)/65535); + out->a = 255; +} + +/* sGp: unpremultiply RGB then convert to sRGB grayscale */ +static void +gpc_sGp(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + if (in->a <= 128) + { + out->r = out->g = out->b = 255; + out->a = 0; + } + + else + { + out->r = out->g = out->b = sRGB(YfromRGBint(in->r, in->g, in->b)/in->a); + out->a = u8d(in->a / 257.); + } +} + +/* sCp: unpremultiply RGB then convert to sRGB */ +static void +gpc_sCp(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + + if (in->a <= 128) + { + out->r = out->g = out->b = 255; + out->a = 0; + } + + else + { + out->r = sRGB((double)in->r / in->a); + out->g = sRGB((double)in->g / in->a); + out->b = sRGB((double)in->b / in->a); + out->a = u8d(in->a / 257.); + } +} + +/* gb16: composite linear onto background and convert to sRGB grayscale */ +/* (order doesn't matter, the composite and grayscale operations permute) */ +static void +gpc_gb16(Pixel *out, const Pixel *in, const Background *back) +{ + if (in->a <= 0) + out->r = out->g = out->b = back->ig; + + else if (in->a >= 65535) + out->r = out->g = out->b = isRGB(in->g); + + else + { + double a = in->a / 65535.; + double a1 = 1-a; + + a /= 65535; + out->r = out->g = out->b = sRGB(in->g * a + back->dg * a1); + } + + out->a = 255; +} + +/* cb16: composite linear onto background and convert to sRGB */ +static void +gpc_cb16(Pixel *out, const Pixel *in, const Background *back) +{ + if (in->a <= 0) + { + out->r = back->ir; + out->g = back->ig; + out->b = back->ib; + } + + else if (in->a >= 65535) + { + out->r = isRGB(in->r); + out->g = isRGB(in->g); + out->b = isRGB(in->b); + } + + else + { + double a = in->a / 65535.; + double a1 = 1-a; + + a /= 65535; + out->r = sRGB(in->r * a + back->dr * a1); + out->g = sRGB(in->g * a + back->dg * a1); + out->b = sRGB(in->b * a + back->db * a1); + } + + out->a = 255; +} + +/* 16-bit to 16-bit conversions */ +/* A: set alpha to 65535 */ +static void +gpc_A(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + out->r = in->r; + out->g = in->g; + out->b = in->b; + out->a = 65535; +} + +/* g16: convert linear RGB to linear grayscale (alpha := 65535) */ +static void +gpc_g16(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + out->r = out->g = out->b = u16d(YfromRGBint(in->r, in->g, in->b)); + out->a = 65535; +} + +/* g16': as 'g16' but alpha is unchanged */ +static void +gpc_g16q(Pixel *out, const Pixel *in, const Background *back) +{ + (void)back; + out->r = out->g = out->b = u16d(YfromRGBint(in->r, in->g, in->b)); + out->a = in->a; +} + +#if ALLOW_UNUSED_GPC +/* Unused functions (to hide them from GCC unused function warnings) */ +void (* const gpc_unused[]) + (Pixel *out, const Pixel *in, const Background *back) = +{ + gpc_Pre, gpc_Preq, gpc_Glin, gpc_Gpre, gpc_Gprq, gpc_nop8, gpc_nop6 +}; +#endif + +/* OUT: ----- 8-bit ----- ----- 16-bit ----- + * IN G GA RGB RGBA G GA RGB RGBA + * 8 G . . . . lin lin lin lin + * 8 GA bckg . bckc . pre' pre pre' pre + * 8 RGB g8 g8 . . glin glin lin lin + * 8 RGBA g8b g8 bckc . gpr' gpre pre' pre + * 16 G sRGB sRGB sRGB sRGB . . . . + * 16 GA b16g unpg b16c unpc A . A . + * 16 RGB sG sG sRGB sRGB g16 g16 . . + * 16 RGBA gb16 sGp cb16 sCp g16 g16' A . + * + * The matrix is held in an array indexed thus: + * + * gpc_fn[out_format & BASE_FORMATS][in_format & BASE_FORMATS]; + */ +/* This will produce a compile time error if the FORMAT_FLAG values don't + * match the above matrix! + */ +#if PNG_FORMAT_FLAG_ALPHA == 1 && PNG_FORMAT_FLAG_COLOR == 2 &&\ + PNG_FORMAT_FLAG_LINEAR == 4 +static void (* const gpc_fn[8/*in*/][8/*out*/]) + (Pixel *out, const Pixel *in, const Background *back) = +{ +/*out: G-8 GA-8 RGB-8 RGBA-8 G-16 GA-16 RGB-16 RGBA-16 */ + {gpc_noop,gpc_noop,gpc_noop,gpc_noop, gpc_Lin, gpc_Lin, gpc_Lin, gpc_Lin }, + {gpc_bckg,gpc_noop,gpc_bckc,gpc_noop, gpc_preq,gpc_pre, gpc_preq,gpc_pre }, + {gpc_g8, gpc_g8, gpc_noop,gpc_noop, gpc_glin,gpc_glin,gpc_lin, gpc_lin }, + {gpc_g8b, gpc_g8, gpc_bckc,gpc_noop, gpc_gprq,gpc_gpre,gpc_preq,gpc_pre }, + {gpc_sRGB,gpc_sRGB,gpc_sRGB,gpc_sRGB, gpc_noop,gpc_noop,gpc_noop,gpc_noop}, + {gpc_b16g,gpc_unpg,gpc_b16c,gpc_unpc, gpc_A, gpc_noop,gpc_A, gpc_noop}, + {gpc_sG, gpc_sG, gpc_sRGB,gpc_sRGB, gpc_g16, gpc_g16, gpc_noop,gpc_noop}, + {gpc_gb16,gpc_sGp, gpc_cb16,gpc_sCp, gpc_g16, gpc_g16q,gpc_A, gpc_noop} +}; + +/* The array is repeated for the cases where both the input and output are color + * mapped because then different algorithms are used. + */ +static void (* const gpc_fn_colormapped[8/*in*/][8/*out*/]) + (Pixel *out, const Pixel *in, const Background *back) = +{ +/*out: G-8 GA-8 RGB-8 RGBA-8 G-16 GA-16 RGB-16 RGBA-16 */ + {gpc_noop,gpc_noop,gpc_noop,gpc_noop, gpc_lin, gpc_lin, gpc_lin, gpc_lin }, + {gpc_bckg,gpc_noop,gpc_bckc,gpc_noop, gpc_preq,gpc_pre, gpc_preq,gpc_pre }, + {gpc_g8, gpc_g8, gpc_noop,gpc_noop, gpc_glin,gpc_glin,gpc_lin, gpc_lin }, + {gpc_g8b, gpc_g8, gpc_bckc,gpc_noop, gpc_gprq,gpc_gpre,gpc_preq,gpc_pre }, + {gpc_sRGB,gpc_sRGB,gpc_sRGB,gpc_sRGB, gpc_noop,gpc_noop,gpc_noop,gpc_noop}, + {gpc_b16g,gpc_unpg,gpc_b16c,gpc_unpc, gpc_A, gpc_noop,gpc_A, gpc_noop}, + {gpc_sG, gpc_sG, gpc_sRGB,gpc_sRGB, gpc_g16, gpc_g16, gpc_noop,gpc_noop}, + {gpc_gb16,gpc_sGp, gpc_cb16,gpc_sCp, gpc_g16, gpc_g16q,gpc_A, gpc_noop} +}; + +/* The error arrays record the error in the same matrix; 64 entries, however + * the different algorithms used in libpng for colormap and direct conversions + * mean that four separate matrices are used (for each combination of + * colormapped and direct.) + * + * In some cases the conversion between sRGB formats goes via a linear + * intermediate; an sRGB to linear conversion (as above) is followed by a simple + * linear to sRGB step with no other conversions. This is done by a separate + * error array from an arbitrary 'in' format to one of the four basic outputs + * (since final output is always sRGB not colormapped). + * + * These arrays may be modified if the --accumulate flag is set during the run; + * then instead of logging errors they are simply added in. + * + * The three entries are currently for transparent, partially transparent and + * opaque input pixel values. Notice that alpha should be exact in each case. + * + * Errors in alpha should only occur when converting from a direct format + * to a colormapped format, when alpha is effectively smashed (so large + * errors can occur.) There should be no error in the '0' and 'opaque' + * values. The fourth entry in the array is used for the alpha error (and it + * should always be zero for the 'via linear' case since this is never color + * mapped.) + * + * Mapping to a colormap smashes the colors, it is necessary to have separate + * values for these cases because they are much larger; it is very much + * impossible to obtain a reasonable result, these are held in + * gpc_error_to_colormap. + */ +#if PNG_FORMAT_FLAG_COLORMAP == 8 /* extra check also required */ +# include "pngstest-errors.h" /* machine generated */ +#endif /* COLORMAP flag check */ +#endif /* flag checks */ + +typedef struct +{ + /* Basic pixel information: */ + Image* in_image; /* Input image */ + const Image* out_image; /* Output image */ + + /* 'background' is the value passed to the gpc_ routines, it may be NULL if + * it should not be used (*this* program has an error if it crashes as a + * result!) + */ + Background background_color; + const Background* background; + + /* Precalculated values: */ + int in_opaque; /* Value of input alpha that is opaque */ + int is_palette; /* Sample values come from the palette */ + int accumulate; /* Accumulate component errors (don't log) */ + int output_8bit; /* Output is 8-bit (else 16-bit) */ + + void (*in_gp)(Pixel*, png_const_voidp); + void (*out_gp)(Pixel*, png_const_voidp); + + void (*transform)(Pixel *out, const Pixel *in, const Background *back); + /* A function to perform the required transform */ + + void (*from_linear)(Pixel *out, const Pixel *in, const Background *back); + /* For 'via_linear' transforms the final, from linear, step, else NULL */ + + png_uint_16 error[4]; + /* Three error values for transparent, partially transparent and opaque + * input pixels (in turn). + */ + + png_uint_16 *error_ptr; + /* Where these are stored in the static array (for 'accumulate') */ +} +Transform; + +/* Return a 'transform' as above for the given format conversion. */ +static void +transform_from_formats(Transform *result, Image *in_image, + const Image *out_image, png_const_colorp background, int via_linear) +{ + png_uint_32 in_format, out_format; + png_uint_32 in_base, out_base; + + memset(result, 0, sizeof *result); + + /* Store the original images for error messages */ + result->in_image = in_image; + result->out_image = out_image; + + in_format = in_image->image.format; + out_format = out_image->image.format; + + if (in_format & PNG_FORMAT_FLAG_LINEAR) + result->in_opaque = 65535; + else + result->in_opaque = 255; + + result->output_8bit = (out_format & PNG_FORMAT_FLAG_LINEAR) == 0; + + result->is_palette = 0; /* set by caller if required */ + result->accumulate = (in_image->opts & ACCUMULATE) != 0; + + /* The loaders (which need the ordering information) */ + result->in_gp = get_pixel(in_format); + result->out_gp = get_pixel(out_format); + + /* Remove the ordering information: */ + in_format &= BASE_FORMATS | PNG_FORMAT_FLAG_COLORMAP; + in_base = in_format & BASE_FORMATS; + out_format &= BASE_FORMATS | PNG_FORMAT_FLAG_COLORMAP; + out_base = out_format & BASE_FORMATS; + + if (via_linear) + { + /* Check for an error in this program: */ + if (out_format & (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLORMAP)) + { + fprintf(stderr, "internal transform via linear error 0x%x->0x%x\n", + in_format, out_format); + exit(1); + } + + result->transform = gpc_fn[in_base][out_base | PNG_FORMAT_FLAG_LINEAR]; + result->from_linear = gpc_fn[out_base | PNG_FORMAT_FLAG_LINEAR][out_base]; + result->error_ptr = gpc_error_via_linear[in_format][out_format]; + } + + else if (~in_format & out_format & PNG_FORMAT_FLAG_COLORMAP) + { + /* The input is not colormapped but the output is, the errors will + * typically be large (only the grayscale-no-alpha case permits preserving + * even 8-bit values.) + */ + result->transform = gpc_fn[in_base][out_base]; + result->from_linear = NULL; + result->error_ptr = gpc_error_to_colormap[in_base][out_base]; + } + + else + { + /* The caller handles the colormap->pixel value conversion, so the + * transform function just gets a pixel value, however because libpng + * currently contains a different implementation for mapping a colormap if + * both input and output are colormapped we need different conversion + * functions to deal with errors in the libpng implementation. + */ + if (in_format & out_format & PNG_FORMAT_FLAG_COLORMAP) + result->transform = gpc_fn_colormapped[in_base][out_base]; + else + result->transform = gpc_fn[in_base][out_base]; + result->from_linear = NULL; + result->error_ptr = gpc_error[in_format][out_format]; + } + + /* Follow the libpng simplified API rules to work out what to pass to the gpc + * routines as a background value, if one is not required pass NULL so that + * this program crashes in the even of a programming error. + */ + result->background = NULL; /* default: not required */ + + /* Rule 1: background only need be supplied if alpha is to be removed */ + if (in_format & ~out_format & PNG_FORMAT_FLAG_ALPHA) + { + /* The input value is 'NULL' to use the background and (otherwise) an sRGB + * background color (to use a solid color). The code above uses a fixed + * byte value, BUFFER_INIT8, for buffer even for 16-bit output. For + * linear (16-bit) output the sRGB background color is ignored; the + * composition is always on the background (so BUFFER_INIT8 * 257), except + * that for the colormap (i.e. linear colormapped output) black is used. + */ + result->background = &result->background_color; + + if (out_format & PNG_FORMAT_FLAG_LINEAR || via_linear) + { + if (out_format & PNG_FORMAT_FLAG_COLORMAP) + { + result->background_color.ir = + result->background_color.ig = + result->background_color.ib = 0; + result->background_color.dr = + result->background_color.dg = + result->background_color.db = 0; + } + + else + { + result->background_color.ir = + result->background_color.ig = + result->background_color.ib = BUFFER_INIT8 * 257; + result->background_color.dr = + result->background_color.dg = + result->background_color.db = 0; + } + } + + else /* sRGB output */ + { + if (background != NULL) + { + if (out_format & PNG_FORMAT_FLAG_COLOR) + { + result->background_color.ir = background->red; + result->background_color.ig = background->green; + result->background_color.ib = background->blue; + /* TODO: sometimes libpng uses the power law conversion here, how + * to handle this? + */ + result->background_color.dr = sRGB_to_d[background->red]; + result->background_color.dg = sRGB_to_d[background->green]; + result->background_color.db = sRGB_to_d[background->blue]; + } + + else /* grayscale: libpng only looks at 'g' */ + { + result->background_color.ir = + result->background_color.ig = + result->background_color.ib = background->green; + /* TODO: sometimes libpng uses the power law conversion here, how + * to handle this? + */ + result->background_color.dr = + result->background_color.dg = + result->background_color.db = sRGB_to_d[background->green]; + } + } + + else if ((out_format & PNG_FORMAT_FLAG_COLORMAP) == 0) + { + result->background_color.ir = + result->background_color.ig = + result->background_color.ib = BUFFER_INIT8; + /* TODO: sometimes libpng uses the power law conversion here, how + * to handle this? + */ + result->background_color.dr = + result->background_color.dg = + result->background_color.db = sRGB_to_d[BUFFER_INIT8]; + } + + /* Else the output is colormapped and a background color must be + * provided; if pngstest crashes then that is a bug in this program + * (though libpng should png_error as well.) + */ + else + result->background = NULL; + } + } + + if (result->background == NULL) + { + result->background_color.ir = + result->background_color.ig = + result->background_color.ib = -1; /* not used */ + result->background_color.dr = + result->background_color.dg = + result->background_color.db = 1E30; /* not used */ + } + + + /* Copy the error values into the Transform: */ + result->error[0] = result->error_ptr[0]; + result->error[1] = result->error_ptr[1]; + result->error[2] = result->error_ptr[2]; + result->error[3] = result->error_ptr[3]; +} + + +/* Compare two pixels. + * + * OLD error values: +static int error_to_linear = 811; * by experiment * +static int error_to_linear_grayscale = 424; * by experiment * +static int error_to_sRGB = 6; * by experiment * +static int error_to_sRGB_grayscale = 17; * libpng error by calculation + + 2 by experiment * +static int error_in_compose = 2; * by experiment * +static int error_in_premultiply = 1; + * + * The following is *just* the result of a round trip from 8-bit sRGB to linear + * then back to 8-bit sRGB when it is done by libpng. There are two problems: + * + * 1) libpng currently uses a 2.2 power law with no linear segment, this results + * in instability in the low values and even with 16-bit precision sRGB(1) ends + * up mapping to sRGB(0) as a result of rounding in the 16-bit representation. + * This gives an error of 1 in the handling of value 1 only. + * + * 2) libpng currently uses an intermediate 8-bit linear value in gamma + * correction of 8-bit values. This results in many more errors, the worse of + * which is mapping sRGB(14) to sRGB(0). + * + * The general 'error_via_linear' is more complex because of pre-multiplication, + * this compounds the 8-bit errors according to the alpha value of the pixel. + * As a result 256 values are pre-calculated for error_via_linear. + */ +#if 0 +static int error_in_libpng_gamma; +static int error_via_linear[256]; /* Indexed by 8-bit alpha */ + +static void +init_error_via_linear(void) +{ + int alpha; + + error_via_linear[0] = 255; /* transparent pixel */ + + for (alpha=1; alpha<=255; ++alpha) + { + /* 16-bit values less than 128.5 get rounded to 8-bit 0 and so the worst + * case error arises with 16-bit 128.5, work out what sRGB + * (non-associated) value generates 128.5; any value less than this is + * going to map to 0, so the worst error is floor(value). + * + * Note that errors are considerably higher (more than a factor of 2) + * because libpng uses a simple power law for sRGB data at present. + * + * Add .1 for arithmetic errors inside libpng. + */ + double v = floor(255*pow(.5/*(128.5 * 255 / 65535)*/ / alpha, 1/2.2)+.1); + + error_via_linear[alpha] = (int)v; + } + + /* This is actually 14.99, but, despite the closeness to 15, 14 seems to work + * ok in this case. + */ + error_in_libpng_gamma = 14; +} +#endif + +static void +print_pixel(char string[64], const Pixel *pixel, png_uint_32 format) +{ + switch (format & (PNG_FORMAT_FLAG_ALPHA|PNG_FORMAT_FLAG_COLOR)) + { + case 0: + sprintf(string, "%s(%d)", format_names[format], pixel->g); + break; + + case PNG_FORMAT_FLAG_ALPHA: + sprintf(string, "%s(%d,%d)", format_names[format], pixel->g, + pixel->a); + break; + + case PNG_FORMAT_FLAG_COLOR: + sprintf(string, "%s(%d,%d,%d)", format_names[format], + pixel->r, pixel->g, pixel->b); + break; + + case PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA: + sprintf(string, "%s(%d,%d,%d,%d)", format_names[format], + pixel->r, pixel->g, pixel->b, pixel->a); + break; + + default: + sprintf(string, "invalid-format"); + break; + } +} + +static int +logpixel(const Transform *transform, png_uint_32 x, png_uint_32 y, + const Pixel *in, const Pixel *calc, const Pixel *out, const char *reason) +{ + png_uint_32 in_format = transform->in_image->image.format; + png_uint_32 out_format = transform->out_image->image.format; + + png_uint_32 back_format = out_format & ~PNG_FORMAT_FLAG_ALPHA; + const char *via_linear = ""; + + char pixel_in[64], pixel_calc[64], pixel_out[64], pixel_loc[64]; + char background_info[100]; + + print_pixel(pixel_in, in, in_format); + print_pixel(pixel_calc, calc, out_format); + print_pixel(pixel_out, out, out_format); + + if (transform->is_palette) + sprintf(pixel_loc, "palette: %lu", (unsigned long)y); + else + sprintf(pixel_loc, "%lu,%lu", (unsigned long)x, (unsigned long)y); + + if (transform->from_linear != NULL) + { + via_linear = " (via linear)"; + /* And as a result the *read* format which did any background processing + * was itself linear, so the background color information is also + * linear. + */ + back_format |= PNG_FORMAT_FLAG_LINEAR; + } + + if (transform->background != NULL) + { + Pixel back; + char pixel_back[64]; + + back.r = transform->background->ir; + back.g = transform->background->ig; + back.b = transform->background->ib; + back.a = -1; /* not used */ + + print_pixel(pixel_back, &back, back_format); + sprintf(background_info, " on background %s", pixel_back); + } + + else + background_info[0] = 0; + + if (transform->in_image->file_name != transform->out_image->file_name) + { + char error_buffer[512]; + sprintf(error_buffer, + "(%s) %s error%s:\n %s%s ->\n %s\n not: %s.\n" + "Use --preserve and examine: ", pixel_loc, reason, via_linear, + pixel_in, background_info, pixel_out, pixel_calc); + return logerror(transform->in_image, transform->in_image->file_name, + error_buffer, transform->out_image->file_name); + } + + else + { + char error_buffer[512]; + sprintf(error_buffer, + "(%s) %s error%s:\n %s%s ->\n %s\n not: %s.\n" + " The error happened when reading the original file with this format.", + pixel_loc, reason, via_linear, pixel_in, background_info, pixel_out, + pixel_calc); + return logerror(transform->in_image, transform->in_image->file_name, + error_buffer, ""); + } +} + +static int +cmppixel(Transform *transform, png_const_voidp in, png_const_voidp out, + png_uint_32 x, png_uint_32 y/*or palette index*/) +{ + int maxerr; + png_const_charp errmsg; + Pixel pixel_in, pixel_calc, pixel_out; + + transform->in_gp(&pixel_in, in); + + if (transform->from_linear == NULL) + transform->transform(&pixel_calc, &pixel_in, transform->background); + + else + { + transform->transform(&pixel_out, &pixel_in, transform->background); + transform->from_linear(&pixel_calc, &pixel_out, NULL); + } + + transform->out_gp(&pixel_out, out); + + /* Eliminate the case where the input and output values match exactly. */ + if (pixel_calc.a == pixel_out.a && pixel_calc.r == pixel_out.r && + pixel_calc.g == pixel_out.g && pixel_calc.b == pixel_out.b) + return 1; + + /* Eliminate the case where the output pixel is transparent and the output + * is 8-bit - any component values are valid. Don't check the input alpha + * here to also skip the 16-bit small alpha cases. + */ + if (transform->output_8bit && pixel_calc.a == 0 && pixel_out.a == 0) + return 1; + + /* Check for alpha errors first; an alpha error can damage the components too + * so avoid spurious checks on components if one is found. + */ + errmsg = NULL; + { + int err_a = abs(pixel_calc.a-pixel_out.a); + + if (err_a > transform->error[3]) + { + /* If accumulating check the components too */ + if (transform->accumulate) + transform->error[3] = (png_uint_16)err_a; + + else + errmsg = "alpha"; + } + } + + /* Now if *either* of the output alphas are 0 but alpha is within tolerance + * eliminate the 8-bit component comparison. + */ + if (errmsg == NULL && transform->output_8bit && + (pixel_calc.a == 0 || pixel_out.a == 0)) + return 1; + + if (errmsg == NULL) /* else just signal an alpha error */ + { + int err_r = abs(pixel_calc.r - pixel_out.r); + int err_g = abs(pixel_calc.g - pixel_out.g); + int err_b = abs(pixel_calc.b - pixel_out.b); + int limit; + + if ((err_r | err_g | err_b) == 0) + return 1; /* exact match */ + + /* Mismatch on a component, check the input alpha */ + if (pixel_in.a >= transform->in_opaque) + { + errmsg = "opaque component"; + limit = 2; /* opaque */ + } + + else if (pixel_in.a > 0) + { + errmsg = "alpha component"; + limit = 1; /* partially transparent */ + } + + else + { + errmsg = "transparent component (background)"; + limit = 0; /* transparent */ + } + + maxerr = err_r; + if (maxerr < err_g) maxerr = err_g; + if (maxerr < err_b) maxerr = err_b; + + if (maxerr <= transform->error[limit]) + return 1; /* within the error limits */ + + /* Handle a component mis-match; log it, just return an error code, or + * accumulate it. + */ + if (transform->accumulate) + { + transform->error[limit] = (png_uint_16)maxerr; + return 1; /* to cause the caller to keep going */ + } + } + + /* Failure to match and not accumulating, so the error must be logged. */ + return logpixel(transform, x, y, &pixel_in, &pixel_calc, &pixel_out, errmsg); +} + +static png_byte +component_loc(png_byte loc[4], png_uint_32 format) +{ + /* Given a format return the number of channels and the location of + * each channel. + * + * The mask 'loc' contains the component offset of the channels in the + * following order. Note that if 'format' is grayscale the entries 1-3 must + * all contain the location of the gray channel. + * + * 0: alpha + * 1: red or gray + * 2: green or gray + * 3: blue or gray + */ + png_byte channels; + + if (format & PNG_FORMAT_FLAG_COLOR) + { + channels = 3; + + loc[2] = 1; + +# ifdef PNG_FORMAT_BGR_SUPPORTED + if (format & PNG_FORMAT_FLAG_BGR) + { + loc[1] = 2; + loc[3] = 0; + } + + else +# endif + { + loc[1] = 0; + loc[3] = 2; + } + } + + else + { + channels = 1; + loc[1] = loc[2] = loc[3] = 0; + } + + if (format & PNG_FORMAT_FLAG_ALPHA) + { +# ifdef PNG_FORMAT_AFIRST_SUPPORTED + if (format & PNG_FORMAT_FLAG_AFIRST) + { + loc[0] = 0; + ++loc[1]; + ++loc[2]; + ++loc[3]; + } + + else +# endif + loc[0] = channels; + + ++channels; + } + + else + loc[0] = 4; /* not present */ + + return channels; +} + +/* Compare two images, the original 'a', which was written out then read back in + * to * give image 'b'. The formats may have been changed. + */ +static int +compare_two_images(Image *a, Image *b, int via_linear, + png_const_colorp background) +{ + ptrdiff_t stridea = a->stride; + ptrdiff_t strideb = b->stride; + png_const_bytep rowa = a->buffer+16; + png_const_bytep rowb = b->buffer+16; + png_uint_32 width = a->image.width; + png_uint_32 height = a->image.height; + png_uint_32 formata = a->image.format; + png_uint_32 formatb = b->image.format; + unsigned int a_sample = PNG_IMAGE_SAMPLE_SIZE(formata); + unsigned int b_sample = PNG_IMAGE_SAMPLE_SIZE(formatb); + int alpha_added, alpha_removed; + int bchannels; + png_uint_32 y; + Transform tr; + int btoa[4]={0,0,0,0}; + + /* This should never happen: */ + if (width != b->image.width || height != b->image.height) + return logerror(a, a->file_name, ": width x height changed: ", + b->file_name); + + /* Set up the background and the transform */ + transform_from_formats(&tr, a, b, background, via_linear); + + /* Find the first row and inter-row space. */ + if (!(formata & PNG_FORMAT_FLAG_COLORMAP) && + (formata & PNG_FORMAT_FLAG_LINEAR)) + stridea *= 2; + + if (!(formatb & PNG_FORMAT_FLAG_COLORMAP) && + (formatb & PNG_FORMAT_FLAG_LINEAR)) + strideb *= 2; + + if (stridea < 0) rowa += (height-1) * (-stridea); + if (strideb < 0) rowb += (height-1) * (-strideb); + + /* First shortcut the two colormap case by comparing the image data; if it + * matches then we expect the colormaps to match, although this is not + * absolutely necessary for an image match. If the colormaps fail to match + * then there is a problem in libpng. + */ + if (formata & formatb & PNG_FORMAT_FLAG_COLORMAP) + { + /* Only check colormap entries that actually exist; */ + png_const_bytep ppa, ppb; + int match; + png_byte in_use[256], amax = 0, bmax = 0; + + memset(in_use, 0, sizeof in_use); + + ppa = rowa; + ppb = rowb; + + /* Do this the slow way to accumulate the 'in_use' flags, don't break out + * of the loop until the end; this validates the color-mapped data to + * ensure all pixels are valid color-map indexes. + */ + for (y=0, match=1; y bmax) + bmax = bval; + + if (bval != aval) + match = 0; + + in_use[aval] = 1; + if (aval > amax) + amax = aval; + } + } + + /* If the buffers match then the colormaps must too. */ + if (match) + { + /* Do the color-maps match, entry by entry? Only check the 'in_use' + * entries. An error here should be logged as a color-map error. + */ + png_const_bytep a_cmap = (png_const_bytep)a->colormap; + png_const_bytep b_cmap = (png_const_bytep)b->colormap; + int result = 1; /* match by default */ + + /* This is used in logpixel to get the error message correct. */ + tr.is_palette = 1; + + for (y=0; y<256; ++y, a_cmap += a_sample, b_cmap += b_sample) + if (in_use[y]) + { + /* The colormap entries should be valid, but because libpng doesn't + * do any checking at present the original image may contain invalid + * pixel values. These cause an error here (at present) unless + * accumulating errors in which case the program just ignores them. + */ + if (y >= a->image.colormap_entries) + { + if ((a->opts & ACCUMULATE) == 0) + { + char pindex[9]; + sprintf(pindex, "%lu[%lu]", (unsigned long)y, + (unsigned long)a->image.colormap_entries); + logerror(a, a->file_name, ": bad pixel index: ", pindex); + } + result = 0; + } + + else if (y >= b->image.colormap_entries) + { + if ((b->opts & ACCUMULATE) == 0) + { + char pindex[9]; + sprintf(pindex, "%lu[%lu]", (unsigned long)y, + (unsigned long)b->image.colormap_entries); + logerror(b, b->file_name, ": bad pixel index: ", pindex); + } + result = 0; + } + + /* All the mismatches are logged here; there can only be 256! */ + else if (!cmppixel(&tr, a_cmap, b_cmap, 0, y)) + result = 0; + } + + /* If requested, copy the error values back from the Transform. */ + if (a->opts & ACCUMULATE) + { + tr.error_ptr[0] = tr.error[0]; + tr.error_ptr[1] = tr.error[1]; + tr.error_ptr[2] = tr.error[2]; + tr.error_ptr[3] = tr.error[3]; + result = 1; /* force a continue */ + } + + return result; + } + + /* else the image buffers don't match pixel-wise so compare sample values + * instead, but first validate that the pixel indexes are in range (but + * only if not accumulating, when the error is ignored.) + */ + else if ((a->opts & ACCUMULATE) == 0) + { +# ifdef __GNUC__ +# define BYTE_CHARS 20 /* 2^32: GCC sprintf warning */ +# else +# define BYTE_CHARS 3 /* 2^8: real maximum value */ +# endif + /* Check the original image first, + * TODO: deal with input images with bad pixel values? + */ + if (amax >= a->image.colormap_entries) + { + char pindex[3+2*BYTE_CHARS]; + sprintf(pindex, "%d[%u]", amax, + (png_byte)/*SAFE*/a->image.colormap_entries); + return logerror(a, a->file_name, ": bad pixel index: ", pindex); + } + + else if (bmax >= b->image.colormap_entries) + { + char pindex[3+2*BYTE_CHARS]; + sprintf(pindex, "%d[%u]", bmax, + (png_byte)/*SAFE*/b->image.colormap_entries); + return logerror(b, b->file_name, ": bad pixel index: ", pindex); + } + } + } + + /* We can directly compare pixel values without the need to use the read + * or transform support (i.e. a memory compare) if: + * + * 1) The bit depth has not changed. + * 2) RGB to grayscale has not been done (the reverse is ok; we just compare + * the three RGB values to the original grayscale.) + * 3) An alpha channel has not been removed from an 8-bit format, or the + * 8-bit alpha value of the pixel was 255 (opaque). + * + * If an alpha channel has been *added* then it must have the relevant opaque + * value (255 or 65535). + * + * The fist two the tests (in the order given above) (using the boolean + * equivalence !a && !b == !(a || b)) + */ + if (!(((formata ^ formatb) & PNG_FORMAT_FLAG_LINEAR) | + (formata & (formatb ^ PNG_FORMAT_FLAG_COLOR) & PNG_FORMAT_FLAG_COLOR))) + { + /* Was an alpha channel changed? */ + png_uint_32 alpha_changed = (formata ^ formatb) & PNG_FORMAT_FLAG_ALPHA; + + /* Was an alpha channel removed? (The third test.) If so the direct + * comparison is only possible if the input alpha is opaque. + */ + alpha_removed = (formata & alpha_changed) != 0; + + /* Was an alpha channel added? */ + alpha_added = (formatb & alpha_changed) != 0; + + /* The channels may have been moved between input and output, this finds + * out how, recording the result in the btoa array, which says where in + * 'a' to find each channel of 'b'. If alpha was added then btoa[alpha] + * ends up as 4 (and is not used.) + */ + { + int i; + png_byte aloc[4]; + png_byte bloc[4]; + + /* The following are used only if the formats match, except that + * 'bchannels' is a flag for matching formats. btoa[x] says, for each + * channel in b, where to find the corresponding value in a, for the + * bchannels. achannels may be different for a gray to rgb transform + * (a will be 1 or 2, b will be 3 or 4 channels.) + */ + (void)component_loc(aloc, formata); + bchannels = component_loc(bloc, formatb); + + /* Hence the btoa array. */ + for (i=0; i<4; ++i) if (bloc[i] < 4) + btoa[bloc[i]] = aloc[i]; /* may be '4' for alpha */ + + if (alpha_added) + alpha_added = bloc[0]; /* location of alpha channel in image b */ + + else + alpha_added = 4; /* Won't match an image b channel */ + + if (alpha_removed) + alpha_removed = aloc[0]; /* location of alpha channel in image a */ + + else + alpha_removed = 4; + } + } + + else + { + /* Direct compare is not possible, cancel out all the corresponding local + * variables. + */ + bchannels = 0; + alpha_removed = alpha_added = 4; + btoa[3] = btoa[2] = btoa[1] = btoa[0] = 4; /* 4 == not present */ + } + + for (y=0; ycolormap + a_sample * *ppa++; + else + psa = ppa, ppa += a_sample; + + if (formatb & PNG_FORMAT_FLAG_COLORMAP) + psb = (png_const_bytep)b->colormap + b_sample * *ppb++; + else + psb = ppb, ppb += b_sample; + + /* Do the fast test if possible. */ + if (bchannels) + { + /* Check each 'b' channel against either the corresponding 'a' + * channel or the opaque alpha value, as appropriate. If + * alpha_removed value is set (not 4) then also do this only if the + * 'a' alpha channel (alpha_removed) is opaque; only relevant for + * the 8-bit case. + */ + if (formatb & PNG_FORMAT_FLAG_LINEAR) /* 16-bit checks */ + { + png_const_uint_16p pua = aligncastconst(png_const_uint_16p, psa); + png_const_uint_16p pub = aligncastconst(png_const_uint_16p, psb); + + switch (bchannels) + { + case 4: + if (pua[btoa[3]] != pub[3]) break; + /* FALLTHROUGH */ + case 3: + if (pua[btoa[2]] != pub[2]) break; + /* FALLTHROUGH */ + case 2: + if (pua[btoa[1]] != pub[1]) break; + /* FALLTHROUGH */ + case 1: + if (pua[btoa[0]] != pub[0]) break; + if (alpha_added != 4 && pub[alpha_added] != 65535) break; + continue; /* x loop */ + default: + break; /* impossible */ + } + } + + else if (alpha_removed == 4 || psa[alpha_removed] == 255) + { + switch (bchannels) + { + case 4: + if (psa[btoa[3]] != psb[3]) break; + /* FALLTHROUGH */ + case 3: + if (psa[btoa[2]] != psb[2]) break; + /* FALLTHROUGH */ + case 2: + if (psa[btoa[1]] != psb[1]) break; + /* FALLTHROUGH */ + case 1: + if (psa[btoa[0]] != psb[0]) break; + if (alpha_added != 4 && psb[alpha_added] != 255) break; + continue; /* x loop */ + default: + break; /* impossible */ + } + } + } + + /* If we get to here the fast match failed; do the slow match for this + * pixel. + */ + if (!cmppixel(&tr, psa, psb, x, y) && (a->opts & KEEP_GOING) == 0) + return 0; /* error case */ + } + } + + /* If requested, copy the error values back from the Transform. */ + if (a->opts & ACCUMULATE) + { + tr.error_ptr[0] = tr.error[0]; + tr.error_ptr[1] = tr.error[1]; + tr.error_ptr[2] = tr.error[2]; + tr.error_ptr[3] = tr.error[3]; + } + + return 1; +} + +/* Read the file; how the read gets done depends on which of input_file and + * input_memory have been set. + */ +static int +read_file(Image *image, png_uint_32 format, png_const_colorp background) +{ + memset(&image->image, 0, sizeof image->image); + image->image.version = PNG_IMAGE_VERSION; + + if (image->input_memory != NULL) + { + if (!png_image_begin_read_from_memory(&image->image, image->input_memory, + image->input_memory_size)) + return logerror(image, "memory init: ", image->file_name, ""); + } + +# ifdef PNG_STDIO_SUPPORTED + else if (image->input_file != NULL) + { + if (!png_image_begin_read_from_stdio(&image->image, image->input_file)) + return logerror(image, "stdio init: ", image->file_name, ""); + } + + else + { + if (!png_image_begin_read_from_file(&image->image, image->file_name)) + return logerror(image, "file init: ", image->file_name, ""); + } +# else + else + { + return logerror(image, "unsupported file/stdio init: ", + image->file_name, ""); + } +# endif + + /* This must be set after the begin_read call: */ + if (image->opts & sRGB_16BIT) + image->image.flags |= PNG_IMAGE_FLAG_16BIT_sRGB; + + /* Have an initialized image with all the data we need plus, maybe, an + * allocated file (myfile) or buffer (mybuffer) that need to be freed. + */ + { + int result; + png_uint_32 image_format; + + /* Print both original and output formats. */ + image_format = image->image.format; + + if (image->opts & VERBOSE) + { + printf("%s %lu x %lu %s -> %s", image->file_name, + (unsigned long)image->image.width, + (unsigned long)image->image.height, + format_names[image_format & FORMAT_MASK], + (format & FORMAT_NO_CHANGE) != 0 || image->image.format == format + ? "no change" : format_names[format & FORMAT_MASK]); + + if (background != NULL) + printf(" background(%d,%d,%d)\n", background->red, + background->green, background->blue); + else + printf("\n"); + + fflush(stdout); + } + + /* 'NO_CHANGE' combined with the color-map flag forces the base format + * flags to be set on read to ensure that the original representation is + * not lost in the pass through a colormap format. + */ + if ((format & FORMAT_NO_CHANGE) != 0) + { + if ((format & PNG_FORMAT_FLAG_COLORMAP) != 0 && + (image_format & PNG_FORMAT_FLAG_COLORMAP) != 0) + format = (image_format & ~BASE_FORMATS) | (format & BASE_FORMATS); + + else + format = image_format; + } + + image->image.format = format; + + image->stride = PNG_IMAGE_ROW_STRIDE(image->image) + image->stride_extra; + allocbuffer(image); + + result = png_image_finish_read(&image->image, background, + image->buffer+16, (png_int_32)image->stride, image->colormap); + + checkbuffer(image, image->file_name); + + if (result) + return checkopaque(image); + + else + return logerror(image, image->file_name, ": image read failed", ""); + } +} + +/* Reads from a filename, which must be in image->file_name, but uses + * image->opts to choose the method. The file is always read in its native + * format (the one the simplified API suggests). + */ +static int +read_one_file(Image *image) +{ + if (!(image->opts & USE_FILE) || (image->opts & USE_STDIO)) + { + /* memory or stdio. */ + FILE *f = fopen(image->file_name, "rb"); + + if (f != NULL) + { + if (image->opts & USE_FILE) + image->input_file = f; + + else /* memory */ + { + if (fseek(f, 0, SEEK_END) == 0) + { + long int cb = ftell(f); + + if (cb > 0) + { +#ifndef __COVERITY__ + if ((unsigned long int)cb <= (size_t)~(size_t)0) +#endif + { + png_bytep b = voidcast(png_bytep, malloc((size_t)cb)); + + if (b != NULL) + { + rewind(f); + + if (fread(b, (size_t)cb, 1, f) == 1) + { + fclose(f); + image->input_memory_size = cb; + image->input_memory = b; + } + + else + { + free(b); + return logclose(image, f, image->file_name, + ": read failed: "); + } + } + + else + return logclose(image, f, image->file_name, + ": out of memory: "); + } + + else + return logclose(image, f, image->file_name, + ": file too big for this architecture: "); + /* cb is the length of the file as a (long) and + * this is greater than the maximum amount of + * memory that can be requested from malloc. + */ + } + + else if (cb == 0) + return logclose(image, f, image->file_name, + ": zero length: "); + + else + return logclose(image, f, image->file_name, + ": tell failed: "); + } + + else + return logclose(image, f, image->file_name, ": seek failed: "); + } + } + + else + return logerror(image, image->file_name, ": open failed: ", + strerror(errno)); + } + + return read_file(image, FORMAT_NO_CHANGE, NULL); +} + +#ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED +static int +write_one_file(Image *output, Image *image, int convert_to_8bit) +{ + if (image->opts & FAST_WRITE) + image->image.flags |= PNG_IMAGE_FLAG_FAST; + + if (image->opts & USE_STDIO) + { +#ifdef PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED +#ifndef __COVERITY__ + FILE *f = tmpfile(); +#else + /* Experimental. Coverity says tmpfile() is insecure because it + * generates predictable names. + * + * It is possible to satisfy Coverity by using mkstemp(); however, + * any platform supporting mkstemp() undoubtedly has a secure tmpfile() + * implementation as well, and doesn't need the fix. Note that + * the fix won't work on platforms that don't support mkstemp(). + * + * https://www.securecoding.cert.org/confluence/display/c/ + * FIO21-C.+Do+not+create+temporary+files+in+shared+directories + * says that most historic implementations of tmpfile() provide + * only a limited number of possible temporary file names + * (usually 26) before file names are recycled. That article also + * provides a secure solution that unfortunately depends upon mkstemp(). + */ + char tmpfile[] = "pngstest-XXXXXX"; + int filedes; + FILE *f; + umask(0177); + filedes = mkstemp(tmpfile); + if (filedes < 0) + f = NULL; + else + { + f = fdopen(filedes,"w+"); + /* Hide the filename immediately and ensure that the file does + * not exist after the program ends + */ + (void) unlink(tmpfile); + } +#endif + + if (f != NULL) + { + if (png_image_write_to_stdio(&image->image, f, convert_to_8bit, + image->buffer+16, (png_int_32)image->stride, image->colormap)) + { + if (fflush(f) == 0) + { + rewind(f); + initimage(output, image->opts, "tmpfile", image->stride_extra); + output->input_file = f; + if (!checkopaque(image)) + return 0; + } + + else + return logclose(image, f, "tmpfile", ": flush: "); + } + + else + { + fclose(f); + return logerror(image, "tmpfile", ": write failed", ""); + } + } + + else + return logerror(image, "tmpfile", ": open: ", strerror(errno)); +#else /* SIMPLIFIED_WRITE_STDIO */ + return logerror(image, "tmpfile", ": open: unsupported", ""); +#endif /* SIMPLIFIED_WRITE_STDIO */ + } + + else if (image->opts & USE_FILE) + { +#ifdef PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED + static int counter = 0; + char name[32]; + + sprintf(name, "%s%d.png", tmpf, ++counter); + + if (png_image_write_to_file(&image->image, name, convert_to_8bit, + image->buffer+16, (png_int_32)image->stride, image->colormap)) + { + initimage(output, image->opts, output->tmpfile_name, + image->stride_extra); + /* Afterwards, or freeimage will delete it! */ + strcpy(output->tmpfile_name, name); + + if (!checkopaque(image)) + return 0; + } + + else + return logerror(image, name, ": write failed", ""); +#else /* SIMPLIFIED_WRITE_STDIO */ + return logerror(image, "stdio", ": open: unsupported", ""); +#endif /* SIMPLIFIED_WRITE_STDIO */ + } + + else /* use memory */ + { + png_alloc_size_t size; + + if (png_image_write_get_memory_size(image->image, size, convert_to_8bit, + image->buffer+16, (png_int_32)image->stride, image->colormap)) + { + /* This is non-fatal but ignoring it was causing serious problems in + * the macro to be ignored: + */ + if (size > PNG_IMAGE_PNG_SIZE_MAX(image->image)) + return logerror(image, "memory", ": PNG_IMAGE_SIZE_MAX wrong", ""); + + initimage(output, image->opts, "memory", image->stride_extra); + output->input_memory = malloc(size); + + if (output->input_memory != NULL) + { + output->input_memory_size = size; + + if (png_image_write_to_memory(&image->image, output->input_memory, + &output->input_memory_size, convert_to_8bit, image->buffer+16, + (png_int_32)image->stride, image->colormap)) + { + /* This is also non-fatal but it safes safer to error out anyway: + */ + if (size != output->input_memory_size) + return logerror(image, "memory", ": memory size wrong", ""); + } + + else + return logerror(image, "memory", ": write failed", ""); + } + + else + return logerror(image, "memory", ": out of memory", ""); + } + + else + return logerror(image, "memory", ": get size:", ""); + } + + /* 'output' has an initialized temporary image, read this back in and compare + * this against the original: there should be no change since the original + * format was written unmodified unless 'convert_to_8bit' was specified. + * However, if the original image was color-mapped, a simple read will zap + * the linear, color and maybe alpha flags, this will cause spurious failures + * under some circumstances. + */ + if (read_file(output, image->image.format | FORMAT_NO_CHANGE, NULL)) + { + png_uint_32 original_format = image->image.format; + + if (convert_to_8bit) + original_format &= ~PNG_FORMAT_FLAG_LINEAR; + + if ((output->image.format & BASE_FORMATS) != + (original_format & BASE_FORMATS)) + return logerror(image, image->file_name, ": format changed on read: ", + output->file_name); + + return compare_two_images(image, output, 0/*via linear*/, NULL); + } + + else + return logerror(output, output->tmpfile_name, + ": read of new file failed", ""); +} +#endif + +static int +testimage(Image *image, png_uint_32 opts, format_list *pf) +{ + int result; + Image copy; + + /* Copy the original data, stealing it from 'image' */ + checkopaque(image); + copy = *image; + + copy.opts = opts; + copy.buffer = NULL; + copy.bufsize = 0; + copy.allocsize = 0; + + image->input_file = NULL; + image->input_memory = NULL; + image->input_memory_size = 0; + image->tmpfile_name[0] = 0; + + { + png_uint_32 counter; + Image output; + + newimage(&output); + + result = 1; + + /* Use the low bit of 'counter' to indicate whether or not to do alpha + * removal with a background color or by composting onto the image; this + * step gets skipped if it isn't relevant + */ + for (counter=0; counter<2*FORMAT_COUNT; ++counter) + if (format_isset(pf, counter >> 1)) + { + png_uint_32 format = counter >> 1; + + png_color background_color; + png_colorp background = NULL; + + /* If there is a format change that removes the alpha channel then + * the background is relevant. If the output is 8-bit color-mapped + * then a background color *must* be provided, otherwise there are + * two tests to do - one with a color, the other with NULL. The + * NULL test happens second. + */ + if ((counter & 1) == 0) + { + if ((format & PNG_FORMAT_FLAG_ALPHA) == 0 && + (image->image.format & PNG_FORMAT_FLAG_ALPHA) != 0) + { + /* Alpha/transparency will be removed, the background is + * relevant: make it a color the first time + */ + random_color(&background_color); + background = &background_color; + + /* BUT if the output is to a color-mapped 8-bit format then + * the background must always be a color, so increment 'counter' + * to skip the NULL test. + */ + if ((format & PNG_FORMAT_FLAG_COLORMAP) != 0 && + (format & PNG_FORMAT_FLAG_LINEAR) == 0) + ++counter; + } + + /* Otherwise an alpha channel is not being eliminated, just leave + * background NULL and skip the (counter & 1) NULL test. + */ + else + ++counter; + } + /* else just use NULL for background */ + + resetimage(©); + copy.opts = opts; /* in case read_file needs to change it */ + + result = read_file(©, format, background); + if (!result) + break; + + /* Make sure the file just read matches the original file. */ + result = compare_two_images(image, ©, 0/*via linear*/, background); + if (!result) + break; + +# ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED + /* Write the *copy* just made to a new file to make sure the write + * side works ok. Check the conversion to sRGB if the copy is + * linear. + */ + output.opts = opts; + result = write_one_file(&output, ©, 0/*convert to 8bit*/); + if (!result) + break; + + /* Validate against the original too; the background is needed here + * as well so that compare_two_images knows what color was used. + */ + result = compare_two_images(image, &output, 0, background); + if (!result) + break; + + if ((format & PNG_FORMAT_FLAG_LINEAR) != 0 && + (format & PNG_FORMAT_FLAG_COLORMAP) == 0) + { + /* 'output' is linear, convert to the corresponding sRGB format. + */ + output.opts = opts; + result = write_one_file(&output, ©, 1/*convert to 8bit*/); + if (!result) + break; + + /* This may involve a conversion via linear; in the ideal world + * this would round-trip correctly, but libpng 1.5.7 is not the + * ideal world so allow a drift (error_via_linear). + * + * 'image' has an alpha channel but 'output' does not then there + * will a strip-alpha-channel operation (because 'output' is + * linear), handle this by composing on black when doing the + * comparison. + */ + result = compare_two_images(image, &output, 1/*via_linear*/, + background); + if (!result) + break; + } +# endif /* PNG_SIMPLIFIED_WRITE_SUPPORTED */ + } + + freeimage(&output); + } + + freeimage(©); + + return result; +} + +static int +test_one_file(const char *file_name, format_list *formats, png_uint_32 opts, + int stride_extra, int log_pass) +{ + int result; + Image image; + + if (!(opts & NO_RESEED)) + reseed(); /* ensure that the random numbers don't depend on file order */ + newimage(&image); + initimage(&image, opts, file_name, stride_extra); + result = read_one_file(&image); + if (result) + result = testimage(&image, opts, formats); + freeimage(&image); + + /* Ensure that stderr is flushed into any log file */ + fflush(stderr); + + if (log_pass) + { + if (result) + printf("PASS:"); + + else + printf("FAIL:"); + +# ifndef PNG_SIMPLIFIED_WRITE_SUPPORTED + printf(" (no write)"); +# endif + + print_opts(opts); + printf(" %s\n", file_name); + /* stdout may not be line-buffered if it is piped to a file, so: */ + fflush(stdout); + } + + else if (!result) + exit(1); + + return result; +} + +int +main(int argc, char **argv) +{ + png_uint_32 opts = FAST_WRITE | STRICT; + format_list formats; + const char *touch = NULL; + int log_pass = 0; + int redundant = 0; + int stride_extra = 0; + int retval = 0; + int c; + +#if PNG_LIBPNG_VER >= 10700 + /* This error should not exist in 1.7 or later: */ + opts |= GBG_ERROR; +#endif + + init_sRGB_to_d(); +#if 0 + init_error_via_linear(); +#endif + format_init(&formats); + reseed(); /* initialize random number seeds */ + + for (c=1; c= sizeof tmpf) + { + fflush(stdout); + fprintf(stderr, "%s: %s is too long for a temp file prefix\n", + argv[0], argv[c]); + exit(99); + } + + /* Safe: checked above */ + strncpy(tmpf, argv[c], sizeof (tmpf)-1); + } + + else + { + fflush(stdout); + fprintf(stderr, "%s: %s requires a temporary file prefix\n", + argv[0], arg); + exit(99); + } + } + else if (strcmp(arg, "--touch") == 0) + { + if (c+1 < argc) + touch = argv[++c]; + + else + { + fflush(stdout); + fprintf(stderr, "%s: %s requires a file name argument\n", + argv[0], arg); + exit(99); + } + } + else if (arg[0] == '+') + { + png_uint_32 format = formatof(arg+1); + + if (format > FORMAT_COUNT) + exit(99); + + format_set(&formats, format); + } + else if (arg[0] == '-' && arg[1] != 0 && (arg[1] != '0' || arg[2] != 0)) + { + fflush(stdout); + fprintf(stderr, "%s: unknown option: %s\n", argv[0], arg); + exit(99); + } + else + { + if (format_is_initial(&formats)) + format_default(&formats, redundant); + + if (arg[0] == '-') + { + int term = (arg[1] == '0' ? 0 : '\n'); + unsigned int ich = 0; + + /* Loop reading files, use a static buffer to simplify this and just + * stop if the name gets to long. + */ + static char buffer[4096]; + + do + { + int ch = getchar(); + + /* Don't allow '\0' in file names, and terminate with '\n' or, + * for -0, just '\0' (use -print0 to find to make this work!) + */ + if (ch == EOF || ch == term || ch == 0) + { + buffer[ich] = 0; + + if (ich > 0 && !test_one_file(buffer, &formats, opts, + stride_extra, log_pass)) + retval = 1; + + if (ch == EOF) + break; + + ich = 0; + --ich; /* so that the increment below sets it to 0 again */ + } + + else + buffer[ich] = (char)ch; + } while (++ich < sizeof buffer); + + if (ich) + { + buffer[32] = 0; + buffer[4095] = 0; + fprintf(stderr, "%s...%s: file name too long\n", buffer, + buffer+(4096-32)); + exit(99); + } + } + + else if (!test_one_file(arg, &formats, opts, stride_extra, log_pass)) + retval = 1; + } + } + + if (opts & ACCUMULATE) + { + unsigned int in; + + printf("/* contrib/libtests/pngstest-errors.h\n"); + printf(" *\n"); + printf(" * BUILT USING:" PNG_HEADER_VERSION_STRING); + printf(" *\n"); + printf(" * This code is released under the libpng license.\n"); + printf(" * For conditions of distribution and use, see the disclaimer\n"); + printf(" * and license in png.h\n"); + printf(" *\n"); + printf(" * THIS IS A MACHINE GENERATED FILE: do not edit it directly!\n"); + printf(" * Instead run:\n"); + printf(" *\n"); + printf(" * pngstest --accumulate\n"); + printf(" *\n"); + printf(" * on as many PNG files as possible; at least PNGSuite and\n"); + printf(" * contrib/libtests/testpngs.\n"); + printf(" */\n"); + + printf("static png_uint_16 gpc_error[16/*in*/][16/*out*/][4/*a*/] =\n"); + printf("{\n"); + for (in=0; in<16; ++in) + { + unsigned int out; + printf(" { /* input: %s */\n ", format_names[in]); + for (out=0; out<16; ++out) + { + unsigned int alpha; + printf(" {"); + for (alpha=0; alpha<4; ++alpha) + { + printf(" %d", gpc_error[in][out][alpha]); + if (alpha < 3) putchar(','); + } + printf(" }"); + if (out < 15) + { + putchar(','); + if (out % 4 == 3) printf("\n "); + } + } + printf("\n }"); + + if (in < 15) + putchar(','); + else + putchar('\n'); + } + printf("};\n"); + + printf("static png_uint_16 gpc_error_via_linear[16][4/*out*/][4] =\n"); + printf("{\n"); + for (in=0; in<16; ++in) + { + unsigned int out; + printf(" { /* input: %s */\n ", format_names[in]); + for (out=0; out<4; ++out) + { + unsigned int alpha; + printf(" {"); + for (alpha=0; alpha<4; ++alpha) + { + printf(" %d", gpc_error_via_linear[in][out][alpha]); + if (alpha < 3) putchar(','); + } + printf(" }"); + if (out < 3) + putchar(','); + } + printf("\n }"); + + if (in < 15) + putchar(','); + else + putchar('\n'); + } + printf("};\n"); + + printf("static png_uint_16 gpc_error_to_colormap[8/*i*/][8/*o*/][4] =\n"); + printf("{\n"); + for (in=0; in<8; ++in) + { + unsigned int out; + printf(" { /* input: %s */\n ", format_names[in]); + for (out=0; out<8; ++out) + { + unsigned int alpha; + printf(" {"); + for (alpha=0; alpha<4; ++alpha) + { + printf(" %d", gpc_error_to_colormap[in][out][alpha]); + if (alpha < 3) putchar(','); + } + printf(" }"); + if (out < 7) + { + putchar(','); + if (out % 4 == 3) printf("\n "); + } + } + printf("\n }"); + + if (in < 7) + putchar(','); + else + putchar('\n'); + } + printf("};\n"); + printf("/* END MACHINE GENERATED */\n"); + } + + if (retval == 0 && touch != NULL) + { + FILE *fsuccess = fopen(touch, "wt"); + + if (fsuccess != NULL) + { + int error = 0; + fprintf(fsuccess, "PNG simple API tests succeeded\n"); + fflush(fsuccess); + error = ferror(fsuccess); + + if (fclose(fsuccess) || error) + { + fflush(stdout); + fprintf(stderr, "%s: write failed\n", touch); + exit(99); + } + } + + else + { + fflush(stdout); + fprintf(stderr, "%s: open failed\n", touch); + exit(99); + } + } + + return retval; +} + +#else /* !PNG_SIMPLIFIED_READ_SUPPORTED */ +int main(void) +{ + fprintf(stderr, "pngstest: no read support in libpng, test skipped\n"); + /* So the test is skipped: */ + return SKIP; +} +#endif /* PNG_SIMPLIFIED_READ_SUPPORTED */ diff --git a/Engine/lib/lpng/contrib/libtests/pngunknown.c b/Engine/lib/lpng/contrib/libtests/pngunknown.c new file mode 100644 index 000000000..05bdd833d --- /dev/null +++ b/Engine/lib/lpng/contrib/libtests/pngunknown.c @@ -0,0 +1,1294 @@ + +/* pngunknown.c - test the read side unknown chunk handling + * + * Last changed in libpng 1.6.32 [August 24, 2017] + * Copyright (c) 2015,2017 Glenn Randers-Pehrson + * Written by John Cunningham Bowler + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + * + * NOTES: + * This is a C program that is intended to be linked against libpng. It + * allows the libpng unknown handling code to be tested by interpreting + * arguments to save or discard combinations of chunks. The program is + * currently just a minimal validation for the built-in libpng facilities. + */ + +#include +#include +#include +#include + +/* Define the following to use this test against your installed libpng, rather + * than the one being built here: + */ +#ifdef PNG_FREESTANDING_TESTS +# include +#else +# include "../../png.h" +#endif + +/* 1.6.1 added support for the configure test harness, which uses 77 to indicate + * a skipped test, in earlier versions we need to succeed on a skipped test, so: + */ +#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H) +# define SKIP 77 +#else +# define SKIP 0 +#endif + + +/* Since this program tests the ability to change the unknown chunk handling + * these must be defined: + */ +#if defined(PNG_SET_UNKNOWN_CHUNKS_SUPPORTED) &&\ + defined(PNG_STDIO_SUPPORTED) &&\ + defined(PNG_READ_SUPPORTED) + +/* One of these must be defined to allow us to find out what happened. It is + * still useful to set unknown chunk handling without either of these in order + * to cause *known* chunks to be discarded. This can be a significant + * efficiency gain, but it can't really be tested here. + */ +#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) ||\ + defined(PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED) + +#if PNG_LIBPNG_VER < 10500 +/* This deliberately lacks the const. */ +typedef png_byte *png_const_bytep; + +/* This is copied from 1.5.1 png.h: */ +#define PNG_INTERLACE_ADAM7_PASSES 7 +#define PNG_PASS_START_ROW(pass) (((1U&~(pass))<<(3-((pass)>>1)))&7) +#define PNG_PASS_START_COL(pass) (((1U& (pass))<<(3-(((pass)+1)>>1)))&7) +#define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3) +#define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3) +#define PNG_PASS_ROWS(height, pass) (((height)+(((1<>PNG_PASS_ROW_SHIFT(pass)) +#define PNG_PASS_COLS(width, pass) (((width)+(((1<>PNG_PASS_COL_SHIFT(pass)) +#define PNG_ROW_FROM_PASS_ROW(yIn, pass) \ + (((yIn)<>(((7-(off))-(pass))<<2)) & 0xFU) | \ + ((0x01145AF0U>>(((7-(off))-(pass))<<2)) & 0xF0U)) +#define PNG_ROW_IN_INTERLACE_PASS(y, pass) \ + ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1) +#define PNG_COL_IN_INTERLACE_PASS(x, pass) \ + ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1) + +/* These are needed too for the default build: */ +#define PNG_WRITE_16BIT_SUPPORTED +#define PNG_READ_16BIT_SUPPORTED + +/* This comes from pnglibconf.h after 1.5: */ +#define PNG_FP_1 100000 +#define PNG_GAMMA_THRESHOLD_FIXED\ + ((png_fixed_point)(PNG_GAMMA_THRESHOLD * PNG_FP_1)) +#endif + +#if PNG_LIBPNG_VER < 10600 + /* 1.6.0 constifies many APIs. The following exists to allow pngvalid to be + * compiled against earlier versions. + */ +# define png_const_structp png_structp +#endif + +#if PNG_LIBPNG_VER < 10700 + /* Copied from libpng 1.7.0 png.h */ +#define PNG_u2(b1, b2) (((unsigned int)(b1) << 8) + (b2)) + +#define PNG_U16(b1, b2) ((png_uint_16)PNG_u2(b1, b2)) +#define PNG_U32(b1, b2, b3, b4)\ + (((png_uint_32)PNG_u2(b1, b2) << 16) + PNG_u2(b3, b4)) + +/* Constants for known chunk types. + */ +#define png_IDAT PNG_U32( 73, 68, 65, 84) +#define png_IEND PNG_U32( 73, 69, 78, 68) +#define png_IHDR PNG_U32( 73, 72, 68, 82) +#define png_PLTE PNG_U32( 80, 76, 84, 69) +#define png_bKGD PNG_U32( 98, 75, 71, 68) +#define png_cHRM PNG_U32( 99, 72, 82, 77) +#define png_eXIf PNG_U32(101, 88, 73, 102) /* registered July 2017 */ +#define png_fRAc PNG_U32(102, 82, 65, 99) /* registered, not defined */ +#define png_gAMA PNG_U32(103, 65, 77, 65) +#define png_gIFg PNG_U32(103, 73, 70, 103) +#define png_gIFt PNG_U32(103, 73, 70, 116) /* deprecated */ +#define png_gIFx PNG_U32(103, 73, 70, 120) +#define png_hIST PNG_U32(104, 73, 83, 84) +#define png_iCCP PNG_U32(105, 67, 67, 80) +#define png_iTXt PNG_U32(105, 84, 88, 116) +#define png_oFFs PNG_U32(111, 70, 70, 115) +#define png_pCAL PNG_U32(112, 67, 65, 76) +#define png_pHYs PNG_U32(112, 72, 89, 115) +#define png_sBIT PNG_U32(115, 66, 73, 84) +#define png_sCAL PNG_U32(115, 67, 65, 76) +#define png_sPLT PNG_U32(115, 80, 76, 84) +#define png_sRGB PNG_U32(115, 82, 71, 66) +#define png_sTER PNG_U32(115, 84, 69, 82) +#define png_tEXt PNG_U32(116, 69, 88, 116) +#define png_tIME PNG_U32(116, 73, 77, 69) +#define png_tRNS PNG_U32(116, 82, 78, 83) +#define png_zTXt PNG_U32(122, 84, 88, 116) + +/* Test on flag values as defined in the spec (section 5.4): */ +#define PNG_CHUNK_ANCILLARY(c) (1 & ((c) >> 29)) +#define PNG_CHUNK_CRITICAL(c) (!PNG_CHUNK_ANCILLARY(c)) +#define PNG_CHUNK_PRIVATE(c) (1 & ((c) >> 21)) +#define PNG_CHUNK_RESERVED(c) (1 & ((c) >> 13)) +#define PNG_CHUNK_SAFE_TO_COPY(c) (1 & ((c) >> 5)) + +#endif /* PNG_LIBPNG_VER < 10700 */ + +#ifdef __cplusplus +# define this not_the_cpp_this +# define new not_the_cpp_new +# define voidcast(type, value) static_cast(value) +#else +# define voidcast(type, value) (value) +#endif /* __cplusplus */ + +/* Unused formal parameter errors are removed using the following macro which is + * expected to have no bad effects on performance. + */ +#ifndef UNUSED +# if defined(__GNUC__) || defined(_MSC_VER) +# define UNUSED(param) (void)param; +# else +# define UNUSED(param) +# endif +#endif + +/* Types of chunks not known to libpng */ +#define png_vpAg PNG_U32(118, 112, 65, 103) + +/* Chunk information */ +#define PNG_INFO_tEXt 0x10000000U +#define PNG_INFO_iTXt 0x20000000U +#define PNG_INFO_zTXt 0x40000000U + +#define PNG_INFO_sTER 0x01000000U +#define PNG_INFO_vpAg 0x02000000U + +#define ABSENT 0 +#define START 1 +#define END 2 + +static struct +{ + char name[5]; + png_uint_32 flag; + png_uint_32 tag; + int unknown; /* Chunk not known to libpng */ + int all; /* Chunk set by the '-1' option */ + int position; /* position in pngtest.png */ + int keep; /* unknown handling setting */ +} chunk_info[] = { + /* Critical chunks */ + { "IDAT", PNG_INFO_IDAT, png_IDAT, 0, 0, START, 0 }, /* must be [0] */ + { "PLTE", PNG_INFO_PLTE, png_PLTE, 0, 0, ABSENT, 0 }, + + /* Non-critical chunks that libpng handles */ + /* This is a mess but it seems to be the only way to do it - there is no way + * to check for a definition outside a #if. + */ + { "bKGD", PNG_INFO_bKGD, png_bKGD, +# ifdef PNG_READ_bKGD_SUPPORTED + 0, +# else + 1, +# endif + 1, START, 0 }, + { "cHRM", PNG_INFO_cHRM, png_cHRM, +# ifdef PNG_READ_cHRM_SUPPORTED + 0, +# else + 1, +# endif + 1, START, 0 }, + { "eXIf", PNG_INFO_eXIf, png_eXIf, +# ifdef PNG_READ_eXIf_SUPPORTED + 0, +# else + 1, +# endif + 1, END, 0 }, + { "gAMA", PNG_INFO_gAMA, png_gAMA, +# ifdef PNG_READ_gAMA_SUPPORTED + 0, +# else + 1, +# endif + 1, START, 0 }, + { "hIST", PNG_INFO_hIST, png_hIST, +# ifdef PNG_READ_hIST_SUPPORTED + 0, +# else + 1, +# endif + 1, ABSENT, 0 }, + { "iCCP", PNG_INFO_iCCP, png_iCCP, +# ifdef PNG_READ_iCCP_SUPPORTED + 0, +# else + 1, +# endif + 1, ABSENT, 0 }, + { "iTXt", PNG_INFO_iTXt, png_iTXt, +# ifdef PNG_READ_iTXt_SUPPORTED + 0, +# else + 1, +# endif + 1, ABSENT, 0 }, + { "oFFs", PNG_INFO_oFFs, png_oFFs, +# ifdef PNG_READ_oFFs_SUPPORTED + 0, +# else + 1, +# endif + 1, START, 0 }, + { "pCAL", PNG_INFO_pCAL, png_pCAL, +# ifdef PNG_READ_pCAL_SUPPORTED + 0, +# else + 1, +# endif + 1, START, 0 }, + { "pHYs", PNG_INFO_pHYs, png_pHYs, +# ifdef PNG_READ_pHYs_SUPPORTED + 0, +# else + 1, +# endif + 1, START, 0 }, + { "sBIT", PNG_INFO_sBIT, png_sBIT, +# ifdef PNG_READ_sBIT_SUPPORTED + 0, +# else + 1, +# endif + 1, START, 0 }, + { "sCAL", PNG_INFO_sCAL, png_sCAL, +# ifdef PNG_READ_sCAL_SUPPORTED + 0, +# else + 1, +# endif + 1, START, 0 }, + { "sPLT", PNG_INFO_sPLT, png_sPLT, +# ifdef PNG_READ_sPLT_SUPPORTED + 0, +# else + 1, +# endif + 1, ABSENT, 0 }, + { "sRGB", PNG_INFO_sRGB, png_sRGB, +# ifdef PNG_READ_sRGB_SUPPORTED + 0, +# else + 1, +# endif + 1, START, 0 }, + { "tEXt", PNG_INFO_tEXt, png_tEXt, +# ifdef PNG_READ_tEXt_SUPPORTED + 0, +# else + 1, +# endif + 1, START, 0 }, + { "tIME", PNG_INFO_tIME, png_tIME, +# ifdef PNG_READ_tIME_SUPPORTED + 0, +# else + 1, +# endif + 1, START, 0 }, + { "tRNS", PNG_INFO_tRNS, png_tRNS, +# ifdef PNG_READ_tRNS_SUPPORTED + 0, +# else + 1, +# endif + 0, ABSENT, 0 }, + { "zTXt", PNG_INFO_zTXt, png_zTXt, +# ifdef PNG_READ_zTXt_SUPPORTED + 0, +# else + 1, +# endif + 1, END, 0 }, + + /* No libpng handling */ + { "sTER", PNG_INFO_sTER, png_sTER, 1, 1, START, 0 }, + { "vpAg", PNG_INFO_vpAg, png_vpAg, 1, 0, START, 0 }, +}; + +#define NINFO ((int)((sizeof chunk_info)/(sizeof chunk_info[0]))) + +static void +clear_keep(void) +{ + int i = NINFO; + while (--i >= 0) + chunk_info[i].keep = 0; +} + +static int +find(const char *name) +{ + int i = NINFO; + while (--i >= 0) + { + if (memcmp(chunk_info[i].name, name, 4) == 0) + break; + } + + return i; +} + +static int +findb(const png_byte *name) +{ + int i = NINFO; + while (--i >= 0) + { + if (memcmp(chunk_info[i].name, name, 4) == 0) + break; + } + + return i; +} + +static int +find_by_flag(png_uint_32 flag) +{ + int i = NINFO; + + while (--i >= 0) if (chunk_info[i].flag == flag) return i; + + fprintf(stderr, "pngunknown: internal error\n"); + exit(4); +} + +static int +ancillary(const char *name) +{ + return PNG_CHUNK_ANCILLARY(PNG_U32(name[0], name[1], name[2], name[3])); +} + +#ifdef PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED +static int +ancillaryb(const png_byte *name) +{ + return PNG_CHUNK_ANCILLARY(PNG_U32(name[0], name[1], name[2], name[3])); +} +#endif + +/* Type of an error_ptr */ +typedef struct +{ + jmp_buf error_return; + png_structp png_ptr; + png_infop info_ptr, end_ptr; + png_uint_32 before_IDAT; + png_uint_32 after_IDAT; + int error_count; + int warning_count; + int keep; /* the default value */ + const char *program; + const char *file; + const char *test; +} display; + +static const char init[] = "initialization"; +static const char cmd[] = "command line"; + +static void +init_display(display *d, const char *program) +{ + memset(d, 0, sizeof *d); + d->png_ptr = NULL; + d->info_ptr = d->end_ptr = NULL; + d->error_count = d->warning_count = 0; + d->program = program; + d->file = program; + d->test = init; +} + +static void +clean_display(display *d) +{ + png_destroy_read_struct(&d->png_ptr, &d->info_ptr, &d->end_ptr); + + /* This must not happen - it might cause an app crash */ + if (d->png_ptr != NULL || d->info_ptr != NULL || d->end_ptr != NULL) + { + fprintf(stderr, "%s(%s): png_destroy_read_struct error\n", d->file, + d->test); + exit(1); + } +} + +PNG_FUNCTION(void, display_exit, (display *d), static PNG_NORETURN) +{ + ++(d->error_count); + + if (d->png_ptr != NULL) + clean_display(d); + + /* During initialization and if this is a single command line argument set + * exit now - there is only one test, otherwise longjmp to do the next test. + */ + if (d->test == init || d->test == cmd) + exit(1); + + longjmp(d->error_return, 1); +} + +static int +display_rc(const display *d, int strict) +{ + return d->error_count + (strict ? d->warning_count : 0); +} + +/* libpng error and warning callbacks */ +PNG_FUNCTION(void, (PNGCBAPI error), (png_structp png_ptr, const char *message), + static PNG_NORETURN) +{ + display *d = (display*)png_get_error_ptr(png_ptr); + + fprintf(stderr, "%s(%s): libpng error: %s\n", d->file, d->test, message); + display_exit(d); +} + +static void PNGCBAPI +warning(png_structp png_ptr, const char *message) +{ + display *d = (display*)png_get_error_ptr(png_ptr); + + fprintf(stderr, "%s(%s): libpng warning: %s\n", d->file, d->test, message); + ++(d->warning_count); +} + +static png_uint_32 +get_valid(display *d, png_infop info_ptr) +{ + png_uint_32 flags = png_get_valid(d->png_ptr, info_ptr, (png_uint_32)~0); + + /* Map the text chunks back into the flags */ + { + png_textp text; + png_uint_32 ntext = png_get_text(d->png_ptr, info_ptr, &text, NULL); + + while (ntext > 0) switch (text[--ntext].compression) + { + case -1: + flags |= PNG_INFO_tEXt; + break; + case 0: + flags |= PNG_INFO_zTXt; + break; + case 1: + case 2: + flags |= PNG_INFO_iTXt; + break; + default: + fprintf(stderr, "%s(%s): unknown text compression %d\n", d->file, + d->test, text[ntext].compression); + display_exit(d); + } + } + + return flags; +} + +#ifdef PNG_READ_USER_CHUNKS_SUPPORTED +static int PNGCBAPI +read_callback(png_structp pp, png_unknown_chunkp pc) +{ + /* This function mimics the behavior of png_set_keep_unknown_chunks by + * returning '0' to keep the chunk and '1' to discard it. + */ + display *d = voidcast(display*, png_get_user_chunk_ptr(pp)); + int chunk = findb(pc->name); + int keep, discard; + + if (chunk < 0) /* not one in our list, so not a known chunk */ + keep = d->keep; + + else + { + keep = chunk_info[chunk].keep; + if (keep == PNG_HANDLE_CHUNK_AS_DEFAULT) + { + /* See the comments in png.h - use the default for unknown chunks, + * do not keep known chunks. + */ + if (chunk_info[chunk].unknown) + keep = d->keep; + + else + keep = PNG_HANDLE_CHUNK_NEVER; + } + } + + switch (keep) + { + default: + fprintf(stderr, "%s(%s): %d: unrecognized chunk option\n", d->file, + d->test, chunk_info[chunk].keep); + display_exit(d); + + case PNG_HANDLE_CHUNK_AS_DEFAULT: + case PNG_HANDLE_CHUNK_NEVER: + discard = 1/*handled; discard*/; + break; + + case PNG_HANDLE_CHUNK_IF_SAFE: + case PNG_HANDLE_CHUNK_ALWAYS: + discard = 0/*not handled; keep*/; + break; + } + + /* Also store information about this chunk in the display, the relevant flag + * is set if the chunk is to be kept ('not handled'.) + */ + if (chunk >= 0) if (!discard) /* stupidity to stop a GCC warning */ + { + png_uint_32 flag = chunk_info[chunk].flag; + + if (pc->location & PNG_AFTER_IDAT) + d->after_IDAT |= flag; + + else + d->before_IDAT |= flag; + } + + /* However if there is no support to store unknown chunks don't ask libpng to + * do it; there will be an png_error. + */ +# ifdef PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED + return discard; +# else + return 1; /*handled; discard*/ +# endif +} +#endif /* READ_USER_CHUNKS_SUPPORTED */ + +#ifdef PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED +static png_uint_32 +get_unknown(display *d, png_infop info_ptr, int after_IDAT) +{ + /* Create corresponding 'unknown' flags */ + png_uint_32 flags = 0; + + UNUSED(after_IDAT) + + { + png_unknown_chunkp unknown; + int num_unknown = png_get_unknown_chunks(d->png_ptr, info_ptr, &unknown); + + while (--num_unknown >= 0) + { + int chunk = findb(unknown[num_unknown].name); + + /* Chunks not known to pngunknown must be validated here; since they + * must also be unknown to libpng the 'display->keep' behavior should + * have been used. + */ + if (chunk < 0) switch (d->keep) + { + default: /* impossible */ + case PNG_HANDLE_CHUNK_AS_DEFAULT: + case PNG_HANDLE_CHUNK_NEVER: + fprintf(stderr, "%s(%s): %s: %s: unknown chunk saved\n", + d->file, d->test, d->keep ? "discard" : "default", + unknown[num_unknown].name); + ++(d->error_count); + break; + + case PNG_HANDLE_CHUNK_IF_SAFE: + if (!ancillaryb(unknown[num_unknown].name)) + { + fprintf(stderr, + "%s(%s): if-safe: %s: unknown critical chunk saved\n", + d->file, d->test, unknown[num_unknown].name); + ++(d->error_count); + break; + } + /* FALLTHROUGH */ /* (safe) */ + case PNG_HANDLE_CHUNK_ALWAYS: + break; + } + + else + flags |= chunk_info[chunk].flag; + } + } + + return flags; +} +#else /* SAVE_UNKNOWN_CHUNKS */ +static png_uint_32 +get_unknown(display *d, png_infop info_ptr, int after_IDAT) + /* Otherwise this will return the cached values set by any user callback */ +{ + UNUSED(info_ptr); + + if (after_IDAT) + return d->after_IDAT; + + else + return d->before_IDAT; +} + +# ifndef PNG_READ_USER_CHUNKS_SUPPORTED + /* The #defines above should mean this is never reached, it's just here as + * a check to ensure the logic is correct. + */ +# error No store support and no user chunk support, this will not work +# endif /* READ_USER_CHUNKS */ +#endif /* SAVE_UNKNOWN_CHUNKS */ + +static int +check(FILE *fp, int argc, const char **argv, png_uint_32p flags/*out*/, + display *d, int set_callback) +{ + int i, npasses, ipass; + png_uint_32 height; + + d->keep = PNG_HANDLE_CHUNK_AS_DEFAULT; + d->before_IDAT = 0; + d->after_IDAT = 0; + + /* Some of these errors are permanently fatal and cause an exit here, others + * are per-test and cause an error return. + */ + d->png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, d, error, + warning); + if (d->png_ptr == NULL) + { + fprintf(stderr, "%s(%s): could not allocate png struct\n", d->file, + d->test); + /* Terminate here, this error is not test specific. */ + exit(1); + } + + d->info_ptr = png_create_info_struct(d->png_ptr); + d->end_ptr = png_create_info_struct(d->png_ptr); + if (d->info_ptr == NULL || d->end_ptr == NULL) + { + fprintf(stderr, "%s(%s): could not allocate png info\n", d->file, + d->test); + clean_display(d); + exit(1); + } + + png_init_io(d->png_ptr, fp); + +# ifdef PNG_READ_USER_CHUNKS_SUPPORTED + /* This is only done if requested by the caller; it interferes with the + * standard store/save mechanism. + */ + if (set_callback) + png_set_read_user_chunk_fn(d->png_ptr, d, read_callback); +# else + UNUSED(set_callback) +# endif + + /* Handle each argument in turn; multiple settings are possible for the same + * chunk and multiple calls will occur (the last one should override all + * preceding ones). + */ + for (i=0; i= 10700 &&\ + !defined(PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED) + if (option < PNG_HANDLE_CHUNK_IF_SAFE) +# endif /* 1.7+ SAVE_UNKNOWN_CHUNKS */ + { + png_byte name[5]; + + memcpy(name, chunk_info[chunk].name, 5); + png_set_keep_unknown_chunks(d->png_ptr, option, name, 1); + chunk_info[chunk].keep = option; + } + continue; + } + + break; + + case 7: /* default */ + if (memcmp(argv[i], "default", 7) == 0) + { +# if PNG_LIBPNG_VER >= 10700 &&\ + !defined(PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED) + if (option < PNG_HANDLE_CHUNK_IF_SAFE) +# endif /* 1.7+ SAVE_UNKNOWN_CHUNKS */ + png_set_keep_unknown_chunks(d->png_ptr, option, NULL, 0); + + d->keep = option; + continue; + } + + break; + + case 3: /* all */ + if (memcmp(argv[i], "all", 3) == 0) + { +# if PNG_LIBPNG_VER >= 10700 &&\ + !defined(PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED) + if (option < PNG_HANDLE_CHUNK_IF_SAFE) +# endif /* 1.7+ SAVE_UNKNOWN_CHUNKS */ + png_set_keep_unknown_chunks(d->png_ptr, option, NULL, -1); + + d->keep = option; + + for (chunk = 0; chunk < NINFO; ++chunk) + if (chunk_info[chunk].all) + chunk_info[chunk].keep = option; + continue; + } + + break; + + default: /* some misplaced = */ + + break; + } + } + + fprintf(stderr, "%s(%s): %s: unrecognized chunk argument\n", d->file, + d->test, argv[i]); + display_exit(d); + } + + png_read_info(d->png_ptr, d->info_ptr); + + switch (png_get_interlace_type(d->png_ptr, d->info_ptr)) + { + case PNG_INTERLACE_NONE: + npasses = 1; + break; + + case PNG_INTERLACE_ADAM7: + npasses = PNG_INTERLACE_ADAM7_PASSES; + break; + + default: + /* Hard error because it is not test specific */ + fprintf(stderr, "%s(%s): invalid interlace type\n", d->file, d->test); + clean_display(d); + exit(1); + } + + /* Skip the image data, if IDAT is not being handled then don't do this + * because it will cause a CRC error. + */ + if (chunk_info[0/*IDAT*/].keep == PNG_HANDLE_CHUNK_AS_DEFAULT) + { + png_start_read_image(d->png_ptr); + height = png_get_image_height(d->png_ptr, d->info_ptr); + + if (npasses > 1) + { + png_uint_32 width = png_get_image_width(d->png_ptr, d->info_ptr); + + for (ipass=0; ipass 0) + { + png_uint_32 y; + + for (y=0; ypng_ptr, NULL, NULL); + } + } + } /* interlaced */ + + else /* not interlaced */ + { + png_uint_32 y; + + for (y=0; ypng_ptr, NULL, NULL); + } + } + + png_read_end(d->png_ptr, d->end_ptr); + + flags[0] = get_valid(d, d->info_ptr); + flags[1] = get_unknown(d, d->info_ptr, 0/*before IDAT*/); + + /* Only png_read_png sets PNG_INFO_IDAT! */ + flags[chunk_info[0/*IDAT*/].keep != PNG_HANDLE_CHUNK_AS_DEFAULT] |= + PNG_INFO_IDAT; + + flags[2] = get_valid(d, d->end_ptr); + flags[3] = get_unknown(d, d->end_ptr, 1/*after IDAT*/); + + clean_display(d); + + return d->keep; +} + +static void +check_error(display *d, png_uint_32 flags, const char *message) +{ + while (flags) + { + png_uint_32 flag = flags & -(png_int_32)flags; + int i = find_by_flag(flag); + + fprintf(stderr, "%s(%s): chunk %s: %s\n", d->file, d->test, + chunk_info[i].name, message); + ++(d->error_count); + + flags &= ~flag; + } +} + +static void +check_handling(display *d, int def, png_uint_32 chunks, png_uint_32 known, + png_uint_32 unknown, const char *position, int set_callback) +{ + while (chunks) + { + png_uint_32 flag = chunks & -(png_int_32)chunks; + int i = find_by_flag(flag); + int keep = chunk_info[i].keep; + const char *type; + const char *errorx = NULL; + + if (chunk_info[i].unknown) + { + if (keep == PNG_HANDLE_CHUNK_AS_DEFAULT) + { + type = "UNKNOWN (default)"; + keep = def; + } + + else + type = "UNKNOWN (specified)"; + + if (flag & known) + errorx = "chunk processed"; + + else switch (keep) + { + case PNG_HANDLE_CHUNK_AS_DEFAULT: + if (flag & unknown) + errorx = "DEFAULT: unknown chunk saved"; + break; + + case PNG_HANDLE_CHUNK_NEVER: + if (flag & unknown) + errorx = "DISCARD: unknown chunk saved"; + break; + + case PNG_HANDLE_CHUNK_IF_SAFE: + if (ancillary(chunk_info[i].name)) + { + if (!(flag & unknown)) + errorx = "IF-SAFE: unknown ancillary chunk lost"; + } + + else if (flag & unknown) + errorx = "IF-SAFE: unknown critical chunk saved"; + break; + + case PNG_HANDLE_CHUNK_ALWAYS: + if (!(flag & unknown)) + errorx = "SAVE: unknown chunk lost"; + break; + + default: + errorx = "internal error: bad keep"; + break; + } + } /* unknown chunk */ + + else /* known chunk */ + { + type = "KNOWN"; + + if (flag & known) + { + /* chunk was processed, it won't have been saved because that is + * caught below when checking for inconsistent processing. + */ + if (keep != PNG_HANDLE_CHUNK_AS_DEFAULT) + errorx = "!DEFAULT: known chunk processed"; + } + + else /* not processed */ switch (keep) + { + case PNG_HANDLE_CHUNK_AS_DEFAULT: + errorx = "DEFAULT: known chunk not processed"; + break; + + case PNG_HANDLE_CHUNK_NEVER: + if (flag & unknown) + errorx = "DISCARD: known chunk saved"; + break; + + case PNG_HANDLE_CHUNK_IF_SAFE: + if (ancillary(chunk_info[i].name)) + { + if (!(flag & unknown)) + errorx = "IF-SAFE: known ancillary chunk lost"; + } + + else if (flag & unknown) + errorx = "IF-SAFE: known critical chunk saved"; + break; + + case PNG_HANDLE_CHUNK_ALWAYS: + if (!(flag & unknown)) + errorx = "SAVE: known chunk lost"; + break; + + default: + errorx = "internal error: bad keep (2)"; + break; + } + } + + if (errorx != NULL) + { + ++(d->error_count); + fprintf(stderr, "%s(%s%s): %s %s %s: %s\n", d->file, d->test, + set_callback ? ",callback" : "", + type, chunk_info[i].name, position, errorx); + } + + chunks &= ~flag; + } +} + +static void +perform_one_test(FILE *fp, int argc, const char **argv, + png_uint_32 *default_flags, display *d, int set_callback) +{ + int def; + png_uint_32 flags[2][4]; + + rewind(fp); + clear_keep(); + memcpy(flags[0], default_flags, sizeof flags[0]); + + def = check(fp, argc, argv, flags[1], d, set_callback); + + /* If IDAT is being handled as unknown the image read is skipped and all the + * IDATs after the first end up in the end info struct, so in this case add + * IDAT to the list of unknowns. (Do this after 'check' above sets the + * chunk_info 'keep' fields.) + * + * Note that the flag setting has to be in the 'known' field to avoid + * triggering the consistency check below and the flag must only be set if + * there are multiple IDATs, so if the check above did find an unknown IDAT + * after IDAT. + */ + if (chunk_info[0/*IDAT*/].keep != PNG_HANDLE_CHUNK_AS_DEFAULT && + (flags[1][3] & PNG_INFO_IDAT) != 0) + flags[0][2] |= PNG_INFO_IDAT; + + /* Chunks should either be known or unknown, never both and this should apply + * whether the chunk is before or after the IDAT (actually, the app can + * probably change this by swapping the handling after the image, but this + * test does not do that.) + */ + check_error(d, (flags[0][0]|flags[0][2]) & (flags[0][1]|flags[0][3]), + "chunk handled inconsistently in count tests"); + check_error(d, (flags[1][0]|flags[1][2]) & (flags[1][1]|flags[1][3]), + "chunk handled inconsistently in option tests"); + + /* Now find out what happened to each chunk before and after the IDAT and + * determine if the behavior was correct. First some basic sanity checks, + * any known chunk should be known in the original count, any unknown chunk + * should be either known or unknown in the original. + */ + { + png_uint_32 test; + + test = flags[1][0] & ~flags[0][0]; + check_error(d, test, "new known chunk before IDAT"); + test = flags[1][1] & ~(flags[0][0] | flags[0][1]); + check_error(d, test, "new unknown chunk before IDAT"); + test = flags[1][2] & ~flags[0][2]; + check_error(d, test, "new known chunk after IDAT"); + test = flags[1][3] & ~(flags[0][2] | flags[0][3]); + check_error(d, test, "new unknown chunk after IDAT"); + } + + /* Now each chunk in the original list should have been handled according to + * the options set for that chunk, regardless of whether libpng knows about + * it or not. + */ + check_handling(d, def, flags[0][0] | flags[0][1], flags[1][0], flags[1][1], + "before IDAT", set_callback); + check_handling(d, def, flags[0][2] | flags[0][3], flags[1][2], flags[1][3], + "after IDAT", set_callback); +} + +static void +perform_one_test_safe(FILE *fp, int argc, const char **argv, + png_uint_32 *default_flags, display *d, const char *test) +{ + if (setjmp(d->error_return) == 0) + { + d->test = test; /* allow use of d->error_return */ +# ifdef PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED + perform_one_test(fp, argc, argv, default_flags, d, 0); +# endif +# ifdef PNG_READ_USER_CHUNKS_SUPPORTED + perform_one_test(fp, argc, argv, default_flags, d, 1); +# endif + d->test = init; /* prevent use of d->error_return */ + } +} + +static const char *standard_tests[] = +{ + "discard", "default=discard", 0, + "save", "default=save", 0, + "if-safe", "default=if-safe", 0, + "vpAg", "vpAg=if-safe", 0, + "sTER", "sTER=if-safe", 0, + "IDAT", "default=discard", "IDAT=save", 0, + "sAPI", "bKGD=save", "cHRM=save", "gAMA=save", "all=discard", "iCCP=save", + "sBIT=save", "sRGB=save", "eXIf=save", 0, + 0/*end*/ +}; + +static PNG_NORETURN void +usage(const char *program, const char *reason) +{ + fprintf(stderr, "pngunknown: %s: usage:\n %s [--strict] " + "--default|{(CHNK|default|all)=(default|discard|if-safe|save)} " + "testfile.png\n", reason, program); + exit(99); +} + +int +main(int argc, const char **argv) +{ + FILE *fp; + png_uint_32 default_flags[4/*valid,unknown{before,after}*/]; + int strict = 0, default_tests = 0; + const char *count_argv = "default=save"; + const char *touch_file = NULL; + display d; + + init_display(&d, argv[0]); + + while (++argv, --argc > 0) + { + if (strcmp(*argv, "--strict") == 0) + strict = 1; + + else if (strcmp(*argv, "--default") == 0) + default_tests = 1; + + else if (strcmp(*argv, "--touch") == 0) + { + if (argc > 1) + touch_file = *++argv, --argc; + + else + usage(d.program, "--touch: missing file name"); + } + + else + break; + } + + /* A file name is required, but there should be no other arguments if + * --default was specified. + */ + if (argc <= 0) + usage(d.program, "missing test file"); + + /* GCC BUG: if (default_tests && argc != 1) triggers some weird GCC argc + * optimization which causes warnings with -Wstrict-overflow! + */ + else if (default_tests) if (argc != 1) + usage(d.program, "extra arguments"); + + /* The name of the test file is the last argument; remove it. */ + d.file = argv[--argc]; + + fp = fopen(d.file, "rb"); + if (fp == NULL) + { + perror(d.file); + exit(99); + } + + /* First find all the chunks, known and unknown, in the test file, a failure + * here aborts the whole test. + * + * If 'save' is supported then the normal saving method should happen, + * otherwise if 'read' is supported then the read callback will do the + * same thing. If both are supported the 'read' callback won't be + * instantiated by default. If 'save' is *not* supported then a user + * callback is required even though we can call png_get_unknown_chunks. + */ + if (check(fp, 1, &count_argv, default_flags, &d, +# ifdef PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED + 0 +# else + 1 +# endif + ) != PNG_HANDLE_CHUNK_ALWAYS) + { + fprintf(stderr, "%s: %s: internal error\n", d.program, d.file); + exit(99); + } + + /* Now find what the various supplied options cause to change: */ + if (!default_tests) + { + d.test = cmd; /* acts as a flag to say exit, do not longjmp */ +# ifdef PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED + perform_one_test(fp, argc, argv, default_flags, &d, 0); +# endif +# ifdef PNG_READ_USER_CHUNKS_SUPPORTED + perform_one_test(fp, argc, argv, default_flags, &d, 1); +# endif + d.test = init; + } + + else + { + const char **test = standard_tests; + + /* Set the exit_test pointer here so we can continue after a libpng error. + * NOTE: this leaks memory because the png_struct data from the failing + * test is never freed. + */ + while (*test) + { + const char *this_test = *test++; + const char **next = test; + int count = display_rc(&d, strict), new_count; + const char *result; + int arg_count = 0; + + while (*next) ++next, ++arg_count; + + perform_one_test_safe(fp, arg_count, test, default_flags, &d, + this_test); + + new_count = display_rc(&d, strict); + + if (new_count == count) + result = "PASS"; + + else + result = "FAIL"; + + printf("%s: %s %s\n", result, d.program, this_test); + + test = next+1; + } + } + + fclose(fp); + + if (display_rc(&d, strict) == 0) + { + /* Success, touch the success file if appropriate */ + if (touch_file != NULL) + { + FILE *fsuccess = fopen(touch_file, "wt"); + + if (fsuccess != NULL) + { + int err = 0; + fprintf(fsuccess, "PNG unknown tests succeeded\n"); + fflush(fsuccess); + err = ferror(fsuccess); + + if (fclose(fsuccess) || err) + { + fprintf(stderr, "%s: write failed\n", touch_file); + exit(99); + } + } + + else + { + fprintf(stderr, "%s: open failed\n", touch_file); + exit(99); + } + } + + return 0; + } + + return 1; +} + +#else /* !(READ_USER_CHUNKS || SAVE_UNKNOWN_CHUNKS) */ +int +main(void) +{ + fprintf(stderr, + " test ignored: no support to find out about unknown chunks\n"); + /* So the test is skipped: */ + return SKIP; +} +#endif /* READ_USER_CHUNKS || SAVE_UNKNOWN_CHUNKS */ + +#else /* !(SET_UNKNOWN_CHUNKS && READ) */ +int +main(void) +{ + fprintf(stderr, + " test ignored: no support to modify unknown chunk handling\n"); + /* So the test is skipped: */ + return SKIP; +} +#endif /* SET_UNKNOWN_CHUNKS && READ*/ diff --git a/Engine/lib/lpng/contrib/libtests/pngvalid.c b/Engine/lib/lpng/contrib/libtests/pngvalid.c new file mode 100644 index 000000000..d800110c7 --- /dev/null +++ b/Engine/lib/lpng/contrib/libtests/pngvalid.c @@ -0,0 +1,12230 @@ + +/* pngvalid.c - validate libpng by constructing then reading png files. + * + * Last changed in libpng 1.6.31 [July 27, 2017] + * Copyright (c) 2014-2017 John Cunningham Bowler + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + * + * NOTES: + * This is a C program that is intended to be linked against libpng. It + * generates bitmaps internally, stores them as PNG files (using the + * sequential write code) then reads them back (using the sequential + * read code) and validates that the result has the correct data. + * + * The program can be modified and extended to test the correctness of + * transformations performed by libpng. + */ + +#define _POSIX_SOURCE 1 +#define _ISOC99_SOURCE 1 /* For floating point */ +#define _GNU_SOURCE 1 /* For the floating point exception extension */ +#define _BSD_SOURCE 1 /* For the floating point exception extension */ + +#include +#include + +#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H) +# include +#endif + +#ifdef HAVE_FEENABLEEXCEPT /* from config.h, if included */ +# include +#endif + +#ifndef FE_DIVBYZERO +# define FE_DIVBYZERO 0 +#endif +#ifndef FE_INVALID +# define FE_INVALID 0 +#endif +#ifndef FE_OVERFLOW +# define FE_OVERFLOW 0 +#endif + +/* Define the following to use this test against your installed libpng, rather + * than the one being built here: + */ +#ifdef PNG_FREESTANDING_TESTS +# include +#else +# include "../../png.h" +#endif + +#ifdef PNG_ZLIB_HEADER +# include PNG_ZLIB_HEADER +#else +# include /* For crc32 */ +#endif + +/* 1.6.1 added support for the configure test harness, which uses 77 to indicate + * a skipped test, in earlier versions we need to succeed on a skipped test, so: + */ +#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H) +# define SKIP 77 +#else +# define SKIP 0 +#endif + +/* pngvalid requires write support and one of the fixed or floating point APIs. + */ +#if defined(PNG_WRITE_SUPPORTED) &&\ + (defined(PNG_FIXED_POINT_SUPPORTED) || defined(PNG_FLOATING_POINT_SUPPORTED)) + +#if PNG_LIBPNG_VER < 10500 +/* This deliberately lacks the const. */ +typedef png_byte *png_const_bytep; + +/* This is copied from 1.5.1 png.h: */ +#define PNG_INTERLACE_ADAM7_PASSES 7 +#define PNG_PASS_START_ROW(pass) (((1U&~(pass))<<(3-((pass)>>1)))&7) +#define PNG_PASS_START_COL(pass) (((1U& (pass))<<(3-(((pass)+1)>>1)))&7) +#define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3) +#define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3) +#define PNG_PASS_ROWS(height, pass) (((height)+(((1<>PNG_PASS_ROW_SHIFT(pass)) +#define PNG_PASS_COLS(width, pass) (((width)+(((1<>PNG_PASS_COL_SHIFT(pass)) +#define PNG_ROW_FROM_PASS_ROW(yIn, pass) \ + (((yIn)<>(((7-(off))-(pass))<<2)) & 0xFU) | \ + ((0x01145AF0U>>(((7-(off))-(pass))<<2)) & 0xF0U)) +#define PNG_ROW_IN_INTERLACE_PASS(y, pass) \ + ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1) +#define PNG_COL_IN_INTERLACE_PASS(x, pass) \ + ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1) + +/* These are needed too for the default build: */ +#define PNG_WRITE_16BIT_SUPPORTED +#define PNG_READ_16BIT_SUPPORTED + +/* This comes from pnglibconf.h after 1.5: */ +#define PNG_FP_1 100000 +#define PNG_GAMMA_THRESHOLD_FIXED\ + ((png_fixed_point)(PNG_GAMMA_THRESHOLD * PNG_FP_1)) +#endif + +#if PNG_LIBPNG_VER < 10600 + /* 1.6.0 constifies many APIs, the following exists to allow pngvalid to be + * compiled against earlier versions. + */ +# define png_const_structp png_structp +#endif + +#ifndef RELEASE_BUILD + /* RELEASE_BUILD is true for releases and release candidates: */ +# define RELEASE_BUILD (PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC) +#endif +#if RELEASE_BUILD +# define debugonly(something) +#else /* !RELEASE_BUILD */ +# define debugonly(something) something +#endif /* !RELEASE_BUILD */ + +#include /* For floating point constants */ +#include /* For malloc */ +#include /* For memcpy, memset */ +#include /* For floor */ + +/* Convenience macros. */ +#define CHUNK(a,b,c,d) (((a)<<24)+((b)<<16)+((c)<<8)+(d)) +#define CHUNK_IHDR CHUNK(73,72,68,82) +#define CHUNK_PLTE CHUNK(80,76,84,69) +#define CHUNK_IDAT CHUNK(73,68,65,84) +#define CHUNK_IEND CHUNK(73,69,78,68) +#define CHUNK_cHRM CHUNK(99,72,82,77) +#define CHUNK_gAMA CHUNK(103,65,77,65) +#define CHUNK_sBIT CHUNK(115,66,73,84) +#define CHUNK_sRGB CHUNK(115,82,71,66) + +/* Unused formal parameter errors are removed using the following macro which is + * expected to have no bad effects on performance. + */ +#ifndef UNUSED +# if defined(__GNUC__) || defined(_MSC_VER) +# define UNUSED(param) (void)param; +# else +# define UNUSED(param) +# endif +#endif + +/***************************** EXCEPTION HANDLING *****************************/ +#ifdef PNG_FREESTANDING_TESTS +# include +#else +# include "../visupng/cexcept.h" +#endif + +#ifdef __cplusplus +# define this not_the_cpp_this +# define new not_the_cpp_new +# define voidcast(type, value) static_cast(value) +#else +# define voidcast(type, value) (value) +#endif /* __cplusplus */ + +struct png_store; +define_exception_type(struct png_store*); + +/* The following are macros to reduce typing everywhere where the well known + * name 'the_exception_context' must be defined. + */ +#define anon_context(ps) struct exception_context *the_exception_context = \ + &(ps)->exception_context +#define context(ps,fault) anon_context(ps); png_store *fault + +/* This macro returns the number of elements in an array as an (unsigned int), + * it is necessary to avoid the inability of certain versions of GCC to use + * the value of a compile-time constant when performing range checks. It must + * be passed an array name. + */ +#define ARRAY_SIZE(a) ((unsigned int)((sizeof (a))/(sizeof (a)[0]))) + +/* GCC BUG 66447 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66447) requires + * some broken GCC versions to be fixed up to avoid invalid whining about auto + * variables that are *not* changed within the scope of a setjmp being changed. + * + * Feel free to extend the list of broken versions. + */ +#define is_gnu(major,minor)\ + (defined __GNUC__) && __GNUC__ == (major) && __GNUC_MINOR__ == (minor) +#define is_gnu_patch(major,minor,patch)\ + is_gnu(major,minor) && __GNUC_PATCHLEVEL__ == 0 +/* For the moment just do it always; all versions of GCC seem to be broken: */ +#ifdef __GNUC__ + const void * volatile make_volatile_for_gnu; +# define gnu_volatile(x) make_volatile_for_gnu = &x; +#else /* !GNUC broken versions */ +# define gnu_volatile(x) +#endif /* !GNUC broken versions */ + +/******************************* UTILITIES ************************************/ +/* Error handling is particularly problematic in production code - error + * handlers often themselves have bugs which lead to programs that detect + * minor errors crashing. The following functions deal with one very + * common class of errors in error handlers - attempting to format error or + * warning messages into buffers that are too small. + */ +static size_t safecat(char *buffer, size_t bufsize, size_t pos, + const char *cat) +{ + while (pos < bufsize && cat != NULL && *cat != 0) + buffer[pos++] = *cat++; + + if (pos >= bufsize) + pos = bufsize-1; + + buffer[pos] = 0; + return pos; +} + +static size_t safecatn(char *buffer, size_t bufsize, size_t pos, int n) +{ + char number[64]; + sprintf(number, "%d", n); + return safecat(buffer, bufsize, pos, number); +} + +#ifdef PNG_READ_TRANSFORMS_SUPPORTED +static size_t safecatd(char *buffer, size_t bufsize, size_t pos, double d, + int precision) +{ + char number[64]; + sprintf(number, "%.*f", precision, d); + return safecat(buffer, bufsize, pos, number); +} +#endif + +static const char invalid[] = "invalid"; +static const char sep[] = ": "; + +static const char *colour_types[8] = +{ + "grayscale", invalid, "truecolour", "indexed-colour", + "grayscale with alpha", invalid, "truecolour with alpha", invalid +}; + +#ifdef PNG_READ_TRANSFORMS_SUPPORTED +/* Convert a double precision value to fixed point. */ +static png_fixed_point +fix(double d) +{ + d = floor(d * PNG_FP_1 + .5); + return (png_fixed_point)d; +} +#endif /* PNG_READ_SUPPORTED */ + +/* Generate random bytes. This uses a boring repeatable algorithm and it + * is implemented here so that it gives the same set of numbers on every + * architecture. It's a linear congruential generator (Knuth or Sedgewick + * "Algorithms") but it comes from the 'feedback taps' table in Horowitz and + * Hill, "The Art of Electronics" (Pseudo-Random Bit Sequences and Noise + * Generation.) + */ +static void +make_random_bytes(png_uint_32* seed, void* pv, size_t size) +{ + png_uint_32 u0 = seed[0], u1 = seed[1]; + png_bytep bytes = voidcast(png_bytep, pv); + + /* There are thirty three bits, the next bit in the sequence is bit-33 XOR + * bit-20. The top 1 bit is in u1, the bottom 32 are in u0. + */ + size_t i; + for (i=0; i> (20-8)) ^ ((u1 << 7) | (u0 >> (32-7)))) & 0xff; + u1 <<= 8; + u1 |= u0 >> 24; + u0 <<= 8; + u0 |= u; + *bytes++ = (png_byte)u; + } + + seed[0] = u0; + seed[1] = u1; +} + +static void +make_four_random_bytes(png_uint_32* seed, png_bytep bytes) +{ + make_random_bytes(seed, bytes, 4); +} + +#if defined PNG_READ_SUPPORTED || defined PNG_WRITE_tRNS_SUPPORTED ||\ + defined PNG_WRITE_FILTER_SUPPORTED +static void +randomize(void *pv, size_t size) +{ + static png_uint_32 random_seed[2] = {0x56789abc, 0xd}; + make_random_bytes(random_seed, pv, size); +} + +#define R8(this) randomize(&(this), sizeof (this)) + +#ifdef PNG_READ_SUPPORTED +static png_byte +random_byte(void) +{ + unsigned char b1[1]; + randomize(b1, sizeof b1); + return b1[0]; +} +#endif /* READ */ + +static png_uint_16 +random_u16(void) +{ + unsigned char b2[2]; + randomize(b2, sizeof b2); + return png_get_uint_16(b2); +} + +#if defined PNG_READ_RGB_TO_GRAY_SUPPORTED ||\ + defined PNG_READ_FILLER_SUPPORTED +static png_uint_32 +random_u32(void) +{ + unsigned char b4[4]; + randomize(b4, sizeof b4); + return png_get_uint_32(b4); +} +#endif /* READ_FILLER || READ_RGB_TO_GRAY */ + +#endif /* READ || WRITE_tRNS || WRITE_FILTER */ + +#if defined PNG_READ_TRANSFORMS_SUPPORTED ||\ + defined PNG_WRITE_FILTER_SUPPORTED +static unsigned int +random_mod(unsigned int max) +{ + return random_u16() % max; /* 0 .. max-1 */ +} +#endif /* READ_TRANSFORMS || WRITE_FILTER */ + +#if (defined PNG_READ_RGB_TO_GRAY_SUPPORTED) ||\ + (defined PNG_READ_FILLER_SUPPORTED) +static int +random_choice(void) +{ + return random_byte() & 1; +} +#endif /* READ_RGB_TO_GRAY || READ_FILLER */ + +/* A numeric ID based on PNG file characteristics. The 'do_interlace' field + * simply records whether pngvalid did the interlace itself or whether it + * was done by libpng. Width and height must be less than 256. 'palette' is an + * index of the palette to use for formats with a palette otherwise a boolean + * indicating if a tRNS chunk was generated. + */ +#define FILEID(col, depth, palette, interlace, width, height, do_interlace) \ + ((png_uint_32)((col) + ((depth)<<3) + ((palette)<<8) + ((interlace)<<13) + \ + (((do_interlace)!=0)<<15) + ((width)<<16) + ((height)<<24))) + +#define COL_FROM_ID(id) ((png_byte)((id)& 0x7U)) +#define DEPTH_FROM_ID(id) ((png_byte)(((id) >> 3) & 0x1fU)) +#define PALETTE_FROM_ID(id) (((id) >> 8) & 0x1f) +#define INTERLACE_FROM_ID(id) ((png_byte)(((id) >> 13) & 0x3)) +#define DO_INTERLACE_FROM_ID(id) ((int)(((id)>>15) & 1)) +#define WIDTH_FROM_ID(id) (((id)>>16) & 0xff) +#define HEIGHT_FROM_ID(id) (((id)>>24) & 0xff) + +/* Utility to construct a standard name for a standard image. */ +static size_t +standard_name(char *buffer, size_t bufsize, size_t pos, png_byte colour_type, + int bit_depth, unsigned int npalette, int interlace_type, + png_uint_32 w, png_uint_32 h, int do_interlace) +{ + pos = safecat(buffer, bufsize, pos, colour_types[colour_type]); + if (colour_type == 3) /* must have a palette */ + { + pos = safecat(buffer, bufsize, pos, "["); + pos = safecatn(buffer, bufsize, pos, npalette); + pos = safecat(buffer, bufsize, pos, "]"); + } + + else if (npalette != 0) + pos = safecat(buffer, bufsize, pos, "+tRNS"); + + pos = safecat(buffer, bufsize, pos, " "); + pos = safecatn(buffer, bufsize, pos, bit_depth); + pos = safecat(buffer, bufsize, pos, " bit"); + + if (interlace_type != PNG_INTERLACE_NONE) + { + pos = safecat(buffer, bufsize, pos, " interlaced"); + if (do_interlace) + pos = safecat(buffer, bufsize, pos, "(pngvalid)"); + else + pos = safecat(buffer, bufsize, pos, "(libpng)"); + } + + if (w > 0 || h > 0) + { + pos = safecat(buffer, bufsize, pos, " "); + pos = safecatn(buffer, bufsize, pos, w); + pos = safecat(buffer, bufsize, pos, "x"); + pos = safecatn(buffer, bufsize, pos, h); + } + + return pos; +} + +static size_t +standard_name_from_id(char *buffer, size_t bufsize, size_t pos, png_uint_32 id) +{ + return standard_name(buffer, bufsize, pos, COL_FROM_ID(id), + DEPTH_FROM_ID(id), PALETTE_FROM_ID(id), INTERLACE_FROM_ID(id), + WIDTH_FROM_ID(id), HEIGHT_FROM_ID(id), DO_INTERLACE_FROM_ID(id)); +} + +/* Convenience API and defines to list valid formats. Note that 16 bit read and + * write support is required to do 16 bit read tests (we must be able to make a + * 16 bit image to test!) + */ +#ifdef PNG_WRITE_16BIT_SUPPORTED +# define WRITE_BDHI 4 +# ifdef PNG_READ_16BIT_SUPPORTED +# define READ_BDHI 4 +# define DO_16BIT +# endif +#else +# define WRITE_BDHI 3 +#endif +#ifndef DO_16BIT +# define READ_BDHI 3 +#endif + +/* The following defines the number of different palettes to generate for + * each log bit depth of a colour type 3 standard image. + */ +#define PALETTE_COUNT(bit_depth) ((bit_depth) > 4 ? 1U : 16U) + +static int +next_format(png_bytep colour_type, png_bytep bit_depth, + unsigned int* palette_number, int low_depth_gray, int tRNS) +{ + if (*bit_depth == 0) + { + *colour_type = 0; + if (low_depth_gray) + *bit_depth = 1; + else + *bit_depth = 8; + *palette_number = 0; + return 1; + } + + if (*colour_type < 4/*no alpha channel*/) + { + /* Add multiple palettes for colour type 3, one image with tRNS + * and one without for other non-alpha formats: + */ + unsigned int pn = ++*palette_number; + png_byte ct = *colour_type; + + if (((ct == 0/*GRAY*/ || ct/*RGB*/ == 2) && tRNS && pn < 2) || + (ct == 3/*PALETTE*/ && pn < PALETTE_COUNT(*bit_depth))) + return 1; + + /* No: next bit depth */ + *palette_number = 0; + } + + *bit_depth = (png_byte)(*bit_depth << 1); + + /* Palette images are restricted to 8 bit depth */ + if (*bit_depth <= 8 +#ifdef DO_16BIT + || (*colour_type != 3 && *bit_depth <= 16) +#endif + ) + return 1; + + /* Move to the next color type, or return 0 at the end. */ + switch (*colour_type) + { + case 0: + *colour_type = 2; + *bit_depth = 8; + return 1; + + case 2: + *colour_type = 3; + *bit_depth = 1; + return 1; + + case 3: + *colour_type = 4; + *bit_depth = 8; + return 1; + + case 4: + *colour_type = 6; + *bit_depth = 8; + return 1; + + default: + return 0; + } +} + +#ifdef PNG_READ_TRANSFORMS_SUPPORTED +static unsigned int +sample(png_const_bytep row, png_byte colour_type, png_byte bit_depth, + png_uint_32 x, unsigned int sample_index, int swap16, int littleendian) +{ + png_uint_32 bit_index, result; + + /* Find a sample index for the desired sample: */ + x *= bit_depth; + bit_index = x; + + if ((colour_type & 1) == 0) /* !palette */ + { + if (colour_type & 2) + bit_index *= 3; + + if (colour_type & 4) + bit_index += x; /* Alpha channel */ + + /* Multiple channels; select one: */ + if (colour_type & (2+4)) + bit_index += sample_index * bit_depth; + } + + /* Return the sample from the row as an integer. */ + row += bit_index >> 3; + result = *row; + + if (bit_depth == 8) + return result; + + else if (bit_depth > 8) + { + if (swap16) + return (*++row << 8) + result; + else + return (result << 8) + *++row; + } + + /* Less than 8 bits per sample. By default PNG has the big end of + * the egg on the left of the screen, but if littleendian is set + * then the big end is on the right. + */ + bit_index &= 7; + + if (!littleendian) + bit_index = 8-bit_index-bit_depth; + + return (result >> bit_index) & ((1U<> 3] & ~destMask; + unsigned int sourceByte = fromBuffer[fromIndex >> 3]; + + /* Don't rely on << or >> supporting '0' here, just in case: */ + fromIndex &= 7; + if (littleendian) + { + if (fromIndex > 0) sourceByte >>= fromIndex; + if ((toIndex & 7) > 0) sourceByte <<= toIndex & 7; + } + + else + { + if (fromIndex > 0) sourceByte <<= fromIndex; + if ((toIndex & 7) > 0) sourceByte >>= toIndex & 7; + } + + toBuffer[toIndex >> 3] = (png_byte)(destByte | (sourceByte & destMask)); + } + else /* One or more bytes */ + memmove(toBuffer+(toIndex>>3), fromBuffer+(fromIndex>>3), pixelSize>>3); +} + +#ifdef PNG_READ_SUPPORTED +/* Copy a complete row of pixels, taking into account potential partial + * bytes at the end. + */ +static void +row_copy(png_bytep toBuffer, png_const_bytep fromBuffer, unsigned int bitWidth, + int littleendian) +{ + memcpy(toBuffer, fromBuffer, bitWidth >> 3); + + if ((bitWidth & 7) != 0) + { + unsigned int mask; + + toBuffer += bitWidth >> 3; + fromBuffer += bitWidth >> 3; + if (littleendian) + mask = 0xff << (bitWidth & 7); + else + mask = 0xff >> (bitWidth & 7); + *toBuffer = (png_byte)((*toBuffer & mask) | (*fromBuffer & ~mask)); + } +} + +/* Compare pixels - they are assumed to start at the first byte in the + * given buffers. + */ +static int +pixel_cmp(png_const_bytep pa, png_const_bytep pb, png_uint_32 bit_width) +{ +#if PNG_LIBPNG_VER < 10506 + if (memcmp(pa, pb, bit_width>>3) == 0) + { + png_uint_32 p; + + if ((bit_width & 7) == 0) return 0; + + /* Ok, any differences? */ + p = pa[bit_width >> 3]; + p ^= pb[bit_width >> 3]; + + if (p == 0) return 0; + + /* There are, but they may not be significant, remove the bits + * after the end (the low order bits in PNG.) + */ + bit_width &= 7; + p >>= 8-bit_width; + + if (p == 0) return 0; + } +#else + /* From libpng-1.5.6 the overwrite should be fixed, so compare the trailing + * bits too: + */ + if (memcmp(pa, pb, (bit_width+7)>>3) == 0) + return 0; +#endif + + /* Return the index of the changed byte. */ + { + png_uint_32 where = 0; + + while (pa[where] == pb[where]) ++where; + return 1+where; + } +} +#endif /* PNG_READ_SUPPORTED */ + +/*************************** BASIC PNG FILE WRITING ***************************/ +/* A png_store takes data from the sequential writer or provides data + * to the sequential reader. It can also store the result of a PNG + * write for later retrieval. + */ +#define STORE_BUFFER_SIZE 500 /* arbitrary */ +typedef struct png_store_buffer +{ + struct png_store_buffer* prev; /* NOTE: stored in reverse order */ + png_byte buffer[STORE_BUFFER_SIZE]; +} png_store_buffer; + +#define FILE_NAME_SIZE 64 + +typedef struct store_palette_entry /* record of a single palette entry */ +{ + png_byte red; + png_byte green; + png_byte blue; + png_byte alpha; +} store_palette_entry, store_palette[256]; + +typedef struct png_store_file +{ + struct png_store_file* next; /* as many as you like... */ + char name[FILE_NAME_SIZE]; + unsigned int IDAT_bits; /* Number of bits in IDAT size */ + png_uint_32 IDAT_size; /* Total size of IDAT data */ + png_uint_32 id; /* must be correct (see FILEID) */ + size_t datacount; /* In this (the last) buffer */ + png_store_buffer data; /* Last buffer in file */ + int npalette; /* Number of entries in palette */ + store_palette_entry* palette; /* May be NULL */ +} png_store_file; + +/* The following is a pool of memory allocated by a single libpng read or write + * operation. + */ +typedef struct store_pool +{ + struct png_store *store; /* Back pointer */ + struct store_memory *list; /* List of allocated memory */ + png_byte mark[4]; /* Before and after data */ + + /* Statistics for this run. */ + png_alloc_size_t max; /* Maximum single allocation */ + png_alloc_size_t current; /* Current allocation */ + png_alloc_size_t limit; /* Highest current allocation */ + png_alloc_size_t total; /* Total allocation */ + + /* Overall statistics (retained across successive runs). */ + png_alloc_size_t max_max; + png_alloc_size_t max_limit; + png_alloc_size_t max_total; +} store_pool; + +typedef struct png_store +{ + /* For cexcept.h exception handling - simply store one of these; + * the context is a self pointer but it may point to a different + * png_store (in fact it never does in this program.) + */ + struct exception_context + exception_context; + + unsigned int verbose :1; + unsigned int treat_warnings_as_errors :1; + unsigned int expect_error :1; + unsigned int expect_warning :1; + unsigned int saw_warning :1; + unsigned int speed :1; + unsigned int progressive :1; /* use progressive read */ + unsigned int validated :1; /* used as a temporary flag */ + int nerrors; + int nwarnings; + int noptions; /* number of options below: */ + struct { + unsigned char option; /* option number, 0..30 */ + unsigned char setting; /* setting (unset,invalid,on,off) */ + } options[16]; + char test[128]; /* Name of test */ + char error[256]; + + /* Share fields */ + png_uint_32 chunklen; /* Length of chunk+overhead (chunkpos >= 8) */ + png_uint_32 chunktype;/* Type of chunk (valid if chunkpos >= 4) */ + png_uint_32 chunkpos; /* Position in chunk */ + png_uint_32 IDAT_size;/* Accumulated IDAT size in .new */ + unsigned int IDAT_bits;/* Cache of the file store value */ + + /* Read fields */ + png_structp pread; /* Used to read a saved file */ + png_infop piread; + png_store_file* current; /* Set when reading */ + png_store_buffer* next; /* Set when reading */ + size_t readpos; /* Position in *next */ + png_byte* image; /* Buffer for reading interlaced images */ + size_t cb_image; /* Size of this buffer */ + size_t cb_row; /* Row size of the image(s) */ + uLong IDAT_crc; + png_uint_32 IDAT_len; /* Used when re-chunking IDAT chunks */ + png_uint_32 IDAT_pos; /* Used when re-chunking IDAT chunks */ + png_uint_32 image_h; /* Number of rows in a single image */ + store_pool read_memory_pool; + + /* Write fields */ + png_store_file* saved; + png_structp pwrite; /* Used when writing a new file */ + png_infop piwrite; + size_t writepos; /* Position in .new */ + char wname[FILE_NAME_SIZE]; + png_store_buffer new; /* The end of the new PNG file being written. */ + store_pool write_memory_pool; + store_palette_entry* palette; + int npalette; +} png_store; + +/* Initialization and cleanup */ +static void +store_pool_mark(png_bytep mark) +{ + static png_uint_32 store_seed[2] = { 0x12345678, 1}; + + make_four_random_bytes(store_seed, mark); +} + +#ifdef PNG_READ_TRANSFORMS_SUPPORTED +/* Use this for random 32 bit values; this function makes sure the result is + * non-zero. + */ +static png_uint_32 +random_32(void) +{ + + for (;;) + { + png_byte mark[4]; + png_uint_32 result; + + store_pool_mark(mark); + result = png_get_uint_32(mark); + + if (result != 0) + return result; + } +} +#endif /* PNG_READ_SUPPORTED */ + +static void +store_pool_init(png_store *ps, store_pool *pool) +{ + memset(pool, 0, sizeof *pool); + + pool->store = ps; + pool->list = NULL; + pool->max = pool->current = pool->limit = pool->total = 0; + pool->max_max = pool->max_limit = pool->max_total = 0; + store_pool_mark(pool->mark); +} + +static void +store_init(png_store* ps) +{ + memset(ps, 0, sizeof *ps); + init_exception_context(&ps->exception_context); + store_pool_init(ps, &ps->read_memory_pool); + store_pool_init(ps, &ps->write_memory_pool); + ps->verbose = 0; + ps->treat_warnings_as_errors = 0; + ps->expect_error = 0; + ps->expect_warning = 0; + ps->saw_warning = 0; + ps->speed = 0; + ps->progressive = 0; + ps->validated = 0; + ps->nerrors = ps->nwarnings = 0; + ps->pread = NULL; + ps->piread = NULL; + ps->saved = ps->current = NULL; + ps->next = NULL; + ps->readpos = 0; + ps->image = NULL; + ps->cb_image = 0; + ps->cb_row = 0; + ps->image_h = 0; + ps->pwrite = NULL; + ps->piwrite = NULL; + ps->writepos = 0; + ps->chunkpos = 8; + ps->chunktype = 0; + ps->chunklen = 16; + ps->IDAT_size = 0; + ps->IDAT_bits = 0; + ps->new.prev = NULL; + ps->palette = NULL; + ps->npalette = 0; + ps->noptions = 0; +} + +static void +store_freebuffer(png_store_buffer* psb) +{ + if (psb->prev) + { + store_freebuffer(psb->prev); + free(psb->prev); + psb->prev = NULL; + } +} + +static void +store_freenew(png_store *ps) +{ + store_freebuffer(&ps->new); + ps->writepos = 0; + ps->chunkpos = 8; + ps->chunktype = 0; + ps->chunklen = 16; + ps->IDAT_size = 0; + ps->IDAT_bits = 0; + if (ps->palette != NULL) + { + free(ps->palette); + ps->palette = NULL; + ps->npalette = 0; + } +} + +static void +store_storenew(png_store *ps) +{ + png_store_buffer *pb; + + pb = voidcast(png_store_buffer*, malloc(sizeof *pb)); + + if (pb == NULL) + png_error(ps->pwrite, "store new: OOM"); + + *pb = ps->new; + ps->new.prev = pb; + ps->writepos = 0; +} + +static void +store_freefile(png_store_file **ppf) +{ + if (*ppf != NULL) + { + store_freefile(&(*ppf)->next); + + store_freebuffer(&(*ppf)->data); + (*ppf)->datacount = 0; + if ((*ppf)->palette != NULL) + { + free((*ppf)->palette); + (*ppf)->palette = NULL; + (*ppf)->npalette = 0; + } + free(*ppf); + *ppf = NULL; + } +} + +static unsigned int +bits_of(png_uint_32 num) +{ + /* Return the number of bits in 'num' */ + unsigned int b = 0; + + if (num & 0xffff0000U) b += 16U, num >>= 16; + if (num & 0xff00U) b += 8U, num >>= 8; + if (num & 0xf0U) b += 4U, num >>= 4; + if (num & 0xcU) b += 2U, num >>= 2; + if (num & 0x2U) ++b, num >>= 1; + if (num) ++b; + + return b; /* 0..32 */ +} + +/* Main interface to file storage, after writing a new PNG file (see the API + * below) call store_storefile to store the result with the given name and id. + */ +static void +store_storefile(png_store *ps, png_uint_32 id) +{ + png_store_file *pf; + + if (ps->chunkpos != 0U || ps->chunktype != 0U || ps->chunklen != 0U || + ps->IDAT_size == 0) + png_error(ps->pwrite, "storefile: incomplete write"); + + pf = voidcast(png_store_file*, malloc(sizeof *pf)); + if (pf == NULL) + png_error(ps->pwrite, "storefile: OOM"); + safecat(pf->name, sizeof pf->name, 0, ps->wname); + pf->id = id; + pf->data = ps->new; + pf->datacount = ps->writepos; + pf->IDAT_size = ps->IDAT_size; + pf->IDAT_bits = bits_of(ps->IDAT_size); + /* Because the IDAT always has zlib header stuff this must be true: */ + if (pf->IDAT_bits == 0U) + png_error(ps->pwrite, "storefile: 0 sized IDAT"); + ps->new.prev = NULL; + ps->writepos = 0; + ps->chunkpos = 8; + ps->chunktype = 0; + ps->chunklen = 16; + ps->IDAT_size = 0; + pf->palette = ps->palette; + pf->npalette = ps->npalette; + ps->palette = 0; + ps->npalette = 0; + + /* And save it. */ + pf->next = ps->saved; + ps->saved = pf; +} + +/* Generate an error message (in the given buffer) */ +static size_t +store_message(png_store *ps, png_const_structp pp, char *buffer, size_t bufsize, + size_t pos, const char *msg) +{ + if (pp != NULL && pp == ps->pread) + { + /* Reading a file */ + pos = safecat(buffer, bufsize, pos, "read: "); + + if (ps->current != NULL) + { + pos = safecat(buffer, bufsize, pos, ps->current->name); + pos = safecat(buffer, bufsize, pos, sep); + } + } + + else if (pp != NULL && pp == ps->pwrite) + { + /* Writing a file */ + pos = safecat(buffer, bufsize, pos, "write: "); + pos = safecat(buffer, bufsize, pos, ps->wname); + pos = safecat(buffer, bufsize, pos, sep); + } + + else + { + /* Neither reading nor writing (or a memory error in struct delete) */ + pos = safecat(buffer, bufsize, pos, "pngvalid: "); + } + + if (ps->test[0] != 0) + { + pos = safecat(buffer, bufsize, pos, ps->test); + pos = safecat(buffer, bufsize, pos, sep); + } + pos = safecat(buffer, bufsize, pos, msg); + return pos; +} + +/* Verbose output to the error stream: */ +static void +store_verbose(png_store *ps, png_const_structp pp, png_const_charp prefix, + png_const_charp message) +{ + char buffer[512]; + + if (prefix) + fputs(prefix, stderr); + + (void)store_message(ps, pp, buffer, sizeof buffer, 0, message); + fputs(buffer, stderr); + fputc('\n', stderr); +} + +/* Log an error or warning - the relevant count is always incremented. */ +static void +store_log(png_store* ps, png_const_structp pp, png_const_charp message, + int is_error) +{ + /* The warning is copied to the error buffer if there are no errors and it is + * the first warning. The error is copied to the error buffer if it is the + * first error (overwriting any prior warnings). + */ + if (is_error ? (ps->nerrors)++ == 0 : + (ps->nwarnings)++ == 0 && ps->nerrors == 0) + store_message(ps, pp, ps->error, sizeof ps->error, 0, message); + + if (ps->verbose) + store_verbose(ps, pp, is_error ? "error: " : "warning: ", message); +} + +#ifdef PNG_READ_SUPPORTED +/* Internal error function, called with a png_store but no libpng stuff. */ +static void +internal_error(png_store *ps, png_const_charp message) +{ + store_log(ps, NULL, message, 1 /* error */); + + /* And finally throw an exception. */ + { + struct exception_context *the_exception_context = &ps->exception_context; + Throw ps; + } +} +#endif /* PNG_READ_SUPPORTED */ + +/* Functions to use as PNG callbacks. */ +static void PNGCBAPI +store_error(png_structp ppIn, png_const_charp message) /* PNG_NORETURN */ +{ + png_const_structp pp = ppIn; + png_store *ps = voidcast(png_store*, png_get_error_ptr(pp)); + + if (!ps->expect_error) + store_log(ps, pp, message, 1 /* error */); + + /* And finally throw an exception. */ + { + struct exception_context *the_exception_context = &ps->exception_context; + Throw ps; + } +} + +static void PNGCBAPI +store_warning(png_structp ppIn, png_const_charp message) +{ + png_const_structp pp = ppIn; + png_store *ps = voidcast(png_store*, png_get_error_ptr(pp)); + + if (!ps->expect_warning) + store_log(ps, pp, message, 0 /* warning */); + else + ps->saw_warning = 1; +} + +/* These somewhat odd functions are used when reading an image to ensure that + * the buffer is big enough, the png_structp is for errors. + */ +/* Return a single row from the correct image. */ +static png_bytep +store_image_row(const png_store* ps, png_const_structp pp, int nImage, + png_uint_32 y) +{ + size_t coffset = (nImage * ps->image_h + y) * (ps->cb_row + 5) + 2; + + if (ps->image == NULL) + png_error(pp, "no allocated image"); + + if (coffset + ps->cb_row + 3 > ps->cb_image) + png_error(pp, "image too small"); + + return ps->image + coffset; +} + +static void +store_image_free(png_store *ps, png_const_structp pp) +{ + if (ps->image != NULL) + { + png_bytep image = ps->image; + + if (image[-1] != 0xed || image[ps->cb_image] != 0xfe) + { + if (pp != NULL) + png_error(pp, "png_store image overwrite (1)"); + else + store_log(ps, NULL, "png_store image overwrite (2)", 1); + } + + ps->image = NULL; + ps->cb_image = 0; + --image; + free(image); + } +} + +static void +store_ensure_image(png_store *ps, png_const_structp pp, int nImages, + size_t cbRow, png_uint_32 cRows) +{ + size_t cb = nImages * cRows * (cbRow + 5); + + if (ps->cb_image < cb) + { + png_bytep image; + + store_image_free(ps, pp); + + /* The buffer is deliberately mis-aligned. */ + image = voidcast(png_bytep, malloc(cb+2)); + if (image == NULL) + { + /* Called from the startup - ignore the error for the moment. */ + if (pp == NULL) + return; + + png_error(pp, "OOM allocating image buffer"); + } + + /* These magic tags are used to detect overwrites above. */ + ++image; + image[-1] = 0xed; + image[cb] = 0xfe; + + ps->image = image; + ps->cb_image = cb; + } + + /* We have an adequate sized image; lay out the rows. There are 2 bytes at + * the start and three at the end of each (this ensures that the row + * alignment starts out odd - 2+1 and changes for larger images on each row.) + */ + ps->cb_row = cbRow; + ps->image_h = cRows; + + /* For error checking, the whole buffer is set to 10110010 (0xb2 - 178). + * This deliberately doesn't match the bits in the size test image which are + * outside the image; these are set to 0xff (all 1). To make the row + * comparison work in the 'size' test case the size rows are pre-initialized + * to the same value prior to calling 'standard_row'. + */ + memset(ps->image, 178, cb); + + /* Then put in the marks. */ + while (--nImages >= 0) + { + png_uint_32 y; + + for (y=0; yimage; + + if (image[-1] != 0xed || image[ps->cb_image] != 0xfe) + png_error(pp, "image overwrite"); + else + { + size_t cbRow = ps->cb_row; + png_uint_32 rows = ps->image_h; + + image += iImage * (cbRow+5) * ps->image_h; + + image += 2; /* skip image first row markers */ + + for (; rows > 0; --rows) + { + if (image[-2] != 190 || image[-1] != 239) + png_error(pp, "row start overwritten"); + + if (image[cbRow] != 222 || image[cbRow+1] != 173 || + image[cbRow+2] != 17) + png_error(pp, "row end overwritten"); + + image += cbRow+5; + } + } +} +#endif /* PNG_READ_SUPPORTED */ + +static int +valid_chunktype(png_uint_32 chunktype) +{ + /* Each byte in the chunk type must be in one of the ranges 65..90, 97..122 + * (both inclusive), so: + */ + unsigned int i; + + for (i=0; i<4; ++i) + { + unsigned int c = chunktype & 0xffU; + + if (!((c >= 65U && c <= 90U) || (c >= 97U && c <= 122U))) + return 0; + + chunktype >>= 8; + } + + return 1; /* It's valid */ +} + +static void PNGCBAPI +store_write(png_structp ppIn, png_bytep pb, size_t st) +{ + png_const_structp pp = ppIn; + png_store *ps = voidcast(png_store*, png_get_io_ptr(pp)); + size_t writepos = ps->writepos; + png_uint_32 chunkpos = ps->chunkpos; + png_uint_32 chunktype = ps->chunktype; + png_uint_32 chunklen = ps->chunklen; + + if (ps->pwrite != pp) + png_error(pp, "store state damaged"); + + /* Technically this is legal, but in practice libpng never writes more than + * the maximum chunk size at once so if it happens something weird has + * changed inside libpng (probably). + */ + if (st > 0x7fffffffU) + png_error(pp, "unexpected write size"); + + /* Now process the bytes to be written. Do this in units of the space in the + * output (write) buffer or, at the start 4 bytes for the chunk type and + * length limited in any case by the amount of data. + */ + while (st > 0) + { + if (writepos >= STORE_BUFFER_SIZE) + store_storenew(ps), writepos = 0; + + if (chunkpos < 4) + { + png_byte b = *pb++; + --st; + chunklen = (chunklen << 8) + b; + ps->new.buffer[writepos++] = b; + ++chunkpos; + } + + else if (chunkpos < 8) + { + png_byte b = *pb++; + --st; + chunktype = (chunktype << 8) + b; + ps->new.buffer[writepos++] = b; + + if (++chunkpos == 8) + { + chunklen &= 0xffffffffU; + if (chunklen > 0x7fffffffU) + png_error(pp, "chunk length too great"); + + chunktype &= 0xffffffffU; + if (chunktype == CHUNK_IDAT) + { + if (chunklen > ~ps->IDAT_size) + png_error(pp, "pngvalid internal image too large"); + + ps->IDAT_size += chunklen; + } + + else if (!valid_chunktype(chunktype)) + png_error(pp, "invalid chunk type"); + + chunklen += 12; /* for header and CRC */ + } + } + + else /* chunkpos >= 8 */ + { + size_t cb = st; + + if (cb > STORE_BUFFER_SIZE - writepos) + cb = STORE_BUFFER_SIZE - writepos; + + if (cb > chunklen - chunkpos/* bytes left in chunk*/) + cb = (size_t)/*SAFE*/(chunklen - chunkpos); + + memcpy(ps->new.buffer + writepos, pb, cb); + chunkpos += (png_uint_32)/*SAFE*/cb; + pb += cb; + writepos += cb; + st -= cb; + + if (chunkpos >= chunklen) /* must be equal */ + chunkpos = chunktype = chunklen = 0; + } + } /* while (st > 0) */ + + ps->writepos = writepos; + ps->chunkpos = chunkpos; + ps->chunktype = chunktype; + ps->chunklen = chunklen; +} + +static void PNGCBAPI +store_flush(png_structp ppIn) +{ + UNUSED(ppIn) /*DOES NOTHING*/ +} + +#ifdef PNG_READ_SUPPORTED +static size_t +store_read_buffer_size(png_store *ps) +{ + /* Return the bytes available for read in the current buffer. */ + if (ps->next != &ps->current->data) + return STORE_BUFFER_SIZE; + + return ps->current->datacount; +} + +/* Return total bytes available for read. */ +static size_t +store_read_buffer_avail(png_store *ps) +{ + if (ps->current != NULL && ps->next != NULL) + { + png_store_buffer *next = &ps->current->data; + size_t cbAvail = ps->current->datacount; + + while (next != ps->next && next != NULL) + { + next = next->prev; + cbAvail += STORE_BUFFER_SIZE; + } + + if (next != ps->next) + png_error(ps->pread, "buffer read error"); + + if (cbAvail > ps->readpos) + return cbAvail - ps->readpos; + } + + return 0; +} + +static int +store_read_buffer_next(png_store *ps) +{ + png_store_buffer *pbOld = ps->next; + png_store_buffer *pbNew = &ps->current->data; + if (pbOld != pbNew) + { + while (pbNew != NULL && pbNew->prev != pbOld) + pbNew = pbNew->prev; + + if (pbNew != NULL) + { + ps->next = pbNew; + ps->readpos = 0; + return 1; + } + + png_error(ps->pread, "buffer lost"); + } + + return 0; /* EOF or error */ +} + +/* Need separate implementation and callback to allow use of the same code + * during progressive read, where the io_ptr is set internally by libpng. + */ +static void +store_read_imp(png_store *ps, png_bytep pb, size_t st) +{ + if (ps->current == NULL || ps->next == NULL) + png_error(ps->pread, "store state damaged"); + + while (st > 0) + { + size_t cbAvail = store_read_buffer_size(ps) - ps->readpos; + + if (cbAvail > 0) + { + if (cbAvail > st) cbAvail = st; + memcpy(pb, ps->next->buffer + ps->readpos, cbAvail); + st -= cbAvail; + pb += cbAvail; + ps->readpos += cbAvail; + } + + else if (!store_read_buffer_next(ps)) + png_error(ps->pread, "read beyond end of file"); + } +} + +static size_t +store_read_chunk(png_store *ps, png_bytep pb, size_t max, size_t min) +{ + png_uint_32 chunklen = ps->chunklen; + png_uint_32 chunktype = ps->chunktype; + png_uint_32 chunkpos = ps->chunkpos; + size_t st = max; + + if (st > 0) do + { + if (chunkpos >= chunklen) /* end of last chunk */ + { + png_byte buffer[8]; + + /* Read the header of the next chunk: */ + store_read_imp(ps, buffer, 8U); + chunklen = png_get_uint_32(buffer) + 12U; + chunktype = png_get_uint_32(buffer+4U); + chunkpos = 0U; /* Position read so far */ + } + + if (chunktype == CHUNK_IDAT) + { + png_uint_32 IDAT_pos = ps->IDAT_pos; + png_uint_32 IDAT_len = ps->IDAT_len; + png_uint_32 IDAT_size = ps->IDAT_size; + + /* The IDAT headers are constructed here; skip the input header. */ + if (chunkpos < 8U) + chunkpos = 8U; + + if (IDAT_pos == IDAT_len) + { + png_byte random = random_byte(); + + /* Make a new IDAT chunk, if IDAT_len is 0 this is the first IDAT, + * if IDAT_size is 0 this is the end. At present this is set up + * using a random number so that there is a 25% chance before + * the start of the first IDAT chunk being 0 length. + */ + if (IDAT_len == 0U) /* First IDAT */ + { + switch (random & 3U) + { + case 0U: IDAT_len = 12U; break; /* 0 bytes */ + case 1U: IDAT_len = 13U; break; /* 1 byte */ + default: IDAT_len = random_u32(); + IDAT_len %= IDAT_size; + IDAT_len += 13U; /* 1..IDAT_size bytes */ + break; + } + } + + else if (IDAT_size == 0U) /* all IDAT data read */ + { + /* The last (IDAT) chunk should be positioned at the CRC now: */ + if (chunkpos != chunklen-4U) + png_error(ps->pread, "internal: IDAT size mismatch"); + + /* The only option here is to add a zero length IDAT, this + * happens 25% of the time. Because of the check above + * chunklen-4U-chunkpos must be zero, we just need to skip the + * CRC now. + */ + if ((random & 3U) == 0U) + IDAT_len = 12U; /* Output another 0 length IDAT */ + + else + { + /* End of IDATs, skip the CRC to make the code above load the + * next chunk header next time round. + */ + png_byte buffer[4]; + + store_read_imp(ps, buffer, 4U); + chunkpos += 4U; + ps->IDAT_pos = IDAT_pos; + ps->IDAT_len = IDAT_len; + ps->IDAT_size = 0U; + continue; /* Read the next chunk */ + } + } + + else + { + /* Middle of IDATs, use 'random' to determine the number of bits + * to use in the IDAT length. + */ + IDAT_len = random_u32(); + IDAT_len &= (1U << (1U + random % ps->IDAT_bits)) - 1U; + if (IDAT_len > IDAT_size) + IDAT_len = IDAT_size; + IDAT_len += 12U; /* zero bytes may occur */ + } + + IDAT_pos = 0U; + ps->IDAT_crc = 0x35af061e; /* Ie: crc32(0UL, "IDAT", 4) */ + } /* IDAT_pos == IDAT_len */ + + if (IDAT_pos < 8U) /* Return the header */ do + { + png_uint_32 b; + unsigned int shift; + + if (IDAT_pos < 4U) + b = IDAT_len - 12U; + + else + b = CHUNK_IDAT; + + shift = 3U & IDAT_pos; + ++IDAT_pos; + + if (shift < 3U) + b >>= 8U*(3U-shift); + + *pb++ = 0xffU & b; + } + while (--st > 0 && IDAT_pos < 8); + + else if (IDAT_pos < IDAT_len - 4U) /* I.e not the CRC */ + { + if (chunkpos < chunklen-4U) + { + uInt avail = (uInt)-1; + + if (avail > (IDAT_len-4U) - IDAT_pos) + avail = (uInt)/*SAFE*/((IDAT_len-4U) - IDAT_pos); + + if (avail > st) + avail = (uInt)/*SAFE*/st; + + if (avail > (chunklen-4U) - chunkpos) + avail = (uInt)/*SAFE*/((chunklen-4U) - chunkpos); + + store_read_imp(ps, pb, avail); + ps->IDAT_crc = crc32(ps->IDAT_crc, pb, avail); + pb += (size_t)/*SAFE*/avail; + st -= (size_t)/*SAFE*/avail; + chunkpos += (png_uint_32)/*SAFE*/avail; + IDAT_size -= (png_uint_32)/*SAFE*/avail; + IDAT_pos += (png_uint_32)/*SAFE*/avail; + } + + else /* skip the input CRC */ + { + png_byte buffer[4]; + + store_read_imp(ps, buffer, 4U); + chunkpos += 4U; + } + } + + else /* IDAT crc */ do + { + uLong b = ps->IDAT_crc; + unsigned int shift = (IDAT_len - IDAT_pos); /* 4..1 */ + ++IDAT_pos; + + if (shift > 1U) + b >>= 8U*(shift-1U); + + *pb++ = 0xffU & b; + } + while (--st > 0 && IDAT_pos < IDAT_len); + + ps->IDAT_pos = IDAT_pos; + ps->IDAT_len = IDAT_len; + ps->IDAT_size = IDAT_size; + } + + else /* !IDAT */ + { + /* If there is still some pending IDAT data after the IDAT chunks have + * been processed there is a problem: + */ + if (ps->IDAT_len > 0 && ps->IDAT_size > 0) + png_error(ps->pread, "internal: missing IDAT data"); + + if (chunktype == CHUNK_IEND && ps->IDAT_len == 0U) + png_error(ps->pread, "internal: missing IDAT"); + + if (chunkpos < 8U) /* Return the header */ do + { + png_uint_32 b; + unsigned int shift; + + if (chunkpos < 4U) + b = chunklen - 12U; + + else + b = chunktype; + + shift = 3U & chunkpos; + ++chunkpos; + + if (shift < 3U) + b >>= 8U*(3U-shift); + + *pb++ = 0xffU & b; + } + while (--st > 0 && chunkpos < 8); + + else /* Return chunk bytes, including the CRC */ + { + size_t avail = st; + + if (avail > chunklen - chunkpos) + avail = (size_t)/*SAFE*/(chunklen - chunkpos); + + store_read_imp(ps, pb, avail); + pb += avail; + st -= avail; + chunkpos += (png_uint_32)/*SAFE*/avail; + + /* Check for end of chunk and end-of-file; don't try to read a new + * chunk header at this point unless instructed to do so by 'min'. + */ + if (chunkpos >= chunklen && max-st >= min && + store_read_buffer_avail(ps) == 0) + break; + } + } /* !IDAT */ + } + while (st > 0); + + ps->chunklen = chunklen; + ps->chunktype = chunktype; + ps->chunkpos = chunkpos; + + return st; /* space left */ +} + +static void PNGCBAPI +store_read(png_structp ppIn, png_bytep pb, size_t st) +{ + png_const_structp pp = ppIn; + png_store *ps = voidcast(png_store*, png_get_io_ptr(pp)); + + if (ps == NULL || ps->pread != pp) + png_error(pp, "bad store read call"); + + store_read_chunk(ps, pb, st, st); +} + +static void +store_progressive_read(png_store *ps, png_structp pp, png_infop pi) +{ + if (ps->pread != pp || ps->current == NULL || ps->next == NULL) + png_error(pp, "store state damaged (progressive)"); + + /* This is another Horowitz and Hill random noise generator. In this case + * the aim is to stress the progressive reader with truly horrible variable + * buffer sizes in the range 1..500, so a sequence of 9 bit random numbers + * is generated. We could probably just count from 1 to 32767 and get as + * good a result. + */ + while (store_read_buffer_avail(ps) > 0) + { + static png_uint_32 noise = 2; + size_t cb; + png_byte buffer[512]; + + /* Generate 15 more bits of stuff: */ + noise = (noise << 9) | ((noise ^ (noise >> (9-5))) & 0x1ff); + cb = noise & 0x1ff; + cb -= store_read_chunk(ps, buffer, cb, 1); + png_process_data(pp, pi, buffer, cb); + } +} +#endif /* PNG_READ_SUPPORTED */ + +/* The caller must fill this in: */ +static store_palette_entry * +store_write_palette(png_store *ps, int npalette) +{ + if (ps->pwrite == NULL) + store_log(ps, NULL, "attempt to write palette without write stream", 1); + + if (ps->palette != NULL) + png_error(ps->pwrite, "multiple store_write_palette calls"); + + /* This function can only return NULL if called with '0'! */ + if (npalette > 0) + { + ps->palette = voidcast(store_palette_entry*, malloc(npalette * + sizeof *ps->palette)); + + if (ps->palette == NULL) + png_error(ps->pwrite, "store new palette: OOM"); + + ps->npalette = npalette; + } + + return ps->palette; +} + +#ifdef PNG_READ_SUPPORTED +static store_palette_entry * +store_current_palette(png_store *ps, int *npalette) +{ + /* This is an internal error (the call has been made outside a read + * operation.) + */ + if (ps->current == NULL) + { + store_log(ps, ps->pread, "no current stream for palette", 1); + return NULL; + } + + /* The result may be null if there is no palette. */ + *npalette = ps->current->npalette; + return ps->current->palette; +} +#endif /* PNG_READ_SUPPORTED */ + +/***************************** MEMORY MANAGEMENT*** ***************************/ +#ifdef PNG_USER_MEM_SUPPORTED +/* A store_memory is simply the header for an allocated block of memory. The + * pointer returned to libpng is just after the end of the header block, the + * allocated memory is followed by a second copy of the 'mark'. + */ +typedef struct store_memory +{ + store_pool *pool; /* Originating pool */ + struct store_memory *next; /* Singly linked list */ + png_alloc_size_t size; /* Size of memory allocated */ + png_byte mark[4]; /* ID marker */ +} store_memory; + +/* Handle a fatal error in memory allocation. This calls png_error if the + * libpng struct is non-NULL, else it outputs a message and returns. This means + * that a memory problem while libpng is running will abort (png_error) the + * handling of particular file while one in cleanup (after the destroy of the + * struct has returned) will simply keep going and free (or attempt to free) + * all the memory. + */ +static void +store_pool_error(png_store *ps, png_const_structp pp, const char *msg) +{ + if (pp != NULL) + png_error(pp, msg); + + /* Else we have to do it ourselves. png_error eventually calls store_log, + * above. store_log accepts a NULL png_structp - it just changes what gets + * output by store_message. + */ + store_log(ps, pp, msg, 1 /* error */); +} + +static void +store_memory_free(png_const_structp pp, store_pool *pool, store_memory *memory) +{ + /* Note that pp may be NULL (see store_pool_delete below), the caller has + * found 'memory' in pool->list *and* unlinked this entry, so this is a valid + * pointer (for sure), but the contents may have been trashed. + */ + if (memory->pool != pool) + store_pool_error(pool->store, pp, "memory corrupted (pool)"); + + else if (memcmp(memory->mark, pool->mark, sizeof memory->mark) != 0) + store_pool_error(pool->store, pp, "memory corrupted (start)"); + + /* It should be safe to read the size field now. */ + else + { + png_alloc_size_t cb = memory->size; + + if (cb > pool->max) + store_pool_error(pool->store, pp, "memory corrupted (size)"); + + else if (memcmp((png_bytep)(memory+1)+cb, pool->mark, sizeof pool->mark) + != 0) + store_pool_error(pool->store, pp, "memory corrupted (end)"); + + /* Finally give the library a chance to find problems too: */ + else + { + pool->current -= cb; + free(memory); + } + } +} + +static void +store_pool_delete(png_store *ps, store_pool *pool) +{ + if (pool->list != NULL) + { + fprintf(stderr, "%s: %s %s: memory lost (list follows):\n", ps->test, + pool == &ps->read_memory_pool ? "read" : "write", + pool == &ps->read_memory_pool ? (ps->current != NULL ? + ps->current->name : "unknown file") : ps->wname); + ++ps->nerrors; + + do + { + store_memory *next = pool->list; + pool->list = next->next; + next->next = NULL; + + fprintf(stderr, "\t%lu bytes @ %p\n", + (unsigned long)next->size, (const void*)(next+1)); + /* The NULL means this will always return, even if the memory is + * corrupted. + */ + store_memory_free(NULL, pool, next); + } + while (pool->list != NULL); + } + + /* And reset the other fields too for the next time. */ + if (pool->max > pool->max_max) pool->max_max = pool->max; + pool->max = 0; + if (pool->current != 0) /* unexpected internal error */ + fprintf(stderr, "%s: %s %s: memory counter mismatch (internal error)\n", + ps->test, pool == &ps->read_memory_pool ? "read" : "write", + pool == &ps->read_memory_pool ? (ps->current != NULL ? + ps->current->name : "unknown file") : ps->wname); + pool->current = 0; + + if (pool->limit > pool->max_limit) + pool->max_limit = pool->limit; + + pool->limit = 0; + + if (pool->total > pool->max_total) + pool->max_total = pool->total; + + pool->total = 0; + + /* Get a new mark too. */ + store_pool_mark(pool->mark); +} + +/* The memory callbacks: */ +static png_voidp PNGCBAPI +store_malloc(png_structp ppIn, png_alloc_size_t cb) +{ + png_const_structp pp = ppIn; + store_pool *pool = voidcast(store_pool*, png_get_mem_ptr(pp)); + store_memory *new = voidcast(store_memory*, malloc(cb + (sizeof *new) + + (sizeof pool->mark))); + + if (new != NULL) + { + if (cb > pool->max) + pool->max = cb; + + pool->current += cb; + + if (pool->current > pool->limit) + pool->limit = pool->current; + + pool->total += cb; + + new->size = cb; + memcpy(new->mark, pool->mark, sizeof new->mark); + memcpy((png_byte*)(new+1) + cb, pool->mark, sizeof pool->mark); + new->pool = pool; + new->next = pool->list; + pool->list = new; + ++new; + } + + else + { + /* NOTE: the PNG user malloc function cannot use the png_ptr it is passed + * other than to retrieve the allocation pointer! libpng calls the + * store_malloc callback in two basic cases: + * + * 1) From png_malloc; png_malloc will do a png_error itself if NULL is + * returned. + * 2) From png_struct or png_info structure creation; png_malloc is + * to return so cleanup can be performed. + * + * To handle this store_malloc can log a message, but can't do anything + * else. + */ + store_log(pool->store, pp, "out of memory", 1 /* is_error */); + } + + return new; +} + +static void PNGCBAPI +store_free(png_structp ppIn, png_voidp memory) +{ + png_const_structp pp = ppIn; + store_pool *pool = voidcast(store_pool*, png_get_mem_ptr(pp)); + store_memory *this = voidcast(store_memory*, memory), **test; + + /* Because libpng calls store_free with a dummy png_struct when deleting + * png_struct or png_info via png_destroy_struct_2 it is necessary to check + * the passed in png_structp to ensure it is valid, and not pass it to + * png_error if it is not. + */ + if (pp != pool->store->pread && pp != pool->store->pwrite) + pp = NULL; + + /* First check that this 'memory' really is valid memory - it must be in the + * pool list. If it is, use the shared memory_free function to free it. + */ + --this; + for (test = &pool->list; *test != this; test = &(*test)->next) + { + if (*test == NULL) + { + store_pool_error(pool->store, pp, "bad pointer to free"); + return; + } + } + + /* Unlink this entry, *test == this. */ + *test = this->next; + this->next = NULL; + store_memory_free(pp, pool, this); +} +#endif /* PNG_USER_MEM_SUPPORTED */ + +/* Setup functions. */ +/* Cleanup when aborting a write or after storing the new file. */ +static void +store_write_reset(png_store *ps) +{ + if (ps->pwrite != NULL) + { + anon_context(ps); + + Try + png_destroy_write_struct(&ps->pwrite, &ps->piwrite); + + Catch_anonymous + { + /* memory corruption: continue. */ + } + + ps->pwrite = NULL; + ps->piwrite = NULL; + } + + /* And make sure that all the memory has been freed - this will output + * spurious errors in the case of memory corruption above, but this is safe. + */ +# ifdef PNG_USER_MEM_SUPPORTED + store_pool_delete(ps, &ps->write_memory_pool); +# endif + + store_freenew(ps); +} + +/* The following is the main write function, it returns a png_struct and, + * optionally, a png_info suitable for writiing a new PNG file. Use + * store_storefile above to record this file after it has been written. The + * returned libpng structures as destroyed by store_write_reset above. + */ +static png_structp +set_store_for_write(png_store *ps, png_infopp ppi, const char *name) +{ + anon_context(ps); + + Try + { + if (ps->pwrite != NULL) + png_error(ps->pwrite, "write store already in use"); + + store_write_reset(ps); + safecat(ps->wname, sizeof ps->wname, 0, name); + + /* Don't do the slow memory checks if doing a speed test, also if user + * memory is not supported we can't do it anyway. + */ +# ifdef PNG_USER_MEM_SUPPORTED + if (!ps->speed) + ps->pwrite = png_create_write_struct_2(PNG_LIBPNG_VER_STRING, + ps, store_error, store_warning, &ps->write_memory_pool, + store_malloc, store_free); + + else +# endif + ps->pwrite = png_create_write_struct(PNG_LIBPNG_VER_STRING, + ps, store_error, store_warning); + + png_set_write_fn(ps->pwrite, ps, store_write, store_flush); + +# ifdef PNG_SET_OPTION_SUPPORTED + { + int opt; + for (opt=0; optnoptions; ++opt) + if (png_set_option(ps->pwrite, ps->options[opt].option, + ps->options[opt].setting) == PNG_OPTION_INVALID) + png_error(ps->pwrite, "png option invalid"); + } +# endif + + if (ppi != NULL) + *ppi = ps->piwrite = png_create_info_struct(ps->pwrite); + } + + Catch_anonymous + return NULL; + + return ps->pwrite; +} + +/* Cleanup when finished reading (either due to error or in the success case). + * This routine exists even when there is no read support to make the code + * tidier (avoid a mass of ifdefs) and so easier to maintain. + */ +static void +store_read_reset(png_store *ps) +{ +# ifdef PNG_READ_SUPPORTED + if (ps->pread != NULL) + { + anon_context(ps); + + Try + png_destroy_read_struct(&ps->pread, &ps->piread, NULL); + + Catch_anonymous + { + /* error already output: continue */ + } + + ps->pread = NULL; + ps->piread = NULL; + } +# endif + +# ifdef PNG_USER_MEM_SUPPORTED + /* Always do this to be safe. */ + store_pool_delete(ps, &ps->read_memory_pool); +# endif + + ps->current = NULL; + ps->next = NULL; + ps->readpos = 0; + ps->validated = 0; + + ps->chunkpos = 8; + ps->chunktype = 0; + ps->chunklen = 16; + ps->IDAT_size = 0; +} + +#ifdef PNG_READ_SUPPORTED +static void +store_read_set(png_store *ps, png_uint_32 id) +{ + png_store_file *pf = ps->saved; + + while (pf != NULL) + { + if (pf->id == id) + { + ps->current = pf; + ps->next = NULL; + ps->IDAT_size = pf->IDAT_size; + ps->IDAT_bits = pf->IDAT_bits; /* just a cache */ + ps->IDAT_len = 0; + ps->IDAT_pos = 0; + ps->IDAT_crc = 0UL; + store_read_buffer_next(ps); + return; + } + + pf = pf->next; + } + + { + size_t pos; + char msg[FILE_NAME_SIZE+64]; + + pos = standard_name_from_id(msg, sizeof msg, 0, id); + pos = safecat(msg, sizeof msg, pos, ": file not found"); + png_error(ps->pread, msg); + } +} + +/* The main interface for reading a saved file - pass the id number of the file + * to retrieve. Ids must be unique or the earlier file will be hidden. The API + * returns a png_struct and, optionally, a png_info. Both of these will be + * destroyed by store_read_reset above. + */ +static png_structp +set_store_for_read(png_store *ps, png_infopp ppi, png_uint_32 id, + const char *name) +{ + /* Set the name for png_error */ + safecat(ps->test, sizeof ps->test, 0, name); + + if (ps->pread != NULL) + png_error(ps->pread, "read store already in use"); + + store_read_reset(ps); + + /* Both the create APIs can return NULL if used in their default mode + * (because there is no other way of handling an error because the jmp_buf + * by default is stored in png_struct and that has not been allocated!) + * However, given that store_error works correctly in these circumstances + * we don't ever expect NULL in this program. + */ +# ifdef PNG_USER_MEM_SUPPORTED + if (!ps->speed) + ps->pread = png_create_read_struct_2(PNG_LIBPNG_VER_STRING, ps, + store_error, store_warning, &ps->read_memory_pool, store_malloc, + store_free); + + else +# endif + ps->pread = png_create_read_struct(PNG_LIBPNG_VER_STRING, ps, store_error, + store_warning); + + if (ps->pread == NULL) + { + struct exception_context *the_exception_context = &ps->exception_context; + + store_log(ps, NULL, "png_create_read_struct returned NULL (unexpected)", + 1 /*error*/); + + Throw ps; + } + +# ifdef PNG_SET_OPTION_SUPPORTED + { + int opt; + for (opt=0; optnoptions; ++opt) + if (png_set_option(ps->pread, ps->options[opt].option, + ps->options[opt].setting) == PNG_OPTION_INVALID) + png_error(ps->pread, "png option invalid"); + } +# endif + + store_read_set(ps, id); + + if (ppi != NULL) + *ppi = ps->piread = png_create_info_struct(ps->pread); + + return ps->pread; +} +#endif /* PNG_READ_SUPPORTED */ + +/* The overall cleanup of a store simply calls the above then removes all the + * saved files. This does not delete the store itself. + */ +static void +store_delete(png_store *ps) +{ + store_write_reset(ps); + store_read_reset(ps); + store_freefile(&ps->saved); + store_image_free(ps, NULL); +} + +/*********************** PNG FILE MODIFICATION ON READ ************************/ +/* Files may be modified on read. The following structure contains a complete + * png_store together with extra members to handle modification and a special + * read callback for libpng. To use this the 'modifications' field must be set + * to a list of png_modification structures that actually perform the + * modification, otherwise a png_modifier is functionally equivalent to a + * png_store. There is a special read function, set_modifier_for_read, which + * replaces set_store_for_read. + */ +typedef enum modifier_state +{ + modifier_start, /* Initial value */ + modifier_signature, /* Have a signature */ + modifier_IHDR /* Have an IHDR */ +} modifier_state; + +typedef struct CIE_color +{ + /* A single CIE tristimulus value, representing the unique response of a + * standard observer to a variety of light spectra. The observer recognizes + * all spectra that produce this response as the same color, therefore this + * is effectively a description of a color. + */ + double X, Y, Z; +} CIE_color; + +typedef struct color_encoding +{ + /* A description of an (R,G,B) encoding of color (as defined above); this + * includes the actual colors of the (R,G,B) triples (1,0,0), (0,1,0) and + * (0,0,1) plus an encoding value that is used to encode the linear + * components R, G and B to give the actual values R^gamma, G^gamma and + * B^gamma that are stored. + */ + double gamma; /* Encoding (file) gamma of space */ + CIE_color red, green, blue; /* End points */ +} color_encoding; + +#ifdef PNG_READ_SUPPORTED +#if defined PNG_READ_TRANSFORMS_SUPPORTED && defined PNG_READ_cHRM_SUPPORTED +static double +chromaticity_x(CIE_color c) +{ + return c.X / (c.X + c.Y + c.Z); +} + +static double +chromaticity_y(CIE_color c) +{ + return c.Y / (c.X + c.Y + c.Z); +} + +static CIE_color +white_point(const color_encoding *encoding) +{ + CIE_color white; + + white.X = encoding->red.X + encoding->green.X + encoding->blue.X; + white.Y = encoding->red.Y + encoding->green.Y + encoding->blue.Y; + white.Z = encoding->red.Z + encoding->green.Z + encoding->blue.Z; + + return white; +} +#endif /* READ_TRANSFORMS && READ_cHRM */ + +#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED +static void +normalize_color_encoding(color_encoding *encoding) +{ + const double whiteY = encoding->red.Y + encoding->green.Y + + encoding->blue.Y; + + if (whiteY != 1) + { + encoding->red.X /= whiteY; + encoding->red.Y /= whiteY; + encoding->red.Z /= whiteY; + encoding->green.X /= whiteY; + encoding->green.Y /= whiteY; + encoding->green.Z /= whiteY; + encoding->blue.X /= whiteY; + encoding->blue.Y /= whiteY; + encoding->blue.Z /= whiteY; + } +} +#endif + +#ifdef PNG_READ_TRANSFORMS_SUPPORTED +static size_t +safecat_color_encoding(char *buffer, size_t bufsize, size_t pos, + const color_encoding *e, double encoding_gamma) +{ + if (e != 0) + { + if (encoding_gamma != 0) + pos = safecat(buffer, bufsize, pos, "("); + pos = safecat(buffer, bufsize, pos, "R("); + pos = safecatd(buffer, bufsize, pos, e->red.X, 4); + pos = safecat(buffer, bufsize, pos, ","); + pos = safecatd(buffer, bufsize, pos, e->red.Y, 4); + pos = safecat(buffer, bufsize, pos, ","); + pos = safecatd(buffer, bufsize, pos, e->red.Z, 4); + pos = safecat(buffer, bufsize, pos, "),G("); + pos = safecatd(buffer, bufsize, pos, e->green.X, 4); + pos = safecat(buffer, bufsize, pos, ","); + pos = safecatd(buffer, bufsize, pos, e->green.Y, 4); + pos = safecat(buffer, bufsize, pos, ","); + pos = safecatd(buffer, bufsize, pos, e->green.Z, 4); + pos = safecat(buffer, bufsize, pos, "),B("); + pos = safecatd(buffer, bufsize, pos, e->blue.X, 4); + pos = safecat(buffer, bufsize, pos, ","); + pos = safecatd(buffer, bufsize, pos, e->blue.Y, 4); + pos = safecat(buffer, bufsize, pos, ","); + pos = safecatd(buffer, bufsize, pos, e->blue.Z, 4); + pos = safecat(buffer, bufsize, pos, ")"); + if (encoding_gamma != 0) + pos = safecat(buffer, bufsize, pos, ")"); + } + + if (encoding_gamma != 0) + { + pos = safecat(buffer, bufsize, pos, "^"); + pos = safecatd(buffer, bufsize, pos, encoding_gamma, 5); + } + + return pos; +} +#endif /* READ_TRANSFORMS */ +#endif /* PNG_READ_SUPPORTED */ + +typedef struct png_modifier +{ + png_store this; /* I am a png_store */ + struct png_modification *modifications; /* Changes to make */ + + modifier_state state; /* My state */ + + /* Information from IHDR: */ + png_byte bit_depth; /* From IHDR */ + png_byte colour_type; /* From IHDR */ + + /* While handling PLTE, IDAT and IEND these chunks may be pended to allow + * other chunks to be inserted. + */ + png_uint_32 pending_len; + png_uint_32 pending_chunk; + + /* Test values */ + double *gammas; + unsigned int ngammas; + unsigned int ngamma_tests; /* Number of gamma tests to run*/ + double current_gamma; /* 0 if not set */ + const color_encoding *encodings; + unsigned int nencodings; + const color_encoding *current_encoding; /* If an encoding has been set */ + unsigned int encoding_counter; /* For iteration */ + int encoding_ignored; /* Something overwrote it */ + + /* Control variables used to iterate through possible encodings, the + * following must be set to 0 and tested by the function that uses the + * png_modifier because the modifier only sets it to 1 (true.) + */ + unsigned int repeat :1; /* Repeat this transform test. */ + unsigned int test_uses_encoding :1; + + /* Lowest sbit to test (pre-1.7 libpng fails for sbit < 8) */ + png_byte sbitlow; + + /* Error control - these are the limits on errors accepted by the gamma tests + * below. + */ + double maxout8; /* Maximum output value error */ + double maxabs8; /* Absolute sample error 0..1 */ + double maxcalc8; /* Absolute sample error 0..1 */ + double maxpc8; /* Percentage sample error 0..100% */ + double maxout16; /* Maximum output value error */ + double maxabs16; /* Absolute sample error 0..1 */ + double maxcalc16;/* Absolute sample error 0..1 */ + double maxcalcG; /* Absolute sample error 0..1 */ + double maxpc16; /* Percentage sample error 0..100% */ + + /* This is set by transforms that need to allow a higher limit, it is an + * internal check on pngvalid to ensure that the calculated error limits are + * not ridiculous; without this it is too easy to make a mistake in pngvalid + * that allows any value through. + * + * NOTE: this is not checked in release builds. + */ + double limit; /* limit on error values, normally 4E-3 */ + + /* Log limits - values above this are logged, but not necessarily + * warned. + */ + double log8; /* Absolute error in 8 bits to log */ + double log16; /* Absolute error in 16 bits to log */ + + /* Logged 8 and 16 bit errors ('output' values): */ + double error_gray_2; + double error_gray_4; + double error_gray_8; + double error_gray_16; + double error_color_8; + double error_color_16; + double error_indexed; + + /* Flags: */ + /* Whether to call png_read_update_info, not png_read_start_image, and how + * many times to call it. + */ + int use_update_info; + + /* Whether or not to interlace. */ + int interlace_type :9; /* int, but must store '1' */ + + /* Run the standard tests? */ + unsigned int test_standard :1; + + /* Run the odd-sized image and interlace read/write tests? */ + unsigned int test_size :1; + + /* Run tests on reading with a combination of transforms, */ + unsigned int test_transform :1; + unsigned int test_tRNS :1; /* Includes tRNS images */ + + /* When to use the use_input_precision option, this controls the gamma + * validation code checks. If set any value that is within the transformed + * range input-.5 to input+.5 will be accepted, otherwise the value must be + * within the normal limits. It should not be necessary to set this; the + * result should always be exact within the permitted error limits. + */ + unsigned int use_input_precision :1; + unsigned int use_input_precision_sbit :1; + unsigned int use_input_precision_16to8 :1; + + /* If set assume that the calculation bit depth is set by the input + * precision, not the output precision. + */ + unsigned int calculations_use_input_precision :1; + + /* If set assume that the calculations are done in 16 bits even if the sample + * depth is 8 bits. + */ + unsigned int assume_16_bit_calculations :1; + + /* Which gamma tests to run: */ + unsigned int test_gamma_threshold :1; + unsigned int test_gamma_transform :1; /* main tests */ + unsigned int test_gamma_sbit :1; + unsigned int test_gamma_scale16 :1; + unsigned int test_gamma_background :1; + unsigned int test_gamma_alpha_mode :1; + unsigned int test_gamma_expand16 :1; + unsigned int test_exhaustive :1; + + /* Whether or not to run the low-bit-depth grayscale tests. This fails on + * gamma images in some cases because of gross inaccuracies in the grayscale + * gamma handling for low bit depth. + */ + unsigned int test_lbg :1; + unsigned int test_lbg_gamma_threshold :1; + unsigned int test_lbg_gamma_transform :1; + unsigned int test_lbg_gamma_sbit :1; + unsigned int test_lbg_gamma_composition :1; + + unsigned int log :1; /* Log max error */ + + /* Buffer information, the buffer size limits the size of the chunks that can + * be modified - they must fit (including header and CRC) into the buffer! + */ + size_t flush; /* Count of bytes to flush */ + size_t buffer_count; /* Bytes in buffer */ + size_t buffer_position; /* Position in buffer */ + png_byte buffer[1024]; +} png_modifier; + +/* This returns true if the test should be stopped now because it has already + * failed and it is running silently. + */ +static int fail(png_modifier *pm) +{ + return !pm->log && !pm->this.verbose && (pm->this.nerrors > 0 || + (pm->this.treat_warnings_as_errors && pm->this.nwarnings > 0)); +} + +static void +modifier_init(png_modifier *pm) +{ + memset(pm, 0, sizeof *pm); + store_init(&pm->this); + pm->modifications = NULL; + pm->state = modifier_start; + pm->sbitlow = 1U; + pm->ngammas = 0; + pm->ngamma_tests = 0; + pm->gammas = 0; + pm->current_gamma = 0; + pm->encodings = 0; + pm->nencodings = 0; + pm->current_encoding = 0; + pm->encoding_counter = 0; + pm->encoding_ignored = 0; + pm->repeat = 0; + pm->test_uses_encoding = 0; + pm->maxout8 = pm->maxpc8 = pm->maxabs8 = pm->maxcalc8 = 0; + pm->maxout16 = pm->maxpc16 = pm->maxabs16 = pm->maxcalc16 = 0; + pm->maxcalcG = 0; + pm->limit = 4E-3; + pm->log8 = pm->log16 = 0; /* Means 'off' */ + pm->error_gray_2 = pm->error_gray_4 = pm->error_gray_8 = 0; + pm->error_gray_16 = pm->error_color_8 = pm->error_color_16 = 0; + pm->error_indexed = 0; + pm->use_update_info = 0; + pm->interlace_type = PNG_INTERLACE_NONE; + pm->test_standard = 0; + pm->test_size = 0; + pm->test_transform = 0; +# ifdef PNG_WRITE_tRNS_SUPPORTED + pm->test_tRNS = 1; +# else + pm->test_tRNS = 0; +# endif + pm->use_input_precision = 0; + pm->use_input_precision_sbit = 0; + pm->use_input_precision_16to8 = 0; + pm->calculations_use_input_precision = 0; + pm->assume_16_bit_calculations = 0; + pm->test_gamma_threshold = 0; + pm->test_gamma_transform = 0; + pm->test_gamma_sbit = 0; + pm->test_gamma_scale16 = 0; + pm->test_gamma_background = 0; + pm->test_gamma_alpha_mode = 0; + pm->test_gamma_expand16 = 0; + pm->test_lbg = 1; + pm->test_lbg_gamma_threshold = 1; + pm->test_lbg_gamma_transform = 1; + pm->test_lbg_gamma_sbit = 1; + pm->test_lbg_gamma_composition = 1; + pm->test_exhaustive = 0; + pm->log = 0; + + /* Rely on the memset for all the other fields - there are no pointers */ +} + +#ifdef PNG_READ_TRANSFORMS_SUPPORTED + +/* This controls use of checks that explicitly know how libpng digitizes the + * samples in calculations; setting this circumvents simple error limit checking + * in the rgb_to_gray check, replacing it with an exact copy of the libpng 1.5 + * algorithm. + */ +#define DIGITIZE PNG_LIBPNG_VER < 10700 + +/* If pm->calculations_use_input_precision is set then operations will happen + * with the precision of the input, not the precision of the output depth. + * + * If pm->assume_16_bit_calculations is set then even 8 bit calculations use 16 + * bit precision. This only affects those of the following limits that pertain + * to a calculation - not a digitization operation - unless the following API is + * called directly. + */ +#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED +#if DIGITIZE +static double digitize(double value, int depth, int do_round) +{ + /* 'value' is in the range 0 to 1, the result is the same value rounded to a + * multiple of the digitization factor - 8 or 16 bits depending on both the + * sample depth and the 'assume' setting. Digitization is normally by + * rounding and 'do_round' should be 1, if it is 0 the digitized value will + * be truncated. + */ + unsigned int digitization_factor = (1U << depth) - 1; + + /* Limiting the range is done as a convenience to the caller - it's easier to + * do it once here than every time at the call site. + */ + if (value <= 0) + value = 0; + + else if (value >= 1) + value = 1; + + value *= digitization_factor; + if (do_round) value += .5; + return floor(value)/digitization_factor; +} +#endif +#endif /* RGB_TO_GRAY */ + +#ifdef PNG_READ_GAMMA_SUPPORTED +static double abserr(const png_modifier *pm, int in_depth, int out_depth) +{ + /* Absolute error permitted in linear values - affected by the bit depth of + * the calculations. + */ + if (pm->assume_16_bit_calculations || + (pm->calculations_use_input_precision ? in_depth : out_depth) == 16) + return pm->maxabs16; + else + return pm->maxabs8; +} + +static double calcerr(const png_modifier *pm, int in_depth, int out_depth) +{ + /* Error in the linear composition arithmetic - only relevant when + * composition actually happens (0 < alpha < 1). + */ + if ((pm->calculations_use_input_precision ? in_depth : out_depth) == 16) + return pm->maxcalc16; + else if (pm->assume_16_bit_calculations) + return pm->maxcalcG; + else + return pm->maxcalc8; +} + +static double pcerr(const png_modifier *pm, int in_depth, int out_depth) +{ + /* Percentage error permitted in the linear values. Note that the specified + * value is a percentage but this routine returns a simple number. + */ + if (pm->assume_16_bit_calculations || + (pm->calculations_use_input_precision ? in_depth : out_depth) == 16) + return pm->maxpc16 * .01; + else + return pm->maxpc8 * .01; +} + +/* Output error - the error in the encoded value. This is determined by the + * digitization of the output so can be +/-0.5 in the actual output value. In + * the expand_16 case with the current code in libpng the expand happens after + * all the calculations are done in 8 bit arithmetic, so even though the output + * depth is 16 the output error is determined by the 8 bit calculation. + * + * This limit is not determined by the bit depth of internal calculations. + * + * The specified parameter does *not* include the base .5 digitization error but + * it is added here. + */ +static double outerr(const png_modifier *pm, int in_depth, int out_depth) +{ + /* There is a serious error in the 2 and 4 bit grayscale transform because + * the gamma table value (8 bits) is simply shifted, not rounded, so the + * error in 4 bit grayscale gamma is up to the value below. This is a hack + * to allow pngvalid to succeed: + * + * TODO: fix this in libpng + */ + if (out_depth == 2) + return .73182-.5; + + if (out_depth == 4) + return .90644-.5; + + if ((pm->calculations_use_input_precision ? in_depth : out_depth) == 16) + return pm->maxout16; + + /* This is the case where the value was calculated at 8-bit precision then + * scaled to 16 bits. + */ + else if (out_depth == 16) + return pm->maxout8 * 257; + + else + return pm->maxout8; +} + +/* This does the same thing as the above however it returns the value to log, + * rather than raising a warning. This is useful for debugging to track down + * exactly what set of parameters cause high error values. + */ +static double outlog(const png_modifier *pm, int in_depth, int out_depth) +{ + /* The command line parameters are either 8 bit (0..255) or 16 bit (0..65535) + * and so must be adjusted for low bit depth grayscale: + */ + if (out_depth <= 8) + { + if (pm->log8 == 0) /* switched off */ + return 256; + + if (out_depth < 8) + return pm->log8 / 255 * ((1<log8; + } + + if ((pm->calculations_use_input_precision ? in_depth : out_depth) == 16) + { + if (pm->log16 == 0) + return 65536; + + return pm->log16; + } + + /* This is the case where the value was calculated at 8-bit precision then + * scaled to 16 bits. + */ + if (pm->log8 == 0) + return 65536; + + return pm->log8 * 257; +} + +/* This complements the above by providing the appropriate quantization for the + * final value. Normally this would just be quantization to an integral value, + * but in the 8 bit calculation case it's actually quantization to a multiple of + * 257! + */ +static int output_quantization_factor(const png_modifier *pm, int in_depth, + int out_depth) +{ + if (out_depth == 16 && in_depth != 16 && + pm->calculations_use_input_precision) + return 257; + else + return 1; +} +#endif /* PNG_READ_GAMMA_SUPPORTED */ + +/* One modification structure must be provided for each chunk to be modified (in + * fact more than one can be provided if multiple separate changes are desired + * for a single chunk.) Modifications include adding a new chunk when a + * suitable chunk does not exist. + * + * The caller of modify_fn will reset the CRC of the chunk and record 'modified' + * or 'added' as appropriate if the modify_fn returns 1 (true). If the + * modify_fn is NULL the chunk is simply removed. + */ +typedef struct png_modification +{ + struct png_modification *next; + png_uint_32 chunk; + + /* If the following is NULL all matching chunks will be removed: */ + int (*modify_fn)(struct png_modifier *pm, + struct png_modification *me, int add); + + /* If the following is set to PLTE, IDAT or IEND and the chunk has not been + * found and modified (and there is a modify_fn) the modify_fn will be called + * to add the chunk before the relevant chunk. + */ + png_uint_32 add; + unsigned int modified :1; /* Chunk was modified */ + unsigned int added :1; /* Chunk was added */ + unsigned int removed :1; /* Chunk was removed */ +} png_modification; + +static void +modification_reset(png_modification *pmm) +{ + if (pmm != NULL) + { + pmm->modified = 0; + pmm->added = 0; + pmm->removed = 0; + modification_reset(pmm->next); + } +} + +static void +modification_init(png_modification *pmm) +{ + memset(pmm, 0, sizeof *pmm); + pmm->next = NULL; + pmm->chunk = 0; + pmm->modify_fn = NULL; + pmm->add = 0; + modification_reset(pmm); +} + +#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED +static void +modifier_current_encoding(const png_modifier *pm, color_encoding *ce) +{ + if (pm->current_encoding != 0) + *ce = *pm->current_encoding; + + else + memset(ce, 0, sizeof *ce); + + ce->gamma = pm->current_gamma; +} +#endif + +#ifdef PNG_READ_TRANSFORMS_SUPPORTED +static size_t +safecat_current_encoding(char *buffer, size_t bufsize, size_t pos, + const png_modifier *pm) +{ + pos = safecat_color_encoding(buffer, bufsize, pos, pm->current_encoding, + pm->current_gamma); + + if (pm->encoding_ignored) + pos = safecat(buffer, bufsize, pos, "[overridden]"); + + return pos; +} +#endif + +/* Iterate through the usefully testable color encodings. An encoding is one + * of: + * + * 1) Nothing (no color space, no gamma). + * 2) Just a gamma value from the gamma array (including 1.0) + * 3) A color space from the encodings array with the corresponding gamma. + * 4) The same, but with gamma 1.0 (only really useful with 16 bit calculations) + * + * The iterator selects these in turn, the randomizer selects one at random, + * which is used depends on the setting of the 'test_exhaustive' flag. Notice + * that this function changes the colour space encoding so it must only be + * called on completion of the previous test. This is what 'modifier_reset' + * does, below. + * + * After the function has been called the 'repeat' flag will still be set; the + * caller of modifier_reset must reset it at the start of each run of the test! + */ +static unsigned int +modifier_total_encodings(const png_modifier *pm) +{ + return 1 + /* (1) nothing */ + pm->ngammas + /* (2) gamma values to test */ + pm->nencodings + /* (3) total number of encodings */ + /* The following test only works after the first time through the + * png_modifier code because 'bit_depth' is set when the IHDR is read. + * modifier_reset, below, preserves the setting until after it has called + * the iterate function (also below.) + * + * For this reason do not rely on this function outside a call to + * modifier_reset. + */ + ((pm->bit_depth == 16 || pm->assume_16_bit_calculations) ? + pm->nencodings : 0); /* (4) encodings with gamma == 1.0 */ +} + +static void +modifier_encoding_iterate(png_modifier *pm) +{ + if (!pm->repeat && /* Else something needs the current encoding again. */ + pm->test_uses_encoding) /* Some transform is encoding dependent */ + { + if (pm->test_exhaustive) + { + if (++pm->encoding_counter >= modifier_total_encodings(pm)) + pm->encoding_counter = 0; /* This will stop the repeat */ + } + + else + { + /* Not exhaustive - choose an encoding at random; generate a number in + * the range 1..(max-1), so the result is always non-zero: + */ + if (pm->encoding_counter == 0) + pm->encoding_counter = random_mod(modifier_total_encodings(pm)-1)+1; + else + pm->encoding_counter = 0; + } + + if (pm->encoding_counter > 0) + pm->repeat = 1; + } + + else if (!pm->repeat) + pm->encoding_counter = 0; +} + +static void +modifier_reset(png_modifier *pm) +{ + store_read_reset(&pm->this); + pm->limit = 4E-3; + pm->pending_len = pm->pending_chunk = 0; + pm->flush = pm->buffer_count = pm->buffer_position = 0; + pm->modifications = NULL; + pm->state = modifier_start; + modifier_encoding_iterate(pm); + /* The following must be set in the next run. In particular + * test_uses_encodings must be set in the _ini function of each transform + * that looks at the encodings. (Not the 'add' function!) + */ + pm->test_uses_encoding = 0; + pm->current_gamma = 0; + pm->current_encoding = 0; + pm->encoding_ignored = 0; + /* These only become value after IHDR is read: */ + pm->bit_depth = pm->colour_type = 0; +} + +/* The following must be called before anything else to get the encoding set up + * on the modifier. In particular it must be called before the transform init + * functions are called. + */ +static void +modifier_set_encoding(png_modifier *pm) +{ + /* Set the encoding to the one specified by the current encoding counter, + * first clear out all the settings - this corresponds to an encoding_counter + * of 0. + */ + pm->current_gamma = 0; + pm->current_encoding = 0; + pm->encoding_ignored = 0; /* not ignored yet - happens in _ini functions. */ + + /* Now, if required, set the gamma and encoding fields. */ + if (pm->encoding_counter > 0) + { + /* The gammas[] array is an array of screen gammas, not encoding gammas, + * so we need the inverse: + */ + if (pm->encoding_counter <= pm->ngammas) + pm->current_gamma = 1/pm->gammas[pm->encoding_counter-1]; + + else + { + unsigned int i = pm->encoding_counter - pm->ngammas; + + if (i >= pm->nencodings) + { + i %= pm->nencodings; + pm->current_gamma = 1; /* Linear, only in the 16 bit case */ + } + + else + pm->current_gamma = pm->encodings[i].gamma; + + pm->current_encoding = pm->encodings + i; + } + } +} + +/* Enquiry functions to find out what is set. Notice that there is an implicit + * assumption below that the first encoding in the list is the one for sRGB. + */ +static int +modifier_color_encoding_is_sRGB(const png_modifier *pm) +{ + return pm->current_encoding != 0 && pm->current_encoding == pm->encodings && + pm->current_encoding->gamma == pm->current_gamma; +} + +static int +modifier_color_encoding_is_set(const png_modifier *pm) +{ + return pm->current_gamma != 0; +} + +/* The guts of modification are performed during a read. */ +static void +modifier_crc(png_bytep buffer) +{ + /* Recalculate the chunk CRC - a complete chunk must be in + * the buffer, at the start. + */ + uInt datalen = png_get_uint_32(buffer); + uLong crc = crc32(0, buffer+4, datalen+4); + /* The cast to png_uint_32 is safe because a crc32 is always a 32 bit value. + */ + png_save_uint_32(buffer+datalen+8, (png_uint_32)crc); +} + +static void +modifier_setbuffer(png_modifier *pm) +{ + modifier_crc(pm->buffer); + pm->buffer_count = png_get_uint_32(pm->buffer)+12; + pm->buffer_position = 0; +} + +/* Separate the callback into the actual implementation (which is passed the + * png_modifier explicitly) and the callback, which gets the modifier from the + * png_struct. + */ +static void +modifier_read_imp(png_modifier *pm, png_bytep pb, size_t st) +{ + while (st > 0) + { + size_t cb; + png_uint_32 len, chunk; + png_modification *mod; + + if (pm->buffer_position >= pm->buffer_count) switch (pm->state) + { + static png_byte sign[8] = { 137, 80, 78, 71, 13, 10, 26, 10 }; + case modifier_start: + store_read_chunk(&pm->this, pm->buffer, 8, 8); /* signature. */ + pm->buffer_count = 8; + pm->buffer_position = 0; + + if (memcmp(pm->buffer, sign, 8) != 0) + png_error(pm->this.pread, "invalid PNG file signature"); + pm->state = modifier_signature; + break; + + case modifier_signature: + store_read_chunk(&pm->this, pm->buffer, 13+12, 13+12); /* IHDR */ + pm->buffer_count = 13+12; + pm->buffer_position = 0; + + if (png_get_uint_32(pm->buffer) != 13 || + png_get_uint_32(pm->buffer+4) != CHUNK_IHDR) + png_error(pm->this.pread, "invalid IHDR"); + + /* Check the list of modifiers for modifications to the IHDR. */ + mod = pm->modifications; + while (mod != NULL) + { + if (mod->chunk == CHUNK_IHDR && mod->modify_fn && + (*mod->modify_fn)(pm, mod, 0)) + { + mod->modified = 1; + modifier_setbuffer(pm); + } + + /* Ignore removal or add if IHDR! */ + mod = mod->next; + } + + /* Cache information from the IHDR (the modified one.) */ + pm->bit_depth = pm->buffer[8+8]; + pm->colour_type = pm->buffer[8+8+1]; + + pm->state = modifier_IHDR; + pm->flush = 0; + break; + + case modifier_IHDR: + default: + /* Read a new chunk and process it until we see PLTE, IDAT or + * IEND. 'flush' indicates that there is still some data to + * output from the preceding chunk. + */ + if ((cb = pm->flush) > 0) + { + if (cb > st) cb = st; + pm->flush -= cb; + store_read_chunk(&pm->this, pb, cb, cb); + pb += cb; + st -= cb; + if (st == 0) return; + } + + /* No more bytes to flush, read a header, or handle a pending + * chunk. + */ + if (pm->pending_chunk != 0) + { + png_save_uint_32(pm->buffer, pm->pending_len); + png_save_uint_32(pm->buffer+4, pm->pending_chunk); + pm->pending_len = 0; + pm->pending_chunk = 0; + } + else + store_read_chunk(&pm->this, pm->buffer, 8, 8); + + pm->buffer_count = 8; + pm->buffer_position = 0; + + /* Check for something to modify or a terminator chunk. */ + len = png_get_uint_32(pm->buffer); + chunk = png_get_uint_32(pm->buffer+4); + + /* Terminators first, they may have to be delayed for added + * chunks + */ + if (chunk == CHUNK_PLTE || chunk == CHUNK_IDAT || + chunk == CHUNK_IEND) + { + mod = pm->modifications; + + while (mod != NULL) + { + if ((mod->add == chunk || + (mod->add == CHUNK_PLTE && chunk == CHUNK_IDAT)) && + mod->modify_fn != NULL && !mod->modified && !mod->added) + { + /* Regardless of what the modify function does do not run + * this again. + */ + mod->added = 1; + + if ((*mod->modify_fn)(pm, mod, 1 /*add*/)) + { + /* Reset the CRC on a new chunk */ + if (pm->buffer_count > 0) + modifier_setbuffer(pm); + + else + { + pm->buffer_position = 0; + mod->removed = 1; + } + + /* The buffer has been filled with something (we assume) + * so output this. Pend the current chunk. + */ + pm->pending_len = len; + pm->pending_chunk = chunk; + break; /* out of while */ + } + } + + mod = mod->next; + } + + /* Don't do any further processing if the buffer was modified - + * otherwise the code will end up modifying a chunk that was + * just added. + */ + if (mod != NULL) + break; /* out of switch */ + } + + /* If we get to here then this chunk may need to be modified. To + * do this it must be less than 1024 bytes in total size, otherwise + * it just gets flushed. + */ + if (len+12 <= sizeof pm->buffer) + { + size_t s = len+12-pm->buffer_count; + store_read_chunk(&pm->this, pm->buffer+pm->buffer_count, s, s); + pm->buffer_count = len+12; + + /* Check for a modification, else leave it be. */ + mod = pm->modifications; + while (mod != NULL) + { + if (mod->chunk == chunk) + { + if (mod->modify_fn == NULL) + { + /* Remove this chunk */ + pm->buffer_count = pm->buffer_position = 0; + mod->removed = 1; + break; /* Terminate the while loop */ + } + + else if ((*mod->modify_fn)(pm, mod, 0)) + { + mod->modified = 1; + /* The chunk may have been removed: */ + if (pm->buffer_count == 0) + { + pm->buffer_position = 0; + break; + } + modifier_setbuffer(pm); + } + } + + mod = mod->next; + } + } + + else + pm->flush = len+12 - pm->buffer_count; /* data + crc */ + + /* Take the data from the buffer (if there is any). */ + break; + } + + /* Here to read from the modifier buffer (not directly from + * the store, as in the flush case above.) + */ + cb = pm->buffer_count - pm->buffer_position; + + if (cb > st) + cb = st; + + memcpy(pb, pm->buffer + pm->buffer_position, cb); + st -= cb; + pb += cb; + pm->buffer_position += cb; + } +} + +/* The callback: */ +static void PNGCBAPI +modifier_read(png_structp ppIn, png_bytep pb, size_t st) +{ + png_const_structp pp = ppIn; + png_modifier *pm = voidcast(png_modifier*, png_get_io_ptr(pp)); + + if (pm == NULL || pm->this.pread != pp) + png_error(pp, "bad modifier_read call"); + + modifier_read_imp(pm, pb, st); +} + +/* Like store_progressive_read but the data is getting changed as we go so we + * need a local buffer. + */ +static void +modifier_progressive_read(png_modifier *pm, png_structp pp, png_infop pi) +{ + if (pm->this.pread != pp || pm->this.current == NULL || + pm->this.next == NULL) + png_error(pp, "store state damaged (progressive)"); + + /* This is another Horowitz and Hill random noise generator. In this case + * the aim is to stress the progressive reader with truly horrible variable + * buffer sizes in the range 1..500, so a sequence of 9 bit random numbers + * is generated. We could probably just count from 1 to 32767 and get as + * good a result. + */ + for (;;) + { + static png_uint_32 noise = 1; + size_t cb, cbAvail; + png_byte buffer[512]; + + /* Generate 15 more bits of stuff: */ + noise = (noise << 9) | ((noise ^ (noise >> (9-5))) & 0x1ff); + cb = noise & 0x1ff; + + /* Check that this number of bytes are available (in the current buffer.) + * (This doesn't quite work - the modifier might delete a chunk; unlikely + * but possible, it doesn't happen at present because the modifier only + * adds chunks to standard images.) + */ + cbAvail = store_read_buffer_avail(&pm->this); + if (pm->buffer_count > pm->buffer_position) + cbAvail += pm->buffer_count - pm->buffer_position; + + if (cb > cbAvail) + { + /* Check for EOF: */ + if (cbAvail == 0) + break; + + cb = cbAvail; + } + + modifier_read_imp(pm, buffer, cb); + png_process_data(pp, pi, buffer, cb); + } + + /* Check the invariants at the end (if this fails it's a problem in this + * file!) + */ + if (pm->buffer_count > pm->buffer_position || + pm->this.next != &pm->this.current->data || + pm->this.readpos < pm->this.current->datacount) + png_error(pp, "progressive read implementation error"); +} + +/* Set up a modifier. */ +static png_structp +set_modifier_for_read(png_modifier *pm, png_infopp ppi, png_uint_32 id, + const char *name) +{ + /* Do this first so that the modifier fields are cleared even if an error + * happens allocating the png_struct. No allocation is done here so no + * cleanup is required. + */ + pm->state = modifier_start; + pm->bit_depth = 0; + pm->colour_type = 255; + + pm->pending_len = 0; + pm->pending_chunk = 0; + pm->flush = 0; + pm->buffer_count = 0; + pm->buffer_position = 0; + + return set_store_for_read(&pm->this, ppi, id, name); +} + + +/******************************** MODIFICATIONS *******************************/ +/* Standard modifications to add chunks. These do not require the _SUPPORTED + * macros because the chunks can be there regardless of whether this specific + * libpng supports them. + */ +typedef struct gama_modification +{ + png_modification this; + png_fixed_point gamma; +} gama_modification; + +static int +gama_modify(png_modifier *pm, png_modification *me, int add) +{ + UNUSED(add) + /* This simply dumps the given gamma value into the buffer. */ + png_save_uint_32(pm->buffer, 4); + png_save_uint_32(pm->buffer+4, CHUNK_gAMA); + png_save_uint_32(pm->buffer+8, ((gama_modification*)me)->gamma); + return 1; +} + +static void +gama_modification_init(gama_modification *me, png_modifier *pm, double gammad) +{ + double g; + + modification_init(&me->this); + me->this.chunk = CHUNK_gAMA; + me->this.modify_fn = gama_modify; + me->this.add = CHUNK_PLTE; + g = fix(gammad); + me->gamma = (png_fixed_point)g; + me->this.next = pm->modifications; + pm->modifications = &me->this; +} + +typedef struct chrm_modification +{ + png_modification this; + const color_encoding *encoding; + png_fixed_point wx, wy, rx, ry, gx, gy, bx, by; +} chrm_modification; + +static int +chrm_modify(png_modifier *pm, png_modification *me, int add) +{ + UNUSED(add) + /* As with gAMA this just adds the required cHRM chunk to the buffer. */ + png_save_uint_32(pm->buffer , 32); + png_save_uint_32(pm->buffer+ 4, CHUNK_cHRM); + png_save_uint_32(pm->buffer+ 8, ((chrm_modification*)me)->wx); + png_save_uint_32(pm->buffer+12, ((chrm_modification*)me)->wy); + png_save_uint_32(pm->buffer+16, ((chrm_modification*)me)->rx); + png_save_uint_32(pm->buffer+20, ((chrm_modification*)me)->ry); + png_save_uint_32(pm->buffer+24, ((chrm_modification*)me)->gx); + png_save_uint_32(pm->buffer+28, ((chrm_modification*)me)->gy); + png_save_uint_32(pm->buffer+32, ((chrm_modification*)me)->bx); + png_save_uint_32(pm->buffer+36, ((chrm_modification*)me)->by); + return 1; +} + +static void +chrm_modification_init(chrm_modification *me, png_modifier *pm, + const color_encoding *encoding) +{ + CIE_color white = white_point(encoding); + + /* Original end points: */ + me->encoding = encoding; + + /* Chromaticities (in fixed point): */ + me->wx = fix(chromaticity_x(white)); + me->wy = fix(chromaticity_y(white)); + + me->rx = fix(chromaticity_x(encoding->red)); + me->ry = fix(chromaticity_y(encoding->red)); + me->gx = fix(chromaticity_x(encoding->green)); + me->gy = fix(chromaticity_y(encoding->green)); + me->bx = fix(chromaticity_x(encoding->blue)); + me->by = fix(chromaticity_y(encoding->blue)); + + modification_init(&me->this); + me->this.chunk = CHUNK_cHRM; + me->this.modify_fn = chrm_modify; + me->this.add = CHUNK_PLTE; + me->this.next = pm->modifications; + pm->modifications = &me->this; +} + +typedef struct srgb_modification +{ + png_modification this; + png_byte intent; +} srgb_modification; + +static int +srgb_modify(png_modifier *pm, png_modification *me, int add) +{ + UNUSED(add) + /* As above, ignore add and just make a new chunk */ + png_save_uint_32(pm->buffer, 1); + png_save_uint_32(pm->buffer+4, CHUNK_sRGB); + pm->buffer[8] = ((srgb_modification*)me)->intent; + return 1; +} + +static void +srgb_modification_init(srgb_modification *me, png_modifier *pm, png_byte intent) +{ + modification_init(&me->this); + me->this.chunk = CHUNK_sBIT; + + if (intent <= 3) /* if valid, else *delete* sRGB chunks */ + { + me->this.modify_fn = srgb_modify; + me->this.add = CHUNK_PLTE; + me->intent = intent; + } + + else + { + me->this.modify_fn = 0; + me->this.add = 0; + me->intent = 0; + } + + me->this.next = pm->modifications; + pm->modifications = &me->this; +} + +#ifdef PNG_READ_GAMMA_SUPPORTED +typedef struct sbit_modification +{ + png_modification this; + png_byte sbit; +} sbit_modification; + +static int +sbit_modify(png_modifier *pm, png_modification *me, int add) +{ + png_byte sbit = ((sbit_modification*)me)->sbit; + if (pm->bit_depth > sbit) + { + int cb = 0; + switch (pm->colour_type) + { + case 0: + cb = 1; + break; + + case 2: + case 3: + cb = 3; + break; + + case 4: + cb = 2; + break; + + case 6: + cb = 4; + break; + + default: + png_error(pm->this.pread, + "unexpected colour type in sBIT modification"); + } + + png_save_uint_32(pm->buffer, cb); + png_save_uint_32(pm->buffer+4, CHUNK_sBIT); + + while (cb > 0) + (pm->buffer+8)[--cb] = sbit; + + return 1; + } + else if (!add) + { + /* Remove the sBIT chunk */ + pm->buffer_count = pm->buffer_position = 0; + return 1; + } + else + return 0; /* do nothing */ +} + +static void +sbit_modification_init(sbit_modification *me, png_modifier *pm, png_byte sbit) +{ + modification_init(&me->this); + me->this.chunk = CHUNK_sBIT; + me->this.modify_fn = sbit_modify; + me->this.add = CHUNK_PLTE; + me->sbit = sbit; + me->this.next = pm->modifications; + pm->modifications = &me->this; +} +#endif /* PNG_READ_GAMMA_SUPPORTED */ +#endif /* PNG_READ_TRANSFORMS_SUPPORTED */ + +/***************************** STANDARD PNG FILES *****************************/ +/* Standard files - write and save standard files. */ +/* There are two basic forms of standard images. Those which attempt to have + * all the possible pixel values (not possible for 16bpp images, but a range of + * values are produced) and those which have a range of image sizes. The former + * are used for testing transforms, in particular gamma correction and bit + * reduction and increase. The latter are reserved for testing the behavior of + * libpng with respect to 'odd' image sizes - particularly small images where + * rows become 1 byte and interlace passes disappear. + * + * The first, most useful, set are the 'transform' images, the second set of + * small images are the 'size' images. + * + * The transform files are constructed with rows which fit into a 1024 byte row + * buffer. This makes allocation easier below. Further regardless of the file + * format every row has 128 pixels (giving 1024 bytes for 64bpp formats). + * + * Files are stored with no gAMA or sBIT chunks, with a PLTE only when needed + * and with an ID derived from the colour type, bit depth and interlace type + * as above (FILEID). The width (128) and height (variable) are not stored in + * the FILEID - instead the fields are set to 0, indicating a transform file. + * + * The size files ar constructed with rows a maximum of 128 bytes wide, allowing + * a maximum width of 16 pixels (for the 64bpp case.) They also have a maximum + * height of 16 rows. The width and height are stored in the FILEID and, being + * non-zero, indicate a size file. + * + * Because the PNG filter code is typically the largest CPU consumer within + * libpng itself there is a tendency to attempt to optimize it. This results in + * special case code which needs to be validated. To cause this to happen the + * 'size' images are made to use each possible filter, in so far as this is + * possible for smaller images. + * + * For palette image (colour type 3) multiple transform images are stored with + * the same bit depth to allow testing of more colour combinations - + * particularly important for testing the gamma code because libpng uses a + * different code path for palette images. For size images a single palette is + * used. + */ + +/* Make a 'standard' palette. Because there are only 256 entries in a palette + * (maximum) this actually makes a random palette in the hope that enough tests + * will catch enough errors. (Note that the same palette isn't produced every + * time for the same test - it depends on what previous tests have been run - + * but a given set of arguments to pngvalid will always produce the same palette + * at the same test! This is why pseudo-random number generators are useful for + * testing.) + * + * The store must be open for write when this is called, otherwise an internal + * error will occur. This routine contains its own magic number seed, so the + * palettes generated don't change if there are intervening errors (changing the + * calls to the store_mark seed.) + */ +static store_palette_entry * +make_standard_palette(png_store* ps, int npalette, int do_tRNS) +{ + static png_uint_32 palette_seed[2] = { 0x87654321, 9 }; + + int i = 0; + png_byte values[256][4]; + + /* Always put in black and white plus the six primary and secondary colors. + */ + for (; i<8; ++i) + { + values[i][1] = (png_byte)((i&1) ? 255U : 0U); + values[i][2] = (png_byte)((i&2) ? 255U : 0U); + values[i][3] = (png_byte)((i&4) ? 255U : 0U); + } + + /* Then add 62 grays (one quarter of the remaining 256 slots). */ + { + int j = 0; + png_byte random_bytes[4]; + png_byte need[256]; + + need[0] = 0; /*got black*/ + memset(need+1, 1, (sizeof need)-2); /*need these*/ + need[255] = 0; /*but not white*/ + + while (i<70) + { + png_byte b; + + if (j==0) + { + make_four_random_bytes(palette_seed, random_bytes); + j = 4; + } + + b = random_bytes[--j]; + if (need[b]) + { + values[i][1] = b; + values[i][2] = b; + values[i++][3] = b; + } + } + } + + /* Finally add 192 colors at random - don't worry about matches to things we + * already have, chance is less than 1/65536. Don't worry about grays, + * chance is the same, so we get a duplicate or extra gray less than 1 time + * in 170. + */ + for (; i<256; ++i) + make_four_random_bytes(palette_seed, values[i]); + + /* Fill in the alpha values in the first byte. Just use all possible values + * (0..255) in an apparently random order: + */ + { + store_palette_entry *palette; + png_byte selector[4]; + + make_four_random_bytes(palette_seed, selector); + + if (do_tRNS) + for (i=0; i<256; ++i) + values[i][0] = (png_byte)(i ^ selector[0]); + + else + for (i=0; i<256; ++i) + values[i][0] = 255; /* no transparency/tRNS chunk */ + + /* 'values' contains 256 ARGB values, but we only need 'npalette'. + * 'npalette' will always be a power of 2: 2, 4, 16 or 256. In the low + * bit depth cases select colors at random, else it is difficult to have + * a set of low bit depth palette test with any chance of a reasonable + * range of colors. Do this by randomly permuting values into the low + * 'npalette' entries using an XOR mask generated here. This also + * permutes the npalette == 256 case in a potentially useful way (there is + * no relationship between palette index and the color value therein!) + */ + palette = store_write_palette(ps, npalette); + + for (i=0; i 0) + png_set_tRNS(pp, pi, tRNS, j, 0/*color*/); +#endif + } +} + +#ifdef PNG_WRITE_tRNS_SUPPORTED +static void +set_random_tRNS(png_structp pp, png_infop pi, png_byte colour_type, + int bit_depth) +{ + /* To make this useful the tRNS color needs to match at least one pixel. + * Random values are fine for gray, including the 16-bit case where we know + * that the test image contains all the gray values. For RGB we need more + * method as only 65536 different RGB values are generated. + */ + png_color_16 tRNS; + png_uint_16 mask = (png_uint_16)((1U << bit_depth)-1); + + R8(tRNS); /* makes unset fields random */ + + if (colour_type & 2/*RGB*/) + { + if (bit_depth == 8) + { + tRNS.red = random_u16(); + tRNS.green = random_u16(); + tRNS.blue = tRNS.red ^ tRNS.green; + tRNS.red &= mask; + tRNS.green &= mask; + tRNS.blue &= mask; + } + + else /* bit_depth == 16 */ + { + tRNS.red = random_u16(); + tRNS.green = (png_uint_16)(tRNS.red * 257); + tRNS.blue = (png_uint_16)(tRNS.green * 17); + } + } + + else + { + tRNS.gray = random_u16(); + tRNS.gray &= mask; + } + + png_set_tRNS(pp, pi, NULL, 0, &tRNS); +} +#endif + +/* The number of passes is related to the interlace type. There was no libpng + * API to determine this prior to 1.5, so we need an inquiry function: + */ +static int +npasses_from_interlace_type(png_const_structp pp, int interlace_type) +{ + switch (interlace_type) + { + default: + png_error(pp, "invalid interlace type"); + + case PNG_INTERLACE_NONE: + return 1; + + case PNG_INTERLACE_ADAM7: + return PNG_INTERLACE_ADAM7_PASSES; + } +} + +static unsigned int +bit_size(png_const_structp pp, png_byte colour_type, png_byte bit_depth) +{ + switch (colour_type) + { + default: png_error(pp, "invalid color type"); + + case 0: return bit_depth; + + case 2: return 3*bit_depth; + + case 3: return bit_depth; + + case 4: return 2*bit_depth; + + case 6: return 4*bit_depth; + } +} + +#define TRANSFORM_WIDTH 128U +#define TRANSFORM_ROWMAX (TRANSFORM_WIDTH*8U) +#define SIZE_ROWMAX (16*8U) /* 16 pixels, max 8 bytes each - 128 bytes */ +#define STANDARD_ROWMAX TRANSFORM_ROWMAX /* The larger of the two */ +#define SIZE_HEIGHTMAX 16 /* Maximum range of size images */ + +static size_t +transform_rowsize(png_const_structp pp, png_byte colour_type, + png_byte bit_depth) +{ + return (TRANSFORM_WIDTH * bit_size(pp, colour_type, bit_depth)) / 8; +} + +/* transform_width(pp, colour_type, bit_depth) current returns the same number + * every time, so just use a macro: + */ +#define transform_width(pp, colour_type, bit_depth) TRANSFORM_WIDTH + +static png_uint_32 +transform_height(png_const_structp pp, png_byte colour_type, png_byte bit_depth) +{ + switch (bit_size(pp, colour_type, bit_depth)) + { + case 1: + case 2: + case 4: + return 1; /* Total of 128 pixels */ + + case 8: + return 2; /* Total of 256 pixels/bytes */ + + case 16: + return 512; /* Total of 65536 pixels */ + + case 24: + case 32: + return 512; /* 65536 pixels */ + + case 48: + case 64: + return 2048;/* 4 x 65536 pixels. */ +# define TRANSFORM_HEIGHTMAX 2048 + + default: + return 0; /* Error, will be caught later */ + } +} + +#ifdef PNG_READ_SUPPORTED +/* The following can only be defined here, now we have the definitions + * of the transform image sizes. + */ +static png_uint_32 +standard_width(png_const_structp pp, png_uint_32 id) +{ + png_uint_32 width = WIDTH_FROM_ID(id); + UNUSED(pp) + + if (width == 0) + width = transform_width(pp, COL_FROM_ID(id), DEPTH_FROM_ID(id)); + + return width; +} + +static png_uint_32 +standard_height(png_const_structp pp, png_uint_32 id) +{ + png_uint_32 height = HEIGHT_FROM_ID(id); + + if (height == 0) + height = transform_height(pp, COL_FROM_ID(id), DEPTH_FROM_ID(id)); + + return height; +} + +static png_uint_32 +standard_rowsize(png_const_structp pp, png_uint_32 id) +{ + png_uint_32 width = standard_width(pp, id); + + /* This won't overflow: */ + width *= bit_size(pp, COL_FROM_ID(id), DEPTH_FROM_ID(id)); + return (width + 7) / 8; +} +#endif /* PNG_READ_SUPPORTED */ + +static void +transform_row(png_const_structp pp, png_byte buffer[TRANSFORM_ROWMAX], + png_byte colour_type, png_byte bit_depth, png_uint_32 y) +{ + png_uint_32 v = y << 7; + png_uint_32 i = 0; + + switch (bit_size(pp, colour_type, bit_depth)) + { + case 1: + while (i<128/8) buffer[i] = (png_byte)(v & 0xff), v += 17, ++i; + return; + + case 2: + while (i<128/4) buffer[i] = (png_byte)(v & 0xff), v += 33, ++i; + return; + + case 4: + while (i<128/2) buffer[i] = (png_byte)(v & 0xff), v += 65, ++i; + return; + + case 8: + /* 256 bytes total, 128 bytes in each row set as follows: */ + while (i<128) buffer[i] = (png_byte)(v & 0xff), ++v, ++i; + return; + + case 16: + /* Generate all 65536 pixel values in order, which includes the 8 bit + * GA case as well as the 16 bit G case. + */ + while (i<128) + { + buffer[2*i] = (png_byte)((v>>8) & 0xff); + buffer[2*i+1] = (png_byte)(v & 0xff); + ++v; + ++i; + } + + return; + + case 24: + /* 65535 pixels, but rotate the values. */ + while (i<128) + { + /* Three bytes per pixel, r, g, b, make b by r^g */ + buffer[3*i+0] = (png_byte)((v >> 8) & 0xff); + buffer[3*i+1] = (png_byte)(v & 0xff); + buffer[3*i+2] = (png_byte)(((v >> 8) ^ v) & 0xff); + ++v; + ++i; + } + + return; + + case 32: + /* 65535 pixels, r, g, b, a; just replicate */ + while (i<128) + { + buffer[4*i+0] = (png_byte)((v >> 8) & 0xff); + buffer[4*i+1] = (png_byte)(v & 0xff); + buffer[4*i+2] = (png_byte)((v >> 8) & 0xff); + buffer[4*i+3] = (png_byte)(v & 0xff); + ++v; + ++i; + } + + return; + + case 48: + /* y is maximum 2047, giving 4x65536 pixels, make 'r' increase by 1 at + * each pixel, g increase by 257 (0x101) and 'b' by 0x1111: + */ + while (i<128) + { + png_uint_32 t = v++; + buffer[6*i+0] = (png_byte)((t >> 8) & 0xff); + buffer[6*i+1] = (png_byte)(t & 0xff); + t *= 257; + buffer[6*i+2] = (png_byte)((t >> 8) & 0xff); + buffer[6*i+3] = (png_byte)(t & 0xff); + t *= 17; + buffer[6*i+4] = (png_byte)((t >> 8) & 0xff); + buffer[6*i+5] = (png_byte)(t & 0xff); + ++i; + } + + return; + + case 64: + /* As above in the 32 bit case. */ + while (i<128) + { + png_uint_32 t = v++; + buffer[8*i+0] = (png_byte)((t >> 8) & 0xff); + buffer[8*i+1] = (png_byte)(t & 0xff); + buffer[8*i+4] = (png_byte)((t >> 8) & 0xff); + buffer[8*i+5] = (png_byte)(t & 0xff); + t *= 257; + buffer[8*i+2] = (png_byte)((t >> 8) & 0xff); + buffer[8*i+3] = (png_byte)(t & 0xff); + buffer[8*i+6] = (png_byte)((t >> 8) & 0xff); + buffer[8*i+7] = (png_byte)(t & 0xff); + ++i; + } + return; + + default: + break; + } + + png_error(pp, "internal error"); +} + +/* This is just to do the right cast - could be changed to a function to check + * 'bd' but there isn't much point. + */ +#define DEPTH(bd) ((png_byte)(1U << (bd))) + +/* This is just a helper for compiling on minimal systems with no write + * interlacing support. If there is no write interlacing we can't generate test + * cases with interlace: + */ +#ifdef PNG_WRITE_INTERLACING_SUPPORTED +# define INTERLACE_LAST PNG_INTERLACE_LAST +# define check_interlace_type(type) ((void)(type)) +# define set_write_interlace_handling(pp,type) png_set_interlace_handling(pp) +# define do_own_interlace 0 +#elif PNG_LIBPNG_VER < 10700 +# define set_write_interlace_handling(pp,type) (1) +static void +check_interlace_type(int const interlace_type) +{ + /* Prior to 1.7.0 libpng does not support the write of an interlaced image + * unless PNG_WRITE_INTERLACING_SUPPORTED, even with do_interlace so the + * code here does the pixel interlace itself, so: + */ + if (interlace_type != PNG_INTERLACE_NONE) + { + /* This is an internal error - --interlace tests should be skipped, not + * attempted. + */ + fprintf(stderr, "pngvalid: no interlace support\n"); + exit(99); + } +} +# define INTERLACE_LAST (PNG_INTERLACE_NONE+1) +# define do_own_interlace 0 +#else /* libpng 1.7+ */ +# define set_write_interlace_handling(pp,type)\ + npasses_from_interlace_type(pp,type) +# define check_interlace_type(type) ((void)(type)) +# define INTERLACE_LAST PNG_INTERLACE_LAST +# define do_own_interlace 1 +#endif /* WRITE_INTERLACING tests */ + +#if PNG_LIBPNG_VER >= 10700 || defined PNG_WRITE_INTERLACING_SUPPORTED +# define CAN_WRITE_INTERLACE 1 +#else +# define CAN_WRITE_INTERLACE 0 +#endif + +/* Do the same thing for read interlacing; this controls whether read tests do + * their own de-interlace or use libpng. + */ +#ifdef PNG_READ_INTERLACING_SUPPORTED +# define do_read_interlace 0 +#else /* no libpng read interlace support */ +# define do_read_interlace 1 +#endif +/* The following two routines use the PNG interlace support macros from + * png.h to interlace or deinterlace rows. + */ +static void +interlace_row(png_bytep buffer, png_const_bytep imageRow, + unsigned int pixel_size, png_uint_32 w, int pass, int littleendian) +{ + png_uint_32 xin, xout, xstep; + + /* Note that this can, trivially, be optimized to a memcpy on pass 7, the + * code is presented this way to make it easier to understand. In practice + * consult the code in the libpng source to see other ways of doing this. + * + * It is OK for buffer and imageRow to be identical, because 'xin' moves + * faster than 'xout' and we copy up. + */ + xin = PNG_PASS_START_COL(pass); + xstep = 1U<wname); + text.text = copy; + text.text_length = pos; + text.itxt_length = 0; + text.lang = 0; + text.lang_key = 0; + + png_set_text(pp, pi, &text, 1); + } +#endif + + if (colour_type == 3) /* palette */ + init_standard_palette(ps, pp, pi, 1U << bit_depth, 1/*do tRNS*/); + +# ifdef PNG_WRITE_tRNS_SUPPORTED + else if (palette_number) + set_random_tRNS(pp, pi, colour_type, bit_depth); +# endif + + png_write_info(pp, pi); + + if (png_get_rowbytes(pp, pi) != + transform_rowsize(pp, colour_type, bit_depth)) + png_error(pp, "transform row size incorrect"); + + else + { + /* Somewhat confusingly this must be called *after* png_write_info + * because if it is called before, the information in *pp has not been + * updated to reflect the interlaced image. + */ + int npasses = set_write_interlace_handling(pp, interlace_type); + int pass; + + if (npasses != npasses_from_interlace_type(pp, interlace_type)) + png_error(pp, "write: png_set_interlace_handling failed"); + + for (pass=0; pass 0) + interlace_row(buffer, buffer, + bit_size(pp, colour_type, bit_depth), w, pass, + 0/*data always bigendian*/); + else + continue; + } +# endif /* do_own_interlace */ + + choose_random_filter(pp, pass == 0 && y == 0); + png_write_row(pp, buffer); + } + } + } + +#ifdef PNG_TEXT_SUPPORTED + { + static char key[] = "end marker"; + static char comment[] = "end"; + png_text text; + + /* Use a compressed text string to test the correct interaction of text + * compression and IDAT compression. + */ + text.compression = TEXT_COMPRESSION; + text.key = key; + text.text = comment; + text.text_length = (sizeof comment)-1; + text.itxt_length = 0; + text.lang = 0; + text.lang_key = 0; + + png_set_text(pp, pi, &text, 1); + } +#endif + + png_write_end(pp, pi); + + /* And store this under the appropriate id, then clean up. */ + store_storefile(ps, FILEID(colour_type, bit_depth, palette_number, + interlace_type, 0, 0, 0)); + + store_write_reset(ps); + } + + Catch(fault) + { + /* Use the png_store returned by the exception. This may help the compiler + * because 'ps' is not used in this branch of the setjmp. Note that fault + * and ps will always be the same value. + */ + store_write_reset(fault); + } +} + +static void +make_transform_images(png_modifier *pm) +{ + png_byte colour_type = 0; + png_byte bit_depth = 0; + unsigned int palette_number = 0; + + /* This is in case of errors. */ + safecat(pm->this.test, sizeof pm->this.test, 0, "make standard images"); + + /* Use next_format to enumerate all the combinations we test, including + * generating multiple low bit depth palette images. Non-A images (palette + * and direct) are created with and without tRNS chunks. + */ + while (next_format(&colour_type, &bit_depth, &palette_number, 1, 1)) + { + int interlace_type; + + for (interlace_type = PNG_INTERLACE_NONE; + interlace_type < INTERLACE_LAST; ++interlace_type) + { + char name[FILE_NAME_SIZE]; + + standard_name(name, sizeof name, 0, colour_type, bit_depth, + palette_number, interlace_type, 0, 0, do_own_interlace); + make_transform_image(&pm->this, colour_type, bit_depth, palette_number, + interlace_type, name); + } + } +} + +/* Build a single row for the 'size' test images; this fills in only the + * first bit_width bits of the sample row. + */ +static void +size_row(png_byte buffer[SIZE_ROWMAX], png_uint_32 bit_width, png_uint_32 y) +{ + /* height is in the range 1 to 16, so: */ + y = ((y & 1) << 7) + ((y & 2) << 6) + ((y & 4) << 5) + ((y & 8) << 4); + /* the following ensures bits are set in small images: */ + y ^= 0xA5; + + while (bit_width >= 8) + *buffer++ = (png_byte)y++, bit_width -= 8; + + /* There may be up to 7 remaining bits, these go in the most significant + * bits of the byte. + */ + if (bit_width > 0) + { + png_uint_32 mask = (1U<<(8-bit_width))-1; + *buffer = (png_byte)((*buffer & mask) | (y & ~mask)); + } +} + +static void +make_size_image(png_store* const ps, png_byte const colour_type, + png_byte const bit_depth, int const interlace_type, + png_uint_32 const w, png_uint_32 const h, + int const do_interlace) +{ + context(ps, fault); + + check_interlace_type(interlace_type); + + Try + { + png_infop pi; + png_structp pp; + unsigned int pixel_size; + + /* Make a name and get an appropriate id for the store: */ + char name[FILE_NAME_SIZE]; + png_uint_32 id = FILEID(colour_type, bit_depth, 0/*palette*/, + interlace_type, w, h, do_interlace); + + standard_name_from_id(name, sizeof name, 0, id); + pp = set_store_for_write(ps, &pi, name); + + /* In the event of a problem return control to the Catch statement below + * to do the clean up - it is not possible to 'return' directly from a Try + * block. + */ + if (pp == NULL) + Throw ps; + + png_set_IHDR(pp, pi, w, h, bit_depth, colour_type, interlace_type, + PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + +#ifdef PNG_TEXT_SUPPORTED + { + static char key[] = "image name"; /* must be writeable */ + size_t pos; + png_text text; + char copy[FILE_NAME_SIZE]; + + /* Use a compressed text string to test the correct interaction of text + * compression and IDAT compression. + */ + text.compression = TEXT_COMPRESSION; + text.key = key; + /* Yuck: the text must be writable! */ + pos = safecat(copy, sizeof copy, 0, ps->wname); + text.text = copy; + text.text_length = pos; + text.itxt_length = 0; + text.lang = 0; + text.lang_key = 0; + + png_set_text(pp, pi, &text, 1); + } +#endif + + if (colour_type == 3) /* palette */ + init_standard_palette(ps, pp, pi, 1U << bit_depth, 0/*do tRNS*/); + + png_write_info(pp, pi); + + /* Calculate the bit size, divide by 8 to get the byte size - this won't + * overflow because we know the w values are all small enough even for + * a system where 'unsigned int' is only 16 bits. + */ + pixel_size = bit_size(pp, colour_type, bit_depth); + if (png_get_rowbytes(pp, pi) != ((w * pixel_size) + 7) / 8) + png_error(pp, "size row size incorrect"); + + else + { + int npasses = npasses_from_interlace_type(pp, interlace_type); + png_uint_32 y; + int pass; + png_byte image[16][SIZE_ROWMAX]; + + /* To help consistent error detection make the parts of this buffer + * that aren't set below all '1': + */ + memset(image, 0xff, sizeof image); + + if (!do_interlace && + npasses != set_write_interlace_handling(pp, interlace_type)) + png_error(pp, "write: png_set_interlace_handling failed"); + + /* Prepare the whole image first to avoid making it 7 times: */ + for (y=0; y 0) + { + /* Set to all 1's for error detection (libpng tends to + * set unset things to 0). + */ + memset(tempRow, 0xff, sizeof tempRow); + interlace_row(tempRow, row, pixel_size, w, pass, + 0/*data always bigendian*/); + row = tempRow; + } + else + continue; + } + +# ifdef PNG_WRITE_FILTER_SUPPORTED + /* Only get to here if the row has some pixels in it, set the + * filters to 'all' for the very first row and thereafter to a + * single filter. It isn't well documented, but png_set_filter + * does accept a filter number (per the spec) as well as a bit + * mask. + * + * The code now uses filters at random, except that on the first + * row of an image it ensures that a previous row filter is in + * the set so that libpng allocates the row buffer. + */ + { + int filters = 8 << random_mod(PNG_FILTER_VALUE_LAST); + + if (pass == 0 && y == 0 && + (filters < PNG_FILTER_UP || w == 1U)) + filters |= PNG_FILTER_UP; + + png_set_filter(pp, 0/*method*/, filters); + } +# endif + + png_write_row(pp, row); + } + } + } + +#ifdef PNG_TEXT_SUPPORTED + { + static char key[] = "end marker"; + static char comment[] = "end"; + png_text text; + + /* Use a compressed text string to test the correct interaction of text + * compression and IDAT compression. + */ + text.compression = TEXT_COMPRESSION; + text.key = key; + text.text = comment; + text.text_length = (sizeof comment)-1; + text.itxt_length = 0; + text.lang = 0; + text.lang_key = 0; + + png_set_text(pp, pi, &text, 1); + } +#endif + + png_write_end(pp, pi); + + /* And store this under the appropriate id, then clean up. */ + store_storefile(ps, id); + + store_write_reset(ps); + } + + Catch(fault) + { + /* Use the png_store returned by the exception. This may help the compiler + * because 'ps' is not used in this branch of the setjmp. Note that fault + * and ps will always be the same value. + */ + store_write_reset(fault); + } +} + +static void +make_size(png_store* const ps, png_byte const colour_type, int bdlo, + int const bdhi) +{ + for (; bdlo <= bdhi; ++bdlo) + { + png_uint_32 width; + + for (width = 1; width <= 16; ++width) + { + png_uint_32 height; + + for (height = 1; height <= 16; ++height) + { + /* The four combinations of DIY interlace and interlace or not - + * no interlace + DIY should be identical to no interlace with + * libpng doing it. + */ + make_size_image(ps, colour_type, DEPTH(bdlo), PNG_INTERLACE_NONE, + width, height, 0); + make_size_image(ps, colour_type, DEPTH(bdlo), PNG_INTERLACE_NONE, + width, height, 1); +# ifdef PNG_WRITE_INTERLACING_SUPPORTED + make_size_image(ps, colour_type, DEPTH(bdlo), PNG_INTERLACE_ADAM7, + width, height, 0); +# endif +# if CAN_WRITE_INTERLACE + /* 1.7.0 removes the hack that prevented app write of an interlaced + * image if WRITE_INTERLACE was not supported + */ + make_size_image(ps, colour_type, DEPTH(bdlo), PNG_INTERLACE_ADAM7, + width, height, 1); +# endif + } + } + } +} + +static void +make_size_images(png_store *ps) +{ + /* This is in case of errors. */ + safecat(ps->test, sizeof ps->test, 0, "make size images"); + + /* Arguments are colour_type, low bit depth, high bit depth + */ + make_size(ps, 0, 0, WRITE_BDHI); + make_size(ps, 2, 3, WRITE_BDHI); + make_size(ps, 3, 0, 3 /*palette: max 8 bits*/); + make_size(ps, 4, 3, WRITE_BDHI); + make_size(ps, 6, 3, WRITE_BDHI); +} + +#ifdef PNG_READ_SUPPORTED +/* Return a row based on image id and 'y' for checking: */ +static void +standard_row(png_const_structp pp, png_byte std[STANDARD_ROWMAX], + png_uint_32 id, png_uint_32 y) +{ + if (WIDTH_FROM_ID(id) == 0) + transform_row(pp, std, COL_FROM_ID(id), DEPTH_FROM_ID(id), y); + else + size_row(std, WIDTH_FROM_ID(id) * bit_size(pp, COL_FROM_ID(id), + DEPTH_FROM_ID(id)), y); +} +#endif /* PNG_READ_SUPPORTED */ + +/* Tests - individual test cases */ +/* Like 'make_standard' but errors are deliberately introduced into the calls + * to ensure that they get detected - it should not be possible to write an + * invalid image with libpng! + */ +/* TODO: the 'set' functions can probably all be made to take a + * png_const_structp rather than a modifiable one. + */ +#ifdef PNG_WARNINGS_SUPPORTED +static void +sBIT0_error_fn(png_structp pp, png_infop pi) +{ + /* 0 is invalid... */ + png_color_8 bad; + bad.red = bad.green = bad.blue = bad.gray = bad.alpha = 0; + png_set_sBIT(pp, pi, &bad); +} + +static void +sBIT_error_fn(png_structp pp, png_infop pi) +{ + png_byte bit_depth; + png_color_8 bad; + + if (png_get_color_type(pp, pi) == PNG_COLOR_TYPE_PALETTE) + bit_depth = 8; + + else + bit_depth = png_get_bit_depth(pp, pi); + + /* Now we know the bit depth we can easily generate an invalid sBIT entry */ + bad.red = bad.green = bad.blue = bad.gray = bad.alpha = + (png_byte)(bit_depth+1); + png_set_sBIT(pp, pi, &bad); +} + +static const struct +{ + void (*fn)(png_structp, png_infop); + const char *msg; + unsigned int warning :1; /* the error is a warning... */ +} error_test[] = + { + /* no warnings makes these errors undetectable prior to 1.7.0 */ + { sBIT0_error_fn, "sBIT(0): failed to detect error", + PNG_LIBPNG_VER < 10700 }, + + { sBIT_error_fn, "sBIT(too big): failed to detect error", + PNG_LIBPNG_VER < 10700 }, + }; + +static void +make_error(png_store* const ps, png_byte const colour_type, + png_byte bit_depth, int interlace_type, int test, png_const_charp name) +{ + context(ps, fault); + + check_interlace_type(interlace_type); + + Try + { + png_infop pi; + png_structp pp = set_store_for_write(ps, &pi, name); + png_uint_32 w, h; + gnu_volatile(pp) + + if (pp == NULL) + Throw ps; + + w = transform_width(pp, colour_type, bit_depth); + gnu_volatile(w) + h = transform_height(pp, colour_type, bit_depth); + gnu_volatile(h) + png_set_IHDR(pp, pi, w, h, bit_depth, colour_type, interlace_type, + PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + + if (colour_type == 3) /* palette */ + init_standard_palette(ps, pp, pi, 1U << bit_depth, 0/*do tRNS*/); + + /* Time for a few errors; these are in various optional chunks, the + * standard tests test the standard chunks pretty well. + */ +# define exception__prev exception_prev_1 +# define exception__env exception_env_1 + Try + { + gnu_volatile(exception__prev) + + /* Expect this to throw: */ + ps->expect_error = !error_test[test].warning; + ps->expect_warning = error_test[test].warning; + ps->saw_warning = 0; + error_test[test].fn(pp, pi); + + /* Normally the error is only detected here: */ + png_write_info(pp, pi); + + /* And handle the case where it was only a warning: */ + if (ps->expect_warning && ps->saw_warning) + Throw ps; + + /* If we get here there is a problem, we have success - no error or + * no warning - when we shouldn't have success. Log an error. + */ + store_log(ps, pp, error_test[test].msg, 1 /*error*/); + } + + Catch (fault) + { /* expected exit */ + } +#undef exception__prev +#undef exception__env + + /* And clear these flags */ + ps->expect_warning = 0; + + if (ps->expect_error) + ps->expect_error = 0; + + else + { + /* Now write the whole image, just to make sure that the detected, or + * undetected, error has not created problems inside libpng. This + * doesn't work if there was a png_error in png_write_info because that + * can abort before PLTE was written. + */ + if (png_get_rowbytes(pp, pi) != + transform_rowsize(pp, colour_type, bit_depth)) + png_error(pp, "row size incorrect"); + + else + { + int npasses = set_write_interlace_handling(pp, interlace_type); + int pass; + + if (npasses != npasses_from_interlace_type(pp, interlace_type)) + png_error(pp, "write: png_set_interlace_handling failed"); + + for (pass=0; pass 0) + interlace_row(buffer, buffer, + bit_size(pp, colour_type, bit_depth), w, pass, + 0/*data always bigendian*/); + else + continue; + } +# endif /* do_own_interlace */ + + png_write_row(pp, buffer); + } + } + } /* image writing */ + + png_write_end(pp, pi); + } + + /* The following deletes the file that was just written. */ + store_write_reset(ps); + } + + Catch(fault) + { + store_write_reset(fault); + } +} + +static int +make_errors(png_modifier* const pm, png_byte const colour_type, + int bdlo, int const bdhi) +{ + for (; bdlo <= bdhi; ++bdlo) + { + int interlace_type; + + for (interlace_type = PNG_INTERLACE_NONE; + interlace_type < INTERLACE_LAST; ++interlace_type) + { + unsigned int test; + char name[FILE_NAME_SIZE]; + + standard_name(name, sizeof name, 0, colour_type, 1<this, colour_type, DEPTH(bdlo), interlace_type, + test, name); + + if (fail(pm)) + return 0; + } + } + } + + return 1; /* keep going */ +} +#endif /* PNG_WARNINGS_SUPPORTED */ + +static void +perform_error_test(png_modifier *pm) +{ +#ifdef PNG_WARNINGS_SUPPORTED /* else there are no cases that work! */ + /* Need to do this here because we just write in this test. */ + safecat(pm->this.test, sizeof pm->this.test, 0, "error test"); + + if (!make_errors(pm, 0, 0, WRITE_BDHI)) + return; + + if (!make_errors(pm, 2, 3, WRITE_BDHI)) + return; + + if (!make_errors(pm, 3, 0, 3)) + return; + + if (!make_errors(pm, 4, 3, WRITE_BDHI)) + return; + + if (!make_errors(pm, 6, 3, WRITE_BDHI)) + return; +#else + UNUSED(pm) +#endif +} + +/* This is just to validate the internal PNG formatting code - if this fails + * then the warning messages the library outputs will probably be garbage. + */ +static void +perform_formatting_test(png_store *ps) +{ +#ifdef PNG_TIME_RFC1123_SUPPORTED + /* The handle into the formatting code is the RFC1123 support; this test does + * nothing if that is compiled out. + */ + context(ps, fault); + + Try + { + png_const_charp correct = "29 Aug 2079 13:53:60 +0000"; + png_const_charp result; +# if PNG_LIBPNG_VER >= 10600 + char timestring[29]; +# endif + png_structp pp; + png_time pt; + + pp = set_store_for_write(ps, NULL, "libpng formatting test"); + + if (pp == NULL) + Throw ps; + + + /* Arbitrary settings: */ + pt.year = 2079; + pt.month = 8; + pt.day = 29; + pt.hour = 13; + pt.minute = 53; + pt.second = 60; /* a leap second */ + +# if PNG_LIBPNG_VER < 10600 + result = png_convert_to_rfc1123(pp, &pt); +# else + if (png_convert_to_rfc1123_buffer(timestring, &pt)) + result = timestring; + + else + result = NULL; +# endif + + if (result == NULL) + png_error(pp, "png_convert_to_rfc1123 failed"); + + if (strcmp(result, correct) != 0) + { + size_t pos = 0; + char msg[128]; + + pos = safecat(msg, sizeof msg, pos, "png_convert_to_rfc1123("); + pos = safecat(msg, sizeof msg, pos, correct); + pos = safecat(msg, sizeof msg, pos, ") returned: '"); + pos = safecat(msg, sizeof msg, pos, result); + pos = safecat(msg, sizeof msg, pos, "'"); + + png_error(pp, msg); + } + + store_write_reset(ps); + } + + Catch(fault) + { + store_write_reset(fault); + } +#else + UNUSED(ps) +#endif +} + +#ifdef PNG_READ_SUPPORTED +/* Because we want to use the same code in both the progressive reader and the + * sequential reader it is necessary to deal with the fact that the progressive + * reader callbacks only have one parameter (png_get_progressive_ptr()), so this + * must contain all the test parameters and all the local variables directly + * accessible to the sequential reader implementation. + * + * The technique adopted is to reinvent part of what Dijkstra termed a + * 'display'; an array of pointers to the stack frames of enclosing functions so + * that a nested function definition can access the local (C auto) variables of + * the functions that contain its definition. In fact C provides the first + * pointer (the local variables - the stack frame pointer) and the last (the + * global variables - the BCPL global vector typically implemented as global + * addresses), this code requires one more pointer to make the display - the + * local variables (and function call parameters) of the function that actually + * invokes either the progressive or sequential reader. + * + * Perhaps confusingly this technique is confounded with classes - the + * 'standard_display' defined here is sub-classed as the 'gamma_display' below. + * A gamma_display is a standard_display, taking advantage of the ANSI-C + * requirement that the pointer to the first member of a structure must be the + * same as the pointer to the structure. This allows us to reuse standard_ + * functions in the gamma test code; something that could not be done with + * nested functions! + */ +typedef struct standard_display +{ + png_store* ps; /* Test parameters (passed to the function) */ + png_byte colour_type; + png_byte bit_depth; + png_byte red_sBIT; /* Input data sBIT values. */ + png_byte green_sBIT; + png_byte blue_sBIT; + png_byte alpha_sBIT; + png_byte interlace_type; + png_byte filler; /* Output has a filler */ + png_uint_32 id; /* Calculated file ID */ + png_uint_32 w; /* Width of image */ + png_uint_32 h; /* Height of image */ + int npasses; /* Number of interlaced passes */ + png_uint_32 pixel_size; /* Width of one pixel in bits */ + png_uint_32 bit_width; /* Width of output row in bits */ + size_t cbRow; /* Bytes in a row of the output image */ + int do_interlace; /* Do interlacing internally */ + int littleendian; /* App (row) data is little endian */ + int is_transparent; /* Transparency information was present. */ + int has_tRNS; /* color type GRAY or RGB with a tRNS chunk. */ + int speed; /* Doing a speed test */ + int use_update_info;/* Call update_info, not start_image */ + struct + { + png_uint_16 red; + png_uint_16 green; + png_uint_16 blue; + } transparent; /* The transparent color, if set. */ + int npalette; /* Number of entries in the palette. */ + store_palette + palette; +} standard_display; + +static void +standard_display_init(standard_display *dp, png_store* ps, png_uint_32 id, + int do_interlace, int use_update_info) +{ + memset(dp, 0, sizeof *dp); + + dp->ps = ps; + dp->colour_type = COL_FROM_ID(id); + dp->bit_depth = DEPTH_FROM_ID(id); + if (dp->bit_depth < 1 || dp->bit_depth > 16) + internal_error(ps, "internal: bad bit depth"); + if (dp->colour_type == 3) + dp->red_sBIT = dp->blue_sBIT = dp->green_sBIT = dp->alpha_sBIT = 8; + else + dp->red_sBIT = dp->blue_sBIT = dp->green_sBIT = dp->alpha_sBIT = + dp->bit_depth; + dp->interlace_type = INTERLACE_FROM_ID(id); + check_interlace_type(dp->interlace_type); + dp->id = id; + /* All the rest are filled in after the read_info: */ + dp->w = 0; + dp->h = 0; + dp->npasses = 0; + dp->pixel_size = 0; + dp->bit_width = 0; + dp->cbRow = 0; + dp->do_interlace = do_interlace; + dp->littleendian = 0; + dp->is_transparent = 0; + dp->speed = ps->speed; + dp->use_update_info = use_update_info; + dp->npalette = 0; + /* Preset the transparent color to black: */ + memset(&dp->transparent, 0, sizeof dp->transparent); + /* Preset the palette to full intensity/opaque throughout: */ + memset(dp->palette, 0xff, sizeof dp->palette); +} + +/* Initialize the palette fields - this must be done later because the palette + * comes from the particular png_store_file that is selected. + */ +static void +standard_palette_init(standard_display *dp) +{ + store_palette_entry *palette = store_current_palette(dp->ps, &dp->npalette); + + /* The remaining entries remain white/opaque. */ + if (dp->npalette > 0) + { + int i = dp->npalette; + memcpy(dp->palette, palette, i * sizeof *palette); + + /* Check for a non-opaque palette entry: */ + while (--i >= 0) + if (palette[i].alpha < 255) + break; + +# ifdef __GNUC__ + /* GCC can't handle the more obviously optimizable version. */ + if (i >= 0) + dp->is_transparent = 1; + else + dp->is_transparent = 0; +# else + dp->is_transparent = (i >= 0); +# endif + } +} + +/* Utility to read the palette from the PNG file and convert it into + * store_palette format. This returns 1 if there is any transparency in the + * palette (it does not check for a transparent colour in the non-palette case.) + */ +static int +read_palette(store_palette palette, int *npalette, png_const_structp pp, + png_infop pi) +{ + png_colorp pal; + png_bytep trans_alpha; + int num; + + pal = 0; + *npalette = -1; + + if (png_get_PLTE(pp, pi, &pal, npalette) & PNG_INFO_PLTE) + { + int i = *npalette; + + if (i <= 0 || i > 256) + png_error(pp, "validate: invalid PLTE count"); + + while (--i >= 0) + { + palette[i].red = pal[i].red; + palette[i].green = pal[i].green; + palette[i].blue = pal[i].blue; + } + + /* Mark the remainder of the entries with a flag value (other than + * white/opaque which is the flag value stored above.) + */ + memset(palette + *npalette, 126, (256-*npalette) * sizeof *palette); + } + + else /* !png_get_PLTE */ + { + if (*npalette != (-1)) + png_error(pp, "validate: invalid PLTE result"); + /* But there is no palette, so record this: */ + *npalette = 0; + memset(palette, 113, sizeof (store_palette)); + } + + trans_alpha = 0; + num = 2; /* force error below */ + if ((png_get_tRNS(pp, pi, &trans_alpha, &num, 0) & PNG_INFO_tRNS) != 0 && + (trans_alpha != NULL || num != 1/*returns 1 for a transparent color*/) && + /* Oops, if a palette tRNS gets expanded png_read_update_info (at least so + * far as 1.5.4) does not remove the trans_alpha pointer, only num_trans, + * so in the above call we get a success, we get a pointer (who knows what + * to) and we get num_trans == 0: + */ + !(trans_alpha != NULL && num == 0)) /* TODO: fix this in libpng. */ + { + int i; + + /* Any of these are crash-worthy - given the implementation of + * png_get_tRNS up to 1.5 an app won't crash if it just checks the + * result above and fails to check that the variables it passed have + * actually been filled in! Note that if the app were to pass the + * last, png_color_16p, variable too it couldn't rely on this. + */ + if (trans_alpha == NULL || num <= 0 || num > 256 || num > *npalette) + png_error(pp, "validate: unexpected png_get_tRNS (palette) result"); + + for (i=0; iis_transparent) + png_error(pp, "validate: palette transparency changed"); + + if (npalette != dp->npalette) + { + size_t pos = 0; + char msg[64]; + + pos = safecat(msg, sizeof msg, pos, "validate: palette size changed: "); + pos = safecatn(msg, sizeof msg, pos, dp->npalette); + pos = safecat(msg, sizeof msg, pos, " -> "); + pos = safecatn(msg, sizeof msg, pos, npalette); + png_error(pp, msg); + } + + { + int i = npalette; /* npalette is aliased */ + + while (--i >= 0) + if (palette[i].red != dp->palette[i].red || + palette[i].green != dp->palette[i].green || + palette[i].blue != dp->palette[i].blue || + palette[i].alpha != dp->palette[i].alpha) + png_error(pp, "validate: PLTE or tRNS chunk changed"); + } +} + +/* By passing a 'standard_display' the progressive callbacks can be used + * directly by the sequential code, the functions suffixed "_imp" are the + * implementations, the functions without the suffix are the callbacks. + * + * The code for the info callback is split into two because this callback calls + * png_read_update_info or png_start_read_image and what gets called depends on + * whether the info needs updating (we want to test both calls in pngvalid.) + */ +static void +standard_info_part1(standard_display *dp, png_structp pp, png_infop pi) +{ + if (png_get_bit_depth(pp, pi) != dp->bit_depth) + png_error(pp, "validate: bit depth changed"); + + if (png_get_color_type(pp, pi) != dp->colour_type) + png_error(pp, "validate: color type changed"); + + if (png_get_filter_type(pp, pi) != PNG_FILTER_TYPE_BASE) + png_error(pp, "validate: filter type changed"); + + if (png_get_interlace_type(pp, pi) != dp->interlace_type) + png_error(pp, "validate: interlacing changed"); + + if (png_get_compression_type(pp, pi) != PNG_COMPRESSION_TYPE_BASE) + png_error(pp, "validate: compression type changed"); + + dp->w = png_get_image_width(pp, pi); + + if (dp->w != standard_width(pp, dp->id)) + png_error(pp, "validate: image width changed"); + + dp->h = png_get_image_height(pp, pi); + + if (dp->h != standard_height(pp, dp->id)) + png_error(pp, "validate: image height changed"); + + /* Record (but don't check at present) the input sBIT according to the colour + * type information. + */ + { + png_color_8p sBIT = 0; + + if (png_get_sBIT(pp, pi, &sBIT) & PNG_INFO_sBIT) + { + int sBIT_invalid = 0; + + if (sBIT == 0) + png_error(pp, "validate: unexpected png_get_sBIT result"); + + if (dp->colour_type & PNG_COLOR_MASK_COLOR) + { + if (sBIT->red == 0 || sBIT->red > dp->bit_depth) + sBIT_invalid = 1; + else + dp->red_sBIT = sBIT->red; + + if (sBIT->green == 0 || sBIT->green > dp->bit_depth) + sBIT_invalid = 1; + else + dp->green_sBIT = sBIT->green; + + if (sBIT->blue == 0 || sBIT->blue > dp->bit_depth) + sBIT_invalid = 1; + else + dp->blue_sBIT = sBIT->blue; + } + + else /* !COLOR */ + { + if (sBIT->gray == 0 || sBIT->gray > dp->bit_depth) + sBIT_invalid = 1; + else + dp->blue_sBIT = dp->green_sBIT = dp->red_sBIT = sBIT->gray; + } + + /* All 8 bits in tRNS for a palette image are significant - see the + * spec. + */ + if (dp->colour_type & PNG_COLOR_MASK_ALPHA) + { + if (sBIT->alpha == 0 || sBIT->alpha > dp->bit_depth) + sBIT_invalid = 1; + else + dp->alpha_sBIT = sBIT->alpha; + } + + if (sBIT_invalid) + png_error(pp, "validate: sBIT value out of range"); + } + } + + /* Important: this is validating the value *before* any transforms have been + * put in place. It doesn't matter for the standard tests, where there are + * no transforms, but it does for other tests where rowbytes may change after + * png_read_update_info. + */ + if (png_get_rowbytes(pp, pi) != standard_rowsize(pp, dp->id)) + png_error(pp, "validate: row size changed"); + + /* Validate the colour type 3 palette (this can be present on other color + * types.) + */ + standard_palette_validate(dp, pp, pi); + + /* In any case always check for a transparent color (notice that the + * colour type 3 case must not give a successful return on the get_tRNS call + * with these arguments!) + */ + { + png_color_16p trans_color = 0; + + if (png_get_tRNS(pp, pi, 0, 0, &trans_color) & PNG_INFO_tRNS) + { + if (trans_color == 0) + png_error(pp, "validate: unexpected png_get_tRNS (color) result"); + + switch (dp->colour_type) + { + case 0: + dp->transparent.red = dp->transparent.green = dp->transparent.blue = + trans_color->gray; + dp->has_tRNS = 1; + break; + + case 2: + dp->transparent.red = trans_color->red; + dp->transparent.green = trans_color->green; + dp->transparent.blue = trans_color->blue; + dp->has_tRNS = 1; + break; + + case 3: + /* Not expected because it should result in the array case + * above. + */ + png_error(pp, "validate: unexpected png_get_tRNS result"); + break; + + default: + png_error(pp, "validate: invalid tRNS chunk with alpha image"); + } + } + } + + /* Read the number of passes - expected to match the value used when + * creating the image (interlaced or not). This has the side effect of + * turning on interlace handling (if do_interlace is not set.) + */ + dp->npasses = npasses_from_interlace_type(pp, dp->interlace_type); + if (!dp->do_interlace) + { +# ifdef PNG_READ_INTERLACING_SUPPORTED + if (dp->npasses != png_set_interlace_handling(pp)) + png_error(pp, "validate: file changed interlace type"); +# else /* !READ_INTERLACING */ + /* This should never happen: the relevant tests (!do_interlace) should + * not be run. + */ + if (dp->npasses > 1) + png_error(pp, "validate: no libpng interlace support"); +# endif /* !READ_INTERLACING */ + } + + /* Caller calls png_read_update_info or png_start_read_image now, then calls + * part2. + */ +} + +/* This must be called *after* the png_read_update_info call to get the correct + * 'rowbytes' value, otherwise png_get_rowbytes will refer to the untransformed + * image. + */ +static void +standard_info_part2(standard_display *dp, png_const_structp pp, + png_const_infop pi, int nImages) +{ + /* Record cbRow now that it can be found. */ + { + png_byte ct = png_get_color_type(pp, pi); + png_byte bd = png_get_bit_depth(pp, pi); + + if (bd >= 8 && (ct == PNG_COLOR_TYPE_RGB || ct == PNG_COLOR_TYPE_GRAY) && + dp->filler) + ct |= 4; /* handle filler as faked alpha channel */ + + dp->pixel_size = bit_size(pp, ct, bd); + } + dp->bit_width = png_get_image_width(pp, pi) * dp->pixel_size; + dp->cbRow = png_get_rowbytes(pp, pi); + + /* Validate the rowbytes here again. */ + if (dp->cbRow != (dp->bit_width+7)/8) + png_error(pp, "bad png_get_rowbytes calculation"); + + /* Then ensure there is enough space for the output image(s). */ + store_ensure_image(dp->ps, pp, nImages, dp->cbRow, dp->h); +} + +static void +standard_info_imp(standard_display *dp, png_structp pp, png_infop pi, + int nImages) +{ + /* Note that the validation routine has the side effect of turning on + * interlace handling in the subsequent code. + */ + standard_info_part1(dp, pp, pi); + + /* And the info callback has to call this (or png_read_update_info - see + * below in the png_modifier code for that variant. + */ + if (dp->use_update_info) + { + /* For debugging the effect of multiple calls: */ + int i = dp->use_update_info; + while (i-- > 0) + png_read_update_info(pp, pi); + } + + else + png_start_read_image(pp); + + /* Validate the height, width and rowbytes plus ensure that sufficient buffer + * exists for decoding the image. + */ + standard_info_part2(dp, pp, pi, nImages); +} + +static void PNGCBAPI +standard_info(png_structp pp, png_infop pi) +{ + standard_display *dp = voidcast(standard_display*, + png_get_progressive_ptr(pp)); + + /* Call with nImages==1 because the progressive reader can only produce one + * image. + */ + standard_info_imp(dp, pp, pi, 1 /*only one image*/); +} + +static void PNGCBAPI +progressive_row(png_structp ppIn, png_bytep new_row, png_uint_32 y, int pass) +{ + png_const_structp pp = ppIn; + const standard_display *dp = voidcast(standard_display*, + png_get_progressive_ptr(pp)); + + /* When handling interlacing some rows will be absent in each pass, the + * callback still gets called, but with a NULL pointer. This is checked + * in the 'else' clause below. We need our own 'cbRow', but we can't call + * png_get_rowbytes because we got no info structure. + */ + if (new_row != NULL) + { + png_bytep row; + + /* In the case where the reader doesn't do the interlace it gives + * us the y in the sub-image: + */ + if (dp->do_interlace && dp->interlace_type == PNG_INTERLACE_ADAM7) + { +#ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED + /* Use this opportunity to validate the png 'current' APIs: */ + if (y != png_get_current_row_number(pp)) + png_error(pp, "png_get_current_row_number is broken"); + + if (pass != png_get_current_pass_number(pp)) + png_error(pp, "png_get_current_pass_number is broken"); +#endif /* USER_TRANSFORM_INFO */ + + y = PNG_ROW_FROM_PASS_ROW(y, pass); + } + + /* Validate this just in case. */ + if (y >= dp->h) + png_error(pp, "invalid y to progressive row callback"); + + row = store_image_row(dp->ps, pp, 0, y); + + /* Combine the new row into the old: */ +#ifdef PNG_READ_INTERLACING_SUPPORTED + if (dp->do_interlace) +#endif /* READ_INTERLACING */ + { + if (dp->interlace_type == PNG_INTERLACE_ADAM7) + deinterlace_row(row, new_row, dp->pixel_size, dp->w, pass, + dp->littleendian); + else + row_copy(row, new_row, dp->pixel_size * dp->w, dp->littleendian); + } +#ifdef PNG_READ_INTERLACING_SUPPORTED + else + png_progressive_combine_row(pp, row, new_row); +#endif /* PNG_READ_INTERLACING_SUPPORTED */ + } + + else if (dp->interlace_type == PNG_INTERLACE_ADAM7 && + PNG_ROW_IN_INTERLACE_PASS(y, pass) && + PNG_PASS_COLS(dp->w, pass) > 0) + png_error(pp, "missing row in progressive de-interlacing"); +} + +static void +sequential_row(standard_display *dp, png_structp pp, png_infop pi, + int iImage, int iDisplay) +{ + int npasses = dp->npasses; + int do_interlace = dp->do_interlace && + dp->interlace_type == PNG_INTERLACE_ADAM7; + png_uint_32 height = standard_height(pp, dp->id); + png_uint_32 width = standard_width(pp, dp->id); + const png_store* ps = dp->ps; + int pass; + + for (pass=0; pass 0 && PNG_ROW_IN_INTERLACE_PASS(y, pass)) + { + /* Read the row into a pair of temporary buffers, then do the + * merge here into the output rows. + */ + png_byte row[STANDARD_ROWMAX], display[STANDARD_ROWMAX]; + + /* The following aids (to some extent) error detection - we can + * see where png_read_row wrote. Use opposite values in row and + * display to make this easier. Don't use 0xff (which is used in + * the image write code to fill unused bits) or 0 (which is a + * likely value to overwrite unused bits with). + */ + memset(row, 0xc5, sizeof row); + memset(display, 0x5c, sizeof display); + + png_read_row(pp, row, display); + + if (iImage >= 0) + deinterlace_row(store_image_row(ps, pp, iImage, y), row, + dp->pixel_size, dp->w, pass, dp->littleendian); + + if (iDisplay >= 0) + deinterlace_row(store_image_row(ps, pp, iDisplay, y), display, + dp->pixel_size, dp->w, pass, dp->littleendian); + } + } + else + png_read_row(pp, + iImage >= 0 ? store_image_row(ps, pp, iImage, y) : NULL, + iDisplay >= 0 ? store_image_row(ps, pp, iDisplay, y) : NULL); + } + } + + /* And finish the read operation (only really necessary if the caller wants + * to find additional data in png_info from chunks after the last IDAT.) + */ + png_read_end(pp, pi); +} + +#ifdef PNG_TEXT_SUPPORTED +static void +standard_check_text(png_const_structp pp, png_const_textp tp, + png_const_charp keyword, png_const_charp text) +{ + char msg[1024]; + size_t pos = safecat(msg, sizeof msg, 0, "text: "); + size_t ok; + + pos = safecat(msg, sizeof msg, pos, keyword); + pos = safecat(msg, sizeof msg, pos, ": "); + ok = pos; + + if (tp->compression != TEXT_COMPRESSION) + { + char buf[64]; + + sprintf(buf, "compression [%d->%d], ", TEXT_COMPRESSION, + tp->compression); + pos = safecat(msg, sizeof msg, pos, buf); + } + + if (tp->key == NULL || strcmp(tp->key, keyword) != 0) + { + pos = safecat(msg, sizeof msg, pos, "keyword \""); + if (tp->key != NULL) + { + pos = safecat(msg, sizeof msg, pos, tp->key); + pos = safecat(msg, sizeof msg, pos, "\", "); + } + + else + pos = safecat(msg, sizeof msg, pos, "null, "); + } + + if (tp->text == NULL) + pos = safecat(msg, sizeof msg, pos, "text lost, "); + + else + { + if (tp->text_length != strlen(text)) + { + char buf[64]; + sprintf(buf, "text length changed[%lu->%lu], ", + (unsigned long)strlen(text), (unsigned long)tp->text_length); + pos = safecat(msg, sizeof msg, pos, buf); + } + + if (strcmp(tp->text, text) != 0) + { + pos = safecat(msg, sizeof msg, pos, "text becomes \""); + pos = safecat(msg, sizeof msg, pos, tp->text); + pos = safecat(msg, sizeof msg, pos, "\" (was \""); + pos = safecat(msg, sizeof msg, pos, text); + pos = safecat(msg, sizeof msg, pos, "\"), "); + } + } + + if (tp->itxt_length != 0) + pos = safecat(msg, sizeof msg, pos, "iTXt length set, "); + + if (tp->lang != NULL) + { + pos = safecat(msg, sizeof msg, pos, "iTXt language \""); + pos = safecat(msg, sizeof msg, pos, tp->lang); + pos = safecat(msg, sizeof msg, pos, "\", "); + } + + if (tp->lang_key != NULL) + { + pos = safecat(msg, sizeof msg, pos, "iTXt keyword \""); + pos = safecat(msg, sizeof msg, pos, tp->lang_key); + pos = safecat(msg, sizeof msg, pos, "\", "); + } + + if (pos > ok) + { + msg[pos-2] = '\0'; /* Remove the ", " at the end */ + png_error(pp, msg); + } +} + +static void +standard_text_validate(standard_display *dp, png_const_structp pp, + png_infop pi, int check_end) +{ + png_textp tp = NULL; + png_uint_32 num_text = png_get_text(pp, pi, &tp, NULL); + + if (num_text == 2 && tp != NULL) + { + standard_check_text(pp, tp, "image name", dp->ps->current->name); + + /* This exists because prior to 1.5.18 the progressive reader left the + * png_struct z_stream unreset at the end of the image, so subsequent + * attempts to use it simply returns Z_STREAM_END. + */ + if (check_end) + standard_check_text(pp, tp+1, "end marker", "end"); + } + + else + { + char msg[64]; + + sprintf(msg, "expected two text items, got %lu", + (unsigned long)num_text); + png_error(pp, msg); + } +} +#else +# define standard_text_validate(dp,pp,pi,check_end) ((void)0) +#endif + +static void +standard_row_validate(standard_display *dp, png_const_structp pp, + int iImage, int iDisplay, png_uint_32 y) +{ + int where; + png_byte std[STANDARD_ROWMAX]; + + /* The row must be pre-initialized to the magic number here for the size + * tests to pass: + */ + memset(std, 178, sizeof std); + standard_row(pp, std, dp->id, y); + + /* At the end both the 'row' and 'display' arrays should end up identical. + * In earlier passes 'row' will be partially filled in, with only the pixels + * that have been read so far, but 'display' will have those pixels + * replicated to fill the unread pixels while reading an interlaced image. + */ + if (iImage >= 0 && + (where = pixel_cmp(std, store_image_row(dp->ps, pp, iImage, y), + dp->bit_width)) != 0) + { + char msg[64]; + sprintf(msg, "PNG image row[%lu][%d] changed from %.2x to %.2x", + (unsigned long)y, where-1, std[where-1], + store_image_row(dp->ps, pp, iImage, y)[where-1]); + png_error(pp, msg); + } + + if (iDisplay >= 0 && + (where = pixel_cmp(std, store_image_row(dp->ps, pp, iDisplay, y), + dp->bit_width)) != 0) + { + char msg[64]; + sprintf(msg, "display row[%lu][%d] changed from %.2x to %.2x", + (unsigned long)y, where-1, std[where-1], + store_image_row(dp->ps, pp, iDisplay, y)[where-1]); + png_error(pp, msg); + } +} + +static void +standard_image_validate(standard_display *dp, png_const_structp pp, int iImage, + int iDisplay) +{ + png_uint_32 y; + + if (iImage >= 0) + store_image_check(dp->ps, pp, iImage); + + if (iDisplay >= 0) + store_image_check(dp->ps, pp, iDisplay); + + for (y=0; yh; ++y) + standard_row_validate(dp, pp, iImage, iDisplay, y); + + /* This avoids false positives if the validation code is never called! */ + dp->ps->validated = 1; +} + +static void PNGCBAPI +standard_end(png_structp ppIn, png_infop pi) +{ + png_const_structp pp = ppIn; + standard_display *dp = voidcast(standard_display*, + png_get_progressive_ptr(pp)); + + UNUSED(pi) + + /* Validate the image - progressive reading only produces one variant for + * interlaced images. + */ + standard_text_validate(dp, pp, pi, + PNG_LIBPNG_VER >= 10518/*check_end: see comments above*/); + standard_image_validate(dp, pp, 0, -1); +} + +/* A single test run checking the standard image to ensure it is not damaged. */ +static void +standard_test(png_store* const psIn, png_uint_32 const id, + int do_interlace, int use_update_info) +{ + standard_display d; + context(psIn, fault); + + /* Set up the display (stack frame) variables from the arguments to the + * function and initialize the locals that are filled in later. + */ + standard_display_init(&d, psIn, id, do_interlace, use_update_info); + + /* Everything is protected by a Try/Catch. The functions called also + * typically have local Try/Catch blocks. + */ + Try + { + png_structp pp; + png_infop pi; + + /* Get a png_struct for reading the image. This will throw an error if it + * fails, so we don't need to check the result. + */ + pp = set_store_for_read(d.ps, &pi, d.id, + d.do_interlace ? (d.ps->progressive ? + "pngvalid progressive deinterlacer" : + "pngvalid sequential deinterlacer") : (d.ps->progressive ? + "progressive reader" : "sequential reader")); + + /* Initialize the palette correctly from the png_store_file. */ + standard_palette_init(&d); + + /* Introduce the correct read function. */ + if (d.ps->progressive) + { + png_set_progressive_read_fn(pp, &d, standard_info, progressive_row, + standard_end); + + /* Now feed data into the reader until we reach the end: */ + store_progressive_read(d.ps, pp, pi); + } + else + { + /* Note that this takes the store, not the display. */ + png_set_read_fn(pp, d.ps, store_read); + + /* Check the header values: */ + png_read_info(pp, pi); + + /* The code tests both versions of the images that the sequential + * reader can produce. + */ + standard_info_imp(&d, pp, pi, 2 /*images*/); + + /* Need the total bytes in the image below; we can't get to this point + * unless the PNG file values have been checked against the expected + * values. + */ + { + sequential_row(&d, pp, pi, 0, 1); + + /* After the last pass loop over the rows again to check that the + * image is correct. + */ + if (!d.speed) + { + standard_text_validate(&d, pp, pi, 1/*check_end*/); + standard_image_validate(&d, pp, 0, 1); + } + else + d.ps->validated = 1; + } + } + + /* Check for validation. */ + if (!d.ps->validated) + png_error(pp, "image read failed silently"); + + /* Successful completion. */ + } + + Catch(fault) + d.ps = fault; /* make sure this hasn't been clobbered. */ + + /* In either case clean up the store. */ + store_read_reset(d.ps); +} + +static int +test_standard(png_modifier* const pm, png_byte const colour_type, + int bdlo, int const bdhi) +{ + for (; bdlo <= bdhi; ++bdlo) + { + int interlace_type; + + for (interlace_type = PNG_INTERLACE_NONE; + interlace_type < INTERLACE_LAST; ++interlace_type) + { + standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/, + interlace_type, 0, 0, 0), do_read_interlace, pm->use_update_info); + + if (fail(pm)) + return 0; + } + } + + return 1; /* keep going */ +} + +static void +perform_standard_test(png_modifier *pm) +{ + /* Test each colour type over the valid range of bit depths (expressed as + * log2(bit_depth) in turn, stop as soon as any error is detected. + */ + if (!test_standard(pm, 0, 0, READ_BDHI)) + return; + + if (!test_standard(pm, 2, 3, READ_BDHI)) + return; + + if (!test_standard(pm, 3, 0, 3)) + return; + + if (!test_standard(pm, 4, 3, READ_BDHI)) + return; + + if (!test_standard(pm, 6, 3, READ_BDHI)) + return; +} + + +/********************************** SIZE TESTS ********************************/ +static int +test_size(png_modifier* const pm, png_byte const colour_type, + int bdlo, int const bdhi) +{ + /* Run the tests on each combination. + * + * NOTE: on my 32 bit x86 each of the following blocks takes + * a total of 3.5 seconds if done across every combo of bit depth + * width and height. This is a waste of time in practice, hence the + * hinc and winc stuff: + */ + static const png_byte hinc[] = {1, 3, 11, 1, 5}; + static const png_byte winc[] = {1, 9, 5, 7, 1}; + int save_bdlo = bdlo; + + for (; bdlo <= bdhi; ++bdlo) + { + png_uint_32 h, w; + + for (h=1; h<=16; h+=hinc[bdlo]) for (w=1; w<=16; w+=winc[bdlo]) + { + /* First test all the 'size' images against the sequential + * reader using libpng to deinterlace (where required.) This + * validates the write side of libpng. There are four possibilities + * to validate. + */ + standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/, + PNG_INTERLACE_NONE, w, h, 0), 0/*do_interlace*/, + pm->use_update_info); + + if (fail(pm)) + return 0; + + standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/, + PNG_INTERLACE_NONE, w, h, 1), 0/*do_interlace*/, + pm->use_update_info); + + if (fail(pm)) + return 0; + + /* Now validate the interlaced read side - do_interlace true, + * in the progressive case this does actually make a difference + * to the code used in the non-interlaced case too. + */ + standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/, + PNG_INTERLACE_NONE, w, h, 0), 1/*do_interlace*/, + pm->use_update_info); + + if (fail(pm)) + return 0; + +# if CAN_WRITE_INTERLACE + /* Validate the pngvalid code itself: */ + standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/, + PNG_INTERLACE_ADAM7, w, h, 1), 1/*do_interlace*/, + pm->use_update_info); + + if (fail(pm)) + return 0; +# endif + } + } + + /* Now do the tests of libpng interlace handling, after we have made sure + * that the pngvalid version works: + */ + for (bdlo = save_bdlo; bdlo <= bdhi; ++bdlo) + { + png_uint_32 h, w; + + for (h=1; h<=16; h+=hinc[bdlo]) for (w=1; w<=16; w+=winc[bdlo]) + { +# ifdef PNG_READ_INTERLACING_SUPPORTED + /* Test with pngvalid generated interlaced images first; we have + * already verify these are ok (unless pngvalid has self-consistent + * read/write errors, which is unlikely), so this detects errors in the + * read side first: + */ +# if CAN_WRITE_INTERLACE + standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/, + PNG_INTERLACE_ADAM7, w, h, 1), 0/*do_interlace*/, + pm->use_update_info); + + if (fail(pm)) + return 0; +# endif +# endif /* READ_INTERLACING */ + +# ifdef PNG_WRITE_INTERLACING_SUPPORTED + /* Test the libpng write side against the pngvalid read side: */ + standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/, + PNG_INTERLACE_ADAM7, w, h, 0), 1/*do_interlace*/, + pm->use_update_info); + + if (fail(pm)) + return 0; +# endif + +# ifdef PNG_READ_INTERLACING_SUPPORTED +# ifdef PNG_WRITE_INTERLACING_SUPPORTED + /* Test both together: */ + standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/, + PNG_INTERLACE_ADAM7, w, h, 0), 0/*do_interlace*/, + pm->use_update_info); + + if (fail(pm)) + return 0; +# endif +# endif /* READ_INTERLACING */ + } + } + + return 1; /* keep going */ +} + +static void +perform_size_test(png_modifier *pm) +{ + /* Test each colour type over the valid range of bit depths (expressed as + * log2(bit_depth) in turn, stop as soon as any error is detected. + */ + if (!test_size(pm, 0, 0, READ_BDHI)) + return; + + if (!test_size(pm, 2, 3, READ_BDHI)) + return; + + /* For the moment don't do the palette test - it's a waste of time when + * compared to the grayscale test. + */ +#if 0 + if (!test_size(pm, 3, 0, 3)) + return; +#endif + + if (!test_size(pm, 4, 3, READ_BDHI)) + return; + + if (!test_size(pm, 6, 3, READ_BDHI)) + return; +} + + +/******************************* TRANSFORM TESTS ******************************/ +#ifdef PNG_READ_TRANSFORMS_SUPPORTED +/* A set of tests to validate libpng image transforms. The possibilities here + * are legion because the transforms can be combined in a combinatorial + * fashion. To deal with this some measure of restraint is required, otherwise + * the tests would take forever. + */ +typedef struct image_pixel +{ + /* A local (pngvalid) representation of a PNG pixel, in all its + * various forms. + */ + unsigned int red, green, blue, alpha; /* For non-palette images. */ + unsigned int palette_index; /* For a palette image. */ + png_byte colour_type; /* As in the spec. */ + png_byte bit_depth; /* Defines bit size in row */ + png_byte sample_depth; /* Scale of samples */ + unsigned int have_tRNS :1; /* tRNS chunk may need processing */ + unsigned int swap_rgb :1; /* RGB swapped to BGR */ + unsigned int alpha_first :1; /* Alpha at start, not end */ + unsigned int alpha_inverted :1; /* Alpha channel inverted */ + unsigned int mono_inverted :1; /* Gray channel inverted */ + unsigned int swap16 :1; /* Byte swap 16-bit components */ + unsigned int littleendian :1; /* High bits on right */ + unsigned int sig_bits :1; /* Pixel shifted (sig bits only) */ + + /* For checking the code calculates double precision floating point values + * along with an error value, accumulated from the transforms. Because an + * sBIT setting allows larger error bounds (indeed, by the spec, apparently + * up to just less than +/-1 in the scaled value) the *lowest* sBIT for each + * channel is stored. This sBIT value is folded in to the stored error value + * at the end of the application of the transforms to the pixel. + * + * If sig_bits is set above the red, green, blue and alpha values have been + * scaled so they only contain the significant bits of the component values. + */ + double redf, greenf, bluef, alphaf; + double rede, greene, bluee, alphae; + png_byte red_sBIT, green_sBIT, blue_sBIT, alpha_sBIT; +} image_pixel; + +/* Shared utility function, see below. */ +static void +image_pixel_setf(image_pixel *this, unsigned int rMax, unsigned int gMax, + unsigned int bMax, unsigned int aMax) +{ + this->redf = this->red / (double)rMax; + this->greenf = this->green / (double)gMax; + this->bluef = this->blue / (double)bMax; + this->alphaf = this->alpha / (double)aMax; + + if (this->red < rMax) + this->rede = this->redf * DBL_EPSILON; + else + this->rede = 0; + if (this->green < gMax) + this->greene = this->greenf * DBL_EPSILON; + else + this->greene = 0; + if (this->blue < bMax) + this->bluee = this->bluef * DBL_EPSILON; + else + this->bluee = 0; + if (this->alpha < aMax) + this->alphae = this->alphaf * DBL_EPSILON; + else + this->alphae = 0; +} + +/* Initialize the structure for the next pixel - call this before doing any + * transforms and call it for each pixel since all the fields may need to be + * reset. + */ +static void +image_pixel_init(image_pixel *this, png_const_bytep row, png_byte colour_type, + png_byte bit_depth, png_uint_32 x, store_palette palette, + const image_pixel *format /*from pngvalid transform of input*/) +{ + png_byte sample_depth = + (png_byte)(colour_type == PNG_COLOR_TYPE_PALETTE ? 8 : bit_depth); + unsigned int max = (1U<swap16); + int littleendian = (format != 0 && format->littleendian); + int sig_bits = (format != 0 && format->sig_bits); + + /* Initially just set everything to the same number and the alpha to opaque. + * Note that this currently assumes a simple palette where entry x has colour + * rgb(x,x,x)! + */ + this->palette_index = this->red = this->green = this->blue = + sample(row, colour_type, bit_depth, x, 0, swap16, littleendian); + this->alpha = max; + this->red_sBIT = this->green_sBIT = this->blue_sBIT = this->alpha_sBIT = + sample_depth; + + /* Then override as appropriate: */ + if (colour_type == 3) /* palette */ + { + /* This permits the caller to default to the sample value. */ + if (palette != 0) + { + unsigned int i = this->palette_index; + + this->red = palette[i].red; + this->green = palette[i].green; + this->blue = palette[i].blue; + this->alpha = palette[i].alpha; + } + } + + else /* not palette */ + { + unsigned int i = 0; + + if ((colour_type & 4) != 0 && format != 0 && format->alpha_first) + { + this->alpha = this->red; + /* This handles the gray case for 'AG' pixels */ + this->palette_index = this->red = this->green = this->blue = + sample(row, colour_type, bit_depth, x, 1, swap16, littleendian); + i = 1; + } + + if (colour_type & 2) + { + /* Green is second for both BGR and RGB: */ + this->green = sample(row, colour_type, bit_depth, x, ++i, swap16, + littleendian); + + if (format != 0 && format->swap_rgb) /* BGR */ + this->red = sample(row, colour_type, bit_depth, x, ++i, swap16, + littleendian); + else + this->blue = sample(row, colour_type, bit_depth, x, ++i, swap16, + littleendian); + } + + else /* grayscale */ if (format != 0 && format->mono_inverted) + this->red = this->green = this->blue = this->red ^ max; + + if ((colour_type & 4) != 0) /* alpha */ + { + if (format == 0 || !format->alpha_first) + this->alpha = sample(row, colour_type, bit_depth, x, ++i, swap16, + littleendian); + + if (format != 0 && format->alpha_inverted) + this->alpha ^= max; + } + } + + /* Calculate the scaled values, these are simply the values divided by + * 'max' and the error is initialized to the double precision epsilon value + * from the header file. + */ + image_pixel_setf(this, + sig_bits ? (1U << format->red_sBIT)-1 : max, + sig_bits ? (1U << format->green_sBIT)-1 : max, + sig_bits ? (1U << format->blue_sBIT)-1 : max, + sig_bits ? (1U << format->alpha_sBIT)-1 : max); + + /* Store the input information for use in the transforms - these will + * modify the information. + */ + this->colour_type = colour_type; + this->bit_depth = bit_depth; + this->sample_depth = sample_depth; + this->have_tRNS = 0; + this->swap_rgb = 0; + this->alpha_first = 0; + this->alpha_inverted = 0; + this->mono_inverted = 0; + this->swap16 = 0; + this->littleendian = 0; + this->sig_bits = 0; +} + +#if defined PNG_READ_EXPAND_SUPPORTED || defined PNG_READ_GRAY_TO_RGB_SUPPORTED\ + || defined PNG_READ_EXPAND_SUPPORTED || defined PNG_READ_EXPAND_16_SUPPORTED\ + || defined PNG_READ_BACKGROUND_SUPPORTED +/* Convert a palette image to an rgb image. This necessarily converts the tRNS + * chunk at the same time, because the tRNS will be in palette form. The way + * palette validation works means that the original palette is never updated, + * instead the image_pixel value from the row contains the RGB of the + * corresponding palette entry and *this* is updated. Consequently this routine + * only needs to change the colour type information. + */ +static void +image_pixel_convert_PLTE(image_pixel *this) +{ + if (this->colour_type == PNG_COLOR_TYPE_PALETTE) + { + if (this->have_tRNS) + { + this->colour_type = PNG_COLOR_TYPE_RGB_ALPHA; + this->have_tRNS = 0; + } + else + this->colour_type = PNG_COLOR_TYPE_RGB; + + /* The bit depth of the row changes at this point too (notice that this is + * the row format, not the sample depth, which is separate.) + */ + this->bit_depth = 8; + } +} + +/* Add an alpha channel; this will import the tRNS information because tRNS is + * not valid in an alpha image. The bit depth will invariably be set to at + * least 8 prior to 1.7.0. Palette images will be converted to alpha (using + * the above API). With png_set_background the alpha channel is never expanded + * but this routine is used by pngvalid to simplify code; 'for_background' + * records this. + */ +static void +image_pixel_add_alpha(image_pixel *this, const standard_display *display, + int for_background) +{ + if (this->colour_type == PNG_COLOR_TYPE_PALETTE) + image_pixel_convert_PLTE(this); + + if ((this->colour_type & PNG_COLOR_MASK_ALPHA) == 0) + { + if (this->colour_type == PNG_COLOR_TYPE_GRAY) + { +# if PNG_LIBPNG_VER < 10700 + if (!for_background && this->bit_depth < 8) + this->bit_depth = this->sample_depth = 8; +# endif + + if (this->have_tRNS) + { + /* After 1.7 the expansion of bit depth only happens if there is a + * tRNS chunk to expand at this point. + */ +# if PNG_LIBPNG_VER >= 10700 + if (!for_background && this->bit_depth < 8) + this->bit_depth = this->sample_depth = 8; +# endif + + this->have_tRNS = 0; + + /* Check the input, original, channel value here against the + * original tRNS gray chunk valie. + */ + if (this->red == display->transparent.red) + this->alphaf = 0; + else + this->alphaf = 1; + } + else + this->alphaf = 1; + + this->colour_type = PNG_COLOR_TYPE_GRAY_ALPHA; + } + + else if (this->colour_type == PNG_COLOR_TYPE_RGB) + { + if (this->have_tRNS) + { + this->have_tRNS = 0; + + /* Again, check the exact input values, not the current transformed + * value! + */ + if (this->red == display->transparent.red && + this->green == display->transparent.green && + this->blue == display->transparent.blue) + this->alphaf = 0; + else + this->alphaf = 1; + } + else + this->alphaf = 1; + + this->colour_type = PNG_COLOR_TYPE_RGB_ALPHA; + } + + /* The error in the alpha is zero and the sBIT value comes from the + * original sBIT data (actually it will always be the original bit depth). + */ + this->alphae = 0; + this->alpha_sBIT = display->alpha_sBIT; + } +} +#endif /* transforms that need image_pixel_add_alpha */ + +struct transform_display; +typedef struct image_transform +{ + /* The name of this transform: a string. */ + const char *name; + + /* Each transform can be disabled from the command line: */ + int enable; + + /* The global list of transforms; read only. */ + struct image_transform *const list; + + /* The global count of the number of times this transform has been set on an + * image. + */ + unsigned int global_use; + + /* The local count of the number of times this transform has been set. */ + unsigned int local_use; + + /* The next transform in the list, each transform must call its own next + * transform after it has processed the pixel successfully. + */ + const struct image_transform *next; + + /* A single transform for the image, expressed as a series of function + * callbacks and some space for values. + * + * First a callback to add any required modifications to the png_modifier; + * this gets called just before the modifier is set up for read. + */ + void (*ini)(const struct image_transform *this, + struct transform_display *that); + + /* And a callback to set the transform on the current png_read_struct: + */ + void (*set)(const struct image_transform *this, + struct transform_display *that, png_structp pp, png_infop pi); + + /* Then a transform that takes an input pixel in one PNG format or another + * and modifies it by a pngvalid implementation of the transform (thus + * duplicating the libpng intent without, we hope, duplicating the bugs + * in the libpng implementation!) The png_structp is solely to allow error + * reporting via png_error and png_warning. + */ + void (*mod)(const struct image_transform *this, image_pixel *that, + png_const_structp pp, const struct transform_display *display); + + /* Add this transform to the list and return true if the transform is + * meaningful for this colour type and bit depth - if false then the + * transform should have no effect on the image so there's not a lot of + * point running it. + */ + int (*add)(struct image_transform *this, + const struct image_transform **that, png_byte colour_type, + png_byte bit_depth); +} image_transform; + +typedef struct transform_display +{ + standard_display this; + + /* Parameters */ + png_modifier* pm; + const image_transform* transform_list; + unsigned int max_gamma_8; + + /* Local variables */ + png_byte output_colour_type; + png_byte output_bit_depth; + png_byte unpacked; + + /* Modifications (not necessarily used.) */ + gama_modification gama_mod; + chrm_modification chrm_mod; + srgb_modification srgb_mod; +} transform_display; + +/* Set sRGB, cHRM and gAMA transforms as required by the current encoding. */ +static void +transform_set_encoding(transform_display *this) +{ + /* Set up the png_modifier '_current' fields then use these to determine how + * to add appropriate chunks. + */ + png_modifier *pm = this->pm; + + modifier_set_encoding(pm); + + if (modifier_color_encoding_is_set(pm)) + { + if (modifier_color_encoding_is_sRGB(pm)) + srgb_modification_init(&this->srgb_mod, pm, PNG_sRGB_INTENT_ABSOLUTE); + + else + { + /* Set gAMA and cHRM separately. */ + gama_modification_init(&this->gama_mod, pm, pm->current_gamma); + + if (pm->current_encoding != 0) + chrm_modification_init(&this->chrm_mod, pm, pm->current_encoding); + } + } +} + +/* Three functions to end the list: */ +static void +image_transform_ini_end(const image_transform *this, + transform_display *that) +{ + UNUSED(this) + UNUSED(that) +} + +static void +image_transform_set_end(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + UNUSED(this) + UNUSED(that) + UNUSED(pp) + UNUSED(pi) +} + +/* At the end of the list recalculate the output image pixel value from the + * double precision values set up by the preceding 'mod' calls: + */ +static unsigned int +sample_scale(double sample_value, unsigned int scale) +{ + sample_value = floor(sample_value * scale + .5); + + /* Return NaN as 0: */ + if (!(sample_value > 0)) + sample_value = 0; + else if (sample_value > scale) + sample_value = scale; + + return (unsigned int)sample_value; +} + +static void +image_transform_mod_end(const image_transform *this, image_pixel *that, + png_const_structp pp, const transform_display *display) +{ + unsigned int scale = (1U<sample_depth)-1; + int sig_bits = that->sig_bits; + + UNUSED(this) + UNUSED(pp) + UNUSED(display) + + /* At the end recalculate the digitized red green and blue values according + * to the current sample_depth of the pixel. + * + * The sample value is simply scaled to the maximum, checking for over + * and underflow (which can both happen for some image transforms, + * including simple size scaling, though libpng doesn't do that at present. + */ + that->red = sample_scale(that->redf, scale); + + /* This is a bit bogus; really the above calculation should use the red_sBIT + * value, not sample_depth, but because libpng does png_set_shift by just + * shifting the bits we get errors if we don't do it the same way. + */ + if (sig_bits && that->red_sBIT < that->sample_depth) + that->red >>= that->sample_depth - that->red_sBIT; + + /* The error value is increased, at the end, according to the lowest sBIT + * value seen. Common sense tells us that the intermediate integer + * representations are no more accurate than +/- 0.5 in the integral values, + * the sBIT allows the implementation to be worse than this. In addition the + * PNG specification actually permits any error within the range (-1..+1), + * but that is ignored here. Instead the final digitized value is compared, + * below to the digitized value of the error limits - this has the net effect + * of allowing (almost) +/-1 in the output value. It's difficult to see how + * any algorithm that digitizes intermediate results can be more accurate. + */ + that->rede += 1./(2*((1U<red_sBIT)-1)); + + if (that->colour_type & PNG_COLOR_MASK_COLOR) + { + that->green = sample_scale(that->greenf, scale); + if (sig_bits && that->green_sBIT < that->sample_depth) + that->green >>= that->sample_depth - that->green_sBIT; + + that->blue = sample_scale(that->bluef, scale); + if (sig_bits && that->blue_sBIT < that->sample_depth) + that->blue >>= that->sample_depth - that->blue_sBIT; + + that->greene += 1./(2*((1U<green_sBIT)-1)); + that->bluee += 1./(2*((1U<blue_sBIT)-1)); + } + else + { + that->blue = that->green = that->red; + that->bluef = that->greenf = that->redf; + that->bluee = that->greene = that->rede; + } + + if ((that->colour_type & PNG_COLOR_MASK_ALPHA) || + that->colour_type == PNG_COLOR_TYPE_PALETTE) + { + that->alpha = sample_scale(that->alphaf, scale); + that->alphae += 1./(2*((1U<alpha_sBIT)-1)); + } + else + { + that->alpha = scale; /* opaque */ + that->alphaf = 1; /* Override this. */ + that->alphae = 0; /* It's exact ;-) */ + } + + if (sig_bits && that->alpha_sBIT < that->sample_depth) + that->alpha >>= that->sample_depth - that->alpha_sBIT; +} + +/* Static 'end' structure: */ +static image_transform image_transform_end = +{ + "(end)", /* name */ + 1, /* enable */ + 0, /* list */ + 0, /* global_use */ + 0, /* local_use */ + 0, /* next */ + image_transform_ini_end, + image_transform_set_end, + image_transform_mod_end, + 0 /* never called, I want it to crash if it is! */ +}; + +/* Reader callbacks and implementations, where they differ from the standard + * ones. + */ +static void +transform_display_init(transform_display *dp, png_modifier *pm, png_uint_32 id, + const image_transform *transform_list) +{ + memset(dp, 0, sizeof *dp); + + /* Standard fields */ + standard_display_init(&dp->this, &pm->this, id, do_read_interlace, + pm->use_update_info); + + /* Parameter fields */ + dp->pm = pm; + dp->transform_list = transform_list; + dp->max_gamma_8 = 16; + + /* Local variable fields */ + dp->output_colour_type = 255; /* invalid */ + dp->output_bit_depth = 255; /* invalid */ + dp->unpacked = 0; /* not unpacked */ +} + +static void +transform_info_imp(transform_display *dp, png_structp pp, png_infop pi) +{ + /* Reuse the standard stuff as appropriate. */ + standard_info_part1(&dp->this, pp, pi); + + /* Now set the list of transforms. */ + dp->transform_list->set(dp->transform_list, dp, pp, pi); + + /* Update the info structure for these transforms: */ + { + int i = dp->this.use_update_info; + /* Always do one call, even if use_update_info is 0. */ + do + png_read_update_info(pp, pi); + while (--i > 0); + } + + /* And get the output information into the standard_display */ + standard_info_part2(&dp->this, pp, pi, 1/*images*/); + + /* Plus the extra stuff we need for the transform tests: */ + dp->output_colour_type = png_get_color_type(pp, pi); + dp->output_bit_depth = png_get_bit_depth(pp, pi); + + /* If png_set_filler is in action then fake the output color type to include + * an alpha channel where appropriate. + */ + if (dp->output_bit_depth >= 8 && + (dp->output_colour_type == PNG_COLOR_TYPE_RGB || + dp->output_colour_type == PNG_COLOR_TYPE_GRAY) && dp->this.filler) + dp->output_colour_type |= 4; + + /* Validate the combination of colour type and bit depth that we are getting + * out of libpng; the semantics of something not in the PNG spec are, at + * best, unclear. + */ + switch (dp->output_colour_type) + { + case PNG_COLOR_TYPE_PALETTE: + if (dp->output_bit_depth > 8) goto error; + /* FALLTHROUGH */ + case PNG_COLOR_TYPE_GRAY: + if (dp->output_bit_depth == 1 || dp->output_bit_depth == 2 || + dp->output_bit_depth == 4) + break; + /* FALLTHROUGH */ + default: + if (dp->output_bit_depth == 8 || dp->output_bit_depth == 16) + break; + /* FALLTHROUGH */ + error: + { + char message[128]; + size_t pos; + + pos = safecat(message, sizeof message, 0, + "invalid final bit depth: colour type("); + pos = safecatn(message, sizeof message, pos, dp->output_colour_type); + pos = safecat(message, sizeof message, pos, ") with bit depth: "); + pos = safecatn(message, sizeof message, pos, dp->output_bit_depth); + + png_error(pp, message); + } + } + + /* Use a test pixel to check that the output agrees with what we expect - + * this avoids running the whole test if the output is unexpected. This also + * checks for internal errors. + */ + { + image_pixel test_pixel; + + memset(&test_pixel, 0, sizeof test_pixel); + test_pixel.colour_type = dp->this.colour_type; /* input */ + test_pixel.bit_depth = dp->this.bit_depth; + if (test_pixel.colour_type == PNG_COLOR_TYPE_PALETTE) + test_pixel.sample_depth = 8; + else + test_pixel.sample_depth = test_pixel.bit_depth; + /* Don't need sBIT here, but it must be set to non-zero to avoid + * arithmetic overflows. + */ + test_pixel.have_tRNS = dp->this.is_transparent != 0; + test_pixel.red_sBIT = test_pixel.green_sBIT = test_pixel.blue_sBIT = + test_pixel.alpha_sBIT = test_pixel.sample_depth; + + dp->transform_list->mod(dp->transform_list, &test_pixel, pp, dp); + + if (test_pixel.colour_type != dp->output_colour_type) + { + char message[128]; + size_t pos = safecat(message, sizeof message, 0, "colour type "); + + pos = safecatn(message, sizeof message, pos, dp->output_colour_type); + pos = safecat(message, sizeof message, pos, " expected "); + pos = safecatn(message, sizeof message, pos, test_pixel.colour_type); + + png_error(pp, message); + } + + if (test_pixel.bit_depth != dp->output_bit_depth) + { + char message[128]; + size_t pos = safecat(message, sizeof message, 0, "bit depth "); + + pos = safecatn(message, sizeof message, pos, dp->output_bit_depth); + pos = safecat(message, sizeof message, pos, " expected "); + pos = safecatn(message, sizeof message, pos, test_pixel.bit_depth); + + png_error(pp, message); + } + + /* If both bit depth and colour type are correct check the sample depth. + */ + if (test_pixel.colour_type == PNG_COLOR_TYPE_PALETTE && + test_pixel.sample_depth != 8) /* oops - internal error! */ + png_error(pp, "pngvalid: internal: palette sample depth not 8"); + else if (dp->unpacked && test_pixel.bit_depth != 8) + png_error(pp, "pngvalid: internal: bad unpacked pixel depth"); + else if (!dp->unpacked && test_pixel.colour_type != PNG_COLOR_TYPE_PALETTE + && test_pixel.bit_depth != test_pixel.sample_depth) + { + char message[128]; + size_t pos = safecat(message, sizeof message, 0, + "internal: sample depth "); + + /* Because unless something has set 'unpacked' or the image is palette + * mapped we expect the transform to keep sample depth and bit depth + * the same. + */ + pos = safecatn(message, sizeof message, pos, test_pixel.sample_depth); + pos = safecat(message, sizeof message, pos, " expected "); + pos = safecatn(message, sizeof message, pos, test_pixel.bit_depth); + + png_error(pp, message); + } + else if (test_pixel.bit_depth != dp->output_bit_depth) + { + /* This could be a libpng error too; libpng has not produced what we + * expect for the output bit depth. + */ + char message[128]; + size_t pos = safecat(message, sizeof message, 0, + "internal: bit depth "); + + pos = safecatn(message, sizeof message, pos, dp->output_bit_depth); + pos = safecat(message, sizeof message, pos, " expected "); + pos = safecatn(message, sizeof message, pos, test_pixel.bit_depth); + + png_error(pp, message); + } + } +} + +static void PNGCBAPI +transform_info(png_structp pp, png_infop pi) +{ + transform_info_imp(voidcast(transform_display*, png_get_progressive_ptr(pp)), + pp, pi); +} + +static void +transform_range_check(png_const_structp pp, unsigned int r, unsigned int g, + unsigned int b, unsigned int a, unsigned int in_digitized, double in, + unsigned int out, png_byte sample_depth, double err, double limit, + const char *name, double digitization_error) +{ + /* Compare the scaled, digitzed, values of our local calculation (in+-err) + * with the digitized values libpng produced; 'sample_depth' is the actual + * digitization depth of the libpng output colors (the bit depth except for + * palette images where it is always 8.) The check on 'err' is to detect + * internal errors in pngvalid itself. + */ + unsigned int max = (1U< limit ||) !(out >= in_min && out <= in_max)) + { + char message[256]; + size_t pos; + + pos = safecat(message, sizeof message, 0, name); + pos = safecat(message, sizeof message, pos, " output value error: rgba("); + pos = safecatn(message, sizeof message, pos, r); + pos = safecat(message, sizeof message, pos, ","); + pos = safecatn(message, sizeof message, pos, g); + pos = safecat(message, sizeof message, pos, ","); + pos = safecatn(message, sizeof message, pos, b); + pos = safecat(message, sizeof message, pos, ","); + pos = safecatn(message, sizeof message, pos, a); + pos = safecat(message, sizeof message, pos, "): "); + pos = safecatn(message, sizeof message, pos, out); + pos = safecat(message, sizeof message, pos, " expected: "); + pos = safecatn(message, sizeof message, pos, in_digitized); + pos = safecat(message, sizeof message, pos, " ("); + pos = safecatd(message, sizeof message, pos, (in-err)*max, 3); + pos = safecat(message, sizeof message, pos, ".."); + pos = safecatd(message, sizeof message, pos, (in+err)*max, 3); + pos = safecat(message, sizeof message, pos, ")"); + + png_error(pp, message); + } + + UNUSED(limit) +} + +static void +transform_image_validate(transform_display *dp, png_const_structp pp, + png_infop pi) +{ + /* Constants for the loop below: */ + const png_store* const ps = dp->this.ps; + png_byte in_ct = dp->this.colour_type; + png_byte in_bd = dp->this.bit_depth; + png_uint_32 w = dp->this.w; + png_uint_32 h = dp->this.h; + png_byte out_ct = dp->output_colour_type; + png_byte out_bd = dp->output_bit_depth; + png_byte sample_depth = + (png_byte)(out_ct == PNG_COLOR_TYPE_PALETTE ? 8 : out_bd); + png_byte red_sBIT = dp->this.red_sBIT; + png_byte green_sBIT = dp->this.green_sBIT; + png_byte blue_sBIT = dp->this.blue_sBIT; + png_byte alpha_sBIT = dp->this.alpha_sBIT; + int have_tRNS = dp->this.is_transparent; + double digitization_error; + + store_palette out_palette; + png_uint_32 y; + + UNUSED(pi) + + /* Check for row overwrite errors */ + store_image_check(dp->this.ps, pp, 0); + + /* Read the palette corresponding to the output if the output colour type + * indicates a palette, otherwise set out_palette to garbage. + */ + if (out_ct == PNG_COLOR_TYPE_PALETTE) + { + /* Validate that the palette count itself has not changed - this is not + * expected. + */ + int npalette = (-1); + + (void)read_palette(out_palette, &npalette, pp, pi); + if (npalette != dp->this.npalette) + png_error(pp, "unexpected change in palette size"); + + digitization_error = .5; + } + else + { + png_byte in_sample_depth; + + memset(out_palette, 0x5e, sizeof out_palette); + + /* use-input-precision means assume that if the input has 8 bit (or less) + * samples and the output has 16 bit samples the calculations will be done + * with 8 bit precision, not 16. + */ + if (in_ct == PNG_COLOR_TYPE_PALETTE || in_bd < 16) + in_sample_depth = 8; + else + in_sample_depth = in_bd; + + if (sample_depth != 16 || in_sample_depth > 8 || + !dp->pm->calculations_use_input_precision) + digitization_error = .5; + + /* Else calculations are at 8 bit precision, and the output actually + * consists of scaled 8-bit values, so scale .5 in 8 bits to the 16 bits: + */ + else + digitization_error = .5 * 257; + } + + for (y=0; ythis.palette, + NULL); + + in_pixel.red_sBIT = red_sBIT; + in_pixel.green_sBIT = green_sBIT; + in_pixel.blue_sBIT = blue_sBIT; + in_pixel.alpha_sBIT = alpha_sBIT; + in_pixel.have_tRNS = have_tRNS != 0; + + /* For error detection, below. */ + r = in_pixel.red; + g = in_pixel.green; + b = in_pixel.blue; + a = in_pixel.alpha; + + /* This applies the transforms to the input data, including output + * format operations which must be used when reading the output + * pixel that libpng produces. + */ + dp->transform_list->mod(dp->transform_list, &in_pixel, pp, dp); + + /* Read the output pixel and compare it to what we got, we don't + * use the error field here, so no need to update sBIT. in_pixel + * says whether we expect libpng to change the output format. + */ + image_pixel_init(&out_pixel, pRow, out_ct, out_bd, x, out_palette, + &in_pixel); + + /* We don't expect changes to the index here even if the bit depth is + * changed. + */ + if (in_ct == PNG_COLOR_TYPE_PALETTE && + out_ct == PNG_COLOR_TYPE_PALETTE) + { + if (in_pixel.palette_index != out_pixel.palette_index) + png_error(pp, "unexpected transformed palette index"); + } + + /* Check the colours for palette images too - in fact the palette could + * be separately verified itself in most cases. + */ + if (in_pixel.red != out_pixel.red) + transform_range_check(pp, r, g, b, a, in_pixel.red, in_pixel.redf, + out_pixel.red, sample_depth, in_pixel.rede, + dp->pm->limit + 1./(2*((1U<pm->limit + 1./(2*((1U<pm->limit + 1./(2*((1U<pm->limit + 1./(2*((1U<this.ps->validated = 1; +} + +static void PNGCBAPI +transform_end(png_structp ppIn, png_infop pi) +{ + png_const_structp pp = ppIn; + transform_display *dp = voidcast(transform_display*, + png_get_progressive_ptr(pp)); + + if (!dp->this.speed) + transform_image_validate(dp, pp, pi); + else + dp->this.ps->validated = 1; +} + +/* A single test run. */ +static void +transform_test(png_modifier *pmIn, png_uint_32 idIn, + const image_transform* transform_listIn, const char * const name) +{ + transform_display d; + context(&pmIn->this, fault); + + transform_display_init(&d, pmIn, idIn, transform_listIn); + + Try + { + size_t pos = 0; + png_structp pp; + png_infop pi; + char full_name[256]; + + /* Make sure the encoding fields are correct and enter the required + * modifications. + */ + transform_set_encoding(&d); + + /* Add any modifications required by the transform list. */ + d.transform_list->ini(d.transform_list, &d); + + /* Add the color space information, if any, to the name. */ + pos = safecat(full_name, sizeof full_name, pos, name); + pos = safecat_current_encoding(full_name, sizeof full_name, pos, d.pm); + + /* Get a png_struct for reading the image. */ + pp = set_modifier_for_read(d.pm, &pi, d.this.id, full_name); + standard_palette_init(&d.this); + +# if 0 + /* Logging (debugging only) */ + { + char buffer[256]; + + (void)store_message(&d.pm->this, pp, buffer, sizeof buffer, 0, + "running test"); + + fprintf(stderr, "%s\n", buffer); + } +# endif + + /* Introduce the correct read function. */ + if (d.pm->this.progressive) + { + /* Share the row function with the standard implementation. */ + png_set_progressive_read_fn(pp, &d, transform_info, progressive_row, + transform_end); + + /* Now feed data into the reader until we reach the end: */ + modifier_progressive_read(d.pm, pp, pi); + } + else + { + /* modifier_read expects a png_modifier* */ + png_set_read_fn(pp, d.pm, modifier_read); + + /* Check the header values: */ + png_read_info(pp, pi); + + /* Process the 'info' requirements. Only one image is generated */ + transform_info_imp(&d, pp, pi); + + sequential_row(&d.this, pp, pi, -1, 0); + + if (!d.this.speed) + transform_image_validate(&d, pp, pi); + else + d.this.ps->validated = 1; + } + + modifier_reset(d.pm); + } + + Catch(fault) + { + modifier_reset(voidcast(png_modifier*,(void*)fault)); + } +} + +/* The transforms: */ +#define ITSTRUCT(name) image_transform_##name +#define ITDATA(name) image_transform_data_##name +#define image_transform_ini image_transform_default_ini +#define IT(name)\ +static image_transform ITSTRUCT(name) =\ +{\ + #name,\ + 1, /*enable*/\ + &PT, /*list*/\ + 0, /*global_use*/\ + 0, /*local_use*/\ + 0, /*next*/\ + image_transform_ini,\ + image_transform_png_set_##name##_set,\ + image_transform_png_set_##name##_mod,\ + image_transform_png_set_##name##_add\ +} +#define PT ITSTRUCT(end) /* stores the previous transform */ + +/* To save code: */ +extern void image_transform_default_ini(const image_transform *this, + transform_display *that); /* silence GCC warnings */ + +void /* private, but almost always needed */ +image_transform_default_ini(const image_transform *this, + transform_display *that) +{ + this->next->ini(this->next, that); +} + +#ifdef PNG_READ_BACKGROUND_SUPPORTED +static int +image_transform_default_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(colour_type) + UNUSED(bit_depth) + + this->next = *that; + *that = this; + + return 1; +} +#endif + +#ifdef PNG_READ_EXPAND_SUPPORTED +/* png_set_palette_to_rgb */ +static void +image_transform_png_set_palette_to_rgb_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_set_palette_to_rgb(pp); + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_palette_to_rgb_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + if (that->colour_type == PNG_COLOR_TYPE_PALETTE) + image_pixel_convert_PLTE(that); + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_palette_to_rgb_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(bit_depth) + + this->next = *that; + *that = this; + + return colour_type == PNG_COLOR_TYPE_PALETTE; +} + +IT(palette_to_rgb); +#undef PT +#define PT ITSTRUCT(palette_to_rgb) +#endif /* PNG_READ_EXPAND_SUPPORTED */ + +#ifdef PNG_READ_EXPAND_SUPPORTED +/* png_set_tRNS_to_alpha */ +static void +image_transform_png_set_tRNS_to_alpha_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_set_tRNS_to_alpha(pp); + + /* If there was a tRNS chunk that would get expanded and add an alpha + * channel is_transparent must be updated: + */ + if (that->this.has_tRNS) + that->this.is_transparent = 1; + + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_tRNS_to_alpha_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ +#if PNG_LIBPNG_VER < 10700 + /* LIBPNG BUG: this always forces palette images to RGB. */ + if (that->colour_type == PNG_COLOR_TYPE_PALETTE) + image_pixel_convert_PLTE(that); +#endif + + /* This effectively does an 'expand' only if there is some transparency to + * convert to an alpha channel. + */ + if (that->have_tRNS) +# if PNG_LIBPNG_VER >= 10700 + if (that->colour_type != PNG_COLOR_TYPE_PALETTE && + (that->colour_type & PNG_COLOR_MASK_ALPHA) == 0) +# endif + image_pixel_add_alpha(that, &display->this, 0/*!for background*/); + +#if PNG_LIBPNG_VER < 10700 + /* LIBPNG BUG: otherwise libpng still expands to 8 bits! */ + else + { + if (that->bit_depth < 8) + that->bit_depth =8; + if (that->sample_depth < 8) + that->sample_depth = 8; + } +#endif + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_tRNS_to_alpha_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(bit_depth) + + this->next = *that; + *that = this; + + /* We don't know yet whether there will be a tRNS chunk, but we know that + * this transformation should do nothing if there already is an alpha + * channel. In addition, after the bug fix in 1.7.0, there is no longer + * any action on a palette image. + */ + return +# if PNG_LIBPNG_VER >= 10700 + colour_type != PNG_COLOR_TYPE_PALETTE && +# endif + (colour_type & PNG_COLOR_MASK_ALPHA) == 0; +} + +IT(tRNS_to_alpha); +#undef PT +#define PT ITSTRUCT(tRNS_to_alpha) +#endif /* PNG_READ_EXPAND_SUPPORTED */ + +#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED +/* png_set_gray_to_rgb */ +static void +image_transform_png_set_gray_to_rgb_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_set_gray_to_rgb(pp); + /* NOTE: this doesn't result in tRNS expansion. */ + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_gray_to_rgb_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + /* NOTE: we can actually pend the tRNS processing at this point because we + * can correctly recognize the original pixel value even though we have + * mapped the one gray channel to the three RGB ones, but in fact libpng + * doesn't do this, so we don't either. + */ + if ((that->colour_type & PNG_COLOR_MASK_COLOR) == 0 && that->have_tRNS) + image_pixel_add_alpha(that, &display->this, 0/*!for background*/); + + /* Simply expand the bit depth and alter the colour type as required. */ + if (that->colour_type == PNG_COLOR_TYPE_GRAY) + { + /* RGB images have a bit depth at least equal to '8' */ + if (that->bit_depth < 8) + that->sample_depth = that->bit_depth = 8; + + /* And just changing the colour type works here because the green and blue + * channels are being maintained in lock-step with the red/gray: + */ + that->colour_type = PNG_COLOR_TYPE_RGB; + } + + else if (that->colour_type == PNG_COLOR_TYPE_GRAY_ALPHA) + that->colour_type = PNG_COLOR_TYPE_RGB_ALPHA; + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_gray_to_rgb_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(bit_depth) + + this->next = *that; + *that = this; + + return (colour_type & PNG_COLOR_MASK_COLOR) == 0; +} + +IT(gray_to_rgb); +#undef PT +#define PT ITSTRUCT(gray_to_rgb) +#endif /* PNG_READ_GRAY_TO_RGB_SUPPORTED */ + +#ifdef PNG_READ_EXPAND_SUPPORTED +/* png_set_expand */ +static void +image_transform_png_set_expand_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_set_expand(pp); + + if (that->this.has_tRNS) + that->this.is_transparent = 1; + + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_expand_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + /* The general expand case depends on what the colour type is: */ + if (that->colour_type == PNG_COLOR_TYPE_PALETTE) + image_pixel_convert_PLTE(that); + else if (that->bit_depth < 8) /* grayscale */ + that->sample_depth = that->bit_depth = 8; + + if (that->have_tRNS) + image_pixel_add_alpha(that, &display->this, 0/*!for background*/); + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_expand_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(bit_depth) + + this->next = *that; + *that = this; + + /* 'expand' should do nothing for RGBA or GA input - no tRNS and the bit + * depth is at least 8 already. + */ + return (colour_type & PNG_COLOR_MASK_ALPHA) == 0; +} + +IT(expand); +#undef PT +#define PT ITSTRUCT(expand) +#endif /* PNG_READ_EXPAND_SUPPORTED */ + +#ifdef PNG_READ_EXPAND_SUPPORTED +/* png_set_expand_gray_1_2_4_to_8 + * Pre 1.7.0 LIBPNG BUG: this just does an 'expand' + */ +static void +image_transform_png_set_expand_gray_1_2_4_to_8_set( + const image_transform *this, transform_display *that, png_structp pp, + png_infop pi) +{ + png_set_expand_gray_1_2_4_to_8(pp); + /* NOTE: don't expect this to expand tRNS */ + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_expand_gray_1_2_4_to_8_mod( + const image_transform *this, image_pixel *that, png_const_structp pp, + const transform_display *display) +{ +#if PNG_LIBPNG_VER < 10700 + image_transform_png_set_expand_mod(this, that, pp, display); +#else + /* Only expand grayscale of bit depth less than 8: */ + if (that->colour_type == PNG_COLOR_TYPE_GRAY && + that->bit_depth < 8) + that->sample_depth = that->bit_depth = 8; + + this->next->mod(this->next, that, pp, display); +#endif /* 1.7 or later */ +} + +static int +image_transform_png_set_expand_gray_1_2_4_to_8_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ +#if PNG_LIBPNG_VER < 10700 + return image_transform_png_set_expand_add(this, that, colour_type, + bit_depth); +#else + UNUSED(bit_depth) + + this->next = *that; + *that = this; + + /* This should do nothing unless the color type is gray and the bit depth is + * less than 8: + */ + return colour_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8; +#endif /* 1.7 or later */ +} + +IT(expand_gray_1_2_4_to_8); +#undef PT +#define PT ITSTRUCT(expand_gray_1_2_4_to_8) +#endif /* PNG_READ_EXPAND_SUPPORTED */ + +#ifdef PNG_READ_EXPAND_16_SUPPORTED +/* png_set_expand_16 */ +static void +image_transform_png_set_expand_16_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_set_expand_16(pp); + + /* NOTE: prior to 1.7 libpng does SET_EXPAND as well, so tRNS is expanded. */ +# if PNG_LIBPNG_VER < 10700 + if (that->this.has_tRNS) + that->this.is_transparent = 1; +# endif + + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_expand_16_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + /* Expect expand_16 to expand everything to 16 bits as a result of also + * causing 'expand' to happen. + */ + if (that->colour_type == PNG_COLOR_TYPE_PALETTE) + image_pixel_convert_PLTE(that); + + if (that->have_tRNS) + image_pixel_add_alpha(that, &display->this, 0/*!for background*/); + + if (that->bit_depth < 16) + that->sample_depth = that->bit_depth = 16; + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_expand_16_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(colour_type) + + this->next = *that; + *that = this; + + /* expand_16 does something unless the bit depth is already 16. */ + return bit_depth < 16; +} + +IT(expand_16); +#undef PT +#define PT ITSTRUCT(expand_16) +#endif /* PNG_READ_EXPAND_16_SUPPORTED */ + +#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED /* API added in 1.5.4 */ +/* png_set_scale_16 */ +static void +image_transform_png_set_scale_16_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_set_scale_16(pp); +# if PNG_LIBPNG_VER < 10700 + /* libpng will limit the gamma table size: */ + that->max_gamma_8 = PNG_MAX_GAMMA_8; +# endif + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_scale_16_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + if (that->bit_depth == 16) + { + that->sample_depth = that->bit_depth = 8; + if (that->red_sBIT > 8) that->red_sBIT = 8; + if (that->green_sBIT > 8) that->green_sBIT = 8; + if (that->blue_sBIT > 8) that->blue_sBIT = 8; + if (that->alpha_sBIT > 8) that->alpha_sBIT = 8; + } + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_scale_16_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(colour_type) + + this->next = *that; + *that = this; + + return bit_depth > 8; +} + +IT(scale_16); +#undef PT +#define PT ITSTRUCT(scale_16) +#endif /* PNG_READ_SCALE_16_TO_8_SUPPORTED (1.5.4 on) */ + +#ifdef PNG_READ_16_TO_8_SUPPORTED /* the default before 1.5.4 */ +/* png_set_strip_16 */ +static void +image_transform_png_set_strip_16_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_set_strip_16(pp); +# if PNG_LIBPNG_VER < 10700 + /* libpng will limit the gamma table size: */ + that->max_gamma_8 = PNG_MAX_GAMMA_8; +# endif + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_strip_16_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + if (that->bit_depth == 16) + { + that->sample_depth = that->bit_depth = 8; + if (that->red_sBIT > 8) that->red_sBIT = 8; + if (that->green_sBIT > 8) that->green_sBIT = 8; + if (that->blue_sBIT > 8) that->blue_sBIT = 8; + if (that->alpha_sBIT > 8) that->alpha_sBIT = 8; + + /* Prior to 1.5.4 png_set_strip_16 would use an 'accurate' method if this + * configuration option is set. From 1.5.4 the flag is never set and the + * 'scale' API (above) must be used. + */ +# ifdef PNG_READ_ACCURATE_SCALE_SUPPORTED +# if PNG_LIBPNG_VER >= 10504 +# error PNG_READ_ACCURATE_SCALE should not be set +# endif + + /* The strip 16 algorithm drops the low 8 bits rather than calculating + * 1/257, so we need to adjust the permitted errors appropriately: + * Notice that this is only relevant prior to the addition of the + * png_set_scale_16 API in 1.5.4 (but 1.5.4+ always defines the above!) + */ + { + const double d = (255-128.5)/65535; + that->rede += d; + that->greene += d; + that->bluee += d; + that->alphae += d; + } +# endif + } + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_strip_16_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(colour_type) + + this->next = *that; + *that = this; + + return bit_depth > 8; +} + +IT(strip_16); +#undef PT +#define PT ITSTRUCT(strip_16) +#endif /* PNG_READ_16_TO_8_SUPPORTED */ + +#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED +/* png_set_strip_alpha */ +static void +image_transform_png_set_strip_alpha_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_set_strip_alpha(pp); + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_strip_alpha_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + if (that->colour_type == PNG_COLOR_TYPE_GRAY_ALPHA) + that->colour_type = PNG_COLOR_TYPE_GRAY; + else if (that->colour_type == PNG_COLOR_TYPE_RGB_ALPHA) + that->colour_type = PNG_COLOR_TYPE_RGB; + + that->have_tRNS = 0; + that->alphaf = 1; + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_strip_alpha_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(bit_depth) + + this->next = *that; + *that = this; + + return (colour_type & PNG_COLOR_MASK_ALPHA) != 0; +} + +IT(strip_alpha); +#undef PT +#define PT ITSTRUCT(strip_alpha) +#endif /* PNG_READ_STRIP_ALPHA_SUPPORTED */ + +#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED +/* png_set_rgb_to_gray(png_structp, int err_action, double red, double green) + * png_set_rgb_to_gray_fixed(png_structp, int err_action, png_fixed_point red, + * png_fixed_point green) + * png_get_rgb_to_gray_status + * + * The 'default' test here uses values known to be used inside libpng prior to + * 1.7.0: + * + * red: 6968 + * green: 23434 + * blue: 2366 + * + * These values are being retained for compatibility, along with the somewhat + * broken truncation calculation in the fast-and-inaccurate code path. Older + * versions of libpng will fail the accuracy tests below because they use the + * truncation algorithm everywhere. + */ +#define data ITDATA(rgb_to_gray) +static struct +{ + double gamma; /* File gamma to use in processing */ + + /* The following are the parameters for png_set_rgb_to_gray: */ +# ifdef PNG_FLOATING_POINT_SUPPORTED + double red_to_set; + double green_to_set; +# else + png_fixed_point red_to_set; + png_fixed_point green_to_set; +# endif + + /* The actual coefficients: */ + double red_coefficient; + double green_coefficient; + double blue_coefficient; + + /* Set if the coeefficients have been overridden. */ + int coefficients_overridden; +} data; + +#undef image_transform_ini +#define image_transform_ini image_transform_png_set_rgb_to_gray_ini +static void +image_transform_png_set_rgb_to_gray_ini(const image_transform *this, + transform_display *that) +{ + png_modifier *pm = that->pm; + const color_encoding *e = pm->current_encoding; + + UNUSED(this) + + /* Since we check the encoding this flag must be set: */ + pm->test_uses_encoding = 1; + + /* If 'e' is not NULL chromaticity information is present and either a cHRM + * or an sRGB chunk will be inserted. + */ + if (e != 0) + { + /* Coefficients come from the encoding, but may need to be normalized to a + * white point Y of 1.0 + */ + const double whiteY = e->red.Y + e->green.Y + e->blue.Y; + + data.red_coefficient = e->red.Y; + data.green_coefficient = e->green.Y; + data.blue_coefficient = e->blue.Y; + + if (whiteY != 1) + { + data.red_coefficient /= whiteY; + data.green_coefficient /= whiteY; + data.blue_coefficient /= whiteY; + } + } + + else + { + /* The default (built in) coeffcients, as above: */ +# if PNG_LIBPNG_VER < 10700 + data.red_coefficient = 6968 / 32768.; + data.green_coefficient = 23434 / 32768.; + data.blue_coefficient = 2366 / 32768.; +# else + data.red_coefficient = .2126; + data.green_coefficient = .7152; + data.blue_coefficient = .0722; +# endif + } + + data.gamma = pm->current_gamma; + + /* If not set then the calculations assume linear encoding (implicitly): */ + if (data.gamma == 0) + data.gamma = 1; + + /* The arguments to png_set_rgb_to_gray can override the coefficients implied + * by the color space encoding. If doing exhaustive checks do the override + * in each case, otherwise do it randomly. + */ + if (pm->test_exhaustive) + { + /* First time in coefficients_overridden is 0, the following sets it to 1, + * so repeat if it is set. If a test fails this may mean we subsequently + * skip a non-override test, ignore that. + */ + data.coefficients_overridden = !data.coefficients_overridden; + pm->repeat = data.coefficients_overridden != 0; + } + + else + data.coefficients_overridden = random_choice(); + + if (data.coefficients_overridden) + { + /* These values override the color encoding defaults, simply use random + * numbers. + */ + png_uint_32 ru; + double total; + + ru = random_u32(); + data.green_coefficient = total = (ru & 0xffff) / 65535.; + ru >>= 16; + data.red_coefficient = (1 - total) * (ru & 0xffff) / 65535.; + total += data.red_coefficient; + data.blue_coefficient = 1 - total; + +# ifdef PNG_FLOATING_POINT_SUPPORTED + data.red_to_set = data.red_coefficient; + data.green_to_set = data.green_coefficient; +# else + data.red_to_set = fix(data.red_coefficient); + data.green_to_set = fix(data.green_coefficient); +# endif + + /* The following just changes the error messages: */ + pm->encoding_ignored = 1; + } + + else + { + data.red_to_set = -1; + data.green_to_set = -1; + } + + /* Adjust the error limit in the png_modifier because of the larger errors + * produced in the digitization during the gamma handling. + */ + if (data.gamma != 1) /* Use gamma tables */ + { + if (that->this.bit_depth == 16 || pm->assume_16_bit_calculations) + { + /* The computations have the form: + * + * r * rc + g * gc + b * bc + * + * Each component of which is +/-1/65535 from the gamma_to_1 table + * lookup, resulting in a base error of +/-6. The gamma_from_1 + * conversion adds another +/-2 in the 16-bit case and + * +/-(1<<(15-PNG_MAX_GAMMA_8)) in the 8-bit case. + */ +# if PNG_LIBPNG_VER < 10700 + if (that->this.bit_depth < 16) + that->max_gamma_8 = PNG_MAX_GAMMA_8; +# endif + that->pm->limit += pow( + (that->this.bit_depth == 16 || that->max_gamma_8 > 14 ? + 8. : + 6. + (1<<(15-that->max_gamma_8)) + )/65535, data.gamma); + } + + else + { + /* Rounding to 8 bits in the linear space causes massive errors which + * will trigger the error check in transform_range_check. Fix that + * here by taking the gamma encoding into account. + * + * When DIGITIZE is set because a pre-1.7 version of libpng is being + * tested allow a bigger slack. + * + * NOTE: this number only affects the internal limit check in pngvalid, + * it has no effect on the limits applied to the libpng values. + */ +#if DIGITIZE + that->pm->limit += pow( 2.0/255, data.gamma); +#else + that->pm->limit += pow( 1.0/255, data.gamma); +#endif + } + } + + else + { + /* With no gamma correction a large error comes from the truncation of the + * calculation in the 8 bit case, allow for that here. + */ + if (that->this.bit_depth != 16 && !pm->assume_16_bit_calculations) + that->pm->limit += 4E-3; + } +} + +static void +image_transform_png_set_rgb_to_gray_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + int error_action = 1; /* no error, no defines in png.h */ + +# ifdef PNG_FLOATING_POINT_SUPPORTED + png_set_rgb_to_gray(pp, error_action, data.red_to_set, data.green_to_set); +# else + png_set_rgb_to_gray_fixed(pp, error_action, data.red_to_set, + data.green_to_set); +# endif + +# ifdef PNG_READ_cHRM_SUPPORTED + if (that->pm->current_encoding != 0) + { + /* We have an encoding so a cHRM chunk may have been set; if so then + * check that the libpng APIs give the correct (X,Y,Z) values within + * some margin of error for the round trip through the chromaticity + * form. + */ +# ifdef PNG_FLOATING_POINT_SUPPORTED +# define API_function png_get_cHRM_XYZ +# define API_form "FP" +# define API_type double +# define API_cvt(x) (x) +# else +# define API_function png_get_cHRM_XYZ_fixed +# define API_form "fixed" +# define API_type png_fixed_point +# define API_cvt(x) ((double)(x)/PNG_FP_1) +# endif + + API_type rX, gX, bX; + API_type rY, gY, bY; + API_type rZ, gZ, bZ; + + if ((API_function(pp, pi, &rX, &rY, &rZ, &gX, &gY, &gZ, &bX, &bY, &bZ) + & PNG_INFO_cHRM) != 0) + { + double maxe; + const char *el; + color_encoding e, o; + + /* Expect libpng to return a normalized result, but the original + * color space encoding may not be normalized. + */ + modifier_current_encoding(that->pm, &o); + normalize_color_encoding(&o); + + /* Sanity check the pngvalid code - the coefficients should match + * the normalized Y values of the encoding unless they were + * overridden. + */ + if (data.red_to_set == -1 && data.green_to_set == -1 && + (fabs(o.red.Y - data.red_coefficient) > DBL_EPSILON || + fabs(o.green.Y - data.green_coefficient) > DBL_EPSILON || + fabs(o.blue.Y - data.blue_coefficient) > DBL_EPSILON)) + png_error(pp, "internal pngvalid cHRM coefficient error"); + + /* Generate a colour space encoding. */ + e.gamma = o.gamma; /* not used */ + e.red.X = API_cvt(rX); + e.red.Y = API_cvt(rY); + e.red.Z = API_cvt(rZ); + e.green.X = API_cvt(gX); + e.green.Y = API_cvt(gY); + e.green.Z = API_cvt(gZ); + e.blue.X = API_cvt(bX); + e.blue.Y = API_cvt(bY); + e.blue.Z = API_cvt(bZ); + + /* This should match the original one from the png_modifier, within + * the range permitted by the libpng fixed point representation. + */ + maxe = 0; + el = "-"; /* Set to element name with error */ + +# define CHECK(col,x)\ + {\ + double err = fabs(o.col.x - e.col.x);\ + if (err > maxe)\ + {\ + maxe = err;\ + el = #col "(" #x ")";\ + }\ + } + + CHECK(red,X) + CHECK(red,Y) + CHECK(red,Z) + CHECK(green,X) + CHECK(green,Y) + CHECK(green,Z) + CHECK(blue,X) + CHECK(blue,Y) + CHECK(blue,Z) + + /* Here in both fixed and floating cases to check the values read + * from the cHRm chunk. PNG uses fixed point in the cHRM chunk, so + * we can't expect better than +/-.5E-5 on the result, allow 1E-5. + */ + if (maxe >= 1E-5) + { + size_t pos = 0; + char buffer[256]; + + pos = safecat(buffer, sizeof buffer, pos, API_form); + pos = safecat(buffer, sizeof buffer, pos, " cHRM "); + pos = safecat(buffer, sizeof buffer, pos, el); + pos = safecat(buffer, sizeof buffer, pos, " error: "); + pos = safecatd(buffer, sizeof buffer, pos, maxe, 7); + pos = safecat(buffer, sizeof buffer, pos, " "); + /* Print the color space without the gamma value: */ + pos = safecat_color_encoding(buffer, sizeof buffer, pos, &o, 0); + pos = safecat(buffer, sizeof buffer, pos, " -> "); + pos = safecat_color_encoding(buffer, sizeof buffer, pos, &e, 0); + + png_error(pp, buffer); + } + } + } +# endif /* READ_cHRM */ + + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_rgb_to_gray_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + if ((that->colour_type & PNG_COLOR_MASK_COLOR) != 0) + { + double gray, err; + +# if PNG_LIBPNG_VER < 10700 + if (that->colour_type == PNG_COLOR_TYPE_PALETTE) + image_pixel_convert_PLTE(that); +# endif + + /* Image now has RGB channels... */ +# if DIGITIZE + { + png_modifier *pm = display->pm; + unsigned int sample_depth = that->sample_depth; + unsigned int calc_depth = (pm->assume_16_bit_calculations ? 16 : + sample_depth); + unsigned int gamma_depth = + (sample_depth == 16 ? + display->max_gamma_8 : + (pm->assume_16_bit_calculations ? + display->max_gamma_8 : + sample_depth)); + int isgray; + double r, g, b; + double rlo, rhi, glo, ghi, blo, bhi, graylo, grayhi; + + /* Do this using interval arithmetic, otherwise it is too difficult to + * handle the errors correctly. + * + * To handle the gamma correction work out the upper and lower bounds + * of the digitized value. Assume rounding here - normally the values + * will be identical after this operation if there is only one + * transform, feel free to delete the png_error checks on this below in + * the future (this is just me trying to ensure it works!) + * + * Interval arithmetic is exact, but to implement it it must be + * possible to control the floating point implementation rounding mode. + * This cannot be done in ANSI-C, so instead I reduce the 'lo' values + * by DBL_EPSILON and increase the 'hi' values by the same. + */ +# define DD(v,d,r) (digitize(v*(1-DBL_EPSILON), d, r) * (1-DBL_EPSILON)) +# define DU(v,d,r) (digitize(v*(1+DBL_EPSILON), d, r) * (1+DBL_EPSILON)) + + r = rlo = rhi = that->redf; + rlo -= that->rede; + rlo = DD(rlo, calc_depth, 1/*round*/); + rhi += that->rede; + rhi = DU(rhi, calc_depth, 1/*round*/); + + g = glo = ghi = that->greenf; + glo -= that->greene; + glo = DD(glo, calc_depth, 1/*round*/); + ghi += that->greene; + ghi = DU(ghi, calc_depth, 1/*round*/); + + b = blo = bhi = that->bluef; + blo -= that->bluee; + blo = DD(blo, calc_depth, 1/*round*/); + bhi += that->bluee; + bhi = DU(bhi, calc_depth, 1/*round*/); + + isgray = r==g && g==b; + + if (data.gamma != 1) + { + const double power = 1/data.gamma; + const double abse = .5/(sample_depth == 16 ? 65535 : 255); + + /* If a gamma calculation is done it is done using lookup tables of + * precision gamma_depth, so the already digitized value above may + * need to be further digitized here. + */ + if (gamma_depth != calc_depth) + { + rlo = DD(rlo, gamma_depth, 0/*truncate*/); + rhi = DU(rhi, gamma_depth, 0/*truncate*/); + glo = DD(glo, gamma_depth, 0/*truncate*/); + ghi = DU(ghi, gamma_depth, 0/*truncate*/); + blo = DD(blo, gamma_depth, 0/*truncate*/); + bhi = DU(bhi, gamma_depth, 0/*truncate*/); + } + + /* 'abse' is the error in the gamma table calculation itself. */ + r = pow(r, power); + rlo = DD(pow(rlo, power)-abse, calc_depth, 1); + rhi = DU(pow(rhi, power)+abse, calc_depth, 1); + + g = pow(g, power); + glo = DD(pow(glo, power)-abse, calc_depth, 1); + ghi = DU(pow(ghi, power)+abse, calc_depth, 1); + + b = pow(b, power); + blo = DD(pow(blo, power)-abse, calc_depth, 1); + bhi = DU(pow(bhi, power)+abse, calc_depth, 1); + } + + /* Now calculate the actual gray values. Although the error in the + * coefficients depends on whether they were specified on the command + * line (in which case truncation to 15 bits happened) or not (rounding + * was used) the maximum error in an individual coefficient is always + * 2/32768, because even in the rounding case the requirement that + * coefficients add up to 32768 can cause a larger rounding error. + * + * The only time when rounding doesn't occur in 1.5.5 and later is when + * the non-gamma code path is used for less than 16 bit data. + */ + gray = r * data.red_coefficient + g * data.green_coefficient + + b * data.blue_coefficient; + + { + int do_round = data.gamma != 1 || calc_depth == 16; + const double ce = 2. / 32768; + + graylo = DD(rlo * (data.red_coefficient-ce) + + glo * (data.green_coefficient-ce) + + blo * (data.blue_coefficient-ce), calc_depth, do_round); + if (graylo > gray) /* always accept the right answer */ + graylo = gray; + + grayhi = DU(rhi * (data.red_coefficient+ce) + + ghi * (data.green_coefficient+ce) + + bhi * (data.blue_coefficient+ce), calc_depth, do_round); + if (grayhi < gray) + grayhi = gray; + } + + /* And invert the gamma. */ + if (data.gamma != 1) + { + const double power = data.gamma; + + /* And this happens yet again, shifting the values once more. */ + if (gamma_depth != sample_depth) + { + rlo = DD(rlo, gamma_depth, 0/*truncate*/); + rhi = DU(rhi, gamma_depth, 0/*truncate*/); + glo = DD(glo, gamma_depth, 0/*truncate*/); + ghi = DU(ghi, gamma_depth, 0/*truncate*/); + blo = DD(blo, gamma_depth, 0/*truncate*/); + bhi = DU(bhi, gamma_depth, 0/*truncate*/); + } + + gray = pow(gray, power); + graylo = DD(pow(graylo, power), sample_depth, 1); + grayhi = DU(pow(grayhi, power), sample_depth, 1); + } + +# undef DD +# undef DU + + /* Now the error can be calculated. + * + * If r==g==b because there is no overall gamma correction libpng + * currently preserves the original value. + */ + if (isgray) + err = (that->rede + that->greene + that->bluee)/3; + + else + { + err = fabs(grayhi-gray); + + if (fabs(gray - graylo) > err) + err = fabs(graylo-gray); + +#if !RELEASE_BUILD + /* Check that this worked: */ + if (err > pm->limit) + { + size_t pos = 0; + char buffer[128]; + + pos = safecat(buffer, sizeof buffer, pos, "rgb_to_gray error "); + pos = safecatd(buffer, sizeof buffer, pos, err, 6); + pos = safecat(buffer, sizeof buffer, pos, " exceeds limit "); + pos = safecatd(buffer, sizeof buffer, pos, pm->limit, 6); + png_warning(pp, buffer); + pm->limit = err; + } +#endif /* !RELEASE_BUILD */ + } + } +# else /* !DIGITIZE */ + { + double r = that->redf; + double re = that->rede; + double g = that->greenf; + double ge = that->greene; + double b = that->bluef; + double be = that->bluee; + +# if PNG_LIBPNG_VER < 10700 + /* The true gray case involves no math in earlier versions (not + * true, there was some if gamma correction was happening too.) + */ + if (r == g && r == b) + { + gray = r; + err = re; + if (err < ge) err = ge; + if (err < be) err = be; + } + + else +# endif /* before 1.7 */ + if (data.gamma == 1) + { + /* There is no need to do the conversions to and from linear space, + * so the calculation should be a lot more accurate. There is a + * built in error in the coefficients because they only have 15 bits + * and are adjusted to make sure they add up to 32768. This + * involves a integer calculation with truncation of the form: + * + * ((int)(coefficient * 100000) * 32768)/100000 + * + * This is done to the red and green coefficients (the ones + * provided to the API) then blue is calculated from them so the + * result adds up to 32768. In the worst case this can result in + * a -1 error in red and green and a +2 error in blue. Consequently + * the worst case in the calculation below is 2/32768 error. + * + * TODO: consider fixing this in libpng by rounding the calculation + * limiting the error to 1/32768. + * + * Handling this by adding 2/32768 here avoids needing to increase + * the global error limits to take this into account.) + */ + gray = r * data.red_coefficient + g * data.green_coefficient + + b * data.blue_coefficient; + err = re * data.red_coefficient + ge * data.green_coefficient + + be * data.blue_coefficient + 2./32768 + gray * 5 * DBL_EPSILON; + } + + else + { + /* The calculation happens in linear space, and this produces much + * wider errors in the encoded space. These are handled here by + * factoring the errors in to the calculation. There are two table + * lookups in the calculation and each introduces a quantization + * error defined by the table size. + */ + png_modifier *pm = display->pm; + double in_qe = (that->sample_depth > 8 ? .5/65535 : .5/255); + double out_qe = (that->sample_depth > 8 ? .5/65535 : + (pm->assume_16_bit_calculations ? .5/(1<max_gamma_8) : + .5/255)); + double rhi, ghi, bhi, grayhi; + double g1 = 1/data.gamma; + + rhi = r + re + in_qe; if (rhi > 1) rhi = 1; + r -= re + in_qe; if (r < 0) r = 0; + ghi = g + ge + in_qe; if (ghi > 1) ghi = 1; + g -= ge + in_qe; if (g < 0) g = 0; + bhi = b + be + in_qe; if (bhi > 1) bhi = 1; + b -= be + in_qe; if (b < 0) b = 0; + + r = pow(r, g1)*(1-DBL_EPSILON); rhi = pow(rhi, g1)*(1+DBL_EPSILON); + g = pow(g, g1)*(1-DBL_EPSILON); ghi = pow(ghi, g1)*(1+DBL_EPSILON); + b = pow(b, g1)*(1-DBL_EPSILON); bhi = pow(bhi, g1)*(1+DBL_EPSILON); + + /* Work out the lower and upper bounds for the gray value in the + * encoded space, then work out an average and error. Remove the + * previously added input quantization error at this point. + */ + gray = r * data.red_coefficient + g * data.green_coefficient + + b * data.blue_coefficient - 2./32768 - out_qe; + if (gray <= 0) + gray = 0; + else + { + gray *= (1 - 6 * DBL_EPSILON); + gray = pow(gray, data.gamma) * (1-DBL_EPSILON); + } + + grayhi = rhi * data.red_coefficient + ghi * data.green_coefficient + + bhi * data.blue_coefficient + 2./32768 + out_qe; + grayhi *= (1 + 6 * DBL_EPSILON); + if (grayhi >= 1) + grayhi = 1; + else + grayhi = pow(grayhi, data.gamma) * (1+DBL_EPSILON); + + err = (grayhi - gray) / 2; + gray = (grayhi + gray) / 2; + + if (err <= in_qe) + err = gray * DBL_EPSILON; + + else + err -= in_qe; + +#if !RELEASE_BUILD + /* Validate that the error is within limits (this has caused + * problems before, it's much easier to detect them here.) + */ + if (err > pm->limit) + { + size_t pos = 0; + char buffer[128]; + + pos = safecat(buffer, sizeof buffer, pos, "rgb_to_gray error "); + pos = safecatd(buffer, sizeof buffer, pos, err, 6); + pos = safecat(buffer, sizeof buffer, pos, " exceeds limit "); + pos = safecatd(buffer, sizeof buffer, pos, pm->limit, 6); + png_warning(pp, buffer); + pm->limit = err; + } +#endif /* !RELEASE_BUILD */ + } + } +# endif /* !DIGITIZE */ + + that->bluef = that->greenf = that->redf = gray; + that->bluee = that->greene = that->rede = err; + + /* The sBIT is the minimum of the three colour channel sBITs. */ + if (that->red_sBIT > that->green_sBIT) + that->red_sBIT = that->green_sBIT; + if (that->red_sBIT > that->blue_sBIT) + that->red_sBIT = that->blue_sBIT; + that->blue_sBIT = that->green_sBIT = that->red_sBIT; + + /* And remove the colour bit in the type: */ + if (that->colour_type == PNG_COLOR_TYPE_RGB) + that->colour_type = PNG_COLOR_TYPE_GRAY; + else if (that->colour_type == PNG_COLOR_TYPE_RGB_ALPHA) + that->colour_type = PNG_COLOR_TYPE_GRAY_ALPHA; + } + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_rgb_to_gray_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(bit_depth) + + this->next = *that; + *that = this; + + return (colour_type & PNG_COLOR_MASK_COLOR) != 0; +} + +#undef data +IT(rgb_to_gray); +#undef PT +#define PT ITSTRUCT(rgb_to_gray) +#undef image_transform_ini +#define image_transform_ini image_transform_default_ini +#endif /* PNG_READ_RGB_TO_GRAY_SUPPORTED */ + +#ifdef PNG_READ_BACKGROUND_SUPPORTED +/* png_set_background(png_structp, png_const_color_16p background_color, + * int background_gamma_code, int need_expand, double background_gamma) + * png_set_background_fixed(png_structp, png_const_color_16p background_color, + * int background_gamma_code, int need_expand, + * png_fixed_point background_gamma) + * + * This ignores the gamma (at present.) +*/ +#define data ITDATA(background) +static image_pixel data; + +static void +image_transform_png_set_background_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_byte colour_type, bit_depth; + png_byte random_bytes[8]; /* 8 bytes - 64 bits - the biggest pixel */ + int expand; + png_color_16 back; + + /* We need a background colour, because we don't know exactly what transforms + * have been set we have to supply the colour in the original file format and + * so we need to know what that is! The background colour is stored in the + * transform_display. + */ + R8(random_bytes); + + /* Read the random value, for colour type 3 the background colour is actually + * expressed as a 24bit rgb, not an index. + */ + colour_type = that->this.colour_type; + if (colour_type == 3) + { + colour_type = PNG_COLOR_TYPE_RGB; + bit_depth = 8; + expand = 0; /* passing in an RGB not a pixel index */ + } + + else + { + if (that->this.has_tRNS) + that->this.is_transparent = 1; + + bit_depth = that->this.bit_depth; + expand = 1; + } + + image_pixel_init(&data, random_bytes, colour_type, + bit_depth, 0/*x*/, 0/*unused: palette*/, NULL/*format*/); + + /* Extract the background colour from this image_pixel, but make sure the + * unused fields of 'back' are garbage. + */ + R8(back); + + if (colour_type & PNG_COLOR_MASK_COLOR) + { + back.red = (png_uint_16)data.red; + back.green = (png_uint_16)data.green; + back.blue = (png_uint_16)data.blue; + } + + else + back.gray = (png_uint_16)data.red; + +#ifdef PNG_FLOATING_POINT_SUPPORTED + png_set_background(pp, &back, PNG_BACKGROUND_GAMMA_FILE, expand, 0); +#else + png_set_background_fixed(pp, &back, PNG_BACKGROUND_GAMMA_FILE, expand, 0); +#endif + + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_background_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + /* Check for tRNS first: */ + if (that->have_tRNS && that->colour_type != PNG_COLOR_TYPE_PALETTE) + image_pixel_add_alpha(that, &display->this, 1/*for background*/); + + /* This is only necessary if the alpha value is less than 1. */ + if (that->alphaf < 1) + { + /* Now we do the background calculation without any gamma correction. */ + if (that->alphaf <= 0) + { + that->redf = data.redf; + that->greenf = data.greenf; + that->bluef = data.bluef; + + that->rede = data.rede; + that->greene = data.greene; + that->bluee = data.bluee; + + that->red_sBIT= data.red_sBIT; + that->green_sBIT= data.green_sBIT; + that->blue_sBIT= data.blue_sBIT; + } + + else /* 0 < alpha < 1 */ + { + double alf = 1 - that->alphaf; + + that->redf = that->redf * that->alphaf + data.redf * alf; + that->rede = that->rede * that->alphaf + data.rede * alf + + DBL_EPSILON; + that->greenf = that->greenf * that->alphaf + data.greenf * alf; + that->greene = that->greene * that->alphaf + data.greene * alf + + DBL_EPSILON; + that->bluef = that->bluef * that->alphaf + data.bluef * alf; + that->bluee = that->bluee * that->alphaf + data.bluee * alf + + DBL_EPSILON; + } + + /* Remove the alpha type and set the alpha (not in that order.) */ + that->alphaf = 1; + that->alphae = 0; + } + + if (that->colour_type == PNG_COLOR_TYPE_RGB_ALPHA) + that->colour_type = PNG_COLOR_TYPE_RGB; + else if (that->colour_type == PNG_COLOR_TYPE_GRAY_ALPHA) + that->colour_type = PNG_COLOR_TYPE_GRAY; + /* PNG_COLOR_TYPE_PALETTE is not changed */ + + this->next->mod(this->next, that, pp, display); +} + +#define image_transform_png_set_background_add image_transform_default_add + +#undef data +IT(background); +#undef PT +#define PT ITSTRUCT(background) +#endif /* PNG_READ_BACKGROUND_SUPPORTED */ + +/* png_set_quantize(png_structp, png_colorp palette, int num_palette, + * int maximum_colors, png_const_uint_16p histogram, int full_quantize) + * + * Very difficult to validate this! + */ +/*NOTE: TBD NYI */ + +/* The data layout transforms are handled by swapping our own channel data, + * necessarily these need to happen at the end of the transform list because the + * semantic of the channels changes after these are executed. Some of these, + * like set_shift and set_packing, can't be done at present because they change + * the layout of the data at the sub-sample level so sample() won't get the + * right answer. + */ +/* png_set_invert_alpha */ +#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED +/* Invert the alpha channel + * + * png_set_invert_alpha(png_structrp png_ptr) + */ +static void +image_transform_png_set_invert_alpha_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_set_invert_alpha(pp); + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_invert_alpha_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + if (that->colour_type & 4) + that->alpha_inverted = 1; + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_invert_alpha_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(bit_depth) + + this->next = *that; + *that = this; + + /* Only has an effect on pixels with alpha: */ + return (colour_type & 4) != 0; +} + +IT(invert_alpha); +#undef PT +#define PT ITSTRUCT(invert_alpha) + +#endif /* PNG_READ_INVERT_ALPHA_SUPPORTED */ + +/* png_set_bgr */ +#ifdef PNG_READ_BGR_SUPPORTED +/* Swap R,G,B channels to order B,G,R. + * + * png_set_bgr(png_structrp png_ptr) + * + * This only has an effect on RGB and RGBA pixels. + */ +static void +image_transform_png_set_bgr_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_set_bgr(pp); + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_bgr_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + if (that->colour_type == PNG_COLOR_TYPE_RGB || + that->colour_type == PNG_COLOR_TYPE_RGBA) + that->swap_rgb = 1; + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_bgr_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(bit_depth) + + this->next = *that; + *that = this; + + return colour_type == PNG_COLOR_TYPE_RGB || + colour_type == PNG_COLOR_TYPE_RGBA; +} + +IT(bgr); +#undef PT +#define PT ITSTRUCT(bgr) + +#endif /* PNG_READ_BGR_SUPPORTED */ + +/* png_set_swap_alpha */ +#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED +/* Put the alpha channel first. + * + * png_set_swap_alpha(png_structrp png_ptr) + * + * This only has an effect on GA and RGBA pixels. + */ +static void +image_transform_png_set_swap_alpha_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_set_swap_alpha(pp); + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_swap_alpha_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + if (that->colour_type == PNG_COLOR_TYPE_GA || + that->colour_type == PNG_COLOR_TYPE_RGBA) + that->alpha_first = 1; + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_swap_alpha_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(bit_depth) + + this->next = *that; + *that = this; + + return colour_type == PNG_COLOR_TYPE_GA || + colour_type == PNG_COLOR_TYPE_RGBA; +} + +IT(swap_alpha); +#undef PT +#define PT ITSTRUCT(swap_alpha) + +#endif /* PNG_READ_SWAP_ALPHA_SUPPORTED */ + +/* png_set_swap */ +#ifdef PNG_READ_SWAP_SUPPORTED +/* Byte swap 16-bit components. + * + * png_set_swap(png_structrp png_ptr) + */ +static void +image_transform_png_set_swap_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_set_swap(pp); + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_swap_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + if (that->bit_depth == 16) + that->swap16 = 1; + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_swap_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(colour_type) + + this->next = *that; + *that = this; + + return bit_depth == 16; +} + +IT(swap); +#undef PT +#define PT ITSTRUCT(swap) + +#endif /* PNG_READ_SWAP_SUPPORTED */ + +#ifdef PNG_READ_FILLER_SUPPORTED +/* Add a filler byte to 8-bit Gray or 24-bit RGB images. + * + * png_set_filler, (png_structp png_ptr, png_uint_32 filler, int flags)); + * + * Flags: + * + * PNG_FILLER_BEFORE + * PNG_FILLER_AFTER + */ +#define data ITDATA(filler) +static struct +{ + png_uint_32 filler; + int flags; +} data; + +static void +image_transform_png_set_filler_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + /* Need a random choice for 'before' and 'after' as well as for the + * filler. The 'filler' value has all 32 bits set, but only bit_depth + * will be used. At this point we don't know bit_depth. + */ + data.filler = random_u32(); + data.flags = random_choice(); + + png_set_filler(pp, data.filler, data.flags); + + /* The standard display handling stuff also needs to know that + * there is a filler, so set that here. + */ + that->this.filler = 1; + + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_filler_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + if (that->bit_depth >= 8 && + (that->colour_type == PNG_COLOR_TYPE_RGB || + that->colour_type == PNG_COLOR_TYPE_GRAY)) + { + unsigned int max = (1U << that->bit_depth)-1; + that->alpha = data.filler & max; + that->alphaf = ((double)that->alpha) / max; + that->alphae = 0; + + /* The filler has been stored in the alpha channel, we must record + * that this has been done for the checking later on, the color + * type is faked to have an alpha channel, but libpng won't report + * this; the app has to know the extra channel is there and this + * was recording in standard_display::filler above. + */ + that->colour_type |= 4; /* alpha added */ + that->alpha_first = data.flags == PNG_FILLER_BEFORE; + } + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_filler_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + this->next = *that; + *that = this; + + return bit_depth >= 8 && (colour_type == PNG_COLOR_TYPE_RGB || + colour_type == PNG_COLOR_TYPE_GRAY); +} + +#undef data +IT(filler); +#undef PT +#define PT ITSTRUCT(filler) + +/* png_set_add_alpha, (png_structp png_ptr, png_uint_32 filler, int flags)); */ +/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */ +#define data ITDATA(add_alpha) +static struct +{ + png_uint_32 filler; + int flags; +} data; + +static void +image_transform_png_set_add_alpha_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + /* Need a random choice for 'before' and 'after' as well as for the + * filler. The 'filler' value has all 32 bits set, but only bit_depth + * will be used. At this point we don't know bit_depth. + */ + data.filler = random_u32(); + data.flags = random_choice(); + + png_set_add_alpha(pp, data.filler, data.flags); + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_add_alpha_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + if (that->bit_depth >= 8 && + (that->colour_type == PNG_COLOR_TYPE_RGB || + that->colour_type == PNG_COLOR_TYPE_GRAY)) + { + unsigned int max = (1U << that->bit_depth)-1; + that->alpha = data.filler & max; + that->alphaf = ((double)that->alpha) / max; + that->alphae = 0; + + that->colour_type |= 4; /* alpha added */ + that->alpha_first = data.flags == PNG_FILLER_BEFORE; + } + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_add_alpha_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + this->next = *that; + *that = this; + + return bit_depth >= 8 && (colour_type == PNG_COLOR_TYPE_RGB || + colour_type == PNG_COLOR_TYPE_GRAY); +} + +#undef data +IT(add_alpha); +#undef PT +#define PT ITSTRUCT(add_alpha) + +#endif /* PNG_READ_FILLER_SUPPORTED */ + +/* png_set_packing */ +#ifdef PNG_READ_PACK_SUPPORTED +/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. + * + * png_set_packing(png_structrp png_ptr) + * + * This should only affect grayscale and palette images with less than 8 bits + * per pixel. + */ +static void +image_transform_png_set_packing_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_set_packing(pp); + that->unpacked = 1; + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_packing_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + /* The general expand case depends on what the colour type is, + * low bit-depth pixel values are unpacked into bytes without + * scaling, so sample_depth is not changed. + */ + if (that->bit_depth < 8) /* grayscale or palette */ + that->bit_depth = 8; + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_packing_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(colour_type) + + this->next = *that; + *that = this; + + /* Nothing should happen unless the bit depth is less than 8: */ + return bit_depth < 8; +} + +IT(packing); +#undef PT +#define PT ITSTRUCT(packing) + +#endif /* PNG_READ_PACK_SUPPORTED */ + +/* png_set_packswap */ +#ifdef PNG_READ_PACKSWAP_SUPPORTED +/* Swap pixels packed into bytes; reverses the order on screen so that + * the high order bits correspond to the rightmost pixels. + * + * png_set_packswap(png_structrp png_ptr) + */ +static void +image_transform_png_set_packswap_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_set_packswap(pp); + that->this.littleendian = 1; + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_packswap_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + if (that->bit_depth < 8) + that->littleendian = 1; + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_packswap_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(colour_type) + + this->next = *that; + *that = this; + + return bit_depth < 8; +} + +IT(packswap); +#undef PT +#define PT ITSTRUCT(packswap) + +#endif /* PNG_READ_PACKSWAP_SUPPORTED */ + + +/* png_set_invert_mono */ +#ifdef PNG_READ_INVERT_MONO_SUPPORTED +/* Invert the gray channel + * + * png_set_invert_mono(png_structrp png_ptr) + */ +static void +image_transform_png_set_invert_mono_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_set_invert_mono(pp); + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_invert_mono_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + if (that->colour_type & 4) + that->mono_inverted = 1; + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_invert_mono_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(bit_depth) + + this->next = *that; + *that = this; + + /* Only has an effect on pixels with no colour: */ + return (colour_type & 2) == 0; +} + +IT(invert_mono); +#undef PT +#define PT ITSTRUCT(invert_mono) + +#endif /* PNG_READ_INVERT_MONO_SUPPORTED */ + +#ifdef PNG_READ_SHIFT_SUPPORTED +/* png_set_shift(png_structp, png_const_color_8p true_bits) + * + * The output pixels will be shifted by the given true_bits + * values. + */ +#define data ITDATA(shift) +static png_color_8 data; + +static void +image_transform_png_set_shift_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + /* Get a random set of shifts. The shifts need to do something + * to test the transform, so they are limited to the bit depth + * of the input image. Notice that in the following the 'gray' + * field is randomized independently. This acts as a check that + * libpng does use the correct field. + */ + unsigned int depth = that->this.bit_depth; + + data.red = (png_byte)/*SAFE*/(random_mod(depth)+1); + data.green = (png_byte)/*SAFE*/(random_mod(depth)+1); + data.blue = (png_byte)/*SAFE*/(random_mod(depth)+1); + data.gray = (png_byte)/*SAFE*/(random_mod(depth)+1); + data.alpha = (png_byte)/*SAFE*/(random_mod(depth)+1); + + png_set_shift(pp, &data); + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_shift_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + /* Copy the correct values into the sBIT fields, libpng does not do + * anything to palette data: + */ + if (that->colour_type != PNG_COLOR_TYPE_PALETTE) + { + that->sig_bits = 1; + + /* The sBIT fields are reset to the values previously sent to + * png_set_shift according to the colour type. + * does. + */ + if (that->colour_type & 2) /* RGB channels */ + { + that->red_sBIT = data.red; + that->green_sBIT = data.green; + that->blue_sBIT = data.blue; + } + + else /* One grey channel */ + that->red_sBIT = that->green_sBIT = that->blue_sBIT = data.gray; + + that->alpha_sBIT = data.alpha; + } + + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_shift_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + UNUSED(bit_depth) + + this->next = *that; + *that = this; + + return colour_type != PNG_COLOR_TYPE_PALETTE; +} + +IT(shift); +#undef PT +#define PT ITSTRUCT(shift) + +#endif /* PNG_READ_SHIFT_SUPPORTED */ + +#ifdef THIS_IS_THE_PROFORMA +static void +image_transform_png_set_@_set(const image_transform *this, + transform_display *that, png_structp pp, png_infop pi) +{ + png_set_@(pp); + this->next->set(this->next, that, pp, pi); +} + +static void +image_transform_png_set_@_mod(const image_transform *this, + image_pixel *that, png_const_structp pp, + const transform_display *display) +{ + this->next->mod(this->next, that, pp, display); +} + +static int +image_transform_png_set_@_add(image_transform *this, + const image_transform **that, png_byte colour_type, png_byte bit_depth) +{ + this->next = *that; + *that = this; + + return 1; +} + +IT(@); +#endif + + +/* This may just be 'end' if all the transforms are disabled! */ +static image_transform *const image_transform_first = &PT; + +static void +transform_enable(const char *name) +{ + /* Everything starts out enabled, so if we see an 'enable' disabled + * everything else the first time round. + */ + static int all_disabled = 0; + int found_it = 0; + image_transform *list = image_transform_first; + + while (list != &image_transform_end) + { + if (strcmp(list->name, name) == 0) + { + list->enable = 1; + found_it = 1; + } + else if (!all_disabled) + list->enable = 0; + + list = list->list; + } + + all_disabled = 1; + + if (!found_it) + { + fprintf(stderr, "pngvalid: --transform-enable=%s: unknown transform\n", + name); + exit(99); + } +} + +static void +transform_disable(const char *name) +{ + image_transform *list = image_transform_first; + + while (list != &image_transform_end) + { + if (strcmp(list->name, name) == 0) + { + list->enable = 0; + return; + } + + list = list->list; + } + + fprintf(stderr, "pngvalid: --transform-disable=%s: unknown transform\n", + name); + exit(99); +} + +static void +image_transform_reset_count(void) +{ + image_transform *next = image_transform_first; + int count = 0; + + while (next != &image_transform_end) + { + next->local_use = 0; + next->next = 0; + next = next->list; + ++count; + } + + /* This can only happen if we every have more than 32 transforms (excluding + * the end) in the list. + */ + if (count > 32) abort(); +} + +static int +image_transform_test_counter(png_uint_32 counter, unsigned int max) +{ + /* Test the list to see if there is any point contining, given a current + * counter and a 'max' value. + */ + image_transform *next = image_transform_first; + + while (next != &image_transform_end) + { + /* For max 0 or 1 continue until the counter overflows: */ + counter >>= 1; + + /* Continue if any entry hasn't reacked the max. */ + if (max > 1 && next->local_use < max) + return 1; + next = next->list; + } + + return max <= 1 && counter == 0; +} + +static png_uint_32 +image_transform_add(const image_transform **this, unsigned int max, + png_uint_32 counter, char *name, size_t sizeof_name, size_t *pos, + png_byte colour_type, png_byte bit_depth) +{ + for (;;) /* until we manage to add something */ + { + png_uint_32 mask; + image_transform *list; + + /* Find the next counter value, if the counter is zero this is the start + * of the list. This routine always returns the current counter (not the + * next) so it returns 0 at the end and expects 0 at the beginning. + */ + if (counter == 0) /* first time */ + { + image_transform_reset_count(); + if (max <= 1) + counter = 1; + else + counter = random_32(); + } + else /* advance the counter */ + { + switch (max) + { + case 0: ++counter; break; + case 1: counter <<= 1; break; + default: counter = random_32(); break; + } + } + + /* Now add all these items, if possible */ + *this = &image_transform_end; + list = image_transform_first; + mask = 1; + + /* Go through the whole list adding anything that the counter selects: */ + while (list != &image_transform_end) + { + if ((counter & mask) != 0 && list->enable && + (max == 0 || list->local_use < max)) + { + /* Candidate to add: */ + if (list->add(list, this, colour_type, bit_depth) || max == 0) + { + /* Added, so add to the name too. */ + *pos = safecat(name, sizeof_name, *pos, " +"); + *pos = safecat(name, sizeof_name, *pos, list->name); + } + + else + { + /* Not useful and max>0, so remove it from *this: */ + *this = list->next; + list->next = 0; + + /* And, since we know it isn't useful, stop it being added again + * in this run: + */ + list->local_use = max; + } + } + + mask <<= 1; + list = list->list; + } + + /* Now if anything was added we have something to do. */ + if (*this != &image_transform_end) + return counter; + + /* Nothing added, but was there anything in there to add? */ + if (!image_transform_test_counter(counter, max)) + return 0; + } +} + +static void +perform_transform_test(png_modifier *pm) +{ + png_byte colour_type = 0; + png_byte bit_depth = 0; + unsigned int palette_number = 0; + + while (next_format(&colour_type, &bit_depth, &palette_number, pm->test_lbg, + pm->test_tRNS)) + { + png_uint_32 counter = 0; + size_t base_pos; + char name[64]; + + base_pos = safecat(name, sizeof name, 0, "transform:"); + + for (;;) + { + size_t pos = base_pos; + const image_transform *list = 0; + + /* 'max' is currently hardwired to '1'; this should be settable on the + * command line. + */ + counter = image_transform_add(&list, 1/*max*/, counter, + name, sizeof name, &pos, colour_type, bit_depth); + + if (counter == 0) + break; + + /* The command line can change this to checking interlaced images. */ + do + { + pm->repeat = 0; + transform_test(pm, FILEID(colour_type, bit_depth, palette_number, + pm->interlace_type, 0, 0, 0), list, name); + + if (fail(pm)) + return; + } + while (pm->repeat); + } + } +} +#endif /* PNG_READ_TRANSFORMS_SUPPORTED */ + +/********************************* GAMMA TESTS ********************************/ +#ifdef PNG_READ_GAMMA_SUPPORTED +/* Reader callbacks and implementations, where they differ from the standard + * ones. + */ +typedef struct gamma_display +{ + standard_display this; + + /* Parameters */ + png_modifier* pm; + double file_gamma; + double screen_gamma; + double background_gamma; + png_byte sbit; + int threshold_test; + int use_input_precision; + int scale16; + int expand16; + int do_background; + png_color_16 background_color; + + /* Local variables */ + double maxerrout; + double maxerrpc; + double maxerrabs; +} gamma_display; + +#define ALPHA_MODE_OFFSET 4 + +static void +gamma_display_init(gamma_display *dp, png_modifier *pm, png_uint_32 id, + double file_gamma, double screen_gamma, png_byte sbit, int threshold_test, + int use_input_precision, int scale16, int expand16, + int do_background, const png_color_16 *pointer_to_the_background_color, + double background_gamma) +{ + /* Standard fields */ + standard_display_init(&dp->this, &pm->this, id, do_read_interlace, + pm->use_update_info); + + /* Parameter fields */ + dp->pm = pm; + dp->file_gamma = file_gamma; + dp->screen_gamma = screen_gamma; + dp->background_gamma = background_gamma; + dp->sbit = sbit; + dp->threshold_test = threshold_test; + dp->use_input_precision = use_input_precision; + dp->scale16 = scale16; + dp->expand16 = expand16; + dp->do_background = do_background; + if (do_background && pointer_to_the_background_color != 0) + dp->background_color = *pointer_to_the_background_color; + else + memset(&dp->background_color, 0, sizeof dp->background_color); + + /* Local variable fields */ + dp->maxerrout = dp->maxerrpc = dp->maxerrabs = 0; +} + +static void +gamma_info_imp(gamma_display *dp, png_structp pp, png_infop pi) +{ + /* Reuse the standard stuff as appropriate. */ + standard_info_part1(&dp->this, pp, pi); + + /* If requested strip 16 to 8 bits - this is handled automagically below + * because the output bit depth is read from the library. Note that there + * are interactions with sBIT but, internally, libpng makes sbit at most + * PNG_MAX_GAMMA_8 prior to 1.7 when doing the following. + */ + if (dp->scale16) +# ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED + png_set_scale_16(pp); +# else + /* The following works both in 1.5.4 and earlier versions: */ +# ifdef PNG_READ_16_TO_8_SUPPORTED + png_set_strip_16(pp); +# else + png_error(pp, "scale16 (16 to 8 bit conversion) not supported"); +# endif +# endif + + if (dp->expand16) +# ifdef PNG_READ_EXPAND_16_SUPPORTED + png_set_expand_16(pp); +# else + png_error(pp, "expand16 (8 to 16 bit conversion) not supported"); +# endif + + if (dp->do_background >= ALPHA_MODE_OFFSET) + { +# ifdef PNG_READ_ALPHA_MODE_SUPPORTED + { + /* This tests the alpha mode handling, if supported. */ + int mode = dp->do_background - ALPHA_MODE_OFFSET; + + /* The gamma value is the output gamma, and is in the standard, + * non-inverted, representation. It provides a default for the PNG file + * gamma, but since the file has a gAMA chunk this does not matter. + */ + const double sg = dp->screen_gamma; +# ifndef PNG_FLOATING_POINT_SUPPORTED + png_fixed_point g = fix(sg); +# endif + +# ifdef PNG_FLOATING_POINT_SUPPORTED + png_set_alpha_mode(pp, mode, sg); +# else + png_set_alpha_mode_fixed(pp, mode, g); +# endif + + /* However, for the standard Porter-Duff algorithm the output defaults + * to be linear, so if the test requires non-linear output it must be + * corrected here. + */ + if (mode == PNG_ALPHA_STANDARD && sg != 1) + { +# ifdef PNG_FLOATING_POINT_SUPPORTED + png_set_gamma(pp, sg, dp->file_gamma); +# else + png_fixed_point f = fix(dp->file_gamma); + png_set_gamma_fixed(pp, g, f); +# endif + } + } +# else + png_error(pp, "alpha mode handling not supported"); +# endif + } + + else + { + /* Set up gamma processing. */ +# ifdef PNG_FLOATING_POINT_SUPPORTED + png_set_gamma(pp, dp->screen_gamma, dp->file_gamma); +# else + { + png_fixed_point s = fix(dp->screen_gamma); + png_fixed_point f = fix(dp->file_gamma); + png_set_gamma_fixed(pp, s, f); + } +# endif + + if (dp->do_background) + { +# ifdef PNG_READ_BACKGROUND_SUPPORTED + /* NOTE: this assumes the caller provided the correct background gamma! + */ + const double bg = dp->background_gamma; +# ifndef PNG_FLOATING_POINT_SUPPORTED + png_fixed_point g = fix(bg); +# endif + +# ifdef PNG_FLOATING_POINT_SUPPORTED + png_set_background(pp, &dp->background_color, dp->do_background, + 0/*need_expand*/, bg); +# else + png_set_background_fixed(pp, &dp->background_color, + dp->do_background, 0/*need_expand*/, g); +# endif +# else + png_error(pp, "png_set_background not supported"); +# endif + } + } + + { + int i = dp->this.use_update_info; + /* Always do one call, even if use_update_info is 0. */ + do + png_read_update_info(pp, pi); + while (--i > 0); + } + + /* Now we may get a different cbRow: */ + standard_info_part2(&dp->this, pp, pi, 1 /*images*/); +} + +static void PNGCBAPI +gamma_info(png_structp pp, png_infop pi) +{ + gamma_info_imp(voidcast(gamma_display*, png_get_progressive_ptr(pp)), pp, + pi); +} + +/* Validate a single component value - the routine gets the input and output + * sample values as unscaled PNG component values along with a cache of all the + * information required to validate the values. + */ +typedef struct validate_info +{ + png_const_structp pp; + gamma_display *dp; + png_byte sbit; + int use_input_precision; + int do_background; + int scale16; + unsigned int sbit_max; + unsigned int isbit_shift; + unsigned int outmax; + + double gamma_correction; /* Overall correction required. */ + double file_inverse; /* Inverse of file gamma. */ + double screen_gamma; + double screen_inverse; /* Inverse of screen gamma. */ + + double background_red; /* Linear background value, red or gray. */ + double background_green; + double background_blue; + + double maxabs; + double maxpc; + double maxcalc; + double maxout; + double maxout_total; /* Total including quantization error */ + double outlog; + int outquant; +} +validate_info; + +static void +init_validate_info(validate_info *vi, gamma_display *dp, png_const_structp pp, + int in_depth, int out_depth) +{ + unsigned int outmax = (1U<pp = pp; + vi->dp = dp; + + if (dp->sbit > 0 && dp->sbit < in_depth) + { + vi->sbit = dp->sbit; + vi->isbit_shift = in_depth - dp->sbit; + } + + else + { + vi->sbit = (png_byte)in_depth; + vi->isbit_shift = 0; + } + + vi->sbit_max = (1U << vi->sbit)-1; + + /* This mimics the libpng threshold test, '0' is used to prevent gamma + * correction in the validation test. + */ + vi->screen_gamma = dp->screen_gamma; + if (fabs(vi->screen_gamma-1) < PNG_GAMMA_THRESHOLD) + vi->screen_gamma = vi->screen_inverse = 0; + else + vi->screen_inverse = 1/vi->screen_gamma; + + vi->use_input_precision = dp->use_input_precision; + vi->outmax = outmax; + vi->maxabs = abserr(dp->pm, in_depth, out_depth); + vi->maxpc = pcerr(dp->pm, in_depth, out_depth); + vi->maxcalc = calcerr(dp->pm, in_depth, out_depth); + vi->maxout = outerr(dp->pm, in_depth, out_depth); + vi->outquant = output_quantization_factor(dp->pm, in_depth, out_depth); + vi->maxout_total = vi->maxout + vi->outquant * .5; + vi->outlog = outlog(dp->pm, in_depth, out_depth); + + if ((dp->this.colour_type & PNG_COLOR_MASK_ALPHA) != 0 || + (dp->this.colour_type == 3 && dp->this.is_transparent) || + ((dp->this.colour_type == 0 || dp->this.colour_type == 2) && + dp->this.has_tRNS)) + { + vi->do_background = dp->do_background; + + if (vi->do_background != 0) + { + const double bg_inverse = 1/dp->background_gamma; + double r, g, b; + + /* Caller must at least put the gray value into the red channel */ + r = dp->background_color.red; r /= outmax; + g = dp->background_color.green; g /= outmax; + b = dp->background_color.blue; b /= outmax; + +# if 0 + /* libpng doesn't do this optimization, if we do pngvalid will fail. + */ + if (fabs(bg_inverse-1) >= PNG_GAMMA_THRESHOLD) +# endif + { + r = pow(r, bg_inverse); + g = pow(g, bg_inverse); + b = pow(b, bg_inverse); + } + + vi->background_red = r; + vi->background_green = g; + vi->background_blue = b; + } + } + else /* Do not expect any background processing */ + vi->do_background = 0; + + if (vi->do_background == 0) + vi->background_red = vi->background_green = vi->background_blue = 0; + + vi->gamma_correction = 1/(dp->file_gamma*dp->screen_gamma); + if (fabs(vi->gamma_correction-1) < PNG_GAMMA_THRESHOLD) + vi->gamma_correction = 0; + + vi->file_inverse = 1/dp->file_gamma; + if (fabs(vi->file_inverse-1) < PNG_GAMMA_THRESHOLD) + vi->file_inverse = 0; + + vi->scale16 = dp->scale16; +} + +/* This function handles composition of a single non-alpha component. The + * argument is the input sample value, in the range 0..1, and the alpha value. + * The result is the composed, linear, input sample. If alpha is less than zero + * this is the alpha component and the function should not be called! + */ +static double +gamma_component_compose(int do_background, double input_sample, double alpha, + double background, int *compose) +{ + switch (do_background) + { +#ifdef PNG_READ_BACKGROUND_SUPPORTED + case PNG_BACKGROUND_GAMMA_SCREEN: + case PNG_BACKGROUND_GAMMA_FILE: + case PNG_BACKGROUND_GAMMA_UNIQUE: + /* Standard PNG background processing. */ + if (alpha < 1) + { + if (alpha > 0) + { + input_sample = input_sample * alpha + background * (1-alpha); + if (compose != NULL) + *compose = 1; + } + + else + input_sample = background; + } + break; +#endif + +#ifdef PNG_READ_ALPHA_MODE_SUPPORTED + case ALPHA_MODE_OFFSET + PNG_ALPHA_STANDARD: + case ALPHA_MODE_OFFSET + PNG_ALPHA_BROKEN: + /* The components are premultiplied in either case and the output is + * gamma encoded (to get standard Porter-Duff we expect the output + * gamma to be set to 1.0!) + */ + case ALPHA_MODE_OFFSET + PNG_ALPHA_OPTIMIZED: + /* The optimization is that the partial-alpha entries are linear + * while the opaque pixels are gamma encoded, but this only affects the + * output encoding. + */ + if (alpha < 1) + { + if (alpha > 0) + { + input_sample *= alpha; + if (compose != NULL) + *compose = 1; + } + + else + input_sample = 0; + } + break; +#endif + + default: + /* Standard cases where no compositing is done (so the component + * value is already correct.) + */ + UNUSED(alpha) + UNUSED(background) + UNUSED(compose) + break; + } + + return input_sample; +} + +/* This API returns the encoded *input* component, in the range 0..1 */ +static double +gamma_component_validate(const char *name, const validate_info *vi, + unsigned int id, unsigned int od, + const double alpha /* <0 for the alpha channel itself */, + const double background /* component background value */) +{ + unsigned int isbit = id >> vi->isbit_shift; + unsigned int sbit_max = vi->sbit_max; + unsigned int outmax = vi->outmax; + int do_background = vi->do_background; + + double i; + + /* First check on the 'perfect' result obtained from the digitized input + * value, id, and compare this against the actual digitized result, 'od'. + * 'i' is the input result in the range 0..1: + */ + i = isbit; i /= sbit_max; + + /* Check for the fast route: if we don't do any background composition or if + * this is the alpha channel ('alpha' < 0) or if the pixel is opaque then + * just use the gamma_correction field to correct to the final output gamma. + */ + if (alpha == 1 /* opaque pixel component */ || !do_background +#ifdef PNG_READ_ALPHA_MODE_SUPPORTED + || do_background == ALPHA_MODE_OFFSET + PNG_ALPHA_PNG +#endif + || (alpha < 0 /* alpha channel */ +#ifdef PNG_READ_ALPHA_MODE_SUPPORTED + && do_background != ALPHA_MODE_OFFSET + PNG_ALPHA_BROKEN +#endif + )) + { + /* Then get the gamma corrected version of 'i' and compare to 'od', any + * error less than .5 is insignificant - just quantization of the output + * value to the nearest digital value (nevertheless the error is still + * recorded - it's interesting ;-) + */ + double encoded_sample = i; + double encoded_error; + + /* alpha less than 0 indicates the alpha channel, which is always linear + */ + if (alpha >= 0 && vi->gamma_correction > 0) + encoded_sample = pow(encoded_sample, vi->gamma_correction); + encoded_sample *= outmax; + + encoded_error = fabs(od-encoded_sample); + + if (encoded_error > vi->dp->maxerrout) + vi->dp->maxerrout = encoded_error; + + if (encoded_error < vi->maxout_total && encoded_error < vi->outlog) + return i; + } + + /* The slow route - attempt to do linear calculations. */ + /* There may be an error, or background processing is required, so calculate + * the actual sample values - unencoded light intensity values. Note that in + * practice these are not completely unencoded because they include a + * 'viewing correction' to decrease or (normally) increase the perceptual + * contrast of the image. There's nothing we can do about this - we don't + * know what it is - so assume the unencoded value is perceptually linear. + */ + { + double input_sample = i; /* In range 0..1 */ + double output, error, encoded_sample, encoded_error; + double es_lo, es_hi; + int compose = 0; /* Set to one if composition done */ + int output_is_encoded; /* Set if encoded to screen gamma */ + int log_max_error = 1; /* Check maximum error values */ + png_const_charp pass = 0; /* Reason test passes (or 0 for fail) */ + + /* Convert to linear light (with the above caveat.) The alpha channel is + * already linear. + */ + if (alpha >= 0) + { + int tcompose; + + if (vi->file_inverse > 0) + input_sample = pow(input_sample, vi->file_inverse); + + /* Handle the compose processing: */ + tcompose = 0; + input_sample = gamma_component_compose(do_background, input_sample, + alpha, background, &tcompose); + + if (tcompose) + compose = 1; + } + + /* And similarly for the output value, but we need to check the background + * handling to linearize it correctly. + */ + output = od; + output /= outmax; + + output_is_encoded = vi->screen_gamma > 0; + + if (alpha < 0) /* The alpha channel */ + { +#ifdef PNG_READ_ALPHA_MODE_SUPPORTED + if (do_background != ALPHA_MODE_OFFSET + PNG_ALPHA_BROKEN) +#endif + { + /* In all other cases the output alpha channel is linear already, + * don't log errors here, they are much larger in linear data. + */ + output_is_encoded = 0; + log_max_error = 0; + } + } + +#ifdef PNG_READ_ALPHA_MODE_SUPPORTED + else /* A component */ + { + if (do_background == ALPHA_MODE_OFFSET + PNG_ALPHA_OPTIMIZED && + alpha < 1) /* the optimized case - linear output */ + { + if (alpha > 0) log_max_error = 0; + output_is_encoded = 0; + } + } +#endif + + if (output_is_encoded) + output = pow(output, vi->screen_gamma); + + /* Calculate (or recalculate) the encoded_sample value and repeat the + * check above (unnecessary if we took the fast route, but harmless.) + */ + encoded_sample = input_sample; + if (output_is_encoded) + encoded_sample = pow(encoded_sample, vi->screen_inverse); + encoded_sample *= outmax; + + encoded_error = fabs(od-encoded_sample); + + /* Don't log errors in the alpha channel, or the 'optimized' case, + * neither are significant to the overall perception. + */ + if (log_max_error && encoded_error > vi->dp->maxerrout) + vi->dp->maxerrout = encoded_error; + + if (encoded_error < vi->maxout_total) + { + if (encoded_error < vi->outlog) + return i; + + /* Test passed but error is bigger than the log limit, record why the + * test passed: + */ + pass = "less than maxout:\n"; + } + + /* i: the original input value in the range 0..1 + * + * pngvalid calculations: + * input_sample: linear result; i linearized and composed, range 0..1 + * encoded_sample: encoded result; input_sample scaled to output bit depth + * + * libpng calculations: + * output: linear result; od scaled to 0..1 and linearized + * od: encoded result from libpng + */ + + /* Now we have the numbers for real errors, both absolute values as as a + * percentage of the correct value (output): + */ + error = fabs(input_sample-output); + + if (log_max_error && error > vi->dp->maxerrabs) + vi->dp->maxerrabs = error; + + /* The following is an attempt to ignore the tendency of quantization to + * dominate the percentage errors for lower result values: + */ + if (log_max_error && input_sample > .5) + { + double percentage_error = error/input_sample; + if (percentage_error > vi->dp->maxerrpc) + vi->dp->maxerrpc = percentage_error; + } + + /* Now calculate the digitization limits for 'encoded_sample' using the + * 'max' values. Note that maxout is in the encoded space but maxpc and + * maxabs are in linear light space. + * + * First find the maximum error in linear light space, range 0..1: + */ + { + double tmp = input_sample * vi->maxpc; + if (tmp < vi->maxabs) tmp = vi->maxabs; + /* If 'compose' is true the composition was done in linear space using + * integer arithmetic. This introduces an extra error of +/- 0.5 (at + * least) in the integer space used. 'maxcalc' records this, taking + * into account the possibility that even for 16 bit output 8 bit space + * may have been used. + */ + if (compose && tmp < vi->maxcalc) tmp = vi->maxcalc; + + /* The 'maxout' value refers to the encoded result, to compare with + * this encode input_sample adjusted by the maximum error (tmp) above. + */ + es_lo = encoded_sample - vi->maxout; + + if (es_lo > 0 && input_sample-tmp > 0) + { + double low_value = input_sample-tmp; + if (output_is_encoded) + low_value = pow(low_value, vi->screen_inverse); + low_value *= outmax; + if (low_value < es_lo) es_lo = low_value; + + /* Quantize this appropriately: */ + es_lo = ceil(es_lo / vi->outquant - .5) * vi->outquant; + } + + else + es_lo = 0; + + es_hi = encoded_sample + vi->maxout; + + if (es_hi < outmax && input_sample+tmp < 1) + { + double high_value = input_sample+tmp; + if (output_is_encoded) + high_value = pow(high_value, vi->screen_inverse); + high_value *= outmax; + if (high_value > es_hi) es_hi = high_value; + + es_hi = floor(es_hi / vi->outquant + .5) * vi->outquant; + } + + else + es_hi = outmax; + } + + /* The primary test is that the final encoded value returned by the + * library should be between the two limits (inclusive) that were + * calculated above. + */ + if (od >= es_lo && od <= es_hi) + { + /* The value passes, but we may need to log the information anyway. */ + if (encoded_error < vi->outlog) + return i; + + if (pass == 0) + pass = "within digitization limits:\n"; + } + + { + /* There has been an error in processing, or we need to log this + * value. + */ + double is_lo, is_hi; + + /* pass is set at this point if either of the tests above would have + * passed. Don't do these additional tests here - just log the + * original [es_lo..es_hi] values. + */ + if (pass == 0 && vi->use_input_precision && vi->dp->sbit) + { + /* Ok, something is wrong - this actually happens in current libpng + * 16-to-8 processing. Assume that the input value (id, adjusted + * for sbit) can be anywhere between value-.5 and value+.5 - quite a + * large range if sbit is low. + * + * NOTE: at present because the libpng gamma table stuff has been + * changed to use a rounding algorithm to correct errors in 8-bit + * calculations the precise sbit calculation (a shift) has been + * lost. This can result in up to a +/-1 error in the presence of + * an sbit less than the bit depth. + */ +# if PNG_LIBPNG_VER < 10700 +# define SBIT_ERROR .5 +# else +# define SBIT_ERROR 1. +# endif + double tmp = (isbit - SBIT_ERROR)/sbit_max; + + if (tmp <= 0) + tmp = 0; + + else if (alpha >= 0 && vi->file_inverse > 0 && tmp < 1) + tmp = pow(tmp, vi->file_inverse); + + tmp = gamma_component_compose(do_background, tmp, alpha, background, + NULL); + + if (output_is_encoded && tmp > 0 && tmp < 1) + tmp = pow(tmp, vi->screen_inverse); + + is_lo = ceil(outmax * tmp - vi->maxout_total); + + if (is_lo < 0) + is_lo = 0; + + tmp = (isbit + SBIT_ERROR)/sbit_max; + + if (tmp >= 1) + tmp = 1; + + else if (alpha >= 0 && vi->file_inverse > 0 && tmp < 1) + tmp = pow(tmp, vi->file_inverse); + + tmp = gamma_component_compose(do_background, tmp, alpha, background, + NULL); + + if (output_is_encoded && tmp > 0 && tmp < 1) + tmp = pow(tmp, vi->screen_inverse); + + is_hi = floor(outmax * tmp + vi->maxout_total); + + if (is_hi > outmax) + is_hi = outmax; + + if (!(od < is_lo || od > is_hi)) + { + if (encoded_error < vi->outlog) + return i; + + pass = "within input precision limits:\n"; + } + + /* One last chance. If this is an alpha channel and the 16to8 + * option has been used and 'inaccurate' scaling is used then the + * bit reduction is obtained by simply using the top 8 bits of the + * value. + * + * This is only done for older libpng versions when the 'inaccurate' + * (chop) method of scaling was used. + */ +# ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED +# if PNG_LIBPNG_VER < 10504 + /* This may be required for other components in the future, + * but at present the presence of gamma correction effectively + * prevents the errors in the component scaling (I don't quite + * understand why, but since it's better this way I care not + * to ask, JB 20110419.) + */ + if (pass == 0 && alpha < 0 && vi->scale16 && vi->sbit > 8 && + vi->sbit + vi->isbit_shift == 16) + { + tmp = ((id >> 8) - .5)/255; + + if (tmp > 0) + { + is_lo = ceil(outmax * tmp - vi->maxout_total); + if (is_lo < 0) is_lo = 0; + } + + else + is_lo = 0; + + tmp = ((id >> 8) + .5)/255; + + if (tmp < 1) + { + is_hi = floor(outmax * tmp + vi->maxout_total); + if (is_hi > outmax) is_hi = outmax; + } + + else + is_hi = outmax; + + if (!(od < is_lo || od > is_hi)) + { + if (encoded_error < vi->outlog) + return i; + + pass = "within 8 bit limits:\n"; + } + } +# endif +# endif + } + else /* !use_input_precision */ + is_lo = es_lo, is_hi = es_hi; + + /* Attempt to output a meaningful error/warning message: the message + * output depends on the background/composite operation being performed + * because this changes what parameters were actually used above. + */ + { + size_t pos = 0; + /* Need either 1/255 or 1/65535 precision here; 3 or 6 decimal + * places. Just use outmax to work out which. + */ + int precision = (outmax >= 1000 ? 6 : 3); + int use_input=1, use_background=0, do_compose=0; + char msg[256]; + + if (pass != 0) + pos = safecat(msg, sizeof msg, pos, "\n\t"); + + /* Set up the various flags, the output_is_encoded flag above + * is also used below. do_compose is just a double check. + */ + switch (do_background) + { +# ifdef PNG_READ_BACKGROUND_SUPPORTED + case PNG_BACKGROUND_GAMMA_SCREEN: + case PNG_BACKGROUND_GAMMA_FILE: + case PNG_BACKGROUND_GAMMA_UNIQUE: + use_background = (alpha >= 0 && alpha < 1); +# endif +# ifdef PNG_READ_ALPHA_MODE_SUPPORTED + /* FALLTHROUGH */ + case ALPHA_MODE_OFFSET + PNG_ALPHA_STANDARD: + case ALPHA_MODE_OFFSET + PNG_ALPHA_BROKEN: + case ALPHA_MODE_OFFSET + PNG_ALPHA_OPTIMIZED: +# endif /* ALPHA_MODE_SUPPORTED */ + do_compose = (alpha > 0 && alpha < 1); + use_input = (alpha != 0); + break; + + default: + break; + } + + /* Check the 'compose' flag */ + if (compose != do_compose) + png_error(vi->pp, "internal error (compose)"); + + /* 'name' is the component name */ + pos = safecat(msg, sizeof msg, pos, name); + pos = safecat(msg, sizeof msg, pos, "("); + pos = safecatn(msg, sizeof msg, pos, id); + if (use_input || pass != 0/*logging*/) + { + if (isbit != id) + { + /* sBIT has reduced the precision of the input: */ + pos = safecat(msg, sizeof msg, pos, ", sbit("); + pos = safecatn(msg, sizeof msg, pos, vi->sbit); + pos = safecat(msg, sizeof msg, pos, "): "); + pos = safecatn(msg, sizeof msg, pos, isbit); + } + pos = safecat(msg, sizeof msg, pos, "/"); + /* The output is either "id/max" or "id sbit(sbit): isbit/max" */ + pos = safecatn(msg, sizeof msg, pos, vi->sbit_max); + } + pos = safecat(msg, sizeof msg, pos, ")"); + + /* A component may have been multiplied (in linear space) by the + * alpha value, 'compose' says whether this is relevant. + */ + if (compose || pass != 0) + { + /* If any form of composition is being done report our + * calculated linear value here (the code above doesn't record + * the input value before composition is performed, so what + * gets reported is the value after composition.) + */ + if (use_input || pass != 0) + { + if (vi->file_inverse > 0) + { + pos = safecat(msg, sizeof msg, pos, "^"); + pos = safecatd(msg, sizeof msg, pos, vi->file_inverse, 2); + } + + else + pos = safecat(msg, sizeof msg, pos, "[linear]"); + + pos = safecat(msg, sizeof msg, pos, "*(alpha)"); + pos = safecatd(msg, sizeof msg, pos, alpha, precision); + } + + /* Now record the *linear* background value if it was used + * (this function is not passed the original, non-linear, + * value but it is contained in the test name.) + */ + if (use_background) + { + pos = safecat(msg, sizeof msg, pos, use_input ? "+" : " "); + pos = safecat(msg, sizeof msg, pos, "(background)"); + pos = safecatd(msg, sizeof msg, pos, background, precision); + pos = safecat(msg, sizeof msg, pos, "*"); + pos = safecatd(msg, sizeof msg, pos, 1-alpha, precision); + } + } + + /* Report the calculated value (input_sample) and the linearized + * libpng value (output) unless this is just a component gamma + * correction. + */ + if (compose || alpha < 0 || pass != 0) + { + pos = safecat(msg, sizeof msg, pos, + pass != 0 ? " =\n\t" : " = "); + pos = safecatd(msg, sizeof msg, pos, input_sample, precision); + pos = safecat(msg, sizeof msg, pos, " (libpng: "); + pos = safecatd(msg, sizeof msg, pos, output, precision); + pos = safecat(msg, sizeof msg, pos, ")"); + + /* Finally report the output gamma encoding, if any. */ + if (output_is_encoded) + { + pos = safecat(msg, sizeof msg, pos, " ^"); + pos = safecatd(msg, sizeof msg, pos, vi->screen_inverse, 2); + pos = safecat(msg, sizeof msg, pos, "(to screen) ="); + } + + else + pos = safecat(msg, sizeof msg, pos, " [screen is linear] ="); + } + + if ((!compose && alpha >= 0) || pass != 0) + { + if (pass != 0) /* logging */ + pos = safecat(msg, sizeof msg, pos, "\n\t[overall:"); + + /* This is the non-composition case, the internal linear + * values are irrelevant (though the log below will reveal + * them.) Output a much shorter warning/error message and report + * the overall gamma correction. + */ + if (vi->gamma_correction > 0) + { + pos = safecat(msg, sizeof msg, pos, " ^"); + pos = safecatd(msg, sizeof msg, pos, vi->gamma_correction, 2); + pos = safecat(msg, sizeof msg, pos, "(gamma correction) ="); + } + + else + pos = safecat(msg, sizeof msg, pos, + " [no gamma correction] ="); + + if (pass != 0) + pos = safecat(msg, sizeof msg, pos, "]"); + } + + /* This is our calculated encoded_sample which should (but does + * not) match od: + */ + pos = safecat(msg, sizeof msg, pos, pass != 0 ? "\n\t" : " "); + pos = safecatd(msg, sizeof msg, pos, is_lo, 1); + pos = safecat(msg, sizeof msg, pos, " < "); + pos = safecatd(msg, sizeof msg, pos, encoded_sample, 1); + pos = safecat(msg, sizeof msg, pos, " (libpng: "); + pos = safecatn(msg, sizeof msg, pos, od); + pos = safecat(msg, sizeof msg, pos, ")"); + pos = safecat(msg, sizeof msg, pos, "/"); + pos = safecatn(msg, sizeof msg, pos, outmax); + pos = safecat(msg, sizeof msg, pos, " < "); + pos = safecatd(msg, sizeof msg, pos, is_hi, 1); + + if (pass == 0) /* The error condition */ + { +# ifdef PNG_WARNINGS_SUPPORTED + png_warning(vi->pp, msg); +# else + store_warning(vi->pp, msg); +# endif + } + + else /* logging this value */ + store_verbose(&vi->dp->pm->this, vi->pp, pass, msg); + } + } + } + + return i; +} + +static void +gamma_image_validate(gamma_display *dp, png_const_structp pp, + png_infop pi) +{ + /* Get some constants derived from the input and output file formats: */ + const png_store* const ps = dp->this.ps; + png_byte in_ct = dp->this.colour_type; + png_byte in_bd = dp->this.bit_depth; + png_uint_32 w = dp->this.w; + png_uint_32 h = dp->this.h; + const size_t cbRow = dp->this.cbRow; + png_byte out_ct = png_get_color_type(pp, pi); + png_byte out_bd = png_get_bit_depth(pp, pi); + + /* There are three sources of error, firstly the quantization in the + * file encoding, determined by sbit and/or the file depth, secondly + * the output (screen) gamma and thirdly the output file encoding. + * + * Since this API receives the screen and file gamma in double + * precision it is possible to calculate an exact answer given an input + * pixel value. Therefore we assume that the *input* value is exact - + * sample/maxsample - calculate the corresponding gamma corrected + * output to the limits of double precision arithmetic and compare with + * what libpng returns. + * + * Since the library must quantize the output to 8 or 16 bits there is + * a fundamental limit on the accuracy of the output of +/-.5 - this + * quantization limit is included in addition to the other limits + * specified by the parameters to the API. (Effectively, add .5 + * everywhere.) + * + * The behavior of the 'sbit' parameter is defined by section 12.5 + * (sample depth scaling) of the PNG spec. That section forces the + * decoder to assume that the PNG values have been scaled if sBIT is + * present: + * + * png-sample = floor( input-sample * (max-out/max-in) + .5); + * + * This means that only a subset of the possible PNG values should + * appear in the input. However, the spec allows the encoder to use a + * variety of approximations to the above and doesn't require any + * restriction of the values produced. + * + * Nevertheless the spec requires that the upper 'sBIT' bits of the + * value stored in a PNG file be the original sample bits. + * Consequently the code below simply scales the top sbit bits by + * (1<this.palette; + int in_is_transparent = dp->this.is_transparent; + int process_tRNS; + int out_npalette = -1; + int out_is_transparent = 0; /* Just refers to the palette case */ + store_palette out_palette; + validate_info vi; + + /* Check for row overwrite errors */ + store_image_check(dp->this.ps, pp, 0); + + /* Supply the input and output sample depths here - 8 for an indexed image, + * otherwise the bit depth. + */ + init_validate_info(&vi, dp, pp, in_ct==3?8:in_bd, out_ct==3?8:out_bd); + + processing = (vi.gamma_correction > 0 && !dp->threshold_test) + || in_bd != out_bd || in_ct != out_ct || vi.do_background; + process_tRNS = dp->this.has_tRNS && vi.do_background; + + /* TODO: FIX THIS: MAJOR BUG! If the transformations all happen inside + * the palette there is no way of finding out, because libpng fails to + * update the palette on png_read_update_info. Indeed, libpng doesn't + * even do the required work until much later, when it doesn't have any + * info pointer. Oops. For the moment 'processing' is turned off if + * out_ct is palette. + */ + if (in_ct == 3 && out_ct == 3) + processing = 0; + + if (processing && out_ct == 3) + out_is_transparent = read_palette(out_palette, &out_npalette, pp, pi); + + for (y=0; ythis.palette[in_index].alpha : + sample(std, in_ct, in_bd, x, samples_per_pixel, 0, 0); + + unsigned int output_alpha = 65536 /* as a flag value */; + + if (out_ct == 3) + { + if (out_is_transparent) + output_alpha = out_palette[out_index].alpha; + } + + else if ((out_ct & PNG_COLOR_MASK_ALPHA) != 0) + output_alpha = sample(pRow, out_ct, out_bd, x, + samples_per_pixel, 0, 0); + + if (output_alpha != 65536) + alpha = gamma_component_validate("alpha", &vi, input_alpha, + output_alpha, -1/*alpha*/, 0/*background*/); + + else /* no alpha in output */ + { + /* This is a copy of the calculation of 'i' above in order to + * have the alpha value to use in the background calculation. + */ + alpha = input_alpha >> vi.isbit_shift; + alpha /= vi.sbit_max; + } + } + + else if (process_tRNS) + { + /* alpha needs to be set appropriately for this pixel, it is + * currently 1 and needs to be 0 for an input pixel which matches + * the values in tRNS. + */ + switch (in_ct) + { + case 0: /* gray */ + if (sample(std, in_ct, in_bd, x, 0, 0, 0) == + dp->this.transparent.red) + alpha = 0; + break; + + case 2: /* RGB */ + if (sample(std, in_ct, in_bd, x, 0, 0, 0) == + dp->this.transparent.red && + sample(std, in_ct, in_bd, x, 1, 0, 0) == + dp->this.transparent.green && + sample(std, in_ct, in_bd, x, 2, 0, 0) == + dp->this.transparent.blue) + alpha = 0; + break; + + default: + break; + } + } + + /* Handle grayscale or RGB components. */ + if ((in_ct & PNG_COLOR_MASK_COLOR) == 0) /* grayscale */ + (void)gamma_component_validate("gray", &vi, + sample(std, in_ct, in_bd, x, 0, 0, 0), + sample(pRow, out_ct, out_bd, x, 0, 0, 0), + alpha/*component*/, vi.background_red); + else /* RGB or palette */ + { + (void)gamma_component_validate("red", &vi, + in_ct == 3 ? in_palette[in_index].red : + sample(std, in_ct, in_bd, x, 0, 0, 0), + out_ct == 3 ? out_palette[out_index].red : + sample(pRow, out_ct, out_bd, x, 0, 0, 0), + alpha/*component*/, vi.background_red); + + (void)gamma_component_validate("green", &vi, + in_ct == 3 ? in_palette[in_index].green : + sample(std, in_ct, in_bd, x, 1, 0, 0), + out_ct == 3 ? out_palette[out_index].green : + sample(pRow, out_ct, out_bd, x, 1, 0, 0), + alpha/*component*/, vi.background_green); + + (void)gamma_component_validate("blue", &vi, + in_ct == 3 ? in_palette[in_index].blue : + sample(std, in_ct, in_bd, x, 2, 0, 0), + out_ct == 3 ? out_palette[out_index].blue : + sample(pRow, out_ct, out_bd, x, 2, 0, 0), + alpha/*component*/, vi.background_blue); + } + } + } + + else if (memcmp(std, pRow, cbRow) != 0) + { + char msg[64]; + + /* No transform is expected on the threshold tests. */ + sprintf(msg, "gamma: below threshold row %lu changed", + (unsigned long)y); + + png_error(pp, msg); + } + } /* row (y) loop */ + + dp->this.ps->validated = 1; +} + +static void PNGCBAPI +gamma_end(png_structp ppIn, png_infop pi) +{ + png_const_structp pp = ppIn; + gamma_display *dp = voidcast(gamma_display*, png_get_progressive_ptr(pp)); + + if (!dp->this.speed) + gamma_image_validate(dp, pp, pi); + else + dp->this.ps->validated = 1; +} + +/* A single test run checking a gamma transformation. + * + * maxabs: maximum absolute error as a fraction + * maxout: maximum output error in the output units + * maxpc: maximum percentage error (as a percentage) + */ +static void +gamma_test(png_modifier *pmIn, png_byte colour_typeIn, + png_byte bit_depthIn, int palette_numberIn, + int interlace_typeIn, + const double file_gammaIn, const double screen_gammaIn, + png_byte sbitIn, int threshold_testIn, + const char *name, + int use_input_precisionIn, int scale16In, + int expand16In, int do_backgroundIn, + const png_color_16 *bkgd_colorIn, double bkgd_gammaIn) +{ + gamma_display d; + context(&pmIn->this, fault); + + gamma_display_init(&d, pmIn, FILEID(colour_typeIn, bit_depthIn, + palette_numberIn, interlace_typeIn, 0, 0, 0), + file_gammaIn, screen_gammaIn, sbitIn, + threshold_testIn, use_input_precisionIn, scale16In, + expand16In, do_backgroundIn, bkgd_colorIn, bkgd_gammaIn); + + Try + { + png_structp pp; + png_infop pi; + gama_modification gama_mod; + srgb_modification srgb_mod; + sbit_modification sbit_mod; + + /* For the moment don't use the png_modifier support here. */ + d.pm->encoding_counter = 0; + modifier_set_encoding(d.pm); /* Just resets everything */ + d.pm->current_gamma = d.file_gamma; + + /* Make an appropriate modifier to set the PNG file gamma to the + * given gamma value and the sBIT chunk to the given precision. + */ + d.pm->modifications = NULL; + gama_modification_init(&gama_mod, d.pm, d.file_gamma); + srgb_modification_init(&srgb_mod, d.pm, 127 /*delete*/); + if (d.sbit > 0) + sbit_modification_init(&sbit_mod, d.pm, d.sbit); + + modification_reset(d.pm->modifications); + + /* Get a png_struct for reading the image. */ + pp = set_modifier_for_read(d.pm, &pi, d.this.id, name); + standard_palette_init(&d.this); + + /* Introduce the correct read function. */ + if (d.pm->this.progressive) + { + /* Share the row function with the standard implementation. */ + png_set_progressive_read_fn(pp, &d, gamma_info, progressive_row, + gamma_end); + + /* Now feed data into the reader until we reach the end: */ + modifier_progressive_read(d.pm, pp, pi); + } + else + { + /* modifier_read expects a png_modifier* */ + png_set_read_fn(pp, d.pm, modifier_read); + + /* Check the header values: */ + png_read_info(pp, pi); + + /* Process the 'info' requirements. Only one image is generated */ + gamma_info_imp(&d, pp, pi); + + sequential_row(&d.this, pp, pi, -1, 0); + + if (!d.this.speed) + gamma_image_validate(&d, pp, pi); + else + d.this.ps->validated = 1; + } + + modifier_reset(d.pm); + + if (d.pm->log && !d.threshold_test && !d.this.speed) + fprintf(stderr, "%d bit %s %s: max error %f (%.2g, %2g%%)\n", + d.this.bit_depth, colour_types[d.this.colour_type], name, + d.maxerrout, d.maxerrabs, 100*d.maxerrpc); + + /* Log the summary values too. */ + if (d.this.colour_type == 0 || d.this.colour_type == 4) + { + switch (d.this.bit_depth) + { + case 1: + break; + + case 2: + if (d.maxerrout > d.pm->error_gray_2) + d.pm->error_gray_2 = d.maxerrout; + + break; + + case 4: + if (d.maxerrout > d.pm->error_gray_4) + d.pm->error_gray_4 = d.maxerrout; + + break; + + case 8: + if (d.maxerrout > d.pm->error_gray_8) + d.pm->error_gray_8 = d.maxerrout; + + break; + + case 16: + if (d.maxerrout > d.pm->error_gray_16) + d.pm->error_gray_16 = d.maxerrout; + + break; + + default: + png_error(pp, "bad bit depth (internal: 1)"); + } + } + + else if (d.this.colour_type == 2 || d.this.colour_type == 6) + { + switch (d.this.bit_depth) + { + case 8: + + if (d.maxerrout > d.pm->error_color_8) + d.pm->error_color_8 = d.maxerrout; + + break; + + case 16: + + if (d.maxerrout > d.pm->error_color_16) + d.pm->error_color_16 = d.maxerrout; + + break; + + default: + png_error(pp, "bad bit depth (internal: 2)"); + } + } + + else if (d.this.colour_type == 3) + { + if (d.maxerrout > d.pm->error_indexed) + d.pm->error_indexed = d.maxerrout; + } + } + + Catch(fault) + modifier_reset(voidcast(png_modifier*,(void*)fault)); +} + +static void gamma_threshold_test(png_modifier *pm, png_byte colour_type, + png_byte bit_depth, int interlace_type, double file_gamma, + double screen_gamma) +{ + size_t pos = 0; + char name[64]; + pos = safecat(name, sizeof name, pos, "threshold "); + pos = safecatd(name, sizeof name, pos, file_gamma, 3); + pos = safecat(name, sizeof name, pos, "/"); + pos = safecatd(name, sizeof name, pos, screen_gamma, 3); + + (void)gamma_test(pm, colour_type, bit_depth, 0/*palette*/, interlace_type, + file_gamma, screen_gamma, 0/*sBIT*/, 1/*threshold test*/, name, + 0 /*no input precision*/, + 0 /*no scale16*/, 0 /*no expand16*/, 0 /*no background*/, 0 /*hence*/, + 0 /*no background gamma*/); +} + +static void +perform_gamma_threshold_tests(png_modifier *pm) +{ + png_byte colour_type = 0; + png_byte bit_depth = 0; + unsigned int palette_number = 0; + + /* Don't test more than one instance of each palette - it's pointless, in + * fact this test is somewhat excessive since libpng doesn't make this + * decision based on colour type or bit depth! + * + * CHANGED: now test two palettes and, as a side effect, images with and + * without tRNS. + */ + while (next_format(&colour_type, &bit_depth, &palette_number, + pm->test_lbg_gamma_threshold, pm->test_tRNS)) + if (palette_number < 2) + { + double test_gamma = 1.0; + while (test_gamma >= .4) + { + /* There's little point testing the interlacing vs non-interlacing, + * but this can be set from the command line. + */ + gamma_threshold_test(pm, colour_type, bit_depth, pm->interlace_type, + test_gamma, 1/test_gamma); + test_gamma *= .95; + } + + /* And a special test for sRGB */ + gamma_threshold_test(pm, colour_type, bit_depth, pm->interlace_type, + .45455, 2.2); + + if (fail(pm)) + return; + } +} + +static void gamma_transform_test(png_modifier *pm, + png_byte colour_type, png_byte bit_depth, + int palette_number, + int interlace_type, const double file_gamma, + const double screen_gamma, png_byte sbit, + int use_input_precision, int scale16) +{ + size_t pos = 0; + char name[64]; + + if (sbit != bit_depth && sbit != 0) + { + pos = safecat(name, sizeof name, pos, "sbit("); + pos = safecatn(name, sizeof name, pos, sbit); + pos = safecat(name, sizeof name, pos, ") "); + } + + else + pos = safecat(name, sizeof name, pos, "gamma "); + + if (scale16) + pos = safecat(name, sizeof name, pos, "16to8 "); + + pos = safecatd(name, sizeof name, pos, file_gamma, 3); + pos = safecat(name, sizeof name, pos, "->"); + pos = safecatd(name, sizeof name, pos, screen_gamma, 3); + + gamma_test(pm, colour_type, bit_depth, palette_number, interlace_type, + file_gamma, screen_gamma, sbit, 0, name, use_input_precision, + scale16, pm->test_gamma_expand16, 0 , 0, 0); +} + +static void perform_gamma_transform_tests(png_modifier *pm) +{ + png_byte colour_type = 0; + png_byte bit_depth = 0; + unsigned int palette_number = 0; + + while (next_format(&colour_type, &bit_depth, &palette_number, + pm->test_lbg_gamma_transform, pm->test_tRNS)) + { + unsigned int i, j; + + for (i=0; ingamma_tests; ++i) for (j=0; jngamma_tests; ++j) + if (i != j) + { + gamma_transform_test(pm, colour_type, bit_depth, palette_number, + pm->interlace_type, 1/pm->gammas[i], pm->gammas[j], 0/*sBIT*/, + pm->use_input_precision, 0 /*do not scale16*/); + + if (fail(pm)) + return; + } + } +} + +static void perform_gamma_sbit_tests(png_modifier *pm) +{ + png_byte sbit; + + /* The only interesting cases are colour and grayscale, alpha is ignored here + * for overall speed. Only bit depths where sbit is less than the bit depth + * are tested. + */ + for (sbit=pm->sbitlow; sbit<(1<test_lbg_gamma_sbit, pm->test_tRNS)) + if ((colour_type & PNG_COLOR_MASK_ALPHA) == 0 && + ((colour_type == 3 && sbit < 8) || + (colour_type != 3 && sbit < bit_depth))) + { + unsigned int i; + + for (i=0; ingamma_tests; ++i) + { + unsigned int j; + + for (j=0; jngamma_tests; ++j) if (i != j) + { + gamma_transform_test(pm, colour_type, bit_depth, npalette, + pm->interlace_type, 1/pm->gammas[i], pm->gammas[j], + sbit, pm->use_input_precision_sbit, 0 /*scale16*/); + + if (fail(pm)) + return; + } + } + } + } +} + +/* Note that this requires a 16 bit source image but produces 8 bit output, so + * we only need the 16bit write support, but the 16 bit images are only + * generated if DO_16BIT is defined. + */ +#ifdef DO_16BIT +static void perform_gamma_scale16_tests(png_modifier *pm) +{ +# ifndef PNG_MAX_GAMMA_8 +# define PNG_MAX_GAMMA_8 11 +# endif +# if defined PNG_MAX_GAMMA_8 || PNG_LIBPNG_VER < 10700 +# define SBIT_16_TO_8 PNG_MAX_GAMMA_8 +# else +# define SBIT_16_TO_8 16 +# endif + /* Include the alpha cases here. Note that sbit matches the internal value + * used by the library - otherwise we will get spurious errors from the + * internal sbit style approximation. + * + * The threshold test is here because otherwise the 16 to 8 conversion will + * proceed *without* gamma correction, and the tests above will fail (but not + * by much) - this could be fixed, it only appears with the -g option. + */ + unsigned int i, j; + for (i=0; ingamma_tests; ++i) + { + for (j=0; jngamma_tests; ++j) + { + if (i != j && + fabs(pm->gammas[j]/pm->gammas[i]-1) >= PNG_GAMMA_THRESHOLD) + { + gamma_transform_test(pm, 0, 16, 0, pm->interlace_type, + 1/pm->gammas[i], pm->gammas[j], SBIT_16_TO_8, + pm->use_input_precision_16to8, 1 /*scale16*/); + + if (fail(pm)) + return; + + gamma_transform_test(pm, 2, 16, 0, pm->interlace_type, + 1/pm->gammas[i], pm->gammas[j], SBIT_16_TO_8, + pm->use_input_precision_16to8, 1 /*scale16*/); + + if (fail(pm)) + return; + + gamma_transform_test(pm, 4, 16, 0, pm->interlace_type, + 1/pm->gammas[i], pm->gammas[j], SBIT_16_TO_8, + pm->use_input_precision_16to8, 1 /*scale16*/); + + if (fail(pm)) + return; + + gamma_transform_test(pm, 6, 16, 0, pm->interlace_type, + 1/pm->gammas[i], pm->gammas[j], SBIT_16_TO_8, + pm->use_input_precision_16to8, 1 /*scale16*/); + + if (fail(pm)) + return; + } + } + } +} +#endif /* 16 to 8 bit conversion */ + +#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\ + defined(PNG_READ_ALPHA_MODE_SUPPORTED) +static void gamma_composition_test(png_modifier *pm, + png_byte colour_type, png_byte bit_depth, + int palette_number, + int interlace_type, const double file_gamma, + const double screen_gamma, + int use_input_precision, int do_background, + int expand_16) +{ + size_t pos = 0; + png_const_charp base; + double bg; + char name[128]; + png_color_16 background; + + /* Make up a name and get an appropriate background gamma value. */ + switch (do_background) + { + default: + base = ""; + bg = 4; /* should not be used */ + break; + case PNG_BACKGROUND_GAMMA_SCREEN: + base = " bckg(Screen):"; + bg = 1/screen_gamma; + break; + case PNG_BACKGROUND_GAMMA_FILE: + base = " bckg(File):"; + bg = file_gamma; + break; + case PNG_BACKGROUND_GAMMA_UNIQUE: + base = " bckg(Unique):"; + /* This tests the handling of a unique value, the math is such that the + * value tends to be <1, but is neither screen nor file (even if they + * match!) + */ + bg = (file_gamma + screen_gamma) / 3; + break; +#ifdef PNG_READ_ALPHA_MODE_SUPPORTED + case ALPHA_MODE_OFFSET + PNG_ALPHA_PNG: + base = " alpha(PNG)"; + bg = 4; /* should not be used */ + break; + case ALPHA_MODE_OFFSET + PNG_ALPHA_STANDARD: + base = " alpha(Porter-Duff)"; + bg = 4; /* should not be used */ + break; + case ALPHA_MODE_OFFSET + PNG_ALPHA_OPTIMIZED: + base = " alpha(Optimized)"; + bg = 4; /* should not be used */ + break; + case ALPHA_MODE_OFFSET + PNG_ALPHA_BROKEN: + base = " alpha(Broken)"; + bg = 4; /* should not be used */ + break; +#endif + } + + /* Use random background values - the background is always presented in the + * output space (8 or 16 bit components). + */ + if (expand_16 || bit_depth == 16) + { + png_uint_32 r = random_32(); + + background.red = (png_uint_16)r; + background.green = (png_uint_16)(r >> 16); + r = random_32(); + background.blue = (png_uint_16)r; + background.gray = (png_uint_16)(r >> 16); + + /* In earlier libpng versions, those where DIGITIZE is set, any background + * gamma correction in the expand16 case was done using 8-bit gamma + * correction tables, resulting in larger errors. To cope with those + * cases use a 16-bit background value which will handle this gamma + * correction. + */ +# if DIGITIZE + if (expand_16 && (do_background == PNG_BACKGROUND_GAMMA_UNIQUE || + do_background == PNG_BACKGROUND_GAMMA_FILE) && + fabs(bg*screen_gamma-1) > PNG_GAMMA_THRESHOLD) + { + /* The background values will be looked up in an 8-bit table to do + * the gamma correction, so only select values which are an exact + * match for the 8-bit table entries: + */ + background.red = (png_uint_16)((background.red >> 8) * 257); + background.green = (png_uint_16)((background.green >> 8) * 257); + background.blue = (png_uint_16)((background.blue >> 8) * 257); + background.gray = (png_uint_16)((background.gray >> 8) * 257); + } +# endif + } + + else /* 8 bit colors */ + { + png_uint_32 r = random_32(); + + background.red = (png_byte)r; + background.green = (png_byte)(r >> 8); + background.blue = (png_byte)(r >> 16); + background.gray = (png_byte)(r >> 24); + } + + background.index = 193; /* rgb(193,193,193) to detect errors */ + + if (!(colour_type & PNG_COLOR_MASK_COLOR)) + { + /* Because, currently, png_set_background is always called with + * 'need_expand' false in this case and because the gamma test itself + * doesn't cause an expand to 8-bit for lower bit depths the colour must + * be reduced to the correct range. + */ + if (bit_depth < 8) + background.gray &= (png_uint_16)((1U << bit_depth)-1); + + /* Grayscale input, we do not convert to RGB (TBD), so we must set the + * background to gray - else libpng seems to fail. + */ + background.red = background.green = background.blue = background.gray; + } + + pos = safecat(name, sizeof name, pos, "gamma "); + pos = safecatd(name, sizeof name, pos, file_gamma, 3); + pos = safecat(name, sizeof name, pos, "->"); + pos = safecatd(name, sizeof name, pos, screen_gamma, 3); + + pos = safecat(name, sizeof name, pos, base); + if (do_background < ALPHA_MODE_OFFSET) + { + /* Include the background color and gamma in the name: */ + pos = safecat(name, sizeof name, pos, "("); + /* This assumes no expand gray->rgb - the current code won't handle that! + */ + if (colour_type & PNG_COLOR_MASK_COLOR) + { + pos = safecatn(name, sizeof name, pos, background.red); + pos = safecat(name, sizeof name, pos, ","); + pos = safecatn(name, sizeof name, pos, background.green); + pos = safecat(name, sizeof name, pos, ","); + pos = safecatn(name, sizeof name, pos, background.blue); + } + else + pos = safecatn(name, sizeof name, pos, background.gray); + pos = safecat(name, sizeof name, pos, ")^"); + pos = safecatd(name, sizeof name, pos, bg, 3); + } + + gamma_test(pm, colour_type, bit_depth, palette_number, interlace_type, + file_gamma, screen_gamma, 0/*sBIT*/, 0, name, use_input_precision, + 0/*strip 16*/, expand_16, do_background, &background, bg); +} + + +static void +perform_gamma_composition_tests(png_modifier *pm, int do_background, + int expand_16) +{ + png_byte colour_type = 0; + png_byte bit_depth = 0; + unsigned int palette_number = 0; + + /* Skip the non-alpha cases - there is no setting of a transparency colour at + * present. + * + * TODO: incorrect; the palette case sets tRNS and, now RGB and gray do, + * however the palette case fails miserably so is commented out below. + */ + while (next_format(&colour_type, &bit_depth, &palette_number, + pm->test_lbg_gamma_composition, pm->test_tRNS)) + if ((colour_type & PNG_COLOR_MASK_ALPHA) != 0 +#if 0 /* TODO: FIXME */ + /*TODO: FIXME: this should work */ + || colour_type == 3 +#endif + || (colour_type != 3 && palette_number != 0)) + { + unsigned int i, j; + + /* Don't skip the i==j case here - it's relevant. */ + for (i=0; ingamma_tests; ++i) for (j=0; jngamma_tests; ++j) + { + gamma_composition_test(pm, colour_type, bit_depth, palette_number, + pm->interlace_type, 1/pm->gammas[i], pm->gammas[j], + pm->use_input_precision, do_background, expand_16); + + if (fail(pm)) + return; + } + } +} +#endif /* READ_BACKGROUND || READ_ALPHA_MODE */ + +static void +init_gamma_errors(png_modifier *pm) +{ + /* Use -1 to catch tests that were not actually run */ + pm->error_gray_2 = pm->error_gray_4 = pm->error_gray_8 = -1.; + pm->error_color_8 = -1.; + pm->error_indexed = -1.; + pm->error_gray_16 = pm->error_color_16 = -1.; +} + +static void +print_one(const char *leader, double err) +{ + if (err != -1.) + printf(" %s %.5f\n", leader, err); +} + +static void +summarize_gamma_errors(png_modifier *pm, png_const_charp who, int low_bit_depth, + int indexed) +{ + fflush(stderr); + + if (who) + printf("\nGamma correction with %s:\n", who); + + else + printf("\nBasic gamma correction:\n"); + + if (low_bit_depth) + { + print_one(" 2 bit gray: ", pm->error_gray_2); + print_one(" 4 bit gray: ", pm->error_gray_4); + print_one(" 8 bit gray: ", pm->error_gray_8); + print_one(" 8 bit color:", pm->error_color_8); + if (indexed) + print_one(" indexed: ", pm->error_indexed); + } + + print_one("16 bit gray: ", pm->error_gray_16); + print_one("16 bit color:", pm->error_color_16); + + fflush(stdout); +} + +static void +perform_gamma_test(png_modifier *pm, int summary) +{ + /*TODO: remove this*/ + /* Save certain values for the temporary overrides below. */ + unsigned int calculations_use_input_precision = + pm->calculations_use_input_precision; +# ifdef PNG_READ_BACKGROUND_SUPPORTED + double maxout8 = pm->maxout8; +# endif + + /* First some arbitrary no-transform tests: */ + if (!pm->this.speed && pm->test_gamma_threshold) + { + perform_gamma_threshold_tests(pm); + + if (fail(pm)) + return; + } + + /* Now some real transforms. */ + if (pm->test_gamma_transform) + { + if (summary) + { + fflush(stderr); + printf("Gamma correction error summary\n\n"); + printf("The printed value is the maximum error in the pixel values\n"); + printf("calculated by the libpng gamma correction code. The error\n"); + printf("is calculated as the difference between the output pixel\n"); + printf("value (always an integer) and the ideal value from the\n"); + printf("libpng specification (typically not an integer).\n\n"); + + printf("Expect this value to be less than .5 for 8 bit formats,\n"); + printf("less than 1 for formats with fewer than 8 bits and a small\n"); + printf("number (typically less than 5) for the 16 bit formats.\n"); + printf("For performance reasons the value for 16 bit formats\n"); + printf("increases when the image file includes an sBIT chunk.\n"); + fflush(stdout); + } + + init_gamma_errors(pm); + /*TODO: remove this. Necessary because the current libpng + * implementation works in 8 bits: + */ + if (pm->test_gamma_expand16) + pm->calculations_use_input_precision = 1; + perform_gamma_transform_tests(pm); + if (!calculations_use_input_precision) + pm->calculations_use_input_precision = 0; + + if (summary) + summarize_gamma_errors(pm, 0/*who*/, 1/*low bit depth*/, 1/*indexed*/); + + if (fail(pm)) + return; + } + + /* The sbit tests produce much larger errors: */ + if (pm->test_gamma_sbit) + { + init_gamma_errors(pm); + perform_gamma_sbit_tests(pm); + + if (summary) + summarize_gamma_errors(pm, "sBIT", pm->sbitlow < 8U, 1/*indexed*/); + + if (fail(pm)) + return; + } + +#ifdef DO_16BIT /* Should be READ_16BIT_SUPPORTED */ + if (pm->test_gamma_scale16) + { + /* The 16 to 8 bit strip operations: */ + init_gamma_errors(pm); + perform_gamma_scale16_tests(pm); + + if (summary) + { + fflush(stderr); + printf("\nGamma correction with 16 to 8 bit reduction:\n"); + printf(" 16 bit gray: %.5f\n", pm->error_gray_16); + printf(" 16 bit color: %.5f\n", pm->error_color_16); + fflush(stdout); + } + + if (fail(pm)) + return; + } +#endif + +#ifdef PNG_READ_BACKGROUND_SUPPORTED + if (pm->test_gamma_background) + { + init_gamma_errors(pm); + + /*TODO: remove this. Necessary because the current libpng + * implementation works in 8 bits: + */ + if (pm->test_gamma_expand16) + { + pm->calculations_use_input_precision = 1; + pm->maxout8 = .499; /* because the 16 bit background is smashed */ + } + perform_gamma_composition_tests(pm, PNG_BACKGROUND_GAMMA_UNIQUE, + pm->test_gamma_expand16); + if (!calculations_use_input_precision) + pm->calculations_use_input_precision = 0; + pm->maxout8 = maxout8; + + if (summary) + summarize_gamma_errors(pm, "background", 1, 0/*indexed*/); + + if (fail(pm)) + return; + } +#endif + +#ifdef PNG_READ_ALPHA_MODE_SUPPORTED + if (pm->test_gamma_alpha_mode) + { + int do_background; + + init_gamma_errors(pm); + + /*TODO: remove this. Necessary because the current libpng + * implementation works in 8 bits: + */ + if (pm->test_gamma_expand16) + pm->calculations_use_input_precision = 1; + for (do_background = ALPHA_MODE_OFFSET + PNG_ALPHA_STANDARD; + do_background <= ALPHA_MODE_OFFSET + PNG_ALPHA_BROKEN && !fail(pm); + ++do_background) + perform_gamma_composition_tests(pm, do_background, + pm->test_gamma_expand16); + if (!calculations_use_input_precision) + pm->calculations_use_input_precision = 0; + + if (summary) + summarize_gamma_errors(pm, "alpha mode", 1, 0/*indexed*/); + + if (fail(pm)) + return; + } +#endif +} +#endif /* PNG_READ_GAMMA_SUPPORTED */ +#endif /* PNG_READ_SUPPORTED */ + +/* INTERLACE MACRO VALIDATION */ +/* This is copied verbatim from the specification, it is simply the pass + * number in which each pixel in each 8x8 tile appears. The array must + * be indexed adam7[y][x] and notice that the pass numbers are based at + * 1, not 0 - the base libpng uses. + */ +static const +png_byte adam7[8][8] = +{ + { 1,6,4,6,2,6,4,6 }, + { 7,7,7,7,7,7,7,7 }, + { 5,6,5,6,5,6,5,6 }, + { 7,7,7,7,7,7,7,7 }, + { 3,6,4,6,3,6,4,6 }, + { 7,7,7,7,7,7,7,7 }, + { 5,6,5,6,5,6,5,6 }, + { 7,7,7,7,7,7,7,7 } +}; + +/* This routine validates all the interlace support macros in png.h for + * a variety of valid PNG widths and heights. It uses a number of similarly + * named internal routines that feed off the above array. + */ +static png_uint_32 +png_pass_start_row(int pass) +{ + int x, y; + ++pass; + for (y=0; y<8; ++y) for (x=0; x<8; ++x) if (adam7[y][x] == pass) + return y; + return 0xf; +} + +static png_uint_32 +png_pass_start_col(int pass) +{ + int x, y; + ++pass; + for (x=0; x<8; ++x) for (y=0; y<8; ++y) if (adam7[y][x] == pass) + return x; + return 0xf; +} + +static int +png_pass_row_shift(int pass) +{ + int x, y, base=(-1), inc=8; + ++pass; + for (y=0; y<8; ++y) for (x=0; x<8; ++x) if (adam7[y][x] == pass) + { + if (base == (-1)) + base = y; + else if (base == y) + {} + else if (inc == y-base) + base=y; + else if (inc == 8) + inc = y-base, base=y; + else if (inc != y-base) + return 0xff; /* error - more than one 'inc' value! */ + } + + if (base == (-1)) return 0xfe; /* error - no row in pass! */ + + /* The shift is always 1, 2 or 3 - no pass has all the rows! */ + switch (inc) + { +case 2: return 1; +case 4: return 2; +case 8: return 3; +default: break; + } + + /* error - unrecognized 'inc' */ + return (inc << 8) + 0xfd; +} + +static int +png_pass_col_shift(int pass) +{ + int x, y, base=(-1), inc=8; + ++pass; + for (x=0; x<8; ++x) for (y=0; y<8; ++y) if (adam7[y][x] == pass) + { + if (base == (-1)) + base = x; + else if (base == x) + {} + else if (inc == x-base) + base=x; + else if (inc == 8) + inc = x-base, base=x; + else if (inc != x-base) + return 0xff; /* error - more than one 'inc' value! */ + } + + if (base == (-1)) return 0xfe; /* error - no row in pass! */ + + /* The shift is always 1, 2 or 3 - no pass has all the rows! */ + switch (inc) + { +case 1: return 0; /* pass 7 has all the columns */ +case 2: return 1; +case 4: return 2; +case 8: return 3; +default: break; + } + + /* error - unrecognized 'inc' */ + return (inc << 8) + 0xfd; +} + +static png_uint_32 +png_row_from_pass_row(png_uint_32 yIn, int pass) +{ + /* By examination of the array: */ + switch (pass) + { +case 0: return yIn * 8; +case 1: return yIn * 8; +case 2: return yIn * 8 + 4; +case 3: return yIn * 4; +case 4: return yIn * 4 + 2; +case 5: return yIn * 2; +case 6: return yIn * 2 + 1; +default: break; + } + + return 0xff; /* bad pass number */ +} + +static png_uint_32 +png_col_from_pass_col(png_uint_32 xIn, int pass) +{ + /* By examination of the array: */ + switch (pass) + { +case 0: return xIn * 8; +case 1: return xIn * 8 + 4; +case 2: return xIn * 4; +case 3: return xIn * 4 + 2; +case 4: return xIn * 2; +case 5: return xIn * 2 + 1; +case 6: return xIn; +default: break; + } + + return 0xff; /* bad pass number */ +} + +static int +png_row_in_interlace_pass(png_uint_32 y, int pass) +{ + /* Is row 'y' in pass 'pass'? */ + int x; + y &= 7; + ++pass; + for (x=0; x<8; ++x) if (adam7[y][x] == pass) + return 1; + + return 0; +} + +static int +png_col_in_interlace_pass(png_uint_32 x, int pass) +{ + /* Is column 'x' in pass 'pass'? */ + int y; + x &= 7; + ++pass; + for (y=0; y<8; ++y) if (adam7[y][x] == pass) + return 1; + + return 0; +} + +static png_uint_32 +png_pass_rows(png_uint_32 height, int pass) +{ + png_uint_32 tiles = height>>3; + png_uint_32 rows = 0; + unsigned int x, y; + + height &= 7; + ++pass; + for (y=0; y<8; ++y) for (x=0; x<8; ++x) if (adam7[y][x] == pass) + { + rows += tiles; + if (y < height) ++rows; + break; /* i.e. break the 'x', column, loop. */ + } + + return rows; +} + +static png_uint_32 +png_pass_cols(png_uint_32 width, int pass) +{ + png_uint_32 tiles = width>>3; + png_uint_32 cols = 0; + unsigned int x, y; + + width &= 7; + ++pass; + for (x=0; x<8; ++x) for (y=0; y<8; ++y) if (adam7[y][x] == pass) + { + cols += tiles; + if (x < width) ++cols; + break; /* i.e. break the 'y', row, loop. */ + } + + return cols; +} + +static void +perform_interlace_macro_validation(void) +{ + /* The macros to validate, first those that depend only on pass: + * + * PNG_PASS_START_ROW(pass) + * PNG_PASS_START_COL(pass) + * PNG_PASS_ROW_SHIFT(pass) + * PNG_PASS_COL_SHIFT(pass) + */ + int pass; + + for (pass=0; pass<7; ++pass) + { + png_uint_32 m, f, v; + + m = PNG_PASS_START_ROW(pass); + f = png_pass_start_row(pass); + if (m != f) + { + fprintf(stderr, "PNG_PASS_START_ROW(%d) = %u != %x\n", pass, m, f); + exit(99); + } + + m = PNG_PASS_START_COL(pass); + f = png_pass_start_col(pass); + if (m != f) + { + fprintf(stderr, "PNG_PASS_START_COL(%d) = %u != %x\n", pass, m, f); + exit(99); + } + + m = PNG_PASS_ROW_SHIFT(pass); + f = png_pass_row_shift(pass); + if (m != f) + { + fprintf(stderr, "PNG_PASS_ROW_SHIFT(%d) = %u != %x\n", pass, m, f); + exit(99); + } + + m = PNG_PASS_COL_SHIFT(pass); + f = png_pass_col_shift(pass); + if (m != f) + { + fprintf(stderr, "PNG_PASS_COL_SHIFT(%d) = %u != %x\n", pass, m, f); + exit(99); + } + + /* Macros that depend on the image or sub-image height too: + * + * PNG_PASS_ROWS(height, pass) + * PNG_PASS_COLS(width, pass) + * PNG_ROW_FROM_PASS_ROW(yIn, pass) + * PNG_COL_FROM_PASS_COL(xIn, pass) + * PNG_ROW_IN_INTERLACE_PASS(y, pass) + * PNG_COL_IN_INTERLACE_PASS(x, pass) + */ + for (v=0;;) + { + /* The first two tests overflow if the pass row or column is outside + * the possible range for a 32-bit result. In fact the values should + * never be outside the range for a 31-bit result, but checking for 32 + * bits here ensures that if an app uses a bogus pass row or column + * (just so long as it fits in a 32 bit integer) it won't get a + * possibly dangerous overflow. + */ + /* First the base 0 stuff: */ + if (v < png_pass_rows(0xFFFFFFFFU, pass)) + { + m = PNG_ROW_FROM_PASS_ROW(v, pass); + f = png_row_from_pass_row(v, pass); + if (m != f) + { + fprintf(stderr, "PNG_ROW_FROM_PASS_ROW(%u, %d) = %u != %x\n", + v, pass, m, f); + exit(99); + } + } + + if (v < png_pass_cols(0xFFFFFFFFU, pass)) + { + m = PNG_COL_FROM_PASS_COL(v, pass); + f = png_col_from_pass_col(v, pass); + if (m != f) + { + fprintf(stderr, "PNG_COL_FROM_PASS_COL(%u, %d) = %u != %x\n", + v, pass, m, f); + exit(99); + } + } + + m = PNG_ROW_IN_INTERLACE_PASS(v, pass); + f = png_row_in_interlace_pass(v, pass); + if (m != f) + { + fprintf(stderr, "PNG_ROW_IN_INTERLACE_PASS(%u, %d) = %u != %x\n", + v, pass, m, f); + exit(99); + } + + m = PNG_COL_IN_INTERLACE_PASS(v, pass); + f = png_col_in_interlace_pass(v, pass); + if (m != f) + { + fprintf(stderr, "PNG_COL_IN_INTERLACE_PASS(%u, %d) = %u != %x\n", + v, pass, m, f); + exit(99); + } + + /* Then the base 1 stuff: */ + ++v; + m = PNG_PASS_ROWS(v, pass); + f = png_pass_rows(v, pass); + if (m != f) + { + fprintf(stderr, "PNG_PASS_ROWS(%u, %d) = %u != %x\n", + v, pass, m, f); + exit(99); + } + + m = PNG_PASS_COLS(v, pass); + f = png_pass_cols(v, pass); + if (m != f) + { + fprintf(stderr, "PNG_PASS_COLS(%u, %d) = %u != %x\n", + v, pass, m, f); + exit(99); + } + + /* Move to the next v - the stepping algorithm starts skipping + * values above 1024. + */ + if (v > 1024) + { + if (v == PNG_UINT_31_MAX) + break; + + v = (v << 1) ^ v; + if (v >= PNG_UINT_31_MAX) + v = PNG_UINT_31_MAX-1; + } + } + } +} + +/* Test color encodings. These values are back-calculated from the published + * chromaticities. The values are accurate to about 14 decimal places; 15 are + * given. These values are much more accurate than the ones given in the spec, + * which typically don't exceed 4 decimal places. This allows testing of the + * libpng code to its theoretical accuracy of 4 decimal places. (If pngvalid + * used the published errors the 'slack' permitted would have to be +/-.5E-4 or + * more.) + * + * The png_modifier code assumes that encodings[0] is sRGB and treats it + * specially: do not change the first entry in this list! + */ +static const color_encoding test_encodings[] = +{ +/* sRGB: must be first in this list! */ +/*gamma:*/ { 1/2.2, +/*red: */ { 0.412390799265959, 0.212639005871510, 0.019330818715592 }, +/*green:*/ { 0.357584339383878, 0.715168678767756, 0.119194779794626 }, +/*blue: */ { 0.180480788401834, 0.072192315360734, 0.950532152249660} }, +/* Kodak ProPhoto (wide gamut) */ +/*gamma:*/ { 1/1.6 /*approximate: uses 1.8 power law compared to sRGB 2.4*/, +/*red: */ { 0.797760489672303, 0.288071128229293, 0.000000000000000 }, +/*green:*/ { 0.135185837175740, 0.711843217810102, 0.000000000000000 }, +/*blue: */ { 0.031349349581525, 0.000085653960605, 0.825104602510460} }, +/* Adobe RGB (1998) */ +/*gamma:*/ { 1/(2+51./256), +/*red: */ { 0.576669042910131, 0.297344975250536, 0.027031361386412 }, +/*green:*/ { 0.185558237906546, 0.627363566255466, 0.070688852535827 }, +/*blue: */ { 0.188228646234995, 0.075291458493998, 0.991337536837639} }, +/* Adobe Wide Gamut RGB */ +/*gamma:*/ { 1/(2+51./256), +/*red: */ { 0.716500716779386, 0.258728243040113, 0.000000000000000 }, +/*green:*/ { 0.101020574397477, 0.724682314948566, 0.051211818965388 }, +/*blue: */ { 0.146774385252705, 0.016589442011321, 0.773892783545073} }, +/* Fake encoding which selects just the green channel */ +/*gamma:*/ { 1.45/2.2, /* the 'Mac' gamma */ +/*red: */ { 0.716500716779386, 0.000000000000000, 0.000000000000000 }, +/*green:*/ { 0.101020574397477, 1.000000000000000, 0.051211818965388 }, +/*blue: */ { 0.146774385252705, 0.000000000000000, 0.773892783545073} }, +}; + +/* signal handler + * + * This attempts to trap signals and escape without crashing. It needs a + * context pointer so that it can throw an exception (call longjmp) to recover + * from the condition; this is handled by making the png_modifier used by 'main' + * into a global variable. + */ +static png_modifier pm; + +static void signal_handler(int signum) +{ + + size_t pos = 0; + char msg[64]; + + pos = safecat(msg, sizeof msg, pos, "caught signal: "); + + switch (signum) + { + case SIGABRT: + pos = safecat(msg, sizeof msg, pos, "abort"); + break; + + case SIGFPE: + pos = safecat(msg, sizeof msg, pos, "floating point exception"); + break; + + case SIGILL: + pos = safecat(msg, sizeof msg, pos, "illegal instruction"); + break; + + case SIGINT: + pos = safecat(msg, sizeof msg, pos, "interrupt"); + break; + + case SIGSEGV: + pos = safecat(msg, sizeof msg, pos, "invalid memory access"); + break; + + case SIGTERM: + pos = safecat(msg, sizeof msg, pos, "termination request"); + break; + + default: + pos = safecat(msg, sizeof msg, pos, "unknown "); + pos = safecatn(msg, sizeof msg, pos, signum); + break; + } + + store_log(&pm.this, NULL/*png_structp*/, msg, 1/*error*/); + + /* And finally throw an exception so we can keep going, unless this is + * SIGTERM in which case stop now. + */ + if (signum != SIGTERM) + { + struct exception_context *the_exception_context = + &pm.this.exception_context; + + Throw &pm.this; + } + + else + exit(1); +} + +/* main program */ +int main(int argc, char **argv) +{ + int summary = 1; /* Print the error summary at the end */ + int memstats = 0; /* Print memory statistics at the end */ + + /* Create the given output file on success: */ + const char *touch = NULL; + + /* This is an array of standard gamma values (believe it or not I've seen + * every one of these mentioned somewhere.) + * + * In the following list the most useful values are first! + */ + static double + gammas[]={2.2, 1.0, 2.2/1.45, 1.8, 1.5, 2.4, 2.5, 2.62, 2.9}; + + /* This records the command and arguments: */ + size_t cp = 0; + char command[1024]; + + anon_context(&pm.this); + + gnu_volatile(summary) + gnu_volatile(memstats) + gnu_volatile(touch) + + /* Add appropriate signal handlers, just the ANSI specified ones: */ + signal(SIGABRT, signal_handler); + signal(SIGFPE, signal_handler); + signal(SIGILL, signal_handler); + signal(SIGINT, signal_handler); + signal(SIGSEGV, signal_handler); + signal(SIGTERM, signal_handler); + +#ifdef HAVE_FEENABLEEXCEPT + /* Only required to enable FP exceptions on platforms where they start off + * disabled; this is not necessary but if it is not done pngvalid will likely + * end up ignoring FP conditions that other platforms fault. + */ + feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); +#endif + + modifier_init(&pm); + + /* Preallocate the image buffer, because we know how big it needs to be, + * note that, for testing purposes, it is deliberately mis-aligned by tag + * bytes either side. All rows have an additional five bytes of padding for + * overwrite checking. + */ + store_ensure_image(&pm.this, NULL, 2, TRANSFORM_ROWMAX, TRANSFORM_HEIGHTMAX); + + /* Don't give argv[0], it's normally some horrible libtool string: */ + cp = safecat(command, sizeof command, cp, "pngvalid"); + + /* Default to error on warning: */ + pm.this.treat_warnings_as_errors = 1; + + /* Default assume_16_bit_calculations appropriately; this tells the checking + * code that 16-bit arithmetic is used for 8-bit samples when it would make a + * difference. + */ + pm.assume_16_bit_calculations = PNG_LIBPNG_VER >= 10700; + + /* Currently 16 bit expansion happens at the end of the pipeline, so the + * calculations are done in the input bit depth not the output. + * + * TODO: fix this + */ + pm.calculations_use_input_precision = 1U; + + /* Store the test gammas */ + pm.gammas = gammas; + pm.ngammas = ARRAY_SIZE(gammas); + pm.ngamma_tests = 0; /* default to off */ + + /* Low bit depth gray images don't do well in the gamma tests, until + * this is fixed turn them off for some gamma cases: + */ +# ifdef PNG_WRITE_tRNS_SUPPORTED + pm.test_tRNS = 1; +# endif + pm.test_lbg = PNG_LIBPNG_VER >= 10600; + pm.test_lbg_gamma_threshold = 1; + pm.test_lbg_gamma_transform = PNG_LIBPNG_VER >= 10600; + pm.test_lbg_gamma_sbit = 1; + pm.test_lbg_gamma_composition = PNG_LIBPNG_VER >= 10700; + + /* And the test encodings */ + pm.encodings = test_encodings; + pm.nencodings = ARRAY_SIZE(test_encodings); + +# if PNG_LIBPNG_VER < 10700 + pm.sbitlow = 8U; /* because libpng doesn't do sBIT below 8! */ +# else + pm.sbitlow = 1U; +# endif + + /* The following allows results to pass if they correspond to anything in the + * transformed range [input-.5,input+.5]; this is is required because of the + * way libpng treates the 16_TO_8 flag when building the gamma tables in + * releases up to 1.6.0. + * + * TODO: review this + */ + pm.use_input_precision_16to8 = 1U; + pm.use_input_precision_sbit = 1U; /* because libpng now rounds sBIT */ + + /* Some default values (set the behavior for 'make check' here). + * These values simply control the maximum error permitted in the gamma + * transformations. The practical limits for human perception are described + * below (the setting for maxpc16), however for 8 bit encodings it isn't + * possible to meet the accepted capabilities of human vision - i.e. 8 bit + * images can never be good enough, regardless of encoding. + */ + pm.maxout8 = .1; /* Arithmetic error in *encoded* value */ + pm.maxabs8 = .00005; /* 1/20000 */ + pm.maxcalc8 = 1./255; /* +/-1 in 8 bits for compose errors */ + pm.maxpc8 = .499; /* I.e., .499% fractional error */ + pm.maxout16 = .499; /* Error in *encoded* value */ + pm.maxabs16 = .00005;/* 1/20000 */ + pm.maxcalc16 =1./65535;/* +/-1 in 16 bits for compose errors */ +# if PNG_LIBPNG_VER < 10700 + pm.maxcalcG = 1./((1<38149 by the following: + */ + pm.maxpc16 = .005; /* I.e., 1/200% - 1/20000 */ + + /* Now parse the command line options. */ + while (--argc >= 1) + { + int catmore = 0; /* Set if the argument has an argument. */ + + /* Record each argument for posterity: */ + cp = safecat(command, sizeof command, cp, " "); + cp = safecat(command, sizeof command, cp, *++argv); + + if (strcmp(*argv, "-v") == 0) + pm.this.verbose = 1; + + else if (strcmp(*argv, "-l") == 0) + pm.log = 1; + + else if (strcmp(*argv, "-q") == 0) + summary = pm.this.verbose = pm.log = 0; + + else if (strcmp(*argv, "-w") == 0 || + strcmp(*argv, "--strict") == 0) + pm.this.treat_warnings_as_errors = 1; /* NOTE: this is the default! */ + + else if (strcmp(*argv, "--nostrict") == 0) + pm.this.treat_warnings_as_errors = 0; + + else if (strcmp(*argv, "--speed") == 0) + pm.this.speed = 1, pm.ngamma_tests = pm.ngammas, pm.test_standard = 0, + summary = 0; + + else if (strcmp(*argv, "--memory") == 0) + memstats = 1; + + else if (strcmp(*argv, "--size") == 0) + pm.test_size = 1; + + else if (strcmp(*argv, "--nosize") == 0) + pm.test_size = 0; + + else if (strcmp(*argv, "--standard") == 0) + pm.test_standard = 1; + + else if (strcmp(*argv, "--nostandard") == 0) + pm.test_standard = 0; + + else if (strcmp(*argv, "--transform") == 0) + pm.test_transform = 1; + + else if (strcmp(*argv, "--notransform") == 0) + pm.test_transform = 0; + +#ifdef PNG_READ_TRANSFORMS_SUPPORTED + else if (strncmp(*argv, "--transform-disable=", + sizeof "--transform-disable") == 0) + { + pm.test_transform = 1; + transform_disable(*argv + sizeof "--transform-disable"); + } + + else if (strncmp(*argv, "--transform-enable=", + sizeof "--transform-enable") == 0) + { + pm.test_transform = 1; + transform_enable(*argv + sizeof "--transform-enable"); + } +#endif /* PNG_READ_TRANSFORMS_SUPPORTED */ + + else if (strcmp(*argv, "--gamma") == 0) + { + /* Just do two gamma tests here (2.2 and linear) for speed: */ + pm.ngamma_tests = 2U; + pm.test_gamma_threshold = 1; + pm.test_gamma_transform = 1; + pm.test_gamma_sbit = 1; + pm.test_gamma_scale16 = 1; + pm.test_gamma_background = 1; /* composition */ + pm.test_gamma_alpha_mode = 1; + } + + else if (strcmp(*argv, "--nogamma") == 0) + pm.ngamma_tests = 0; + + else if (strcmp(*argv, "--gamma-threshold") == 0) + pm.ngamma_tests = 2U, pm.test_gamma_threshold = 1; + + else if (strcmp(*argv, "--nogamma-threshold") == 0) + pm.test_gamma_threshold = 0; + + else if (strcmp(*argv, "--gamma-transform") == 0) + pm.ngamma_tests = 2U, pm.test_gamma_transform = 1; + + else if (strcmp(*argv, "--nogamma-transform") == 0) + pm.test_gamma_transform = 0; + + else if (strcmp(*argv, "--gamma-sbit") == 0) + pm.ngamma_tests = 2U, pm.test_gamma_sbit = 1; + + else if (strcmp(*argv, "--nogamma-sbit") == 0) + pm.test_gamma_sbit = 0; + + else if (strcmp(*argv, "--gamma-16-to-8") == 0) + pm.ngamma_tests = 2U, pm.test_gamma_scale16 = 1; + + else if (strcmp(*argv, "--nogamma-16-to-8") == 0) + pm.test_gamma_scale16 = 0; + + else if (strcmp(*argv, "--gamma-background") == 0) + pm.ngamma_tests = 2U, pm.test_gamma_background = 1; + + else if (strcmp(*argv, "--nogamma-background") == 0) + pm.test_gamma_background = 0; + + else if (strcmp(*argv, "--gamma-alpha-mode") == 0) + pm.ngamma_tests = 2U, pm.test_gamma_alpha_mode = 1; + + else if (strcmp(*argv, "--nogamma-alpha-mode") == 0) + pm.test_gamma_alpha_mode = 0; + + else if (strcmp(*argv, "--expand16") == 0) + pm.test_gamma_expand16 = 1; + + else if (strcmp(*argv, "--noexpand16") == 0) + pm.test_gamma_expand16 = 0; + + else if (strcmp(*argv, "--low-depth-gray") == 0) + pm.test_lbg = pm.test_lbg_gamma_threshold = + pm.test_lbg_gamma_transform = pm.test_lbg_gamma_sbit = + pm.test_lbg_gamma_composition = 1; + + else if (strcmp(*argv, "--nolow-depth-gray") == 0) + pm.test_lbg = pm.test_lbg_gamma_threshold = + pm.test_lbg_gamma_transform = pm.test_lbg_gamma_sbit = + pm.test_lbg_gamma_composition = 0; + +# ifdef PNG_WRITE_tRNS_SUPPORTED + else if (strcmp(*argv, "--tRNS") == 0) + pm.test_tRNS = 1; +# endif + + else if (strcmp(*argv, "--notRNS") == 0) + pm.test_tRNS = 0; + + else if (strcmp(*argv, "--more-gammas") == 0) + pm.ngamma_tests = 3U; + + else if (strcmp(*argv, "--all-gammas") == 0) + pm.ngamma_tests = pm.ngammas; + + else if (strcmp(*argv, "--progressive-read") == 0) + pm.this.progressive = 1; + + else if (strcmp(*argv, "--use-update-info") == 0) + ++pm.use_update_info; /* Can call multiple times */ + + else if (strcmp(*argv, "--interlace") == 0) + { +# if CAN_WRITE_INTERLACE + pm.interlace_type = PNG_INTERLACE_ADAM7; +# else /* !CAN_WRITE_INTERLACE */ + fprintf(stderr, "pngvalid: no write interlace support\n"); + return SKIP; +# endif /* !CAN_WRITE_INTERLACE */ + } + + else if (strcmp(*argv, "--use-input-precision") == 0) + pm.use_input_precision = 1U; + + else if (strcmp(*argv, "--use-calculation-precision") == 0) + pm.use_input_precision = 0; + + else if (strcmp(*argv, "--calculations-use-input-precision") == 0) + pm.calculations_use_input_precision = 1U; + + else if (strcmp(*argv, "--assume-16-bit-calculations") == 0) + pm.assume_16_bit_calculations = 1U; + + else if (strcmp(*argv, "--calculations-follow-bit-depth") == 0) + pm.calculations_use_input_precision = + pm.assume_16_bit_calculations = 0; + + else if (strcmp(*argv, "--exhaustive") == 0) + pm.test_exhaustive = 1; + + else if (argc > 1 && strcmp(*argv, "--sbitlow") == 0) + --argc, pm.sbitlow = (png_byte)atoi(*++argv), catmore = 1; + + else if (argc > 1 && strcmp(*argv, "--touch") == 0) + --argc, touch = *++argv, catmore = 1; + + else if (argc > 1 && strncmp(*argv, "--max", 5) == 0) + { + --argc; + + if (strcmp(5+*argv, "abs8") == 0) + pm.maxabs8 = atof(*++argv); + + else if (strcmp(5+*argv, "abs16") == 0) + pm.maxabs16 = atof(*++argv); + + else if (strcmp(5+*argv, "calc8") == 0) + pm.maxcalc8 = atof(*++argv); + + else if (strcmp(5+*argv, "calc16") == 0) + pm.maxcalc16 = atof(*++argv); + + else if (strcmp(5+*argv, "out8") == 0) + pm.maxout8 = atof(*++argv); + + else if (strcmp(5+*argv, "out16") == 0) + pm.maxout16 = atof(*++argv); + + else if (strcmp(5+*argv, "pc8") == 0) + pm.maxpc8 = atof(*++argv); + + else if (strcmp(5+*argv, "pc16") == 0) + pm.maxpc16 = atof(*++argv); + + else + { + fprintf(stderr, "pngvalid: %s: unknown 'max' option\n", *argv); + exit(99); + } + + catmore = 1; + } + + else if (strcmp(*argv, "--log8") == 0) + --argc, pm.log8 = atof(*++argv), catmore = 1; + + else if (strcmp(*argv, "--log16") == 0) + --argc, pm.log16 = atof(*++argv), catmore = 1; + +#ifdef PNG_SET_OPTION_SUPPORTED + else if (strncmp(*argv, "--option=", 9) == 0) + { + /* Syntax of the argument is